- if( !(x >= 0 && y >= 0 && x < frame->get_w() && y < frame->get_h()) ) return;
-
-#define DRAW_PIXEL(model, x, y, components, do_yuv, max, type) \
- case model: { \
- type **rows = (type**)frame->get_rows(); \
- rows[y][x * components] = max - rows[y][x * components]; \
- if( !do_yuv ) { \
- rows[y][x * components + 1] = max - rows[y][x * components + 1]; \
- rows[y][x * components + 2] = max - rows[y][x * components + 2]; \
- } \
- else { \
- rows[y][x * components + 1] = (max / 2 + 1) - rows[y][x * components + 1]; \
- rows[y][x * components + 2] = (max / 2 + 1) - rows[y][x * components + 2]; \
- } \
- if( components == 4 ) \
- rows[y][x * components + 3] = max; \
-} break
-
- switch(frame->get_color_model()) {
- DRAW_PIXEL(BC_RGB888, x, y, 3, 0, 0xff, unsigned char);
- DRAW_PIXEL(BC_RGBA8888, x, y, 4, 0, 0xff, unsigned char);
- DRAW_PIXEL(BC_RGB_FLOAT, x, y, 3, 0, 1.0, float);
- DRAW_PIXEL(BC_RGBA_FLOAT, x, y, 4, 0, 1.0, float);
- DRAW_PIXEL(BC_YUV888, x, y, 3, 1, 0xff, unsigned char);
- DRAW_PIXEL(BC_YUVA8888, x, y, 4, 1, 0xff, unsigned char);
- DRAW_PIXEL(BC_RGB161616, x, y, 3, 0, 0xffff, uint16_t);
- DRAW_PIXEL(BC_YUV161616, x, y, 3, 1, 0xffff, uint16_t);
- DRAW_PIXEL(BC_RGBA16161616, x, y, 4, 0, 0xffff, uint16_t);
- DRAW_PIXEL(BC_YUVA16161616, x, y, 4, 1, 0xffff, uint16_t);