This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
interpolation.go
61 lines (47 loc) · 1.86 KB
/
interpolation.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
package reisen
// #cgo pkg-config: libswscale
// #include <libswscale/swscale.h>
import "C"
// InterpolationAlgorithm is used when
// we scale a video frame in a different resolution.
type InterpolationAlgorithm int
const (
InterpolationFastBilinear InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_FAST_BILINEAR)
InterpolationBilinear InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_BILINEAR)
InterpolationBicubic InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_BICUBIC)
InterpolationX InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_X)
InterpolationPoint InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_POINT)
InterpolationArea InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_AREA)
InterpolationBicubicBilinear InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_BICUBLIN)
InterpolationGauss InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_GAUSS)
InterpolationSinc InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_SINC)
InterpolationLanczos InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_LANCZOS)
InterpolationSpline InterpolationAlgorithm = InterpolationAlgorithm(C.SWS_SPLINE)
)
// String returns the name of the interpolation algorithm.
func (interpolationAlg InterpolationAlgorithm) String() string {
switch interpolationAlg {
case InterpolationFastBilinear:
return "fast bilinear"
case InterpolationBilinear:
return "bilinear"
case InterpolationBicubic:
return "bicubic"
case InterpolationX:
return "x"
case InterpolationPoint:
return "point"
case InterpolationArea:
return "area"
case InterpolationBicubicBilinear:
return "bicubic bilinear"
case InterpolationSinc:
return "sinc"
case InterpolationLanczos:
return "lanczos"
case InterpolationSpline:
return "spline"
default:
return ""
}
}