lms

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpVals

type OpVals struct {

	// red vs. green (long vs. medium)
	RedGreen float32

	// blue vs. yellow (short vs. avg(long, medium))
	BlueYellow float32

	// greyscale luminance channel -- typically use L* from LAB as best
	Grey float32
}

OpVals holds color opponent values based on cone-like L,M,S inputs These values are useful for generating inputs to vision models that simulate color opponency representations in the brain.

func NewOpVals

func NewOpVals(l, m, s, lm, grey float32) OpVals

NewOpVals returns a new opponent color values from values representing the LMS long, medium, short cone responses, and an overall grey value

type Opponents

type Opponents int32 //enums:enum

Opponents enumerates the three primary opponency channels: WhiteBlack, RedGreen, BlueYellow using colloquial "everyday" terms.

const (
	// White vs. Black greyscale
	WhiteBlack Opponents = iota

	// Red vs. Green
	RedGreen

	// Blue vs. Yellow
	BlueYellow
)
const OpponentsN Opponents = 3

OpponentsN is the highest valid value for type Opponents, plus one.

func OpponentsValues

func OpponentsValues() []Opponents

OpponentsValues returns all possible values for the type Opponents.

func (Opponents) Desc

func (i Opponents) Desc() string

Desc returns the description of the Opponents value.

func (Opponents) Int64

func (i Opponents) Int64() int64

Int64 returns the Opponents value as an int64.

func (Opponents) MarshalText

func (i Opponents) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Opponents) SetInt64

func (i *Opponents) SetInt64(in int64)

SetInt64 sets the Opponents value from an int64.

func (*Opponents) SetString

func (i *Opponents) SetString(s string) error

SetString sets the Opponents value from its string representation, and returns an error if the string is invalid.

func (Opponents) String

func (i Opponents) String() string

String returns the string representation of this Opponents value.

func (*Opponents) UnmarshalText

func (i *Opponents) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Opponents) Values

func (i Opponents) Values() []enums.Enum

Values returns all possible values for the type Opponents.

Jump to

Keyboard shortcuts

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