Documentation ¶
Index ¶
- func Blue(col color.Color) (color.Color, error)
- func Blue16(col color.Color) (color.Color, error)
- func Brighten(amount uint32) graph.Mapper
- func Darken(amount uint32) graph.Mapper
- func Green(col color.Color) (color.Color, error)
- func Green16(col color.Color) (color.Color, error)
- func InvertColor(col color.Color) color.Color
- func Level(r1, g1, b1 uint32, f func(a, b uint32) uint32) graph.Mapper
- func Map(f graph.Mapper) graph.Filter
- func MaxLevel(r1, g1, b1 uint32) graph.Mapper
- func MinLevel(r1, g1, b1 uint32) graph.Mapper
- func Mono(col color.Color) (color.Color, error)
- func Mono16(col color.Color) (color.Color, error)
- func Red(col color.Color) (color.Color, error)
- func Red16(col color.Color) (color.Color, error)
- type DeltaRGB
- type Histogram
- func (h *Histogram) Add(c color.Color) *Histogram
- func (h *Histogram) AnalyzeFilter(_, _ int, c color.Color) (color.Color, error)
- func (h *Histogram) AnalyzeImage(src image.Image) *Histogram
- func (h *Histogram) DeltaRGB() DeltaRGB
- func (h *Histogram) ResetValue(x int) *Histogram
- func (h *Histogram) ResetValuesAbove(v int) *Histogram
- func (h *Histogram) ResetValuesBelow(v int) *Histogram
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Brighten ¶
Brighten is a Mapper that will increase the R, G and B components by a fixed amount.
func InvertColor ¶
InvertColor is a Mapper to invert an image
func Level ¶
Level will apply a function against the R, G and B components of a pixel, replacing it with the result. This is the implementation behind MinLevel and MaxLevel which use the util.MinU32 and util.MaxU32 functions. The first parameter passed to this function are the parameters of this function. The second parameter is from the pixel.
func MaxLevel ¶
MaxLevel is a Mapper that will ensure the image contains the maximum of each component. This can be used to set the lower limit in an image, clipping entries that are too dark.
func MinLevel ¶
MinLevel is a Mapper that will ensure the image contains the minimum of each component. This can be used to set the upper limit in an image, clipping entries that are too bright.
func Mono ¶
Mono is a Mapper which converts an image into greyscale.
It does this by just keeping the Green channel, as the human eye is more receptive to this channel.
It's also how most colour scanners do greyscale by scanning in colour & taking just the green component.
func Mono16 ¶
Mono16 is a Mapper which converts an image into greyscale. The default implementationm is to use It does this by just keeping the Green channel, as the human eye is more receptive to this channel.
It's also how most colour scanners do greyscale by scanning in colour & taking just the green component.
Types ¶
type DeltaRGB ¶
type DeltaRGB struct {
R, G, B int
}
DeltaRGB contains the differences to apply to an RGBA colour in an AdjustImageFilter
type Histogram ¶
Histogram represents the total number of pixels in an image based on RGB values
func NewHistogram ¶
func NewHistogram() *Histogram
func (*Histogram) AnalyzeFilter ¶
AnalyzeFilter analyzes an image placing the results in the histogram
func (*Histogram) AnalyzeImage ¶
AnalyzeImage analyzes an image placing the results in the histogram
func (*Histogram) ResetValue ¶
ResetValue sets the histogram values at x to 0. Used after Analyze to remove high known values which affects the results. Eg an image of mostly black needs black removed.
func (*Histogram) ResetValuesAbove ¶
ResetValuesAbove sets the histogram values above v to 0. Used after Analyze to remove high known values which affects the results. Eg an image of mostly white needs white
func (*Histogram) ResetValuesBelow ¶
ResetValuesBelow sets the histogram values below v to 0. Used after Analyze to remove high known values which affects the results. Eg an image of mostly black needs black removed.