Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToGrayscale ¶
ConvertToGrayscale will convert an image from color to grayscale.
Types ¶
type MaxPoints ¶
MaxPoints takes a value between 0 and 1 and returns a calibrated MaxPoints value for use with TriangleConfig. 0 means the face is closer to the original. 1 means the face is maximally obfuscated.
See: https://pkg.go.dev/github.com/rocketlaunchr/showerglass/core#TriangleConfig
NOTE: The implementation is experimental and subject to change. No backward-compatability guarantee!
type Options ¶
type Options struct { // NewHeight, when set, is the height of the image after the resize process. // If a float64 is provided, NewHeight is interpreted as a percentage of the original image. // An int can also be provided to mean the actual NewHeight. // A value of 0 indicates no change from the original height. NewHeight interface{} // NewWidth, when set, is the width of the image after the resize process. // If a float64 is provided, NewWidth is interpreted as a percentage of the original image. // An int can also be provided to mean the actual NewWidth. // A value of 0 indicates no change from the original width. NewWidth interface{} // TriangleConfig is called for each detected face. A *TriangleConfig must be returned to // modify the delaunay triangulation algorithm parameters. // If nil is returned, no triangulation is performed. // // facearea is the size of the detected face. You can calibrate the returned *TriangleConfig parameters based on // the area. The 5 most relevant parameters are BlurRadius, BlurFactor, EdgeFactor, PointRate and MaxPoints. // // QRank indicates the rank of all the "detected faces". If only one face is expected, // then you can return nil for all QRank > 0. If the Q value is _sufficiently_ low, you can // presume a false positive and also return nil. // // See: https://pkg.go.dev/github.com/esimov/triangle/v2#Processor TriangleConfig func(QRank, facearea int, Q float32, h, w int, c MaxPoints) *TriangleConfig // ResizeAlg sets which resizing algorithm to use. // The default is "Caire". ResizeAlg ResizeAlg }
Options is used to adjust behavior of the FaceMask function.
type ResizeAlg ¶
type ResizeAlg int
ResizeAlg defines the algorithm to use for resizing purposes.
const ( // Caire uses a content-aware image resizing algorithm (slowest, but more sophisticated results). // See: https://github.com/esimov/caire // // This is the default. Caire ResizeAlg = iota // NearestNeighbor is very fast (but very low quality results). // See: https://pkg.go.dev/golang.org/x/image/draw#pkg-variables NearestNeighbor // ApproxBiLinear is fast (but medium quality results). // See: https://pkg.go.dev/golang.org/x/image/draw#pkg-variables ApproxBiLinear // BiLinear is slow (but high quality results). // See: https://pkg.go.dev/golang.org/x/image/draw#pkg-variables BiLinear // CatmullRom is slower (but very high quality results). // See: https://pkg.go.dev/golang.org/x/image/draw#pkg-variables CatmullRom )
type TriangleConfig ¶
type TriangleConfig = triangle.Processor
TriangleConfig is a triangle.Processor.
See: https://pkg.go.dev/github.com/esimov/triangle/v2#Processor