From 5b6e6bf6a6938fde3ec9a565d95ae07ec1be044b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 15 Sep 2020 14:55:21 +0100 Subject: [PATCH] xrt: Add XRT_FORMAT_BAYER_GR8 format --- doc/changes/xrt/mr.665.2.md | 1 + src/xrt/auxiliary/util/u_format.c | 5 +++++ src/xrt/include/xrt/xrt_defines.h | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 doc/changes/xrt/mr.665.2.md diff --git a/doc/changes/xrt/mr.665.2.md b/doc/changes/xrt/mr.665.2.md new file mode 100644 index 000000000..b4879930e --- /dev/null +++ b/doc/changes/xrt/mr.665.2.md @@ -0,0 +1 @@ +Add `XRT_FORMAT_BAYER_GR8` format. diff --git a/src/xrt/auxiliary/util/u_format.c b/src/xrt/auxiliary/util/u_format.c index b6fd6d726..03b19c70b 100644 --- a/src/xrt/auxiliary/util/u_format.c +++ b/src/xrt/auxiliary/util/u_format.c @@ -21,6 +21,7 @@ u_format_str(enum xrt_format f) 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_BAYER_GR8: return "XRT_FORMAT_BAYER_GR8"; 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"; @@ -41,6 +42,7 @@ u_format_is_blocks(enum xrt_format f) case XRT_FORMAT_R8G8B8: case XRT_FORMAT_R8G8: case XRT_FORMAT_R8: + case XRT_FORMAT_BAYER_GR8: case XRT_FORMAT_L8: case XRT_FORMAT_BITMAP_8X1: case XRT_FORMAT_BITMAP_8X8: @@ -65,6 +67,7 @@ u_format_block_width(enum xrt_format f) case XRT_FORMAT_R8G8B8: case XRT_FORMAT_R8G8: case XRT_FORMAT_R8: + case XRT_FORMAT_BAYER_GR8: case XRT_FORMAT_L8: case XRT_FORMAT_YUV888: // Regular one pixel per block formats. @@ -90,6 +93,7 @@ u_format_block_height(enum xrt_format f) case XRT_FORMAT_R8G8B8: case XRT_FORMAT_R8G8: case XRT_FORMAT_R8: + case XRT_FORMAT_BAYER_GR8: case XRT_FORMAT_L8: case XRT_FORMAT_BITMAP_8X1: case XRT_FORMAT_YUV888: @@ -110,6 +114,7 @@ u_format_block_size(enum xrt_format f) switch (f) { case XRT_FORMAT_BITMAP_8X1: case XRT_FORMAT_R8: + case XRT_FORMAT_BAYER_GR8: case XRT_FORMAT_L8: // One byte blocks return 1; diff --git a/src/xrt/include/xrt/xrt_defines.h b/src/xrt/include/xrt/xrt_defines.h index f5349a880..04d8cf6c8 100644 --- a/src/xrt/include/xrt/xrt_defines.h +++ b/src/xrt/include/xrt/xrt_defines.h @@ -69,6 +69,8 @@ enum xrt_format XRT_FORMAT_R8G8, XRT_FORMAT_R8, + XRT_FORMAT_BAYER_GR8, + XRT_FORMAT_L8, // Luminence, R = L, G = L, B = L. XRT_FORMAT_BITMAP_8X1, // One bit format tiled in 8x1 blocks.