Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 where Source
red :: a :-> PixelComponent Source
green :: a :-> PixelComponent Source
blue :: a :-> PixelComponent Source
alpha :: Maybe (a :-> PixelComponent) Source
leastIntensity :: a Source
greatestIntensity :: a Source
convertPixelValue :: (Pixel a, Pixel b) => a -> b Source
A less efficient way of converting pixels by their components
type PixelStorage = Word32 Source
type PixelComponent = Word8 Source
class ConvPixelRGB p where Source
toPixelRGB :: p -> PixelRGB Source
fromPixelRGB :: PixelRGB -> p Source
class ConvPixelBGR p where Source
toPixelBGR :: p -> PixelBGR Source
fromPixelBGR :: PixelBGR -> p Source
class ConvPixelRGBA p where Source
toPixelRGBA :: p -> PixelRGBA Source
fromPixelRGBA :: PixelRGBA -> p Source
class ConvPixelBGRA p where Source
toPixelBGRA :: p -> PixelBGRA Source
fromPixelBGRA :: PixelBGRA -> p Source
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 -> Bool Source
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,
neqGenPixelValue :: GenPixel -> GenPixel -> Bool Source
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,
toGenPixelRGB :: GenPixel -> GenPixel Source
toGenPixelBGR :: GenPixel -> GenPixel Source
toGenPixelRGBA :: GenPixel -> GenPixel Source
toGenPixelBGRA :: GenPixel -> GenPixel Source
type GenPixelStorage = Word32 Source
type GenPixelComponent = Word8 Source
colorString :: (StringCells s, Pixel p) => s -> Maybe p Source
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