gube

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: CC0-1.0 Imports: 8 Imported by: 1

Documentation

Overview

Package gube implements functions to work with .cube LUT files.

Index

Constants

View Source
const (
	// LUT_INVALID represents an invalid LUT type.
	LUT_INVALID = iota
	// LUT_1D is a LUT with 1D table data.
	LUT_1D
	// LUT_3D is a LUT with 3D table data.
	LUT_3D
)

Variables

View Source
var (
	// ErrOutsideOfDomain is the error returned when trying to look up values outside of the domain.
	ErrOutsideOfDomain = errors.New("value is outside of domain limits")
	// ErrInvalidLutType is the error returned when the LUT type is not a supported one.
	ErrInvalidLutType = errors.New("invalid LUT type")
	// ErrInvalidLutData is the error returned when the parser encounters invalid data.
	ErrInvalidLutData = errors.New("invalid LUT data")
)

Functions

This section is empty.

Types

type Gube

type Gube interface {
	// ProcessImage applies the LUT to the input and returns a new image with the changes.
	ProcessImage(input image.Image) (image.Image, error)
	// LookUp returns the transformed RGB value based on the LUT.
	LookUp(r float64, g float64, b float64) (RGB, error)
	// Name returns the name of this LUT.
	Name() string
	// TableType returns the table type (1D or 3D).
	TableType() int64
	// TableSize returns the number of entries in this LUT.
	TableSize() int64
	// TableData1D returns the table data for 1D LUTs.
	TableData1D() *[]RGB
	// TableData3D returns the table data for 3D LUTs.
	TableData3D() *[][][]RGB
	// Domain returns the min and max domain values for this LUT.
	Domain() (RGB, RGB)
}

Gube defines the methods used to work with .cube LUT files.

type GubeImpl

type GubeImpl struct {
	// contains filtered or unexported fields
}

func NewFromReader

func NewFromReader(r io.Reader) (*GubeImpl, error)

NewFromReader returns a Gube instance created from the reader data.

func (*GubeImpl) Domain

func (gi *GubeImpl) Domain() (RGB, RGB)

func (*GubeImpl) LookUp

func (gi *GubeImpl) LookUp(r float64, g float64, b float64) (RGB, error)

func (*GubeImpl) Name

func (gi *GubeImpl) Name() string

func (*GubeImpl) ProcessImage

func (gi *GubeImpl) ProcessImage(input image.Image) (image.Image, error)

func (*GubeImpl) TableData1D

func (gi *GubeImpl) TableData1D() *[]RGB

func (*GubeImpl) TableData3D

func (gi *GubeImpl) TableData3D() *[][][]RGB

func (*GubeImpl) TableSize

func (gi *GubeImpl) TableSize() int64

func (*GubeImpl) TableType

func (gi *GubeImpl) TableType() int64

type RGB

type RGB [3]float64

RGB represents a r,g,b value.

Jump to

Keyboard shortcuts

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