Documentation ¶
Overview ¶
It is mainly used to debug the seam carving operation correctness with face detection and image mask enabled. When the GUI mode and the debugging option is activated it will show the image mask and the detected faces rectangles in a distinct color.
Package imop implements the Porter-Duff composition operations used for mixing a graphic element with its backdrop. Porter and Duff presented in their paper 12 different composition operation, but the core image/draw core package implements only the source-over-destination and source. This package implements all of the 12 composite operation together with some blending modes.
Index ¶
- Constants
- type Bitmap
- type Blend
- func (bl *Blend) AlphaCompose(...) float64
- func (bl *Blend) Get() string
- func (bl *Blend) Lum(rgb Color) float64
- func (bl *Blend) Sat(rgb Color) float64
- func (bl *Blend) Set(blendType string) error
- func (bl *Blend) SetLum(rgb Color, l float64) Color
- func (bl *Blend) SetSat(rgb Color, s float64) Color
- type Color
- type Composite
Constants ¶
const ( Normal = "normal" Darken = "darken" Lighten = "lighten" Multiply = "multiply" Screen = "screen" Overlay = "overlay" SoftLight = "soft_light" HardLight = "hard_light" ColorDodge = "color_dodge" ColorBurn = "color_burn" Difference = "difference" Exclusion = "exclusion" // Non-separable blend modes Hue = "hue" Saturation = "saturation" ColorMode = "color" Luminosity = "luminosity" )
const ( Clear = "clear" Copy = "copy" Dst = "dst" SrcOver = "src_over" DstOver = "dst_over" SrcIn = "src_in" DstIn = "dst_in" SrcOut = "src_out" DstOut = "dst_out" SrcAtop = "src_atop" DstAtop = "dst_atop" Xor = "xor" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
Bitmap holds an image type as a placeholder for the Porter-Duff composition operations which can be used as a source or destination image.
type Blend ¶
Blend struct contains the currently active blend mode and all the supported blend modes.
func (*Blend) AlphaCompose ¶ added in v1.4.6
func (bl *Blend) AlphaCompose( backdropAlpha, sourceAlpha, compositeAlpha, backdropColor, sourceColor, compositeColor float64, ) float64
Applies the alpha blending formula for a blend operation. See: https://www.w3.org/TR/compositing-1/#blending
type Color ¶ added in v1.4.6
type Color struct {
R, G, B float64
}
Color represents the RGB channel of a specific color.
type Composite ¶
Composite struct contains the currently active composition operation and all the supported operations.
func (*Composite) Draw ¶
Draw applies the currently active Ported-Duff composition operation formula, taking as parameter the source and the destination image and draws the result into the bitmap. If a blend mode is activated it will plug in the alpha blending formula also into the equation.