channel

package
v0.0.0-...-6905684 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2019 License: MIT Imports: 5 Imported by: 4

Documentation

Overview

Package channel provides functions to alter the values of separate color channels in an image.

Index

Constants

This section is empty.

Variables

View Source
var (
	Red        = redCh{}
	Green      = greenCh{}
	Blue       = blueCh{}
	Alpha      = alphaCh{}
	Hue        = hueCh{}
	Saturation = saturationCh{}
	Lightness  = lightnessCh{}
	Intensity  = intensityCh{}

	// Alias
	Brightness = Intensity
)

Functions

func Adjust

func Adjust(img image.Image, adj utils.Adjuster, chs ...Channel) image.Image

Adjust applies the given Adjuster to the Image on only the Channels specified.

func AdjustC

func AdjustC(adj utils.Adjuster, chs ...Channel) utils.Composable

AdjustC returns a Composable function that applies the given Adjuster to the Channels.

Types

type Channel

type Channel interface {
	Get(color.Color) float64
	Set(color.Color, float64) color.Color
}

A Channel provides Get and Set methods, for accessing and modifying the value of a Color in the corresponding color channel. Get and Set both work on values in the range [0,1]; that is, the value of the channel will be scaled to be in that range.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL