diff --git a/src/xrt/auxiliary/util/u_format.c b/src/xrt/auxiliary/util/u_format.c index 1ed9731d7..0b1d11a98 100644 --- a/src/xrt/auxiliary/util/u_format.c +++ b/src/xrt/auxiliary/util/u_format.c @@ -19,6 +19,9 @@ u_format_str(enum xrt_format f) case XRT_FORMAT_R8G8B8X8: return "XRT_FORMAT_R8G8B8X8"; case XRT_FORMAT_R8G8B8A8: return "XRT_FORMAT_R8G8B8A8"; case XRT_FORMAT_R8G8B8: return "XRT_FORMAT_R8G8B8"; + case XRT_FORMAT_R8G8: return "XRT_FORMAT_R8G8"; + case XRT_FORMAT_R8: return "XRT_FORMAT_R8"; + case XRT_FORMAT_L8: return "XRT_FORMAT_L8"; case XRT_FORMAT_BITMAP_8X1: return "XRT_FORMAT_BITMAP_8X1"; case XRT_FORMAT_BITMAP_8X8: return "XRT_FORMAT_BITMAP_8X8"; case XRT_FORMAT_YUV888: return "XRT_FORMAT_YUV888"; @@ -35,6 +38,9 @@ u_format_is_blocks(enum xrt_format f) case XRT_FORMAT_R8G8B8X8: case XRT_FORMAT_R8G8B8A8: case XRT_FORMAT_R8G8B8: + case XRT_FORMAT_R8G8: + case XRT_FORMAT_R8: + case XRT_FORMAT_L8: case XRT_FORMAT_BITMAP_8X1: case XRT_FORMAT_BITMAP_8X8: case XRT_FORMAT_YUV888: @@ -55,6 +61,9 @@ u_format_block_width(enum xrt_format f) case XRT_FORMAT_R8G8B8X8: case XRT_FORMAT_R8G8B8A8: case XRT_FORMAT_R8G8B8: + case XRT_FORMAT_R8G8: + case XRT_FORMAT_R8: + case XRT_FORMAT_L8: case XRT_FORMAT_YUV888: // Regular one pixel per block formats. return 1; @@ -76,6 +85,9 @@ u_format_block_height(enum xrt_format f) case XRT_FORMAT_R8G8B8X8: case XRT_FORMAT_R8G8B8A8: case XRT_FORMAT_R8G8B8: + case XRT_FORMAT_R8G8: + case XRT_FORMAT_R8: + case XRT_FORMAT_L8: case XRT_FORMAT_BITMAP_8X1: case XRT_FORMAT_YUV888: case XRT_FORMAT_YUV422: @@ -92,8 +104,14 @@ size_t u_format_block_size(enum xrt_format f) { switch (f) { - case XRT_FORMAT_BITMAP_8X1: return 1; - + case XRT_FORMAT_BITMAP_8X1: + case XRT_FORMAT_R8: + case XRT_FORMAT_L8: + // One byte blocks + return 1; + case XRT_FORMAT_R8G8: + // Two bytes, 16bits. + return 2; case XRT_FORMAT_R8G8B8: case XRT_FORMAT_YUV888: // Weird 24bit pixel formats.