Support for pixels with a colour depth of 24 or 32, either lacking or containing an alpha component
Greater precision and color depth are not yet supported. Support for floating point representations of components is planned for the future.
- class (Integral a, ConvPixelRGB a, ConvPixelRGBA a, ConvPixelBGR a, ConvPixelBGRA a) => Pixel a where
- red :: a :-> PixelComponent
- green :: a :-> PixelComponent
- blue :: a :-> PixelComponent
- alpha :: Maybe (a :-> PixelComponent)
- leastIntensity :: a
- greatestIntensity :: a
- toPixel :: Pixel p => a -> p
- fromPixel :: Pixel p => p -> a
- convertPixelValue :: (Pixel a, Pixel b) => a -> b
- type PixelStorage = Word32
- type PixelComponent = Word8
- leastIntensityComponent :: PixelComponent
- greatestIntensityComponent :: PixelComponent
- newtype PixelRGB = PixelRGB {}
- newtype PixelBGR = PixelBGR {}
- newtype PixelRGBA = PixelRGBA {}
- newtype PixelBGRA = PixelBGRA {}
- class ConvPixelRGB p where
- toPixelRGB :: p -> PixelRGB
- fromPixelRGB :: PixelRGB -> p
- class ConvPixelBGR p where
- toPixelBGR :: p -> PixelBGR
- fromPixelBGR :: PixelBGR -> p
- class ConvPixelRGBA p where
- toPixelRGBA :: p -> PixelRGBA
- fromPixelRGBA :: PixelRGBA -> p
- class ConvPixelBGRA p where
- toPixelBGRA :: p -> PixelBGRA
- fromPixelBGRA :: PixelBGRA -> p
- data GenPixel
- eqGenPixelValue :: GenPixel -> GenPixel -> Bool
- neqGenPixelValue :: GenPixel -> GenPixel -> Bool
- genRed :: GenPixel :-> GenPixelComponent
- genGreen :: GenPixel :-> GenPixelComponent
- genBlue :: GenPixel :-> GenPixelComponent
- genAlpha :: GenPixel :-> GenPixelComponent
- toGenPixelRGB :: GenPixel -> GenPixel
- toGenPixelBGR :: GenPixel -> GenPixel
- toGenPixelRGBA :: GenPixel -> GenPixel
- toGenPixelBGRA :: GenPixel -> GenPixel
- type GenPixelStorage = Word32
- type GenPixelComponent = Word8
- leastIntensityGenComponent :: GenPixelComponent
- greatestIntensityGenComponent :: GenPixelComponent
- leastIntensityGen :: GenPixel
- greatestIntensityGen :: GenPixel
- bigEndian :: Bool
- colorString :: (StringCells s, Pixel p) => s -> Maybe p
Documentation
class (Integral a, ConvPixelRGB a, ConvPixelRGBA a, ConvPixelBGR a, ConvPixelBGRA a) => Pixel a whereSource
red :: a :-> PixelComponentSource
green :: a :-> PixelComponentSource
blue :: a :-> PixelComponentSource
alpha :: Maybe (a :-> PixelComponent)Source
leastIntensity :: aSource
convertPixelValue :: (Pixel a, Pixel b) => a -> bSource
A less efficient way of converting pixels by their components
type PixelStorage = Word32Source
type PixelComponent = Word8Source
class ConvPixelRGB p whereSource
toPixelRGB :: p -> PixelRGBSource
fromPixelRGB :: PixelRGB -> pSource
class ConvPixelBGR p whereSource
toPixelBGR :: p -> PixelBGRSource
fromPixelBGR :: PixelBGR -> pSource
class ConvPixelRGBA p whereSource
toPixelRGBA :: p -> PixelRGBASource
fromPixelRGBA :: PixelRGBA -> pSource
class ConvPixelBGRA p whereSource
toPixelBGRA :: p -> PixelBGRASource
fromPixelBGRA :: PixelBGRA -> pSource
Generic pixel type which has not be efficient enough when used with bitmaps in practice
GenPixelRGB | The most significant byte is unused |
GenPixelBGR | The most significant byte is unused |
GenPixelRGBA | |
GenPixelBGRA | |
eqGenPixelValue :: GenPixel -> GenPixel -> BoolSource
neqGenPixelValue :: GenPixel -> GenPixel -> BoolSource
If the Genpixel types differ, they can still be determined to be equivalent if their components are equal
Unlike the default derived instance of Eq,
type GenPixelStorage = Word32Source
type GenPixelComponent = Word8Source
colorString :: (StringCells s, Pixel p) => s -> Maybe pSource
Return a color from the first 6-bytes of a string representing the red, green, and blue components of the color
(colorString "FF0000" :: Maybe PixelRGBA) == Just $ (red =: 0xFF) . (green =: 0x00) . (blue =: 0x00) $ greatestIntensity