cam02

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LMSToResp

func LMSToResp(l, m, s float32) (lc, mc, sc, lmc, grey float32)

LMSToResp converts Long, Medium, Short cone-based values to values that more closely reflect neural responses, including a combined long-medium (yellow) channel (lmc). Uses the CIECAM02 color appearance model (MoroneyFairchildHuntEtAl02) https://en.wikipedia.org/wiki/CIECAM02

func LuminanceAdapt

func LuminanceAdapt(bgLum float32) float32

LuminanceAdapt implements the luminance adaptation function equals 1 at background luminance of 200 so we generally ignore it.. bgLum is background luminance -- 200 default.

func ResponseCompression

func ResponseCompression(val float32) float32

ResponseCompression takes a 0-1 normalized LMS value and performs hyperbolic response compression. val must ALREADY have the luminance adaptation applied to it using the luminance adaptation function, which is 1 at a background luminance level of 200 = 2, so you can skip that step if you assume that level of background.

func SRGBLinToLMS

func SRGBLinToLMS(rl, gl, bl float32) (l, m, s float32)

SRGBLinToLMS converts sRGB linear to Long, Medium, Short cone-based responses, using the CAT02 transform from CIECAM02 color appearance model (MoroneyFairchildHuntEtAl02) this is good for representing adaptation but NOT apparently good for representing appearances

func SRGBToLMS

func SRGBToLMS(r, g, b float32) (l, m, s float32)

SRGBToLMS converts sRGB to Long, Medium, Short cone-based responses, using the CAT02 transform from CIECAM02 color appearance model (MoroneyFairchildHuntEtAl02)

func SRGBToLMSResp

func SRGBToLMSResp(r, g, b float32) (lc, mc, sc, lmc, grey float32)

SRGBToLMSResp converts sRGB to LMS neural response cone values, that more closely reflect neural responses, including a combined long-medium (yellow) channel (lmc). Uses the CIECAM02 color appearance model (MoroneyFairchildHuntEtAl02) https://en.wikipedia.org/wiki/CIECAM02

func XYZToLMS

func XYZToLMS(x, y, z float32) (l, m, s float32)

XYZToLMS converts XYZ to Long, Medium, Short cone-based responses, using the CAT02 transform from CIECAM02 color appearance model (MoroneyFairchildHuntEtAl02)

Types

This section is empty.

Jump to

Keyboard shortcuts

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