cube

package
v0.0.0-...-75117b5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyLut            = errors.New("empty LUT")
	ErrDifferentSampleSize = errors.New("different sample sizes in LUTs")
	ErrUnrecognisedLine    = errors.New("unrecognised line")
)

Functions

This section is empty.

Types

type Cube

type Cube struct {
	Title     string
	Meta      string
	LUT3Dsize int
	DomainMin Sample
	DomainMax Sample
	Samples   []Sample
}

func Load

func Load(r io.Reader) (Cube, error)

func LoadFile

func LoadFile(path string) (Cube, error)

func (Cube) Apply

func (c Cube) Apply(img image.Image) *image.RGBA

func (Cube) ApplyScaled

func (c Cube) ApplyScaled(img image.Image, intensity float64) *image.RGBA

func (*Cube) Blend

func (c *Cube) Blend(c2 Cube, i1, i2 float64) (*Cube, error)

Blend does a weighted blend of two LUTs using the two intensities i1 and i2 provided in input.

func (*Cube) Clamp

func (c *Cube) Clamp() *Cube

func (*Cube) MustBlend

func (c *Cube) MustBlend(c2 Cube, i1, i2 float64) *Cube

func (*Cube) MustSum

func (c *Cube) MustSum(c2 Cube) *Cube

func (*Cube) Rescale

func (c *Cube) Rescale() *Cube

func (*Cube) Scale

func (c *Cube) Scale(v float64) *Cube

func (Cube) String

func (c Cube) String() string

func (*Cube) Sum

func (c *Cube) Sum(c2 Cube) (*Cube, error)

func (Cube) WriteTo

func (c Cube) WriteTo(w io.Writer) (n int64, err error)

type Sample

type Sample struct {
	R, G, B float64
}

func (*Sample) Blend

func (s *Sample) Blend(s2 Sample, w1, w2 float64) *Sample

func (*Sample) Clamp

func (s *Sample) Clamp(min, max Sample) *Sample

func (*Sample) Rescale

func (s *Sample) Rescale(minVal, maxVal float64, domainMin, domainMax Sample) *Sample

func (*Sample) Scale

func (s *Sample) Scale(v float64) *Sample

func (Sample) String

func (s Sample) String() string

func (*Sample) Sum

func (s *Sample) Sum(s2 Sample) *Sample

Jump to

Keyboard shortcuts

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