Skip to content

Commit

Permalink
Merge branch 'update_sensor_lcd' into 'dev'
Browse files Browse the repository at this point in the history
update sensor out_size, lcd set_plane

See merge request maix_sw/k230_canmv!214
  • Loading branch information
zzxcanaan committed Apr 23, 2024
2 parents 6d12e55 + d00ba47 commit 8a8360c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions micropython_port/media/lcd.py
Expand Up @@ -16,10 +16,10 @@
DISPLAY_CHN_OSD3 = K_VO_DISPLAY_CHN_ID6

# define VO mirror
# DISPLAY_MIRROR_NONE = K_VO_MIRROR_NONE
# DISPLAY_MIRROR_HOR = K_VO_MIRROR_HOR
# DISPLAY_MIRROR_VER = K_VO_MIRROR_VER
# DISPLAY_MIRROR_BOTH = K_VO_MIRROR_BOTH
DISPLAY_MIRROR_NONE = K_VO_MIRROR_NONE
DISPLAY_MIRROR_HOR = K_VO_MIRROR_HOR
DISPLAY_MIRROR_VER = K_VO_MIRROR_VER
DISPLAY_MIRROR_BOTH = K_VO_MIRROR_BOTH

class lcd:
plane_array = [0] * 7
Expand Down Expand Up @@ -88,9 +88,9 @@ def set_video_plane(cls, x, y, width, height, pixelformat, mirror, chn):
cls.plane_array[chn] = 1

@classmethod
def set_plane(cls, x, y, width, height, pixelformat, chn):
def set_plane(cls, x, y, width, height, pixelformat, chn, mirror=K_VO_MIRROR_NONE):
if (DISPLAY_CHN_VIDEO1 <= chn <= DISPLAY_CHN_VIDEO2):
cls.set_video_plane(x, y, width, height, pixelformat, K_VO_MIRROR_NONE, chn)
cls.set_video_plane(x, y, width, height, pixelformat, mirror, chn)
elif (DISPLAY_CHN_OSD0 <= chn <= DISPLAY_CHN_OSD3):
cls.set_osd_plane(x, y, width, height, pixelformat, chn)
else:
Expand Down
4 changes: 2 additions & 2 deletions micropython_port/media/sensor.py
Expand Up @@ -155,7 +155,7 @@ def set_outbufs(cls, dev_num, chn_num, num):

# set_outsize
@classmethod
def set_framesize(cls, dev_num, chn_num, width, height):
def set_framesize(cls, dev_num, chn_num, width, height, alignment=0):
if (dev_num > CAM_DEV_ID_MAX - 1) or (chn_num > CAM_CHN_ID_MAX - 1):
raise ValueError(f"invalid param, dev_num({dev_num}, chn_num({chn_num}))")

Expand All @@ -170,7 +170,7 @@ def set_framesize(cls, dev_num, chn_num, width, height):
cls.cam_dev[dev_num].chn_attr[chn_num].out_win.v_start = 0
cls.cam_dev[dev_num].chn_attr[chn_num].out_win.width = ALIGN_UP(width, 16)
cls.cam_dev[dev_num].chn_attr[chn_num].out_win.height = height
cls.cam_dev[dev_num].chn_attr[chn_num].alignment = 0
cls.cam_dev[dev_num].chn_attr[chn_num].alignment = alignment

if cls.cam_dev[dev_num].chn_attr[chn_num].pix_format:
buf_size = 0
Expand Down

0 comments on commit 8a8360c

Please sign in to comment.