forked from technomancers/piCamera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamicRange.go
40 lines (36 loc) · 917 Bytes
/
dynamicRange.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
//Copyright (c) 2017, Technomancers. All rights reserved.
//Use of this source code is governed by a BSD-style
//license that can be found in the LICENSE file.
package piCamera
//DRCType is to set the dynamic range compression
type DRCType int
const (
//DRCNone is so this package can use whatever the default is
DRCNone DRCType = iota
//DRCOff turns of DRC
DRCOff
//DRCLow compress the range slightly
DRCLow
//DRCMedium compress the range more
DRCMedium
//DRCHigh compress the range even more
DRCHigh
)
//Convert takes the type and returns the string representation of that value.
//Returns true as well if it is the default value.
func (t DRCType) Convert() (string, bool) {
switch t {
case DRCOff:
return "off", false
case DRCLow:
return "low", false
case DRCMedium:
return "medium", false
case DRCHigh:
return "high", false
case DRCNone:
fallthrough
default:
return "", true
}
}