Documentation
¶
Index ¶
- type OpponentValues
- type Opponents
- func (i Opponents) Desc() string
- func (i Opponents) Int64() int64
- func (i Opponents) MarshalText() ([]byte, error)
- func (i *Opponents) SetInt64(in int64)
- func (i *Opponents) SetString(s string) error
- func (i Opponents) String() string
- func (i *Opponents) UnmarshalText(text []byte) error
- func (i Opponents) Values() []enums.Enum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpponentValues ¶ added in v0.2.1
type OpponentValues 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
}
OpponentValues 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 NewOpponentValues ¶ added in v0.2.1
func NewOpponentValues(l, m, s, lm, grey float32) OpponentValues
NewOpponentValues returns a new OpponentValues 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, and BlueYellow using colloquial "everyday" terms.
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) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Opponents) SetString ¶
SetString sets the Opponents value from its string representation, and returns an error if the string is invalid.
func (*Opponents) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.