From be325080ab8940ffed789e5ce36837c79ebb65c3 Mon Sep 17 00:00:00 2001
From: Hannah <hypgci@gmail.com>
Date: Sat, 23 Jan 2016 00:06:09 +0000
Subject: [PATCH] also print color space and overlay support status
---
src/bin/screeninfo.cpp | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/src/bin/screeninfo.cpp b/src/bin/screeninfo.cpp
index ff2a06f..52ff63d 100644
a
|
b
|
|
12 | 12 | #include <stdio.h> |
13 | 13 | |
14 | 14 | |
| 15 | const char* colorSpaceName(color_space colorSpace) |
| 16 | { |
| 17 | switch (colorSpace) |
| 18 | { |
| 19 | case B_CMAP8: |
| 20 | return "CMAP8"; |
| 21 | case B_RGB15: |
| 22 | return "RGB15"; |
| 23 | case B_RGB32: |
| 24 | return "RGB32"; |
| 25 | default: |
| 26 | return "None"; |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | |
| 31 | bool overlaySupport(color_space colorSpace) |
| 32 | { |
| 33 | uint32 supportFlags = 0; |
| 34 | |
| 35 | return bitmaps_support_space(colorSpace, &supportFlags) |
| 36 | && (supportFlags & B_BITMAPS_SUPPORT_OVERLAY); |
| 37 | } |
| 38 | |
| 39 | |
15 | 40 | int |
16 | 41 | main() |
17 | 42 | { |
… |
… |
main()
|
34 | 59 | printf(" name: %s\n", info.name); |
35 | 60 | printf(" chipset: %s\n", info.chipset); |
36 | 61 | printf(" serial: %s\n", info.serial_no); |
| 62 | color_space colorSpace = screen.ColorSpace(); |
| 63 | printf(" color space: %s\n", colorSpaceName(colorSpace)); |
| 64 | printf(" overlay support: %s\n", |
| 65 | overlaySupport(colorSpace) ? "yes" : "no"); |
37 | 66 | } |
38 | 67 | } while (screen.SetToNext() == B_OK); |
39 | 68 | |