hrev50050 adds 1 changeset to branch 'master'
old head: bd0b62b178ebe00f813a8dfd6cf2e96affde5388
new head: 8376bc1bc1d68d7024f31eec056d6dee2569f3d4
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=8376bc1bc1d6+%5Ebd0b62b178eb
----------------------------------------------------------------------------
8376bc1bc1d6: screeninfo:also print all supported bitmap overlay colorspaces
[ Hannah <hypgci@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev50050
Commit: 8376bc1bc1d68d7024f31eec056d6dee2569f3d4
URL: http://cgit.haiku-os.org/haiku/commit/?id=8376bc1bc1d6
Author: Hannah <hypgci@xxxxxxxxx>
Date: Sat Jan 23 00:06:09 2016 UTC
Committer: François Revol <revol@xxxxxxx>
Commit-Date: Sat Jan 23 21:33:01 2016 UTC
----------------------------------------------------------------------------
1 file changed, 75 insertions(+)
src/bin/screeninfo.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++
----------------------------------------------------------------------------
diff --git a/src/bin/screeninfo.cpp b/src/bin/screeninfo.cpp
index ff2a06f..5056d50 100644
--- a/src/bin/screeninfo.cpp
+++ b/src/bin/screeninfo.cpp
@@ -12,6 +12,79 @@
#include <stdio.h>
+#define M(x) { B_##x, #x }
+
+struct ColorSpace {
+ color_space space;
+ const char* name;
+};
+
+ColorSpace table[] =
+{
+ M(RGB32),
+ M(RGB32),
+ M(RGBA32),
+ M(RGB24),
+ M(RGB16),
+ M(RGB15),
+ M(RGBA15),
+ M(CMAP8),
+ M(GRAY8),
+ M(GRAY1),
+ M(RGB32_BIG),
+ M(RGBA32_BIG),
+ M(RGB24_BIG),
+ M(RGB16_BIG),
+ M(RGB15_BIG),
+ M(RGBA15_BIG),
+ M(YCbCr422),
+ M(YCbCr411),
+ M(YCbCr444),
+ M(YCbCr420),
+ M(YUV422),
+ M(YUV411),
+ M(YUV444),
+ M(YUV420),
+ M(YUV9),
+ M(YUV12),
+ M(UVL24),
+ M(UVL32),
+ M(UVLA32),
+ M(LAB24),
+ M(LAB32),
+ M(LABA32),
+ M(HSI24),
+ M(HSI32),
+ M(HSIA32),
+ M(HSV24),
+ M(HSV32),
+ M(HSVA32),
+ M(HLS24),
+ M(HLS32),
+ M(HLSA32),
+ M(CMY24),
+ M(CMY32),
+ M(CMYA32),
+ M(CMYK32),
+ M(CMYA32),
+ M(CMYK32)
+};
+
+
+void
+print_supported_overlays()
+{
+ for (int32 i = 0; i < sizeof(table) / sizeof(table[0]); i++)
+ {
+ uint32 supportFlags = 0;
+
+ if (bitmaps_support_space(table[i].space, &supportFlags)
+ && (supportFlags & B_BITMAPS_SUPPORT_OVERLAY))
+ printf("\t%s\n", table[i].name);
+ }
+}
+
+
int
main()
{
@@ -34,6 +107,8 @@ main()
printf(" name: %s\n", info.name);
printf(" chipset: %s\n", info.chipset);
printf(" serial: %s\n", info.serial_no);
+ printf(" bitmap overlay colorspaces supported:\n");
+ print_supported_overlays();
}
} while (screen.SetToNext() == B_OK);