tmo

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// RangeMin is the LDR lower boundary.
	RangeMin = 0
	// RangeMax is the LDR higher boundary.
	RangeMax = 65535 // max uint16
	// LumSize defines the luminance range [0, LumSize]
	LumSize = RangeMax + 3
)

Variables

View Source
var (
	// ICamNormalizeLDRLuminance normalizes the LDR luminance (10% slower when activated).
	ICamNormalizeLDRLuminance = false
)
View Source
var (
	// LumPixFloor is the default lunMap maping for LinearInversePixelMapping func.
	LumPixFloor []float64
)

Functions

func LDRClamp added in v0.2.0

func LDRClamp(channel float64) float64

LDRClamp to solid black and solid white.

func LinearInversePixelMapping

func LinearInversePixelMapping(lum float64, lumMap []float64, lumSize int) float64

LinearInversePixelMapping is an linear inverse pixel mapping. It is preference to have slightly more solid black 0 and solid white RangeMax in spectrum by stretching a mapping.

func WoB

func WoB(b bool) float64

WoB returns 1.0 if b is true, else 0.0

Types

type CustomReinhard05

type CustomReinhard05 struct {
	HDRImage hdr.Image
	// Brightness is included in [-50, 50] with 1 increment step.
	Brightness float64
	// Chromatic is included in [0, 1] with 0.01 increment step.
	Chromatic float64
	// Light is included in [0, 1] with 0.01 increment step.
	Light float64
	// contains filtered or unexported fields
}

A CustomReinhard05 is a custom Reinhard05 TMO implementation. It looks like a JPEG photo taken with a smartphone. It provides a quick render with less RAM consumption than Reinhard05.

func NewCustomReinhard05

func NewCustomReinhard05(m hdr.Image, brightness, chromatic, light float64) *CustomReinhard05

NewCustomReinhard05 instanciates a new CustomReinhard05 TMO.

func NewDefaultCustomReinhard05

func NewDefaultCustomReinhard05(m hdr.Image) *CustomReinhard05

NewDefaultCustomReinhard05 instanciates a new CustomReinhard05 TMO with default parameters.

func (*CustomReinhard05) Perform

func (t *CustomReinhard05) Perform() image.Image

Perform runs the TMO mapping.

type Drago03

type Drago03 struct {
	HDRImage hdr.Image
	// Bias is included in [0, 1] with 0.01 increment step.
	Bias float64
	// contains filtered or unexported fields
}

A Drago03 is an adaptive TMO implementation based on Frederic Drago's 2003 white paper.

Reference: http://resources.mpi-inf.mpg.de/tmo/logmap/

func NewDefaultDrago03

func NewDefaultDrago03(m hdr.Image) *Drago03

NewDefaultDrago03 instanciates a new Drago03 TMO with default parameters.

func NewDrago03

func NewDrago03(m hdr.Image, bias float64) *Drago03

NewDrago03 instanciates a new Drago03 TMO.

func (*Drago03) Perform

func (t *Drago03) Perform() image.Image

Perform runs the TMO mapping.

type Durand

type Durand struct {
	HDRImage hdr.Image
	Contrast float64
	// contains filtered or unexported fields
}

A Durand is a Fast Bilateral Filtering for the Display of High-Dynamic-Range Images.

Reference: Fredo Durand and Julie Dorsey in Proceedings of SIGGRAPH 2002

func NewDefaultDurand

func NewDefaultDurand(m hdr.Image) *Durand

NewDefaultDurand instanciates a new Durand TMO with default parameters.

func NewDurand

func NewDurand(m hdr.Image, contrast float64) *Durand

NewDurand instanciates a new Durand TMO.

func (*Durand) Perform

func (t *Durand) Perform() image.Image

Perform runs the TMO mapping.

type ICam06

type ICam06 struct {
	HDRImage    hdr.Image
	Contrast    float64
	MinClipping float64
	MaxClipping float64
	// contains filtered or unexported fields
}

A ICam06 is a TMO implementation based on Mark D. Fairchild, Jiangtao Kuang and Garrett M. Johnson's 2006 white paper.

Reference: iCAM for high-dynamic-range image rendering. Mark D. Fairchild, Jiangtao Kuang and Garrett M. Johnson. In SIGGRAPH '06 ACM SIGGRAPH 2006 Research posters. Article No. 185 http://rit-mcsl.org/fairchild/PDFs/PAP26.pdf

func NewDefaultICam06

func NewDefaultICam06(m hdr.Image) *ICam06

NewDefaultICam06 instanciates a new ICam06 TMO with default parameters.

func NewICam06

func NewICam06(m hdr.Image, contrast, minClipping, maxClipping float64) *ICam06

NewICam06 instanciates a new ICam06 TMO. Clipping: simulate incomplete light adaptation and the glare in visual system.

func (*ICam06) Perform

func (t *ICam06) Perform() image.Image

Perform runs the TMO mapping.

type Linear

type Linear struct {
	HDRImage hdr.Image
}

A Linear is a naive TMO implementation.

func NewLinear

func NewLinear(m hdr.Image) *Linear

NewLinear instanciates a new Linear TMO.

func (*Linear) Perform

func (t *Linear) Perform() image.Image

Perform runs the TMO mapping.

type Logarithmic

type Logarithmic struct {
	HDRImage hdr.Image
}

A Logarithmic is a naive TMO implementation.

func NewLogarithmic

func NewLogarithmic(m hdr.Image) *Logarithmic

NewLogarithmic instanciates a new Logarithmic TMO.

func (*Logarithmic) Perform

func (t *Logarithmic) Perform() image.Image

Perform runs the TMO mapping.

type Reinhard05

type Reinhard05 struct {
	HDRImage hdr.Image
	// Brightness is included in [-20, 20] with 0.1 increment step.
	Brightness float64
	// Chromatic is included in [0, 1] with 0.01 increment step.
	Chromatic float64
	// Light is included in [0, 1] with 0.01 increment step.
	Light float64
	// contains filtered or unexported fields
}

A Reinhard05 is a TMO implementation based on Erik Reinhard's 2005 white paper.

Reference: Dynamic Range Reduction Inspired by Photoreceptor Physiology. E. Reinhard and K. Devlin. In IEEE Transactions on Visualization and Computer Graphics, 2005.

func NewDefaultReinhard05

func NewDefaultReinhard05(m hdr.Image) *Reinhard05

NewDefaultReinhard05 instanciates a new Reinhard05 TMO with default parameters.

func NewReinhard05

func NewReinhard05(m hdr.Image, brightness, chromatic, light float64) *Reinhard05

NewReinhard05 instanciates a new Reinhard05 TMO.

func (*Reinhard05) Perform

func (t *Reinhard05) Perform() image.Image

Perform runs the TMO mapping.

type ToneMappingOperator

type ToneMappingOperator interface {
	// Perform runs the TMO mapping.
	Perform() image.Image
}

A ToneMappingOperator is an algorithm that converts hdr.Image to image.Image.

HDR is a high dynamic range (HDR) technique used in imaging and photography to reproduce a greater dynamic range of luminosity than is possible with standard digital imaging or photographic techniques. The aim is to present a similar range of luminance to that experienced through the human visual system. The human eye, through adaptation of the iris and other methods, adjusts constantly to adapt to a broad range of luminance present in the environment. The brain continuously interprets this information so that a viewer can see in a wide range of light conditions.

Jump to

Keyboard shortcuts

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