Commit fc88d7d0 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz
Browse files

aux/util: Add more formats

parent 36f24036
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment