Skip to content

Commit fbee73c

Browse files
camtest: show color image
1 parent e7670f8 commit fbee73c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

internal_filesystem/apps/com.example.camtest/assets/camtest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ def build_ui():
152152
"magic": lv.IMAGE_HEADER_MAGIC,
153153
"w": width,
154154
"h": height,
155-
"stride": width ,
156-
#"cf": lv.COLOR_FORMAT.RGB565
157-
"cf": lv.COLOR_FORMAT.L8
155+
"stride": width * 2,
156+
"cf": lv.COLOR_FORMAT.RGB565
157+
#"cf": lv.COLOR_FORMAT.L8
158158
},
159-
'data_size': width * height,
159+
'data_size': width * height * 2,
160160
'data': None # Will be updated per frame
161161
})
162162
image.set_src(image_dsc)
@@ -176,8 +176,8 @@ def init_cam():
176176
xclk_freq=20000000,
177177
powerdown_pin=-1,
178178
reset_pin=-1,
179-
#pixel_format=PixelFormat.RGB565,
180-
pixel_format=PixelFormat.GRAYSCALE,
179+
pixel_format=PixelFormat.RGB565,
180+
#pixel_format=PixelFormat.GRAYSCALE,
181181
frame_size=FrameSize.R240X240,
182182
grab_mode=GrabMode.LATEST
183183
)

internal_filesystem/apps/com.example.camtestnew/assets/camtestcolor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
xclk_freq=20000000,
2727
powerdown_pin=-1,
2828
reset_pin=-1,
29+
#pixel_format=PixelFormat.RAW, # fails
30+
#pixel_format=PixelFormat.RGB888, fails
2931
pixel_format=PixelFormat.RGB565,
3032
#pixel_format=PixelFormat.GRAYSCALE,
3133
#pixel_format=PixelFormat.YUV420,

0 commit comments

Comments
 (0)