Skip to content

Commit adf454e

Browse files
committed
camtest: add --disable-interpolation parameter
1 parent 12885e0 commit adf454e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/mlx90640_camtest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
parser = argparse.ArgumentParser()
3131
parser.add_argument("--windowed", action="store_true",
3232
help="display in a window")
33+
parser.add_argument("--disable-interpolation", action="store_true",
34+
help="disable interpolation in-between camera pixels")
3335

3436
args = parser.parse_args()
3537

@@ -133,7 +135,8 @@ def gradient(x, width, cmap, spread=1):
133135
# pixelrgb = [colors[constrain(int(pixel), 0, COLORDEPTH-1)] for pixel in pixels]
134136
img = Image.new("RGB", (32, 24))
135137
img.putdata(pixels)
136-
img = img.resize((32 * INTERPOLATE, 24 * INTERPOLATE), Image.BICUBIC)
138+
if not args.disable_interpolation:
139+
img = img.resize((32 * INTERPOLATE, 24 * INTERPOLATE), Image.BICUBIC)
137140
img_surface = pygame.image.fromstring(img.tobytes(), img.size, img.mode)
138141
pygame.transform.scale(img_surface.convert(), screen.get_size(), screen)
139142
pygame.display.update()

0 commit comments

Comments
 (0)