forked from technomancers/piCamera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimgEffectType.go
88 lines (84 loc) · 2.04 KB
/
imgEffectType.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//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
//ImgEffectType is used for setting the image effect to use.
type ImgEffectType int
const (
//ImfxNone no effect
ImfxNone ImgEffectType = iota
//ImfxNegative invert the image colours
ImfxNegative
//ImfxSolarise solarise the image
ImfxSolarise
//ImfxPosterise posterise the image
ImfxPosterise
//ImfxWhiteboard whiteboard effect
ImfxWhiteboard
//ImfxBlackboard blackboard effect
ImfxBlackboard
//ImfxSketch sketch effect
ImfxSketch
//ImfxDenoise denoise the image
ImfxDenoise
//ImfxEmboss the image
ImfxEmboss
//ImfxOilpaint oil paint effect
ImfxOilpaint
//ImfxHatch hatch sektch effect
ImfxHatch
//ImfxGPen graphite sketch effect
ImfxGPen
//ImfxPastel pastel effect
ImfxPastel
//ImfxWatercolour watercolour effect
ImfxWatercolour
//ImfxFilm film grain effect
ImfxFilm
//ImfxBlur blur the image
ImfxBlur
//ImfxSaturation colour saturate the image
ImfxSaturation
)
//Convert takes the type and returns the string representation of that value.
//Returns true as well if it is the default value.
func (t ImgEffectType) Convert() (string, bool) { //nolint: gocyclo
switch t {
case ImfxNone:
return "none", true
case ImfxNegative:
return "negative", false
case ImfxSolarise:
return "solarise", false
case ImfxPosterise:
return "posterise", false
case ImfxWhiteboard:
return "whiteboard", false
case ImfxBlackboard:
return "blackboard", false
case ImfxSketch:
return "sketch", false
case ImfxDenoise:
return "denoise", false
case ImfxEmboss:
return "emboss", false
case ImfxOilpaint:
return "oilpaint", false
case ImfxHatch:
return "hatch", false
case ImfxGPen:
return "gpen", false
case ImfxPastel:
return "pastel", false
case ImfxWatercolour:
return "watercolour", false
case ImfxFilm:
return "film", false
case ImfxBlur:
return "blur", false
case ImfxSaturation:
return "saturation", false
default:
return "", true
}
}