Documentation
¶
Index ¶
- Variables
- func EnableDiffMask(o *MatchOptions)
- func IncludeAntiAlias(o *MatchOptions)
- func MatchPixel(a, b image.Image, opts ...MatchOption) (int, error)
- type MatchOption
- func Alpha(alpha float64) MatchOption
- func AntiAliasedColor(c color.Color) MatchOption
- func Checkerboard(enabled bool) MatchOption
- func DiffColor(c color.Color) MatchOption
- func DiffColorAlt(c color.Color) MatchOption
- func IgnoreMask(mask []byte) MatchOption
- func Threshold(threshold float64) MatchOption
- func WindowSize(size float64) MatchOption
- func WriteTo(img *image.Image) MatchOption
- type MatchOptions
Constants ¶
This section is empty.
Variables ¶
var ErrIgnoreMaskSizeNotMatch = errors.New("ignore mask size does not match image width/height")
var ErrImageSizesNotMatch = errors.New("image sizes do not match")
Functions ¶
func EnableDiffMask ¶
func EnableDiffMask(o *MatchOptions)
func IncludeAntiAlias ¶
func IncludeAntiAlias(o *MatchOptions)
func MatchPixel ¶
func MatchPixel(a, b image.Image, opts ...MatchOption) (int, error)
Types ¶
type MatchOption ¶
type MatchOption func(*MatchOptions)
func Alpha ¶
func Alpha(alpha float64) MatchOption
func AntiAliasedColor ¶
func AntiAliasedColor(c color.Color) MatchOption
func Checkerboard ¶
func Checkerboard(enabled bool) MatchOption
Checkerboard controls the comparison background for semi-transparent pixels. It defaults to true; false composites pixels over white.
func DiffColor ¶
func DiffColor(c color.Color) MatchOption
func DiffColorAlt ¶
func DiffColorAlt(c color.Color) MatchOption
func IgnoreMask ¶
func IgnoreMask(mask []byte) MatchOption
IgnoreMask skips pixels whose mask byte is nonzero. The mask must contain width*height bytes in row order, independent of the images' bounds origins. A nil mask disables masking. Ignored pixels are drawn as unchanged.
func Threshold ¶
func Threshold(threshold float64) MatchOption
func WindowSize ¶
func WindowSize(size float64) MatchOption
WindowSize returns the largest diff count in any N by N sliding window. Finite sizes are floored and clamped to [1, min(width, height)]. Non-finite sizes, including the default +Inf, return the total diff count.
func WriteTo ¶
func WriteTo(img *image.Image) MatchOption
type MatchOptions ¶
type MatchOptions struct {
// contains filtered or unexported fields
}