Copyright | [2019..2020] The Accelerate Team |
---|---|
License | BSD3 |
Maintainer | Trevor L. McDonell <trevor.mcdonell@gmail.com> |
Stability | experimental |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Image a = Image {
- imageWidth :: !Int
- imageHeight :: !Int
- imageData :: Vector (PixelBaseComponent a)
- class (Storable (PixelBaseComponent a), Num (PixelBaseComponent a), Eq a) => Pixel a where
- type PixelBaseComponent a :: Type
- type Pixel8 = Word8
- type Pixel16 = Word16
- type Pixel32 = Word32
- type PixelF = Float
- data PixelYA8 = PixelYA8 !Pixel8 !Pixel8
- pattern PixelYA8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp PixelYA8
- data PixelYA16 = PixelYA16 !Pixel16 !Pixel16
- pattern PixelYA16_ :: Exp Pixel16 -> Exp Pixel16 -> Exp PixelYA16
- data PixelRGB8 = PixelRGB8 !Pixel8 !Pixel8 !Pixel8
- pattern PixelRGB8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelRGB8
- data PixelRGB16 = PixelRGB16 !Pixel16 !Pixel16 !Pixel16
- pattern PixelRGB16_ :: Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp PixelRGB16
- data PixelRGBF = PixelRGBF !PixelF !PixelF !PixelF
- pattern PixelRGBF_ :: Exp PixelF -> Exp PixelF -> Exp PixelF -> Exp PixelRGBF
- data PixelRGBA8 = PixelRGBA8 !Pixel8 !Pixel8 !Pixel8 !Pixel8
- pattern PixelRGBA8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelRGBA8
- data PixelRGBA16 = PixelRGBA16 !Pixel16 !Pixel16 !Pixel16 !Pixel16
- pattern PixelRGBA16_ :: Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp PixelRGBA16
- data PixelCMYK8 = PixelCMYK8 !Pixel8 !Pixel8 !Pixel8 !Pixel8
- pattern PixelCMYK8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelCMYK8
- data PixelCMYK16 = PixelCMYK16 !Pixel16 !Pixel16 !Pixel16 !Pixel16
- pattern PixelCMYK16_ :: Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp PixelCMYK16
- data PixelYCbCr8 = PixelYCbCr8 !Pixel8 !Pixel8 !Pixel8
- pattern PixelYCbCr8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelYCbCr8
- data PixelYCbCrK8 = PixelYCbCrK8 !Pixel8 !Pixel8 !Pixel8 !Pixel8
- pattern PixelYCbCrK8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelYCbCrK8
Documentation
The main type of this package, one that most functions work on, is Image.
Parameterized by the underlying pixel format it
forms a rigid type. If you wish to store images
of different or unknown pixel formats use DynamicImage
.
Image is essentially a rectangular pixel buffer of specified width and height. The coordinates are assumed to start from the upper-left corner of the image, with the horizontal position first and vertical second.
Image | |
|
class (Storable (PixelBaseComponent a), Num (PixelBaseComponent a), Eq a) => Pixel a #
Definition of pixels used in images. Each pixel has a color space, and a representative component (Word8 or Float).
mixWith, pixelOpacity, componentCount, colorMap, pixelAt, readPixel, writePixel, unsafePixelAt, unsafeReadPixel, unsafeWritePixel
type PixelBaseComponent a :: Type #
Type of the pixel component, "classical" images would have Word8 type as their PixelBaseComponent, HDR image would have Float for instance
Instances
Type alias for 8bit greyscale pixels. For simplicity, greyscale pixels use plain numbers instead of a separate type.
Type alias for 32bit floating point greyscale pixels. The standard bounded value range is mapped to the closed interval [0,1] i.e.
map promotePixel [0, 1 .. 255 :: Pixel8] == [0/255, 1/255 .. 1.0 :: PixelF]
Pixel type storing 8bit Luminance (Y) and alpha (A) information. Values are stored in the following order:
- Luminance
- Alpha
Instances
Pixel type storing 16bit Luminance (Y) and alpha (A) information. Values are stored in the following order:
- Luminance
- Alpha
Instances
Classic pixel type storing 8bit red, green and blue (RGB) information. Values are stored in the following order:
- Red
- Green
- Blue
Instances
data PixelRGB16 #
Pixel type storing 16bit red, green and blue (RGB) information. Values are stored in the following order:
- Red
- Green
- Blue
Instances
HDR pixel type storing floating point 32bit red, green and blue (RGB) information.
Same value range and comments apply as for PixelF
.
Values are stored in the following order:
- Red
- Green
- Blue
Instances
data PixelRGBA8 #
Classical pixel type storing 8bit red, green, blue and alpha (RGBA) information. Values are stored in the following order:
- Red
- Green
- Blue
- Alpha
Instances
pattern PixelRGBA8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelRGBA8 Source #
data PixelRGBA16 #
Pixel type storing 16bit red, green, blue and alpha (RGBA) information. Values are stored in the following order:
- Red
- Green
- Blue
- Alpha
Instances
pattern PixelRGBA16_ :: Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp PixelRGBA16 Source #
data PixelCMYK8 #
Pixel type storing 8bit cyan, magenta, yellow and black (CMYK) information. Values are stored in the following order:
- Cyan
- Magenta
- Yellow
- Black
Instances
pattern PixelCMYK8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelCMYK8 Source #
data PixelCMYK16 #
Pixel type storing 16bit cyan, magenta, yellow and black (CMYK) information. Values are stored in the following order:
- Cyan
- Magenta
- Yellow
- Black
Instances
pattern PixelCMYK16_ :: Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp Pixel16 -> Exp PixelCMYK16 Source #
data PixelYCbCr8 #
Pixel type storing 8bit luminance, blue difference and red difference (YCbCr) information. Values are stored in the following order:
- Y (luminance)
- Cb
- Cr
Instances
data PixelYCbCrK8 #
Pixel type storing value for the YCCK color space:
- Y (Luminance)
- Cb
- Cr
- Black
Instances
pattern PixelYCbCrK8_ :: Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp Pixel8 -> Exp PixelYCbCrK8 Source #