-
Notifications
You must be signed in to change notification settings - Fork 6
/
value.go
41 lines (37 loc) · 898 Bytes
/
value.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package colordepth
import "strconv"
// Value identifies a color depth as used by windows terminal server.
type Value uint16
// Color depth values.
//
// https://docs.microsoft.com/en-us/windows/win32/api/wtsapi32/ns-wtsapi32-wts_client_display
const (
D4 = 1 // 4 bits per pixel
D8 = 2 // 8 bits per pixel
D16 = 4 // 16 bits per pixel
D24A = 8 // 24 bits per pixel
D15 = 16 // 15 bits per pixel
D24B = 24 // 24 bits per pixel
D32 = 32 // 32 bits per pixel
)
// String returns a string representation of the connection state.
func (v Value) String() string {
switch v {
case D4:
return "4-bit RGB"
case D8:
return "8-bit RGB"
case D16:
return "16-bit RGB"
case D24A:
return "24-bit RGB"
case D15:
return "15-bit RGB"
case D24B:
return "24-bit RGB"
case D32:
return "32-bit RGB"
default:
return "Unknown Color Depth (" + strconv.Itoa(int(v)) + ")"
}
}