Portability | ghc |
---|---|
Stability | unstable |
Maintainer | Andy Gill <andygill@ku.edu> |
This module contains the types used by chalkboard, except Board itself.
- type UI = R
- type R = Float
- type Point = (R, R)
- type Radian = Float
- class Over c where
- over :: c -> c -> c
- stack :: Over c => [c] -> c
- class Scale c where
- class Lerp a where
- class Average a where
- average :: [a] -> a
- data Alpha c = Alpha c !UI
- alpha :: c -> Alpha c
- transparent :: Scale c => c -> Alpha c
- withAlpha :: Scale c => UI -> c -> Alpha c
- unAlpha :: Scale c => Alpha c -> c
- data Z c = Z c R
- nearZero :: R
Basic types
Overlaying
For placing a value literally over another value. The 2nd value might shine through. The operation must be assocative.
Scaling
Scale
something by a value. scaling value can be bigger than 1.
Linear Interpolation
Linear interpolation between two values.
Averaging
Average
a set of values. weighting can be achived using multiple entries.
Alpha Channel support
Channels with alpha component, the channel is
pre-scaled.
alpha
builds something that has an alpha channel, and is completely opaque.
transparent :: Scale c => c -> Alpha cSource
transparent
builds something that has an alpha channel, and is completely transparent.
withAlpha :: Scale c => UI -> c -> Alpha cSource
withAlpha
builds somethings that has a specific alpha value.
unAlpha :: Scale c => Alpha c -> cSource
unAlpha
removes the alpha component, and returns the channel inside.
Z buffer support
A Z buffer style Z value for a point, where lower numbers are nearer the viewer. Assumes no transparency.