| Maintainer | Jeremy Nuttall <jeremy@jeremy-nuttall.com> |
|---|---|
| Stability | experimental |
| Safe Haskell | None |
| Language | GHC2021 |
Numeric.Noise.Cellular
Contents
Description
Synopsis
- data CellularConfig a = CellularConfig {}
- defaultCellularConfig :: RealFrac a => CellularConfig a
- data CellularDistanceFn
- data CellularResult
- noise2 :: (RealFrac a, Floating a) => CellularConfig a -> Noise2 a
Configuration
data CellularConfig a Source #
Configuration for cellular (Worley) noise generation.
Cellular noise is based on distances to randomly distributed cell points, creating a distinctive cellular or organic pattern.
Constructors
| CellularConfig | |
Fields
| |
Instances
defaultCellularConfig :: RealFrac a => CellularConfig a Source #
Default configuration for cellular noise generation.
data CellularDistanceFn Source #
Distance function for cellular noise calculations.
Different distance metrics produce different visual characteristics in the cellular pattern.
Constructors
| DistEuclidean | \( \sqrt{dx^2 + dy^2} \) - Creates circular cells with smooth edges. |
| DistEuclideanSq | \( dx^2 + dy^2 \) - Faster than |
| DistManhattan | \( |dx| + |dy| \) - Creates diamond-shaped cells with sharp edges. |
| DistHybrid | Hybrid of Euclidean and Manhattan distances. |
Instances
| Bounded CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular | |||||
| Enum CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular Methods succ :: CellularDistanceFn -> CellularDistanceFn # pred :: CellularDistanceFn -> CellularDistanceFn # toEnum :: Int -> CellularDistanceFn # fromEnum :: CellularDistanceFn -> Int # enumFrom :: CellularDistanceFn -> [CellularDistanceFn] # enumFromThen :: CellularDistanceFn -> CellularDistanceFn -> [CellularDistanceFn] # enumFromTo :: CellularDistanceFn -> CellularDistanceFn -> [CellularDistanceFn] # enumFromThenTo :: CellularDistanceFn -> CellularDistanceFn -> CellularDistanceFn -> [CellularDistanceFn] # | |||||
| Generic CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular Associated Types
Methods from :: CellularDistanceFn -> Rep CellularDistanceFn x # to :: Rep CellularDistanceFn x -> CellularDistanceFn # | |||||
| Read CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular Methods readsPrec :: Int -> ReadS CellularDistanceFn # readList :: ReadS [CellularDistanceFn] # | |||||
| Show CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular Methods showsPrec :: Int -> CellularDistanceFn -> ShowS # show :: CellularDistanceFn -> String # showList :: [CellularDistanceFn] -> ShowS # | |||||
| Eq CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular Methods (==) :: CellularDistanceFn -> CellularDistanceFn -> Bool # (/=) :: CellularDistanceFn -> CellularDistanceFn -> Bool # | |||||
| Ord CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular Methods compare :: CellularDistanceFn -> CellularDistanceFn -> Ordering # (<) :: CellularDistanceFn -> CellularDistanceFn -> Bool # (<=) :: CellularDistanceFn -> CellularDistanceFn -> Bool # (>) :: CellularDistanceFn -> CellularDistanceFn -> Bool # (>=) :: CellularDistanceFn -> CellularDistanceFn -> Bool # max :: CellularDistanceFn -> CellularDistanceFn -> CellularDistanceFn # min :: CellularDistanceFn -> CellularDistanceFn -> CellularDistanceFn # | |||||
| type Rep CellularDistanceFn Source # | |||||
Defined in Numeric.Noise.Cellular type Rep CellularDistanceFn = D1 ('MetaData "CellularDistanceFn" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) ((C1 ('MetaCons "DistEuclidean" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistEuclideanSq" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DistManhattan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistHybrid" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data CellularResult Source #
What value to return from cellular noise evaluation.
These options allow for different visual effects by returning different properties of the cell structure.
Constructors
| CellValue | Return the hash value of the nearest cell point. Creates discrete regions with constant values. |
| Distance | Return the distance to the nearest cell point. Creates a classic Worley noise pattern with cell boundaries. |
| Distance2 | Return the distance to the second-nearest cell point. Creates larger, more organic-looking cells. |
| Distance2Add | Return the sum of distances to the two nearest cell points. Creates smooth, rounded cells. |
| Distance2Sub | Return the difference between distances to the two nearest cell points. Emphasizes cell boundaries and creates sharp edges. |
| Distance2Mul | Return the product of distances to the two nearest cell points. Creates cells with varying contrast. |
| Distance2Div | Return the ratio of nearest to second-nearest distance. Creates normalized cell patterns. |
Instances
| Bounded CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular | |||||
| Enum CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular Methods succ :: CellularResult -> CellularResult # pred :: CellularResult -> CellularResult # toEnum :: Int -> CellularResult # fromEnum :: CellularResult -> Int # enumFrom :: CellularResult -> [CellularResult] # enumFromThen :: CellularResult -> CellularResult -> [CellularResult] # enumFromTo :: CellularResult -> CellularResult -> [CellularResult] # enumFromThenTo :: CellularResult -> CellularResult -> CellularResult -> [CellularResult] # | |||||
| Generic CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular Associated Types
Methods from :: CellularResult -> Rep CellularResult x # to :: Rep CellularResult x -> CellularResult # | |||||
| Read CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular Methods readsPrec :: Int -> ReadS CellularResult # readList :: ReadS [CellularResult] # | |||||
| Show CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular Methods showsPrec :: Int -> CellularResult -> ShowS # show :: CellularResult -> String # showList :: [CellularResult] -> ShowS # | |||||
| Eq CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular Methods (==) :: CellularResult -> CellularResult -> Bool # (/=) :: CellularResult -> CellularResult -> Bool # | |||||
| Ord CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular Methods compare :: CellularResult -> CellularResult -> Ordering # (<) :: CellularResult -> CellularResult -> Bool # (<=) :: CellularResult -> CellularResult -> Bool # (>) :: CellularResult -> CellularResult -> Bool # (>=) :: CellularResult -> CellularResult -> Bool # max :: CellularResult -> CellularResult -> CellularResult # min :: CellularResult -> CellularResult -> CellularResult # | |||||
| type Rep CellularResult Source # | |||||
Defined in Numeric.Noise.Cellular type Rep CellularResult = D1 ('MetaData "CellularResult" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) ((C1 ('MetaCons "CellValue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Distance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Distance2Add" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2Sub" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Distance2Mul" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2Div" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||