levels

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: 7 Imported by: 1

Documentation

Overview

Package levels provides functions to alter the distibution of values of a color channel in an image.

Index

Constants

View Source
const (
	VALUE_DELIM = ","
	POINT_DELIM = " "
)

Variables

This section is empty.

Functions

func Auto

func Auto(img image.Image, ch channel.Channel) image.Image

func AutoBlack

func AutoBlack(img image.Image, ch channel.Channel) image.Image

AutoBlack finds the darkest colour in the image and makes it black, adjusting the colours of every other point to achieve the same distribution.

func AutoWhite

func AutoWhite(img image.Image, ch channel.Channel) image.Image

func SetBlack

func SetBlack(img image.Image, ch channel.Channel, darkest float64) image.Image

func SetBlackC

func SetBlackC(ch channel.Channel, darkest float64) utils.Composable

func SetCurve

func SetCurve(img image.Image, ch channel.Channel, curve *Curve) image.Image

func SetCurveC

func SetCurveC(ch channel.Channel, curve *Curve) utils.Composable

func SetWhite

func SetWhite(img image.Image, ch channel.Channel, lightest float64) image.Image

func SetWhiteC

func SetWhiteC(ch channel.Channel, lightest float64) utils.Composable

Types

type Curve

type Curve struct {
	Points []*Point
}

func C

func C(ps [][]float64) *Curve

func ParseCurveString

func ParseCurveString(s string) *Curve

func (*Curve) String

func (c *Curve) String() string

func (*Curve) Value

func (c *Curve) Value(x float64) float64

Value calculates the y-value for the given x-value by approximating a bezier curve through the points the Curve describes.

BUG(r): Only uses linear interpolation.

type Point

type Point struct {
	X, Y float64
}

func P

func P(x, y float64) *Point

func (*Point) String

func (p *Point) String() string

Notes

Bugs

  • Only uses linear interpolation.

Jump to

Keyboard shortcuts

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