From 9c3830b6b948848412a6a94c3ad58756068b8351 Mon Sep 17 00:00:00 2001
From: Hannah <hypgci@gmail.com>
Date: Sat, 23 Jan 2016 00:06:09 +0000
Subject: [PATCH] screeninfo:also print all supported bitmap overlay
colorspaces
---
src/bin/screeninfo.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/src/bin/screeninfo.cpp b/src/bin/screeninfo.cpp
index ff2a06f..5056d50 100644
a
|
b
|
|
12 | 12 | #include <stdio.h> |
13 | 13 | |
14 | 14 | |
| 15 | #define M(x) { B_##x, #x } |
| 16 | |
| 17 | struct ColorSpace { |
| 18 | color_space space; |
| 19 | const char* name; |
| 20 | }; |
| 21 | |
| 22 | ColorSpace table[] = |
| 23 | { |
| 24 | M(RGB32), |
| 25 | M(RGB32), |
| 26 | M(RGBA32), |
| 27 | M(RGB24), |
| 28 | M(RGB16), |
| 29 | M(RGB15), |
| 30 | M(RGBA15), |
| 31 | M(CMAP8), |
| 32 | M(GRAY8), |
| 33 | M(GRAY1), |
| 34 | M(RGB32_BIG), |
| 35 | M(RGBA32_BIG), |
| 36 | M(RGB24_BIG), |
| 37 | M(RGB16_BIG), |
| 38 | M(RGB15_BIG), |
| 39 | M(RGBA15_BIG), |
| 40 | M(YCbCr422), |
| 41 | M(YCbCr411), |
| 42 | M(YCbCr444), |
| 43 | M(YCbCr420), |
| 44 | M(YUV422), |
| 45 | M(YUV411), |
| 46 | M(YUV444), |
| 47 | M(YUV420), |
| 48 | M(YUV9), |
| 49 | M(YUV12), |
| 50 | M(UVL24), |
| 51 | M(UVL32), |
| 52 | M(UVLA32), |
| 53 | M(LAB24), |
| 54 | M(LAB32), |
| 55 | M(LABA32), |
| 56 | M(HSI24), |
| 57 | M(HSI32), |
| 58 | M(HSIA32), |
| 59 | M(HSV24), |
| 60 | M(HSV32), |
| 61 | M(HSVA32), |
| 62 | M(HLS24), |
| 63 | M(HLS32), |
| 64 | M(HLSA32), |
| 65 | M(CMY24), |
| 66 | M(CMY32), |
| 67 | M(CMYA32), |
| 68 | M(CMYK32), |
| 69 | M(CMYA32), |
| 70 | M(CMYK32) |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | void |
| 75 | print_supported_overlays() |
| 76 | { |
| 77 | for (int32 i = 0; i < sizeof(table) / sizeof(table[0]); i++) |
| 78 | { |
| 79 | uint32 supportFlags = 0; |
| 80 | |
| 81 | if (bitmaps_support_space(table[i].space, &supportFlags) |
| 82 | && (supportFlags & B_BITMAPS_SUPPORT_OVERLAY)) |
| 83 | printf("\t%s\n", table[i].name); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | |
15 | 88 | int |
16 | 89 | main() |
17 | 90 | { |
… |
… |
main()
|
34 | 107 | printf(" name: %s\n", info.name); |
35 | 108 | printf(" chipset: %s\n", info.chipset); |
36 | 109 | printf(" serial: %s\n", info.serial_no); |
| 110 | printf(" bitmap overlay colorspaces supported:\n"); |
| 111 | print_supported_overlays(); |
37 | 112 | } |
38 | 113 | } while (screen.SetToNext() == B_OK); |
39 | 114 | |