generative-art-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Geometry.LookupTable.Lookup1

Description

One-dimensional lookup tables

Synopsis

Documentation

newtype LookupTable1 a b Source #

Vector-based lookup table. Functions assume that values must increase with vector index, enabling binary search.

Constructors

LookupTable1 (Vector (a, b)) 

Instances

Instances details
(Show a, Show b) => Show (LookupTable1 a b) Source # 
Instance details

Defined in Geometry.LookupTable.Lookup1

(NFData a, NFData b) => NFData (LookupTable1 a b) Source # 
Instance details

Defined in Geometry.LookupTable.Lookup1

Methods

rnf :: LookupTable1 a b -> () #

(Eq a, Eq b) => Eq (LookupTable1 a b) Source # 
Instance details

Defined in Geometry.LookupTable.Lookup1

Methods

(==) :: LookupTable1 a b -> LookupTable1 a b -> Bool #

(/=) :: LookupTable1 a b -> LookupTable1 a b -> Bool #

(Ord a, Ord b) => Ord (LookupTable1 a b) Source # 
Instance details

Defined in Geometry.LookupTable.Lookup1

lookupInterpolated :: LookupTable1 Double Double -> Double -> Double Source #

Find a value in the lookup table using binary search, interpolating linearly around the search result. Clips for out-of-range values.

lookupBiasLower :: Ord a => LookupTable1 a b -> a -> (a, b) Source #

Lookup in the LUT, with bias towards the left, i.e. when searching a value not present in the LUT, return the closest one before.