Skip to content

Commit

Permalink
Support abgr2101010 color view
Browse files Browse the repository at this point in the history
Signed-off-by: Kyuwon Kim <[email protected]>
  • Loading branch information
chammoru committed Dec 26, 2022
1 parent ca24e27 commit 66214af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions QVisionCore/qimage_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,3 +895,18 @@ void qimage_yuv420_set_pixel_str(qu8* src, int w, int h,
sprintf(str, "%03d\n%03d\n%03d", y_val, u_val, v_val);
}
}

void qimage_abgr2101010_set_pixel_str(qu8* src, int w, int h,
int x, int y, int base, char* str)
{
qu32 abgr2101010 = ((qu32*)src)[w * y + x];
qu32 B10 = (abgr2101010 >> 20) & 0x3ff;
qu32 G10 = (abgr2101010 >> 10) & 0x3ff;
qu32 R10 = abgr2101010 & 0x3ff;

if (base == 16) {
sprintf(str, "%02X\n%02X\n%02X", R10, G10, B10);
} else {
sprintf(str, "%04d\n%04d\n%04d", R10, G10, B10);
}
}
4 changes: 3 additions & 1 deletion QVisionCore/qimage_cs.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ void qimage_bgr888_to_yuv420(qu8 *bgr, qu8 *y, qu8 *u, qu8 *v,

void qimage_yuv420_set_pixel_str(qu8 *src, int w, int h,
int x, int y, int base, char *str);
void qimage_abgr2101010_set_pixel_str(qu8* src, int w, int h,
int x, int y, int base, char* str);

static const struct qcsc_info qcsc_info_table[] =
{
Expand Down Expand Up @@ -216,7 +218,7 @@ static const struct qcsc_info qcsc_info_table[] =
qimage_abgr2101010_load_info,
qimage_abgr2101010_to_bgr888,
NULL,
NULL,
qimage_abgr2101010_set_pixel_str,
},
{
QIMAGE_CS_RGB16U,
Expand Down

0 comments on commit 66214af

Please sign in to comment.