JuicyPixels-3.3.8: Picture loading/serialization (in png, jpeg, bitmap, gif, tga, tiff and radiance)

Safe Haskell | Safe-Inferred
Language | Haskell2010

Codec.Picture.Types

Contents

- Types
  - Image types
  - Image functions
  - Image Lenses
  - Pixel types
- Type classes
- Helper functions
- Color plane extraction
- Packeable writing (unsafe but faster)

Description

Module provides basic types for image manipulation in the library.

Synopsis

- data Image a = Image {
  - imageWidth :: !Int
  - imageHeight :: !Int
  - imageData :: Vector (PixelBaseComponent a)
  }
- data MutableImage s a = MutableImage {
  - mutableImageWidth :: !Int
  - mutableImageHeight :: !Int
  - mutableImageData :: STVector s (PixelBaseComponent a)
  }
- data DynamicImage
  - = ImageY8 (Image Pixel8)
  - | ImageY16 (Image Pixel16)
  - | ImageY32 (Image Pixel32)
  - | ImageYF (Image PixelF)
  - | ImageYA8 (Image PixelYA8)
  - | ImageYA16 (Image PixelYA16)
  - | ImageRGB8 (Image PixelRGB8)
  - | ImageRGB16 (Image PixelRGB16)
  - | ImageRGBF (Image PixelRGBF)
  - | ImageRGBA8 (Image PixelRGBA8)
  - | ImageRGBA16 (Image PixelRGBA16)
  - | ImageYCbCr8 (Image PixelYCbCr8)
  - | ImageCMYK8 (Image PixelCMYK8)
  - | ImageCMYK16 (Image PixelCMYK16)
- data PalettedImage
  - = TrueColorImage DynamicImage
  - | PalettedY8 (Image Pixel8) (Palette' Pixel8)
  - | PalettedRGB8 (Image Pixel8) (Palette' PixelRGB8)
  - | PalettedRGBA8 (Image Pixel8) (Palette' PixelRGBA8)
  - | PalettedRGB16 (Image Pixel8) (Palette' PixelRGB16)
- type Palette = Image PixelRGB8
- data Palette' px = Palette' {
  - _paletteSize :: !Int
  - _paletteData :: !(Vector (PixelBaseComponent px))
  }
- createMutableImage :: (Pixel px, PrimMonad m) => Int -> Int -> px -> m (MutableImage (PrimState m) px)
- newMutableImage :: forall px m. (Pixel px, PrimMonad m) => Int -> Int -> m (MutableImage (PrimState m) px)
- freezeImage :: (Storable (PixelBaseComponent px), PrimMonad m) => MutableImage (PrimState m) px -> m (Image px)
- unsafeFreezeImage :: (Storable (PixelBaseComponent a), PrimMonad m) => MutableImage (PrimState m) a -> m (Image a)
- thawImage :: (Storable (PixelBaseComponent px), PrimMonad m) => Image px -> m (MutableImage (PrimState m) px)
- unsafeThawImage :: (Storable (PixelBaseComponent px), PrimMonad m) => Image px -> m (MutableImage (PrimState m) px)
- type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
- imagePixels :: forall pxa pxb. (Pixel pxa, Pixel pxb) => Traversal (Image pxa) (Image pxb) pxa pxb
- imageIPixels :: forall pxa pxb. (Pixel pxa, Pixel pxb) => Traversal (Image pxa) (Image pxb) (Int, Int, pxa) pxb
- type Pixel8 = Word8
- type Pixel16 = Word16
- type Pixel32 = Word32
- type PixelF = Float
- data PixelYA8 = PixelYA8 !Pixel8 !Pixel8
- data PixelYA16 = PixelYA16 !Pixel16 !Pixel16
- data PixelRGB8 = PixelRGB8 !Pixel8 !Pixel8 !Pixel8
- data PixelRGB16 = PixelRGB16 !Pixel16 !Pixel16 !Pixel16
- data PixelRGBF = PixelRGBF !PixelF !PixelF !PixelF
- data PixelRGBA8 = PixelRGBA8 !Pixel8 !Pixel8 !Pixel8 !Pixel8
- data PixelRGBA16 = PixelRGBA16 !Pixel16 !Pixel16 !Pixel16 !Pixel16
- data PixelCMYK8 = PixelCMYK8 !Pixel8 !Pixel8 !Pixel8 !Pixel8
- data PixelCMYK16 = PixelCMYK16 !Pixel16 !Pixel16 !Pixel16 !Pixel16
- data PixelYCbCr8 = PixelYCbCr8 !Pixel8 !Pixel8 !Pixel8
- data PixelYCbCrK8 = PixelYCbCrK8 !Pixel8 !Pixel8 !Pixel8 !Pixel8
- class (Pixel a, Pixel b) => ColorConvertible a b where
  - promotePixel :: a -> b
  - promoteImage :: Image a -> Image b
- class (Storable (PixelBaseComponent a), Num (PixelBaseComponent a), Eq a) => Pixel a where
  - type PixelBaseComponent a :: *
  - mixWith :: (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> a
  - mixWithAlpha :: (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> (PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> a
  - pixelOpacity :: a -> PixelBaseComponent a
  - componentCount :: a -> Int
  - colorMap :: (PixelBaseComponent a -> PixelBaseComponent a) -> a -> a
  - pixelBaseIndex :: Image a -> Int -> Int -> Int
  - mutablePixelBaseIndex :: MutableImage s a -> Int -> Int -> Int
  - pixelAt :: Image a -> Int -> Int -> a
  - readPixel :: PrimMonad m => MutableImage (PrimState m) a -> Int -> Int -> m a
  - writePixel :: PrimMonad m => MutableImage (PrimState m) a -> Int -> Int -> a -> m ()
  - unsafePixelAt :: Vector (PixelBaseComponent a) -> Int -> a
  - unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent a) -> Int -> m a
  - unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent a) -> Int -> a -> m ()
- class (Pixel a, Pixel b) => ColorSpaceConvertible a b where
  - convertPixel :: a -> b
  - convertImage :: Image a -> Image b
- class (Pixel a, Pixel (PixelBaseComponent a)) => LumaPlaneExtractable a where
  - computeLuma :: a -> PixelBaseComponent a
  - extractLumaPlane :: Image a -> Image (PixelBaseComponent a)
- class (Pixel a, Pixel b) => TransparentPixel a b | a -> b where
  - dropTransparency :: a -> b
  - getTransparency :: a -> PixelBaseComponent a
- pixelMap :: forall a b. (Pixel a, Pixel b) => (a -> b) -> Image a -> Image b
- pixelMapXY :: forall a b. (Pixel a, Pixel b) => (Int -> Int -> a -> b) -> Image a -> Image b
- pixelFold :: forall acc pixel. Pixel pixel => (acc -> Int -> Int -> pixel -> acc) -> acc -> Image pixel -> acc
- pixelFoldM :: (Pixel pixel, Monad m) => (acc -> Int -> Int -> pixel -> m acc) -> acc -> Image pixel -> m acc
- pixelFoldMap :: forall m px. (Pixel px, Monoid m) => (px -> m) -> Image px -> m
- dynamicMap :: (forall pixel. Pixel pixel => Image pixel -> a) -> DynamicImage -> a
- dynamicPixelMap :: (forall pixel. Pixel pixel => Image pixel -> Image pixel) -> DynamicImage -> DynamicImage
- palettedToTrueColor :: PalettedImage -> DynamicImage
- palettedAsImage :: Palette' px -> Image px
- dropAlphaLayer :: TransparentPixel a b => Image a -> Image b
- withImage :: forall m pixel. (Pixel pixel, PrimMonad m) => Int -> Int -> (Int -> Int -> m pixel) -> m (Image pixel)
- zipPixelComponent3 :: forall px. Storable (PixelBaseComponent px) => (PixelBaseComponent px -> PixelBaseComponent px -> PixelBaseComponent px -> PixelBaseComponent px) -> Image px -> Image px -> Image px -> Image px
- generateImage :: forall px. Pixel px => (Int -> Int -> px) -> Int -> Int -> Image px
- generateFoldImage :: forall a acc. Pixel a => (acc -> Int -> Int -> (acc, a)) -> acc -> Int -> Int -> (acc, Image a)
- gammaCorrection :: PixelF -> Image PixelRGBF -> Image PixelRGBF
- toneMapping :: PixelF -> Image PixelRGBF -> Image PixelRGBF
- class ColorPlane pixel planeToken
- data PlaneRed = PlaneRed
- data PlaneGreen = PlaneGreen
- data PlaneBlue = PlaneBlue
- data PlaneAlpha = PlaneAlpha
- data PlaneLuma = PlaneLuma
- data PlaneCr = PlaneCr
- data PlaneCb = PlaneCb
- data PlaneCyan = PlaneCyan
- data PlaneMagenta = PlaneMagenta
- data PlaneYellow = PlaneYellow
- data PlaneBlack = PlaneBlack
- extractComponent :: forall px plane. (Pixel px, Pixel (PixelBaseComponent px), PixelBaseComponent (PixelBaseComponent px) ~ PixelBaseComponent px, ColorPlane px plane) => plane -> Image px -> Image (PixelBaseComponent px)
- unsafeExtractComponent :: forall a. (Pixel a, Pixel (PixelBaseComponent a), PixelBaseComponent (PixelBaseComponent a) ~ PixelBaseComponent a) => Int -> Image a -> Image (PixelBaseComponent a)
- class PackeablePixel a where
  - type PackedRepresentation a
  - packPixel :: a -> PackedRepresentation a
  - unpackPixel :: PackedRepresentation a -> a
- fillImageWith :: (Pixel px, PackeablePixel px, PrimMonad m, Storable (PackedRepresentation px)) => MutableImage (PrimState m) px -> px -> m ()
- readPackedPixelAt :: forall m px. (Pixel px, PackeablePixel px, Storable (PackedRepresentation px), PrimMonad m) => MutableImage (PrimState m) px -> Int -> m px
- writePackedPixelAt :: (Pixel px, PackeablePixel px, Storable (PackedRepresentation px), PrimMonad m) => MutableImage (PrimState m) px -> Int -> px -> m ()
- unsafeWritePixelBetweenAt :: (PrimMonad m, Pixel px, PackeablePixel px, Storable (PackedRepresentation px)) => MutableImage (PrimState m) px -> px -> Int -> Int -> m ()

# Types

## Image types

data Image a Source #

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.

Constructors

Image |

Fields

- imageWidth :: !Int

  Width of the image in pixels

- imageHeight :: !Int

  Height of the image in pixels.

- imageData :: Vector (PixelBaseComponent a)

  Image pixel data. To extract pixels at a given position you should use the helper functions.

  Internally pixel data is stored as consecutively packed lines from top to bottom, scanned from left to right within individual lines, from first to last color component within each pixel.

#### Instances

Instances details

NFData (Image a) Source # |
Instance details Defined in Codec.Picture.Types Methods rnf :: Image a -> () Source #
(Eq (PixelBaseComponent a), Storable (PixelBaseComponent a)) => Eq (Image a) Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: Image a -> Image a -> Bool Source # (/=) :: Image a -> Image a -> Bool Source #

data MutableImage s a Source #

Image or pixel buffer, the coordinates are assumed to start from the upper-left corner of the image, with the horizontal position first, then the vertical one. The image can be transformed in place.

Constructors

MutableImage |

Fields

- mutableImageWidth :: !Int

  Width of the image in pixels

- mutableImageHeight :: !Int

  Height of the image in pixels.

- mutableImageData :: STVector s (PixelBaseComponent a)

  The real image, to extract pixels at some position you should use the helpers functions.

#### Instances

Instances details

NFData (MutableImage s a) Source # |
Instance details Defined in Codec.Picture.Types Methods rnf :: MutableImage s a -> () Source #

data DynamicImage Source #

Image type enumerating all predefined pixel types. It enables loading and use of images of different pixel types.

Constructors

ImageY8 (Image Pixel8) | A greyscale image.
ImageY16 (Image Pixel16) | A greyscale image with 16bit components
ImageY32 (Image Pixel32) | A greyscale image with 32bit components
ImageYF (Image PixelF) | A greyscale HDR image
ImageYA8 (Image PixelYA8) | An image in greyscale with an alpha channel.
ImageYA16 (Image PixelYA16) | An image in greyscale with alpha channel on 16 bits.
ImageRGB8 (Image PixelRGB8) | An image in true color.
ImageRGB16 (Image PixelRGB16) | An image in true color with 16bit depth.
ImageRGBF (Image PixelRGBF) | An image with HDR pixels
ImageRGBA8 (Image PixelRGBA8) | An image in true color and an alpha channel.
ImageRGBA16 (Image PixelRGBA16) | A true color image with alpha on 16 bits.
ImageYCbCr8 (Image PixelYCbCr8) | An image in the colorspace used by Jpeg images.
ImageCMYK8 (Image PixelCMYK8) | An image in the colorspace CMYK
ImageCMYK16 (Image PixelCMYK16) | An image in the colorspace CMYK and 16 bits precision

#### Instances

Instances details

NFData DynamicImage Source # |
Instance details Defined in Codec.Picture.Types Methods rnf :: DynamicImage -> () Source #
Eq DynamicImage Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: DynamicImage -> DynamicImage -> Bool Source # (/=) :: DynamicImage -> DynamicImage -> Bool Source #

data PalettedImage Source #

Describe an image and it's potential associated palette. If no palette is present, fallback to a DynamicImage

Constructors

TrueColorImage DynamicImage | Fallback
PalettedY8 (Image Pixel8) (Palette' Pixel8) |
PalettedRGB8 (Image Pixel8) (Palette' PixelRGB8) |
PalettedRGBA8 (Image Pixel8) (Palette' PixelRGBA8) |
PalettedRGB16 (Image Pixel8) (Palette' PixelRGB16) |

type Palette = Image PixelRGB8 Source #

Type for the palette used in Gif & PNG files.

data Palette' px Source #

Type used to expose a palette extracted during reading. Use `palettedAsImage` to convert it to a palette usable for writing.

Constructors

Palette' |

Fields

- _paletteSize :: !Int

  Number of element in pixels.

- _paletteData :: !(Vector (PixelBaseComponent px))

  Real data used by the palette.

## Image functions

createMutableImage Source #

Arguments

:: (Pixel px, PrimMonad m) |
=> Int | Width
-> Int | Height
-> px | Background color
-> m (MutableImage (PrimState m) px) |

Create a mutable image, filled with the given background color.

newMutableImage Source #

Arguments

:: forall px m. (Pixel px, PrimMonad m) |
=> Int | Width
-> Int | Height
-> m (MutableImage (PrimState m) px) |

Create a mutable image with garbage as content. All data is uninitialized.

freezeImage :: (Storable (PixelBaseComponent px), PrimMonad m) => MutableImage (PrimState m) px -> m (Image px) Source #

`O(n)` Yield an immutable copy of an image by making a copy of it

unsafeFreezeImage :: (Storable (PixelBaseComponent a), PrimMonad m) => MutableImage (PrimState m) a -> m (Image a) Source #

`O(1)` Unsafe convert a mutable image to an immutable one without copying. The mutable image may not be used after this operation.

thawImage :: (Storable (PixelBaseComponent px), PrimMonad m) => Image px -> m (MutableImage (PrimState m) px) Source #

`O(n)` Yield a mutable copy of an image by making a copy of it.

unsafeThawImage :: (Storable (PixelBaseComponent px), PrimMonad m) => Image px -> m (MutableImage (PrimState m) px) Source #

`O(1)` Unsafe convert an imutable image to an mutable one without copying. The source image shouldn't be used after this operation.

## Image Lenses

type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t Source #

Traversal type matching the definition in the Lens package.

imagePixels :: forall pxa pxb. (Pixel pxa, Pixel pxb) => Traversal (Image pxa) (Image pxb) pxa pxb Source #

Traversal in "raster" order, from left to right the top to bottom. This traversal is matching pixelMap in spirit.

Since 3.2.4

imageIPixels :: forall pxa pxb. (Pixel pxa, Pixel pxb) => Traversal (Image pxa) (Image pxb) (Int, Int, pxa) pxb Source #

Traversal providing the pixel position with it's value. The traversal in raster order, from lef to right, then top to bottom. The traversal match pixelMapXY in spirit.

Since 3.2.4

## Pixel types

type Pixel8 = Word8 Source #

Type alias for 8bit greyscale pixels. For simplicity, greyscale pixels use plain numbers instead of a separate type.

type Pixel16 = Word16 Source #

Type alias for 16bit greyscale pixels.

type Pixel32 = Word32 Source #

Type alias for 32bit greyscale pixels.

type PixelF = Float Source #

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]

data PixelYA8 Source #

Pixel type storing 8bit Luminance (Y) and alpha (A) information. Values are stored in the following order:

- Luminance
- Alpha

Constructors

PixelYA8 !Pixel8 !Pixel8 |

#### Instances

Instances details

PngSavable PixelYA8 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelYA8 -> ByteString Source # encodePngWithMetadata :: Metadatas -> Image PixelYA8 -> ByteString Source #
TiffSaveable PixelYA8 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelYA8 -> TiffColorspace extraSampleCodeOfPixel :: PixelYA8 -> Maybe ExtraSample subSamplingInfo :: PixelYA8 -> Vector Word32 sampleFormat :: PixelYA8 -> [TiffSampleFormat]
LumaPlaneExtractable PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelYA8 -> PixelBaseComponent PixelYA8 Source # extractLumaPlane :: Image PixelYA8 -> Image (PixelBaseComponent PixelYA8) Source #
PackeablePixel PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelYA8 Source # Methods packPixel :: PixelYA8 -> PackedRepresentation PixelYA8 Source # unpackPixel :: PackedRepresentation PixelYA8 -> PixelYA8 Source #
Pixel PixelYA8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYA8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> PixelYA8 -> PixelYA8 -> PixelYA8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> (PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> PixelYA8 -> PixelYA8 -> PixelYA8 Source #

pixelOpacity :: PixelYA8 -> PixelBaseComponent PixelYA8 Source #

componentCount :: PixelYA8 -> Int Source #

colorMap :: (PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> PixelYA8 -> PixelYA8 Source #

pixelBaseIndex :: Image PixelYA8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYA8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYA8 -> Int -> Int -> PixelYA8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYA8 -> Int -> Int -> m PixelYA8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYA8 -> Int -> Int -> PixelYA8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYA8) -> Int -> PixelYA8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA8) -> Int -> m PixelYA8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA8) -> Int -> PixelYA8 -> m () Source #

Show PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelYA8 -> ShowS Source # show :: PixelYA8 -> String Source # showList :: [PixelYA8] -> ShowS Source #
Eq PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelYA8 -> PixelYA8 -> Bool Source # (/=) :: PixelYA8 -> PixelYA8 -> Bool Source #
Ord PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods compare :: PixelYA8 -> PixelYA8 -> Ordering Source # (<) :: PixelYA8 -> PixelYA8 -> Bool Source # (<=) :: PixelYA8 -> PixelYA8 -> Bool Source # (>) :: PixelYA8 -> PixelYA8 -> Bool Source # (>=) :: PixelYA8 -> PixelYA8 -> Bool Source # max :: PixelYA8 -> PixelYA8 -> PixelYA8 Source # min :: PixelYA8 -> PixelYA8 -> PixelYA8 Source #
ColorConvertible Pixel8 PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelYA8 Source # promoteImage :: Image Pixel8 -> Image PixelYA8 Source #
ColorConvertible PixelYA8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGB16 Source # promoteImage :: Image PixelYA8 -> Image PixelRGB16 Source #
ColorConvertible PixelYA8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGB8 Source # promoteImage :: Image PixelYA8 -> Image PixelRGB8 Source #
ColorConvertible PixelYA8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGBA8 Source # promoteImage :: Image PixelYA8 -> Image PixelRGBA8 Source #
ColorPlane PixelYA8 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA8 -> PlaneAlpha -> Int
ColorPlane PixelYA8 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA8 -> PlaneLuma -> Int
TransparentPixel PixelYA8 Pixel8 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelYA8 -> Pixel8 Source # getTransparency :: PixelYA8 -> PixelBaseComponent PixelYA8 Source #
type PackedRepresentation PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types type PackedRepresentation PixelYA8 = Word16
type PixelBaseComponent PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelYA8 = Word8

data PixelYA16 Source #

Pixel type storing 16bit Luminance (Y) and alpha (A) information. Values are stored in the following order:

- Luminance
- Alpha

Constructors

PixelYA16 !Pixel16 !Pixel16 |

#### Instances

Instances details

PngSavable PixelYA16 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelYA16 -> ByteString Source # encodePngWithMetadata :: Metadatas -> Image PixelYA16 -> ByteString Source #
TiffSaveable PixelYA16 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelYA16 -> TiffColorspace extraSampleCodeOfPixel :: PixelYA16 -> Maybe ExtraSample subSamplingInfo :: PixelYA16 -> Vector Word32 sampleFormat :: PixelYA16 -> [TiffSampleFormat]
PackeablePixel PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelYA16 Source # Methods packPixel :: PixelYA16 -> PackedRepresentation PixelYA16 Source # unpackPixel :: PackedRepresentation PixelYA16 -> PixelYA16 Source #
Pixel PixelYA16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYA16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> PixelYA16 -> PixelYA16 -> PixelYA16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> (PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> PixelYA16 -> PixelYA16 -> PixelYA16 Source #

pixelOpacity :: PixelYA16 -> PixelBaseComponent PixelYA16 Source #

componentCount :: PixelYA16 -> Int Source #

colorMap :: (PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> PixelYA16 -> PixelYA16 Source #

pixelBaseIndex :: Image PixelYA16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYA16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYA16 -> Int -> Int -> PixelYA16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYA16 -> Int -> Int -> m PixelYA16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYA16 -> Int -> Int -> PixelYA16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYA16) -> Int -> PixelYA16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA16) -> Int -> m PixelYA16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA16) -> Int -> PixelYA16 -> m () Source #

Show PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelYA16 -> ShowS Source # show :: PixelYA16 -> String Source # showList :: [PixelYA16] -> ShowS Source #
Eq PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelYA16 -> PixelYA16 -> Bool Source # (/=) :: PixelYA16 -> PixelYA16 -> Bool Source #
Ord PixelYA16 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelYA16 -> PixelYA16 -> Ordering Source #

(<) :: PixelYA16 -> PixelYA16 -> Bool Source #

(<=) :: PixelYA16 -> PixelYA16 -> Bool Source #

(>) :: PixelYA16 -> PixelYA16 -> Bool Source #

(>=) :: PixelYA16 -> PixelYA16 -> Bool Source #

max :: PixelYA16 -> PixelYA16 -> PixelYA16 Source #

min :: PixelYA16 -> PixelYA16 -> PixelYA16 Source #

ColorConvertible Pixel16 PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel16 -> PixelYA16 Source # promoteImage :: Image Pixel16 -> Image PixelYA16 Source #
ColorConvertible PixelYA16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA16 -> PixelRGB16 Source # promoteImage :: Image PixelYA16 -> Image PixelRGB16 Source #
ColorConvertible PixelYA16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA16 -> PixelRGBA16 Source # promoteImage :: Image PixelYA16 -> Image PixelRGBA16 Source #
ColorPlane PixelYA16 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA16 -> PlaneAlpha -> Int
ColorPlane PixelYA16 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA16 -> PlaneLuma -> Int
TransparentPixel PixelYA16 Pixel16 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelYA16 -> Pixel16 Source # getTransparency :: PixelYA16 -> PixelBaseComponent PixelYA16 Source #
type PackedRepresentation PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types type PackedRepresentation PixelYA16 = Word32
type PixelBaseComponent PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelYA16 = Word16

data PixelRGB8 Source #

Classic pixel type storing 8bit red, green and blue (RGB) information. Values are stored in the following order:

- Red
- Green
- Blue

Constructors

PixelRGB8 !Pixel8 !Pixel8 !Pixel8 |

#### Instances

Instances details

BmpEncodable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Bitmap Methods bitsPerPixel :: PixelRGB8 -> Int bmpEncode :: Image PixelRGB8 -> Put hasAlpha :: Image PixelRGB8 -> Bool defaultPalette :: PixelRGB8 -> BmpPalette
JpgEncodable PixelRGB8 Source # |

Instance details

Defined in Codec.Picture.Jpg

Methods

additionalBlocks :: Image PixelRGB8 -> [JpgFrame]

componentsOfColorSpace :: Image PixelRGB8 -> [JpgComponent]

encodingState :: Int -> Image PixelRGB8 -> Vector EncoderState

imageHuffmanTables :: Image PixelRGB8 -> [(JpgHuffmanTableSpec, HuffmanPackedTree)]

scanSpecificationOfColorSpace :: Image PixelRGB8 -> [JpgScanSpecification]

quantTableSpec :: Image PixelRGB8 -> Int -> [JpgQuantTableSpec]

maximumSubSamplingOf :: Image PixelRGB8 -> Int

PngPaletteSaveable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePalettedPng :: Image PixelRGB8 -> Image Pixel8 -> Either String ByteString Source # encodePalettedPngWithMetadata :: Metadatas -> Image PixelRGB8 -> Image Pixel8 -> Either String ByteString Source #
PngSavable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelRGB8 -> ByteString Source # encodePngWithMetadata :: Metadatas -> Image PixelRGB8 -> ByteString Source #
TgaSaveable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Tga Methods tgaDataOfImage :: Image PixelRGB8 -> ByteString tgaPixelDepthOfImage :: Image PixelRGB8 -> Word8 tgaTypeOfImage :: Image PixelRGB8 -> TgaImageType
TiffSaveable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelRGB8 -> TiffColorspace extraSampleCodeOfPixel :: PixelRGB8 -> Maybe ExtraSample subSamplingInfo :: PixelRGB8 -> Vector Word32 sampleFormat :: PixelRGB8 -> [TiffSampleFormat]
LumaPlaneExtractable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGB8 -> PixelBaseComponent PixelRGB8 Source # extractLumaPlane :: Image PixelRGB8 -> Image (PixelBaseComponent PixelRGB8) Source #
Pixel PixelRGB8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGB8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 -> PixelRGB8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> (PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 -> PixelRGB8 Source #

pixelOpacity :: PixelRGB8 -> PixelBaseComponent PixelRGB8 Source #

componentCount :: PixelRGB8 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 Source #

pixelBaseIndex :: Image PixelRGB8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGB8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGB8 -> Int -> Int -> PixelRGB8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB8 -> Int -> Int -> m PixelRGB8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB8 -> Int -> Int -> PixelRGB8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGB8) -> Int -> PixelRGB8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB8) -> Int -> m PixelRGB8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB8) -> Int -> PixelRGB8 -> m () Source #

Show PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelRGB8 -> ShowS Source # show :: PixelRGB8 -> String Source # showList :: [PixelRGB8] -> ShowS Source #
Eq PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelRGB8 -> PixelRGB8 -> Bool Source # (/=) :: PixelRGB8 -> PixelRGB8 -> Bool Source #
Ord PixelRGB8 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelRGB8 -> PixelRGB8 -> Ordering Source #

(<) :: PixelRGB8 -> PixelRGB8 -> Bool Source #

(<=) :: PixelRGB8 -> PixelRGB8 -> Bool Source #

(>) :: PixelRGB8 -> PixelRGB8 -> Bool Source #

(>=) :: PixelRGB8 -> PixelRGB8 -> Bool Source #

max :: PixelRGB8 -> PixelRGB8 -> PixelRGB8 Source #

min :: PixelRGB8 -> PixelRGB8 -> PixelRGB8 Source #

ColorConvertible Pixel8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelRGB8 Source # promoteImage :: Image Pixel8 -> Image PixelRGB8 Source #
ColorConvertible PixelRGB8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGB16 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGB16 Source #
ColorConvertible PixelRGB8 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBA16 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGB8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBA8 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBA8 Source #
ColorConvertible PixelRGB8 PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBF Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBF Source #
ColorConvertible PixelYA8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGB8 Source # promoteImage :: Image PixelYA8 -> Image PixelRGB8 Source #
ColorPlane PixelRGB8 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneBlue -> Int
ColorPlane PixelRGB8 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneGreen -> Int
ColorPlane PixelRGB8 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneRed -> Int
ColorSpaceConvertible PixelCMYK8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelCMYK8 -> PixelRGB8 Source # convertImage :: Image PixelCMYK8 -> Image PixelRGB8 Source #
ColorSpaceConvertible PixelRGB8 PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB8 -> PixelCMYK8 Source # convertImage :: Image PixelRGB8 -> Image PixelCMYK8 Source #
ColorSpaceConvertible PixelRGB8 PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB8 -> PixelYCbCr8 Source # convertImage :: Image PixelRGB8 -> Image PixelYCbCr8 Source #
ColorSpaceConvertible PixelYCbCr8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCr8 -> PixelRGB8 Source # convertImage :: Image PixelYCbCr8 -> Image PixelRGB8 Source #
ColorSpaceConvertible PixelYCbCrK8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelRGB8 Source # convertImage :: Image PixelYCbCrK8 -> Image PixelRGB8 Source #
TransparentPixel PixelRGBA8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA8 -> PixelRGB8 Source # getTransparency :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source #
type PixelBaseComponent PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelRGB8 = Word8

data PixelRGB16 Source #

Pixel type storing 16bit red, green and blue (RGB) information. Values are stored in the following order:

- Red
- Green
- Blue

Constructors

PixelRGB16 !Pixel16 !Pixel16 !Pixel16 |

#### Instances

Instances details

PngSavable PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelRGB16 -> ByteString Source # encodePngWithMetadata :: Metadatas -> Image PixelRGB16 -> ByteString Source #
TiffSaveable PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelRGB16 -> TiffColorspace extraSampleCodeOfPixel :: PixelRGB16 -> Maybe ExtraSample subSamplingInfo :: PixelRGB16 -> Vector Word32 sampleFormat :: PixelRGB16 -> [TiffSampleFormat]
LumaPlaneExtractable PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGB16 -> PixelBaseComponent PixelRGB16 Source # extractLumaPlane :: Image PixelRGB16 -> Image (PixelBaseComponent PixelRGB16) Source #
Pixel PixelRGB16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGB16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> PixelRGB16 -> PixelRGB16 -> PixelRGB16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> (PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> PixelRGB16 -> PixelRGB16 -> PixelRGB16 Source #

pixelOpacity :: PixelRGB16 -> PixelBaseComponent PixelRGB16 Source #

componentCount :: PixelRGB16 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> PixelRGB16 -> PixelRGB16 Source #

pixelBaseIndex :: Image PixelRGB16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGB16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGB16 -> Int -> Int -> PixelRGB16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB16 -> Int -> Int -> m PixelRGB16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB16 -> Int -> Int -> PixelRGB16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGB16) -> Int -> PixelRGB16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB16) -> Int -> m PixelRGB16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB16) -> Int -> PixelRGB16 -> m () Source #

Show PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelRGB16 -> ShowS Source # show :: PixelRGB16 -> String Source # showList :: [PixelRGB16] -> ShowS Source #
Eq PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelRGB16 -> PixelRGB16 -> Bool Source # (/=) :: PixelRGB16 -> PixelRGB16 -> Bool Source #
Ord PixelRGB16 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelRGB16 -> PixelRGB16 -> Ordering Source #

(<) :: PixelRGB16 -> PixelRGB16 -> Bool Source #

(<=) :: PixelRGB16 -> PixelRGB16 -> Bool Source #

(>) :: PixelRGB16 -> PixelRGB16 -> Bool Source #

(>=) :: PixelRGB16 -> PixelRGB16 -> Bool Source #

max :: PixelRGB16 -> PixelRGB16 -> PixelRGB16 Source #

min :: PixelRGB16 -> PixelRGB16 -> PixelRGB16 Source #

ColorConvertible Pixel16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel16 -> PixelRGB16 Source # promoteImage :: Image Pixel16 -> Image PixelRGB16 Source #
ColorConvertible Pixel8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelRGB16 Source # promoteImage :: Image Pixel8 -> Image PixelRGB16 Source #
ColorConvertible PixelRGB16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB16 -> PixelRGBA16 Source # promoteImage :: Image PixelRGB16 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGB8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGB16 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGB16 Source #
ColorConvertible PixelYA16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA16 -> PixelRGB16 Source # promoteImage :: Image PixelYA16 -> Image PixelRGB16 Source #
ColorConvertible PixelYA8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGB16 Source # promoteImage :: Image PixelYA8 -> Image PixelRGB16 Source #
ColorPlane PixelRGB16 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneBlue -> Int
ColorPlane PixelRGB16 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneGreen -> Int
ColorPlane PixelRGB16 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneRed -> Int
ColorSpaceConvertible PixelCMYK16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelCMYK16 -> PixelRGB16 Source # convertImage :: Image PixelCMYK16 -> Image PixelRGB16 Source #
ColorSpaceConvertible PixelRGB16 PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB16 -> PixelCMYK16 Source # convertImage :: Image PixelRGB16 -> Image PixelCMYK16 Source #
TransparentPixel PixelRGBA16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA16 -> PixelRGB16 Source # getTransparency :: PixelRGBA16 -> PixelBaseComponent PixelRGBA16 Source #
type PixelBaseComponent PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelRGB16 = Pixel16

data PixelRGBF Source #

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

Constructors

PixelRGBF !PixelF !PixelF !PixelF |

#### Instances

Instances details

LumaPlaneExtractable PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGBF -> PixelBaseComponent PixelRGBF Source # extractLumaPlane :: Image PixelRGBF -> Image (PixelBaseComponent PixelRGBF) Source #
Pixel PixelRGBF Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGBF Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> PixelRGBF -> PixelRGBF -> PixelRGBF Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> (PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> PixelRGBF -> PixelRGBF -> PixelRGBF Source #

pixelOpacity :: PixelRGBF -> PixelBaseComponent PixelRGBF Source #

componentCount :: PixelRGBF -> Int Source #

colorMap :: (PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> PixelRGBF -> PixelRGBF Source #

pixelBaseIndex :: Image PixelRGBF -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGBF -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGBF -> Int -> Int -> PixelRGBF Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBF -> Int -> Int -> m PixelRGBF Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBF -> Int -> Int -> PixelRGBF -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGBF) -> Int -> PixelRGBF Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBF) -> Int -> m PixelRGBF Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBF) -> Int -> PixelRGBF -> m () Source #

Show PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelRGBF -> ShowS Source # show :: PixelRGBF -> String Source # showList :: [PixelRGBF] -> ShowS Source #
Eq PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelRGBF -> PixelRGBF -> Bool Source # (/=) :: PixelRGBF -> PixelRGBF -> Bool Source #
Ord PixelRGBF Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelRGBF -> PixelRGBF -> Ordering Source #

(<) :: PixelRGBF -> PixelRGBF -> Bool Source #

(<=) :: PixelRGBF -> PixelRGBF -> Bool Source #

(>) :: PixelRGBF -> PixelRGBF -> Bool Source #

(>=) :: PixelRGBF -> PixelRGBF -> Bool Source #

max :: PixelRGBF -> PixelRGBF -> PixelRGBF Source #

min :: PixelRGBF -> PixelRGBF -> PixelRGBF Source #

ColorConvertible PixelF PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelF -> PixelRGBF Source # promoteImage :: Image PixelF -> Image PixelRGBF Source #
ColorConvertible PixelRGB8 PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBF Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBF Source #
ColorPlane PixelRGBF PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneBlue -> Int
ColorPlane PixelRGBF PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneGreen -> Int
ColorPlane PixelRGBF PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneRed -> Int
type PixelBaseComponent PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelRGBF = PixelF

data PixelRGBA8 Source #

Classical pixel type storing 8bit red, green, blue and alpha (RGBA) information. Values are stored in the following order:

- Red
- Green
- Blue
- Alpha

Constructors

PixelRGBA8 !Pixel8 !Pixel8 !Pixel8 !Pixel8 |

#### Instances

Instances details

BmpEncodable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Bitmap Methods bitsPerPixel :: PixelRGBA8 -> Int bmpEncode :: Image PixelRGBA8 -> Put hasAlpha :: Image PixelRGBA8 -> Bool defaultPalette :: PixelRGBA8 -> BmpPalette
PngPaletteSaveable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePalettedPng :: Image PixelRGBA8 -> Image Pixel8 -> Either String ByteString Source # encodePalettedPngWithMetadata :: Metadatas -> Image PixelRGBA8 -> Image Pixel8 -> Either String ByteString Source #
PngSavable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelRGBA8 -> ByteString Source # encodePngWithMetadata :: Metadatas -> Image PixelRGBA8 -> ByteString Source #
TgaSaveable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Tga Methods tgaDataOfImage :: Image PixelRGBA8 -> ByteString tgaPixelDepthOfImage :: Image PixelRGBA8 -> Word8 tgaTypeOfImage :: Image PixelRGBA8 -> TgaImageType
TiffSaveable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelRGBA8 -> TiffColorspace extraSampleCodeOfPixel :: PixelRGBA8 -> Maybe ExtraSample subSamplingInfo :: PixelRGBA8 -> Vector Word32 sampleFormat :: PixelRGBA8 -> [TiffSampleFormat]
LumaPlaneExtractable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source # extractLumaPlane :: Image PixelRGBA8 -> Image (PixelBaseComponent PixelRGBA8) Source #
PackeablePixel PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelRGBA8 Source # Methods packPixel :: PixelRGBA8 -> PackedRepresentation PixelRGBA8 Source # unpackPixel :: PackedRepresentation PixelRGBA8 -> PixelRGBA8 Source #
Pixel PixelRGBA8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGBA8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> PixelRGBA8 -> PixelRGBA8 -> PixelRGBA8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> (PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> PixelRGBA8 -> PixelRGBA8 -> PixelRGBA8 Source #

pixelOpacity :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source #

componentCount :: PixelRGBA8 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> PixelRGBA8 -> PixelRGBA8 Source #

pixelBaseIndex :: Image PixelRGBA8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGBA8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGBA8 -> Int -> Int -> PixelRGBA8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA8 -> Int -> Int -> m PixelRGBA8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA8 -> Int -> Int -> PixelRGBA8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGBA8) -> Int -> PixelRGBA8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA8) -> Int -> m PixelRGBA8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA8) -> Int -> PixelRGBA8 -> m () Source #

Show PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelRGBA8 -> ShowS Source # show :: PixelRGBA8 -> String Source # showList :: [PixelRGBA8] -> ShowS Source #
Eq PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelRGBA8 -> PixelRGBA8 -> Bool Source # (/=) :: PixelRGBA8 -> PixelRGBA8 -> Bool Source #
Ord PixelRGBA8 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelRGBA8 -> PixelRGBA8 -> Ordering Source #

(<) :: PixelRGBA8 -> PixelRGBA8 -> Bool Source #

(<=) :: PixelRGBA8 -> PixelRGBA8 -> Bool Source #

(>) :: PixelRGBA8 -> PixelRGBA8 -> Bool Source #

(>=) :: PixelRGBA8 -> PixelRGBA8 -> Bool Source #

max :: PixelRGBA8 -> PixelRGBA8 -> PixelRGBA8 Source #

min :: PixelRGBA8 -> PixelRGBA8 -> PixelRGBA8 Source #

ColorConvertible Pixel8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelRGBA8 Source # promoteImage :: Image Pixel8 -> Image PixelRGBA8 Source #
ColorConvertible PixelRGB8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBA8 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBA8 Source #
ColorConvertible PixelRGBA8 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGBA8 -> PixelRGBA16 Source # promoteImage :: Image PixelRGBA8 -> Image PixelRGBA16 Source #
ColorConvertible PixelYA8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGBA8 Source # promoteImage :: Image PixelYA8 -> Image PixelRGBA8 Source #
ColorPlane PixelRGBA8 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneAlpha -> Int
ColorPlane PixelRGBA8 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneBlue -> Int
ColorPlane PixelRGBA8 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneGreen -> Int
ColorPlane PixelRGBA8 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneRed -> Int
TransparentPixel PixelRGBA8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA8 -> PixelRGB8 Source # getTransparency :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source #
type PackedRepresentation PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types type PackedRepresentation PixelRGBA8 = Word32
type PixelBaseComponent PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelRGBA8 = Word8

data PixelRGBA16 Source #

Pixel type storing 16bit red, green, blue and alpha (RGBA) information. Values are stored in the following order:

- Red
- Green
- Blue
- Alpha

Constructors

PixelRGBA16 !Pixel16 !Pixel16 !Pixel16 !Pixel16 |

#### Instances

Instances details

PngSavable PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelRGBA16 -> ByteString Source # encodePngWithMetadata :: Metadatas -> Image PixelRGBA16 -> ByteString Source #
TiffSaveable PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelRGBA16 -> TiffColorspace extraSampleCodeOfPixel :: PixelRGBA16 -> Maybe ExtraSample subSamplingInfo :: PixelRGBA16 -> Vector Word32 sampleFormat :: PixelRGBA16 -> [TiffSampleFormat]
PackeablePixel PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelRGBA16 Source # Methods packPixel :: PixelRGBA16 -> PackedRepresentation PixelRGBA16 Source # unpackPixel :: PackedRepresentation PixelRGBA16 -> PixelRGBA16 Source #
Pixel PixelRGBA16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGBA16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> PixelRGBA16 -> PixelRGBA16 -> PixelRGBA16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> (PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> PixelRGBA16 -> PixelRGBA16 -> PixelRGBA16 Source #

pixelOpacity :: PixelRGBA16 -> PixelBaseComponent PixelRGBA16 Source #

componentCount :: PixelRGBA16 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> PixelRGBA16 -> PixelRGBA16 Source #

pixelBaseIndex :: Image PixelRGBA16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGBA16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGBA16 -> Int -> Int -> PixelRGBA16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA16 -> Int -> Int -> m PixelRGBA16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA16 -> Int -> Int -> PixelRGBA16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGBA16) -> Int -> PixelRGBA16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA16) -> Int -> m PixelRGBA16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA16) -> Int -> PixelRGBA16 -> m () Source #

Show PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelRGBA16 -> ShowS Source # show :: PixelRGBA16 -> String Source # showList :: [PixelRGBA16] -> ShowS Source #
Eq PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelRGBA16 -> PixelRGBA16 -> Bool Source # (/=) :: PixelRGBA16 -> PixelRGBA16 -> Bool Source #
Ord PixelRGBA16 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelRGBA16 -> PixelRGBA16 -> Ordering Source #

(<) :: PixelRGBA16 -> PixelRGBA16 -> Bool Source #

(<=) :: PixelRGBA16 -> PixelRGBA16 -> Bool Source #

(>) :: PixelRGBA16 -> PixelRGBA16 -> Bool Source #

(>=) :: PixelRGBA16 -> PixelRGBA16 -> Bool Source #

max :: PixelRGBA16 -> PixelRGBA16 -> PixelRGBA16 Source #

min :: PixelRGBA16 -> PixelRGBA16 -> PixelRGBA16 Source #

ColorConvertible Pixel16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel16 -> PixelRGBA16 Source # promoteImage :: Image Pixel16 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGB16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB16 -> PixelRGBA16 Source # promoteImage :: Image PixelRGB16 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGB8 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBA16 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGBA8 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGBA8 -> PixelRGBA16 Source # promoteImage :: Image PixelRGBA8 -> Image PixelRGBA16 Source #
ColorConvertible PixelYA16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA16 -> PixelRGBA16 Source # promoteImage :: Image PixelYA16 -> Image PixelRGBA16 Source #
ColorPlane PixelRGBA16 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneAlpha -> Int
ColorPlane PixelRGBA16 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneBlue -> Int
ColorPlane PixelRGBA16 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneGreen -> Int
ColorPlane PixelRGBA16 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneRed -> Int
TransparentPixel PixelRGBA16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA16 -> PixelRGB16 Source # getTransparency :: PixelRGBA16 -> PixelBaseComponent PixelRGBA16 Source #
type PackedRepresentation PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types type PackedRepresentation PixelRGBA16 = Word64
type PixelBaseComponent PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelRGBA16 = Pixel16

data PixelCMYK8 Source #

Pixel type storing 8bit cyan, magenta, yellow and black (CMYK) information. Values are stored in the following order:

- Cyan
- Magenta
- Yellow
- Black

Constructors

PixelCMYK8 !Pixel8 !Pixel8 !Pixel8 !Pixel8 |

#### Instances

Instances details

JpgEncodable PixelCMYK8 Source # |

Instance details

Defined in Codec.Picture.Jpg

Methods

additionalBlocks :: Image PixelCMYK8 -> [JpgFrame]

componentsOfColorSpace :: Image PixelCMYK8 -> [JpgComponent]

encodingState :: Int -> Image PixelCMYK8 -> Vector EncoderState

imageHuffmanTables :: Image PixelCMYK8 -> [(JpgHuffmanTableSpec, HuffmanPackedTree)]

scanSpecificationOfColorSpace :: Image PixelCMYK8 -> [JpgScanSpecification]

quantTableSpec :: Image PixelCMYK8 -> Int -> [JpgQuantTableSpec]

maximumSubSamplingOf :: Image PixelCMYK8 -> Int

TiffSaveable PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelCMYK8 -> TiffColorspace extraSampleCodeOfPixel :: PixelCMYK8 -> Maybe ExtraSample subSamplingInfo :: PixelCMYK8 -> Vector Word32 sampleFormat :: PixelCMYK8 -> [TiffSampleFormat]
PackeablePixel PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelCMYK8 Source # Methods packPixel :: PixelCMYK8 -> PackedRepresentation PixelCMYK8 Source # unpackPixel :: PackedRepresentation PixelCMYK8 -> PixelCMYK8 Source #
Pixel PixelCMYK8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelCMYK8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> PixelCMYK8 -> PixelCMYK8 -> PixelCMYK8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> (PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> PixelCMYK8 -> PixelCMYK8 -> PixelCMYK8 Source #

pixelOpacity :: PixelCMYK8 -> PixelBaseComponent PixelCMYK8 Source #

componentCount :: PixelCMYK8 -> Int Source #

colorMap :: (PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> PixelCMYK8 -> PixelCMYK8 Source #

pixelBaseIndex :: Image PixelCMYK8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelCMYK8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelCMYK8 -> Int -> Int -> PixelCMYK8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK8 -> Int -> Int -> m PixelCMYK8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK8 -> Int -> Int -> PixelCMYK8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelCMYK8) -> Int -> PixelCMYK8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK8) -> Int -> m PixelCMYK8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK8) -> Int -> PixelCMYK8 -> m () Source #

Show PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelCMYK8 -> ShowS Source # show :: PixelCMYK8 -> String Source # showList :: [PixelCMYK8] -> ShowS Source #
Eq PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelCMYK8 -> PixelCMYK8 -> Bool Source # (/=) :: PixelCMYK8 -> PixelCMYK8 -> Bool Source #
Ord PixelCMYK8 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelCMYK8 -> PixelCMYK8 -> Ordering Source #

(<) :: PixelCMYK8 -> PixelCMYK8 -> Bool Source #

(<=) :: PixelCMYK8 -> PixelCMYK8 -> Bool Source #

(>) :: PixelCMYK8 -> PixelCMYK8 -> Bool Source #

(>=) :: PixelCMYK8 -> PixelCMYK8 -> Bool Source #

max :: PixelCMYK8 -> PixelCMYK8 -> PixelCMYK8 Source #

min :: PixelCMYK8 -> PixelCMYK8 -> PixelCMYK8 Source #

ColorPlane PixelCMYK8 PlaneBlack Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneBlack -> Int
ColorPlane PixelCMYK8 PlaneCyan Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneCyan -> Int
ColorPlane PixelCMYK8 PlaneMagenta Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneMagenta -> Int
ColorPlane PixelCMYK8 PlaneYellow Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneYellow -> Int
ColorSpaceConvertible PixelCMYK8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelCMYK8 -> PixelRGB8 Source # convertImage :: Image PixelCMYK8 -> Image PixelRGB8 Source #
ColorSpaceConvertible PixelRGB8 PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB8 -> PixelCMYK8 Source # convertImage :: Image PixelRGB8 -> Image PixelCMYK8 Source #
ColorSpaceConvertible PixelYCbCrK8 PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelCMYK8 Source # convertImage :: Image PixelYCbCrK8 -> Image PixelCMYK8 Source #
type PackedRepresentation PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types type PackedRepresentation PixelCMYK8 = Word32
type PixelBaseComponent PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelCMYK8 = Word8

data PixelCMYK16 Source #

Pixel type storing 16bit cyan, magenta, yellow and black (CMYK) information. Values are stored in the following order:

- Cyan
- Magenta
- Yellow
- Black

Constructors

PixelCMYK16 !Pixel16 !Pixel16 !Pixel16 !Pixel16 |

#### Instances

Instances details

TiffSaveable PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelCMYK16 -> TiffColorspace extraSampleCodeOfPixel :: PixelCMYK16 -> Maybe ExtraSample subSamplingInfo :: PixelCMYK16 -> Vector Word32 sampleFormat :: PixelCMYK16 -> [TiffSampleFormat]
PackeablePixel PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelCMYK16 Source # Methods packPixel :: PixelCMYK16 -> PackedRepresentation PixelCMYK16 Source # unpackPixel :: PackedRepresentation PixelCMYK16 -> PixelCMYK16 Source #
Pixel PixelCMYK16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelCMYK16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> PixelCMYK16 -> PixelCMYK16 -> PixelCMYK16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> (PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> PixelCMYK16 -> PixelCMYK16 -> PixelCMYK16 Source #

pixelOpacity :: PixelCMYK16 -> PixelBaseComponent PixelCMYK16 Source #

componentCount :: PixelCMYK16 -> Int Source #

colorMap :: (PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> PixelCMYK16 -> PixelCMYK16 Source #

pixelBaseIndex :: Image PixelCMYK16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelCMYK16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelCMYK16 -> Int -> Int -> PixelCMYK16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK16 -> Int -> Int -> m PixelCMYK16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK16 -> Int -> Int -> PixelCMYK16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelCMYK16) -> Int -> PixelCMYK16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK16) -> Int -> m PixelCMYK16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK16) -> Int -> PixelCMYK16 -> m () Source #

Show PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelCMYK16 -> ShowS Source # show :: PixelCMYK16 -> String Source # showList :: [PixelCMYK16] -> ShowS Source #
Eq PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelCMYK16 -> PixelCMYK16 -> Bool Source # (/=) :: PixelCMYK16 -> PixelCMYK16 -> Bool Source #
Ord PixelCMYK16 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelCMYK16 -> PixelCMYK16 -> Ordering Source #

(<) :: PixelCMYK16 -> PixelCMYK16 -> Bool Source #

(<=) :: PixelCMYK16 -> PixelCMYK16 -> Bool Source #

(>) :: PixelCMYK16 -> PixelCMYK16 -> Bool Source #

(>=) :: PixelCMYK16 -> PixelCMYK16 -> Bool Source #

max :: PixelCMYK16 -> PixelCMYK16 -> PixelCMYK16 Source #

min :: PixelCMYK16 -> PixelCMYK16 -> PixelCMYK16 Source #

ColorPlane PixelCMYK16 PlaneBlack Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneBlack -> Int
ColorPlane PixelCMYK16 PlaneCyan Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneCyan -> Int
ColorPlane PixelCMYK16 PlaneMagenta Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneMagenta -> Int
ColorPlane PixelCMYK16 PlaneYellow Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneYellow -> Int
ColorSpaceConvertible PixelCMYK16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelCMYK16 -> PixelRGB16 Source # convertImage :: Image PixelCMYK16 -> Image PixelRGB16 Source #
ColorSpaceConvertible PixelRGB16 PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB16 -> PixelCMYK16 Source # convertImage :: Image PixelRGB16 -> Image PixelCMYK16 Source #
type PackedRepresentation PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types type PackedRepresentation PixelCMYK16 = Word64
type PixelBaseComponent PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelCMYK16 = Word16

data PixelYCbCr8 Source #

Pixel type storing 8bit luminance, blue difference and red difference (YCbCr) information. Values are stored in the following order:

- Y (luminance)
- Cb
- Cr

Constructors

PixelYCbCr8 !Pixel8 !Pixel8 !Pixel8 |

#### Instances

Instances details

JpgEncodable PixelYCbCr8 Source # |

Instance details

Defined in Codec.Picture.Jpg

Methods

additionalBlocks :: Image PixelYCbCr8 -> [JpgFrame]

componentsOfColorSpace :: Image PixelYCbCr8 -> [JpgComponent]

encodingState :: Int -> Image PixelYCbCr8 -> Vector EncoderState

imageHuffmanTables :: Image PixelYCbCr8 -> [(JpgHuffmanTableSpec, HuffmanPackedTree)]

scanSpecificationOfColorSpace :: Image PixelYCbCr8 -> [JpgScanSpecification]

quantTableSpec :: Image PixelYCbCr8 -> Int -> [JpgQuantTableSpec]

maximumSubSamplingOf :: Image PixelYCbCr8 -> Int

TiffSaveable PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelYCbCr8 -> TiffColorspace extraSampleCodeOfPixel :: PixelYCbCr8 -> Maybe ExtraSample subSamplingInfo :: PixelYCbCr8 -> Vector Word32 sampleFormat :: PixelYCbCr8 -> [TiffSampleFormat]
LumaPlaneExtractable PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 Source # extractLumaPlane :: Image PixelYCbCr8 -> Image (PixelBaseComponent PixelYCbCr8) Source #
Pixel PixelYCbCr8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYCbCr8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> PixelYCbCr8 -> PixelYCbCr8 -> PixelYCbCr8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> (PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> PixelYCbCr8 -> PixelYCbCr8 -> PixelYCbCr8 Source #

pixelOpacity :: PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 Source #

componentCount :: PixelYCbCr8 -> Int Source #

colorMap :: (PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> PixelYCbCr8 -> PixelYCbCr8 Source #

pixelBaseIndex :: Image PixelYCbCr8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYCbCr8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYCbCr8 -> Int -> Int -> PixelYCbCr8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCr8 -> Int -> Int -> m PixelYCbCr8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCr8 -> Int -> Int -> PixelYCbCr8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYCbCr8) -> Int -> PixelYCbCr8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCr8) -> Int -> m PixelYCbCr8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCr8) -> Int -> PixelYCbCr8 -> m () Source #

Show PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelYCbCr8 -> ShowS Source # show :: PixelYCbCr8 -> String Source # showList :: [PixelYCbCr8] -> ShowS Source #
Eq PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelYCbCr8 -> PixelYCbCr8 -> Bool Source # (/=) :: PixelYCbCr8 -> PixelYCbCr8 -> Bool Source #
Ord PixelYCbCr8 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelYCbCr8 -> PixelYCbCr8 -> Ordering Source #

(<) :: PixelYCbCr8 -> PixelYCbCr8 -> Bool Source #

(<=) :: PixelYCbCr8 -> PixelYCbCr8 -> Bool Source #

(>) :: PixelYCbCr8 -> PixelYCbCr8 -> Bool Source #

(>=) :: PixelYCbCr8 -> PixelYCbCr8 -> Bool Source #

max :: PixelYCbCr8 -> PixelYCbCr8 -> PixelYCbCr8 Source #

min :: PixelYCbCr8 -> PixelYCbCr8 -> PixelYCbCr8 Source #

ColorPlane PixelYCbCr8 PlaneCb Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneCb -> Int
ColorPlane PixelYCbCr8 PlaneCr Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneCr -> Int
ColorPlane PixelYCbCr8 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneLuma -> Int
ColorSpaceConvertible PixelRGB8 PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB8 -> PixelYCbCr8 Source # convertImage :: Image PixelRGB8 -> Image PixelYCbCr8 Source #
ColorSpaceConvertible PixelYCbCr8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCr8 -> PixelRGB8 Source # convertImage :: Image PixelYCbCr8 -> Image PixelRGB8 Source #
type PixelBaseComponent PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelYCbCr8 = Word8

data PixelYCbCrK8 Source #

Pixel type storing value for the YCCK color space:

- Y (Luminance)
- Cb
- Cr
- Black

Constructors

PixelYCbCrK8 !Pixel8 !Pixel8 !Pixel8 !Pixel8 |

#### Instances

Instances details

Pixel PixelYCbCrK8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYCbCrK8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> PixelYCbCrK8 -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> (PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> PixelYCbCrK8 -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

pixelOpacity :: PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 Source #

componentCount :: PixelYCbCrK8 -> Int Source #

colorMap :: (PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

pixelBaseIndex :: Image PixelYCbCrK8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYCbCrK8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYCbCrK8 -> Int -> Int -> PixelYCbCrK8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCrK8 -> Int -> Int -> m PixelYCbCrK8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCrK8 -> Int -> Int -> PixelYCbCrK8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYCbCrK8) -> Int -> PixelYCbCrK8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCrK8) -> Int -> m PixelYCbCrK8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCrK8) -> Int -> PixelYCbCrK8 -> m () Source #

Show PixelYCbCrK8 Source # |
Instance details Defined in Codec.Picture.Types Methods showsPrec :: Int -> PixelYCbCrK8 -> ShowS Source # show :: PixelYCbCrK8 -> String Source # showList :: [PixelYCbCrK8] -> ShowS Source #
Eq PixelYCbCrK8 Source # |
Instance details Defined in Codec.Picture.Types Methods (==) :: PixelYCbCrK8 -> PixelYCbCrK8 -> Bool Source # (/=) :: PixelYCbCrK8 -> PixelYCbCrK8 -> Bool Source #
Ord PixelYCbCrK8 Source # |

Instance details

Defined in Codec.Picture.Types

Methods

compare :: PixelYCbCrK8 -> PixelYCbCrK8 -> Ordering Source #

(<) :: PixelYCbCrK8 -> PixelYCbCrK8 -> Bool Source #

(<=) :: PixelYCbCrK8 -> PixelYCbCrK8 -> Bool Source #

(>) :: PixelYCbCrK8 -> PixelYCbCrK8 -> Bool Source #

(>=) :: PixelYCbCrK8 -> PixelYCbCrK8 -> Bool Source #

max :: PixelYCbCrK8 -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

min :: PixelYCbCrK8 -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

ColorSpaceConvertible PixelYCbCrK8 PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelCMYK8 Source # convertImage :: Image PixelYCbCrK8 -> Image PixelCMYK8 Source #
ColorSpaceConvertible PixelYCbCrK8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelRGB8 Source # convertImage :: Image PixelYCbCrK8 -> Image PixelRGB8 Source #
type PixelBaseComponent PixelYCbCrK8 Source # |
Instance details Defined in Codec.Picture.Types type PixelBaseComponent PixelYCbCrK8 = Word8

# Type classes

class (Pixel a, Pixel b) => ColorConvertible a b where Source #

Implement upcasting for pixel types. Minimal declaration of `promotePixel`. It is strongly recommended to overload promoteImage to keep performance acceptable

Minimal complete definition

promotePixel

Methods

promotePixel :: a -> b Source #

Convert a pixel type to another pixel type. This operation should never lose any data.

promoteImage :: Image a -> Image b Source #

Change the underlying pixel type of an image by performing a full copy of it.

#### Instances

Instances details

ColorConvertible Pixel16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel16 -> PixelRGB16 Source # promoteImage :: Image Pixel16 -> Image PixelRGB16 Source #
ColorConvertible Pixel16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel16 -> PixelRGBA16 Source # promoteImage :: Image Pixel16 -> Image PixelRGBA16 Source #
ColorConvertible Pixel16 PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel16 -> PixelYA16 Source # promoteImage :: Image Pixel16 -> Image PixelYA16 Source #
ColorConvertible Pixel8 Pixel16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> Pixel16 Source # promoteImage :: Image Pixel8 -> Image Pixel16 Source #
ColorConvertible Pixel8 PixelF Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelF Source # promoteImage :: Image Pixel8 -> Image PixelF Source #
ColorConvertible Pixel8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelRGB16 Source # promoteImage :: Image Pixel8 -> Image PixelRGB16 Source #
ColorConvertible Pixel8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelRGB8 Source # promoteImage :: Image Pixel8 -> Image PixelRGB8 Source #
ColorConvertible Pixel8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelRGBA8 Source # promoteImage :: Image Pixel8 -> Image PixelRGBA8 Source #
ColorConvertible Pixel8 PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: Pixel8 -> PixelYA8 Source # promoteImage :: Image Pixel8 -> Image PixelYA8 Source #
ColorConvertible PixelF PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelF -> PixelRGBF Source # promoteImage :: Image PixelF -> Image PixelRGBF Source #
ColorConvertible PixelRGB16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB16 -> PixelRGBA16 Source # promoteImage :: Image PixelRGB16 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGB8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGB16 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGB16 Source #
ColorConvertible PixelRGB8 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBA16 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBA16 Source #
ColorConvertible PixelRGB8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBA8 Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBA8 Source #
ColorConvertible PixelRGB8 PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGB8 -> PixelRGBF Source # promoteImage :: Image PixelRGB8 -> Image PixelRGBF Source #
ColorConvertible PixelRGBA8 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelRGBA8 -> PixelRGBA16 Source # promoteImage :: Image PixelRGBA8 -> Image PixelRGBA16 Source #
ColorConvertible PixelYA16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA16 -> PixelRGB16 Source # promoteImage :: Image PixelYA16 -> Image PixelRGB16 Source #
ColorConvertible PixelYA16 PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA16 -> PixelRGBA16 Source # promoteImage :: Image PixelYA16 -> Image PixelRGBA16 Source #
ColorConvertible PixelYA8 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGB16 Source # promoteImage :: Image PixelYA8 -> Image PixelRGB16 Source #
ColorConvertible PixelYA8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGB8 Source # promoteImage :: Image PixelYA8 -> Image PixelRGB8 Source #
ColorConvertible PixelYA8 PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods promotePixel :: PixelYA8 -> PixelRGBA8 Source # promoteImage :: Image PixelYA8 -> Image PixelRGBA8 Source #
Pixel a => ColorConvertible a a Source # | Free promotion for identic pixel types
Instance details Defined in Codec.Picture.Types Methods promotePixel :: a -> a Source # promoteImage :: Image a -> Image a Source #

class (Storable (PixelBaseComponent a), Num (PixelBaseComponent a), Eq a) => Pixel a where Source #

Definition of pixels used in images. Each pixel has a color space, and a representative component (Word8 or Float).

Minimal complete definition

mixWith, pixelOpacity, componentCount, colorMap, pixelAt, readPixel, writePixel, unsafePixelAt, unsafeReadPixel, unsafeWritePixel

Associated Types

type PixelBaseComponent a :: * Source #

Type of the pixel component, "classical" images would have Word8 type as their PixelBaseComponent, HDR image would have Float for instance

Methods

mixWith :: (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> a Source #

Call the function for every component of the pixels. For example for RGB pixels mixWith is declared like this:

    mixWith f (PixelRGB8 ra ga ba) (PixelRGB8 rb gb bb) =
       PixelRGB8 (f 0 ra rb) (f 1 ga gb) (f 2 ba bb)

mixWithAlpha Source #

Arguments

:: (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) | Function for color component
-> (PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) | Function for alpha component
-> a |
-> a |
-> a |

Extension of the `mixWith` which separate the treatment of the color components of the alpha value (transparency component). For pixel without alpha components, it is equivalent to mixWith.

    mixWithAlpha f fa (PixelRGBA8 ra ga ba aa) (PixelRGB8 rb gb bb ab) =
       PixelRGBA8 (f 0 ra rb) (f 1 ga gb) (f 2 ba bb) (fa aa ab)

pixelOpacity :: a -> PixelBaseComponent a Source #

Return the opacity of a pixel, if the pixel has an alpha layer, return the alpha value. If the pixel doesn't have an alpha value, return a value representing the opaqueness.

componentCount :: a -> Int Source #

Return the number of components of the pixel

colorMap :: (PixelBaseComponent a -> PixelBaseComponent a) -> a -> a Source #

Apply a function to each component of a pixel. If the color type possess an alpha (transparency channel), it is treated like the other color components.

pixelBaseIndex :: Image a -> Int -> Int -> Int Source #

Calculate the index for the begining of the pixel

mutablePixelBaseIndex :: MutableImage s a -> Int -> Int -> Int Source #

Calculate theindex for the begining of the pixel at position x y

pixelAt :: Image a -> Int -> Int -> a Source #

Extract a pixel at a given position, (x, y), the origin is assumed to be at the corner top left, positive y to the bottom of the image

readPixel :: PrimMonad m => MutableImage (PrimState m) a -> Int -> Int -> m a Source #

Same as pixelAt but for mutable images.

writePixel :: PrimMonad m => MutableImage (PrimState m) a -> Int -> Int -> a -> m () Source #

Write a pixel in a mutable image at position x y

unsafePixelAt :: Vector (PixelBaseComponent a) -> Int -> a Source #

Unsafe version of pixelAt, read a pixel at the given index without bound checking (if possible). The index is expressed in number (PixelBaseComponent a)

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent a) -> Int -> m a Source #

Unsafe version of readPixel, read a pixel at the given position without bound checking (if possible). The index is expressed in number (PixelBaseComponent a)

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent a) -> Int -> a -> m () Source #

Unsafe version of writePixel, write a pixel at the given position without bound checking. This can be _really_ unsafe. The index is expressed in number (PixelBaseComponent a)

#### Instances

Instances details

Pixel Pixel16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent Pixel16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16) -> Pixel16 -> Pixel16 -> Pixel16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16) -> (PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16) -> Pixel16 -> Pixel16 -> Pixel16 Source #

pixelOpacity :: Pixel16 -> PixelBaseComponent Pixel16 Source #

componentCount :: Pixel16 -> Int Source #

colorMap :: (PixelBaseComponent Pixel16 -> PixelBaseComponent Pixel16) -> Pixel16 -> Pixel16 Source #

pixelBaseIndex :: Image Pixel16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s Pixel16 -> Int -> Int -> Int Source #

pixelAt :: Image Pixel16 -> Int -> Int -> Pixel16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) Pixel16 -> Int -> Int -> m Pixel16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) Pixel16 -> Int -> Int -> Pixel16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent Pixel16) -> Int -> Pixel16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent Pixel16) -> Int -> m Pixel16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent Pixel16) -> Int -> Pixel16 -> m () Source #

Pixel Pixel32 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent Pixel32 Source #

Methods

mixWith :: (Int -> PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32) -> Pixel32 -> Pixel32 -> Pixel32 Source #

mixWithAlpha :: (Int -> PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32) -> (PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32) -> Pixel32 -> Pixel32 -> Pixel32 Source #

pixelOpacity :: Pixel32 -> PixelBaseComponent Pixel32 Source #

componentCount :: Pixel32 -> Int Source #

colorMap :: (PixelBaseComponent Pixel32 -> PixelBaseComponent Pixel32) -> Pixel32 -> Pixel32 Source #

pixelBaseIndex :: Image Pixel32 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s Pixel32 -> Int -> Int -> Int Source #

pixelAt :: Image Pixel32 -> Int -> Int -> Pixel32 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) Pixel32 -> Int -> Int -> m Pixel32 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) Pixel32 -> Int -> Int -> Pixel32 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent Pixel32) -> Int -> Pixel32 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent Pixel32) -> Int -> m Pixel32 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent Pixel32) -> Int -> Pixel32 -> m () Source #

Pixel Pixel8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent Pixel8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8) -> Pixel8 -> Pixel8 -> Pixel8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8) -> (PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8) -> Pixel8 -> Pixel8 -> Pixel8 Source #

pixelOpacity :: Pixel8 -> PixelBaseComponent Pixel8 Source #

componentCount :: Pixel8 -> Int Source #

colorMap :: (PixelBaseComponent Pixel8 -> PixelBaseComponent Pixel8) -> Pixel8 -> Pixel8 Source #

pixelBaseIndex :: Image Pixel8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s Pixel8 -> Int -> Int -> Int Source #

pixelAt :: Image Pixel8 -> Int -> Int -> Pixel8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) Pixel8 -> Int -> Int -> m Pixel8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) Pixel8 -> Int -> Int -> Pixel8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent Pixel8) -> Int -> Pixel8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent Pixel8) -> Int -> m Pixel8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent Pixel8) -> Int -> Pixel8 -> m () Source #

Pixel PixelCMYK16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelCMYK16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> PixelCMYK16 -> PixelCMYK16 -> PixelCMYK16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> (PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> PixelCMYK16 -> PixelCMYK16 -> PixelCMYK16 Source #

pixelOpacity :: PixelCMYK16 -> PixelBaseComponent PixelCMYK16 Source #

componentCount :: PixelCMYK16 -> Int Source #

colorMap :: (PixelBaseComponent PixelCMYK16 -> PixelBaseComponent PixelCMYK16) -> PixelCMYK16 -> PixelCMYK16 Source #

pixelBaseIndex :: Image PixelCMYK16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelCMYK16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelCMYK16 -> Int -> Int -> PixelCMYK16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK16 -> Int -> Int -> m PixelCMYK16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK16 -> Int -> Int -> PixelCMYK16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelCMYK16) -> Int -> PixelCMYK16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK16) -> Int -> m PixelCMYK16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK16) -> Int -> PixelCMYK16 -> m () Source #

Pixel PixelCMYK8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelCMYK8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> PixelCMYK8 -> PixelCMYK8 -> PixelCMYK8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> (PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> PixelCMYK8 -> PixelCMYK8 -> PixelCMYK8 Source #

pixelOpacity :: PixelCMYK8 -> PixelBaseComponent PixelCMYK8 Source #

componentCount :: PixelCMYK8 -> Int Source #

colorMap :: (PixelBaseComponent PixelCMYK8 -> PixelBaseComponent PixelCMYK8) -> PixelCMYK8 -> PixelCMYK8 Source #

pixelBaseIndex :: Image PixelCMYK8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelCMYK8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelCMYK8 -> Int -> Int -> PixelCMYK8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK8 -> Int -> Int -> m PixelCMYK8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelCMYK8 -> Int -> Int -> PixelCMYK8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelCMYK8) -> Int -> PixelCMYK8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK8) -> Int -> m PixelCMYK8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelCMYK8) -> Int -> PixelCMYK8 -> m () Source #

Pixel PixelF Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelF Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelF -> PixelBaseComponent PixelF -> PixelBaseComponent PixelF) -> PixelF -> PixelF -> PixelF Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelF -> PixelBaseComponent PixelF -> PixelBaseComponent PixelF) -> (PixelBaseComponent PixelF -> PixelBaseComponent PixelF -> PixelBaseComponent PixelF) -> PixelF -> PixelF -> PixelF Source #

pixelOpacity :: PixelF -> PixelBaseComponent PixelF Source #

componentCount :: PixelF -> Int Source #

colorMap :: (PixelBaseComponent PixelF -> PixelBaseComponent PixelF) -> PixelF -> PixelF Source #

pixelBaseIndex :: Image PixelF -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelF -> Int -> Int -> Int Source #

pixelAt :: Image PixelF -> Int -> Int -> PixelF Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelF -> Int -> Int -> m PixelF Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelF -> Int -> Int -> PixelF -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelF) -> Int -> PixelF Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelF) -> Int -> m PixelF Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelF) -> Int -> PixelF -> m () Source #

Pixel PixelRGB16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGB16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> PixelRGB16 -> PixelRGB16 -> PixelRGB16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> (PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> PixelRGB16 -> PixelRGB16 -> PixelRGB16 Source #

pixelOpacity :: PixelRGB16 -> PixelBaseComponent PixelRGB16 Source #

componentCount :: PixelRGB16 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGB16 -> PixelBaseComponent PixelRGB16) -> PixelRGB16 -> PixelRGB16 Source #

pixelBaseIndex :: Image PixelRGB16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGB16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGB16 -> Int -> Int -> PixelRGB16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB16 -> Int -> Int -> m PixelRGB16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB16 -> Int -> Int -> PixelRGB16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGB16) -> Int -> PixelRGB16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB16) -> Int -> m PixelRGB16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB16) -> Int -> PixelRGB16 -> m () Source #

Pixel PixelRGB8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGB8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 -> PixelRGB8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> (PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 -> PixelRGB8 Source #

pixelOpacity :: PixelRGB8 -> PixelBaseComponent PixelRGB8 Source #

componentCount :: PixelRGB8 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 Source #

pixelBaseIndex :: Image PixelRGB8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGB8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGB8 -> Int -> Int -> PixelRGB8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB8 -> Int -> Int -> m PixelRGB8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB8 -> Int -> Int -> PixelRGB8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGB8) -> Int -> PixelRGB8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB8) -> Int -> m PixelRGB8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB8) -> Int -> PixelRGB8 -> m () Source #

Pixel PixelRGBA16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGBA16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> PixelRGBA16 -> PixelRGBA16 -> PixelRGBA16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> (PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> PixelRGBA16 -> PixelRGBA16 -> PixelRGBA16 Source #

pixelOpacity :: PixelRGBA16 -> PixelBaseComponent PixelRGBA16 Source #

componentCount :: PixelRGBA16 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGBA16 -> PixelBaseComponent PixelRGBA16) -> PixelRGBA16 -> PixelRGBA16 Source #

pixelBaseIndex :: Image PixelRGBA16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGBA16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGBA16 -> Int -> Int -> PixelRGBA16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA16 -> Int -> Int -> m PixelRGBA16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA16 -> Int -> Int -> PixelRGBA16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGBA16) -> Int -> PixelRGBA16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA16) -> Int -> m PixelRGBA16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA16) -> Int -> PixelRGBA16 -> m () Source #

Pixel PixelRGBA8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGBA8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> PixelRGBA8 -> PixelRGBA8 -> PixelRGBA8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> (PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> PixelRGBA8 -> PixelRGBA8 -> PixelRGBA8 Source #

pixelOpacity :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source #

componentCount :: PixelRGBA8 -> Int Source #

colorMap :: (PixelBaseComponent PixelRGBA8 -> PixelBaseComponent PixelRGBA8) -> PixelRGBA8 -> PixelRGBA8 Source #

pixelBaseIndex :: Image PixelRGBA8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGBA8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGBA8 -> Int -> Int -> PixelRGBA8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA8 -> Int -> Int -> m PixelRGBA8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBA8 -> Int -> Int -> PixelRGBA8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGBA8) -> Int -> PixelRGBA8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA8) -> Int -> m PixelRGBA8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBA8) -> Int -> PixelRGBA8 -> m () Source #

Pixel PixelRGBF Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelRGBF Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> PixelRGBF -> PixelRGBF -> PixelRGBF Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> (PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> PixelRGBF -> PixelRGBF -> PixelRGBF Source #

pixelOpacity :: PixelRGBF -> PixelBaseComponent PixelRGBF Source #

componentCount :: PixelRGBF -> Int Source #

colorMap :: (PixelBaseComponent PixelRGBF -> PixelBaseComponent PixelRGBF) -> PixelRGBF -> PixelRGBF Source #

pixelBaseIndex :: Image PixelRGBF -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelRGBF -> Int -> Int -> Int Source #

pixelAt :: Image PixelRGBF -> Int -> Int -> PixelRGBF Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBF -> Int -> Int -> m PixelRGBF Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGBF -> Int -> Int -> PixelRGBF -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelRGBF) -> Int -> PixelRGBF Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBF) -> Int -> m PixelRGBF Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGBF) -> Int -> PixelRGBF -> m () Source #

Pixel PixelYA16 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYA16 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> PixelYA16 -> PixelYA16 -> PixelYA16 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> (PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> PixelYA16 -> PixelYA16 -> PixelYA16 Source #

pixelOpacity :: PixelYA16 -> PixelBaseComponent PixelYA16 Source #

componentCount :: PixelYA16 -> Int Source #

colorMap :: (PixelBaseComponent PixelYA16 -> PixelBaseComponent PixelYA16) -> PixelYA16 -> PixelYA16 Source #

pixelBaseIndex :: Image PixelYA16 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYA16 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYA16 -> Int -> Int -> PixelYA16 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYA16 -> Int -> Int -> m PixelYA16 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYA16 -> Int -> Int -> PixelYA16 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYA16) -> Int -> PixelYA16 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA16) -> Int -> m PixelYA16 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA16) -> Int -> PixelYA16 -> m () Source #

Pixel PixelYA8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYA8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> PixelYA8 -> PixelYA8 -> PixelYA8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> (PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> PixelYA8 -> PixelYA8 -> PixelYA8 Source #

pixelOpacity :: PixelYA8 -> PixelBaseComponent PixelYA8 Source #

componentCount :: PixelYA8 -> Int Source #

colorMap :: (PixelBaseComponent PixelYA8 -> PixelBaseComponent PixelYA8) -> PixelYA8 -> PixelYA8 Source #

pixelBaseIndex :: Image PixelYA8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYA8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYA8 -> Int -> Int -> PixelYA8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYA8 -> Int -> Int -> m PixelYA8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYA8 -> Int -> Int -> PixelYA8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYA8) -> Int -> PixelYA8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA8) -> Int -> m PixelYA8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYA8) -> Int -> PixelYA8 -> m () Source #

Pixel PixelYCbCr8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYCbCr8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> PixelYCbCr8 -> PixelYCbCr8 -> PixelYCbCr8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> (PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> PixelYCbCr8 -> PixelYCbCr8 -> PixelYCbCr8 Source #

pixelOpacity :: PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 Source #

componentCount :: PixelYCbCr8 -> Int Source #

colorMap :: (PixelBaseComponent PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8) -> PixelYCbCr8 -> PixelYCbCr8 Source #

pixelBaseIndex :: Image PixelYCbCr8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYCbCr8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYCbCr8 -> Int -> Int -> PixelYCbCr8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCr8 -> Int -> Int -> m PixelYCbCr8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCr8 -> Int -> Int -> PixelYCbCr8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYCbCr8) -> Int -> PixelYCbCr8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCr8) -> Int -> m PixelYCbCr8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCr8) -> Int -> PixelYCbCr8 -> m () Source #

Pixel PixelYCbCrK8 Source # |

Instance details

Defined in Codec.Picture.Types

Associated Types

type PixelBaseComponent PixelYCbCrK8 Source #

Methods

mixWith :: (Int -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> PixelYCbCrK8 -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

mixWithAlpha :: (Int -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> (PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> PixelYCbCrK8 -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

pixelOpacity :: PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8 Source #

componentCount :: PixelYCbCrK8 -> Int Source #

colorMap :: (PixelBaseComponent PixelYCbCrK8 -> PixelBaseComponent PixelYCbCrK8) -> PixelYCbCrK8 -> PixelYCbCrK8 Source #

pixelBaseIndex :: Image PixelYCbCrK8 -> Int -> Int -> Int Source #

mutablePixelBaseIndex :: MutableImage s PixelYCbCrK8 -> Int -> Int -> Int Source #

pixelAt :: Image PixelYCbCrK8 -> Int -> Int -> PixelYCbCrK8 Source #

readPixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCrK8 -> Int -> Int -> m PixelYCbCrK8 Source #

writePixel :: PrimMonad m => MutableImage (PrimState m) PixelYCbCrK8 -> Int -> Int -> PixelYCbCrK8 -> m () Source #

unsafePixelAt :: Vector (PixelBaseComponent PixelYCbCrK8) -> Int -> PixelYCbCrK8 Source #

unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCrK8) -> Int -> m PixelYCbCrK8 Source #

unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelYCbCrK8) -> Int -> PixelYCbCrK8 -> m () Source #

The following graph describe the differents way to convert between pixel types,

- Nodes describe pixel type
- Arrows describe functions

class (Pixel a, Pixel b) => ColorSpaceConvertible a b where Source #

This class abstract colorspace conversion. This conversion can be lossy, which ColorConvertible cannot

Minimal complete definition

convertPixel

Methods

convertPixel :: a -> b Source #

Pass a pixel from a colorspace (say RGB) to the second one (say YCbCr)

convertImage :: Image a -> Image b Source #

Helper function to convert a whole image by taking a copy it.

#### Instances

Instances details

ColorSpaceConvertible PixelCMYK16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelCMYK16 -> PixelRGB16 Source # convertImage :: Image PixelCMYK16 -> Image PixelRGB16 Source #
ColorSpaceConvertible PixelCMYK8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelCMYK8 -> PixelRGB8 Source # convertImage :: Image PixelCMYK8 -> Image PixelRGB8 Source #
ColorSpaceConvertible PixelRGB16 PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB16 -> PixelCMYK16 Source # convertImage :: Image PixelRGB16 -> Image PixelCMYK16 Source #
ColorSpaceConvertible PixelRGB8 PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB8 -> PixelCMYK8 Source # convertImage :: Image PixelRGB8 -> Image PixelCMYK8 Source #
ColorSpaceConvertible PixelRGB8 PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelRGB8 -> PixelYCbCr8 Source # convertImage :: Image PixelRGB8 -> Image PixelYCbCr8 Source #
ColorSpaceConvertible PixelYCbCr8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCr8 -> PixelRGB8 Source # convertImage :: Image PixelYCbCr8 -> Image PixelRGB8 Source #
ColorSpaceConvertible PixelYCbCrK8 PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelCMYK8 Source # convertImage :: Image PixelYCbCrK8 -> Image PixelCMYK8 Source #
ColorSpaceConvertible PixelYCbCrK8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelRGB8 Source # convertImage :: Image PixelYCbCrK8 -> Image PixelRGB8 Source #
Pixel a => ColorSpaceConvertible a a Source # |
Instance details Defined in Codec.Picture.Types Methods convertPixel :: a -> a Source # convertImage :: Image a -> Image a Source #

class (Pixel a, Pixel (PixelBaseComponent a)) => LumaPlaneExtractable a where Source #

Helper class to help extract a luma plane out of an image or a pixel

Minimal complete definition

computeLuma

Methods

computeLuma :: a -> PixelBaseComponent a Source #

Compute the luminance part of a pixel

extractLumaPlane :: Image a -> Image (PixelBaseComponent a) Source #

Extract a luma plane out of an image. This method is in the typeclass to help performant implementation.

    jpegToGrayScale :: FilePath -> FilePath -> IO ()
    jpegToGrayScale source dest

#### Instances

Instances details

LumaPlaneExtractable Pixel16 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: Pixel16 -> PixelBaseComponent Pixel16 Source # extractLumaPlane :: Image Pixel16 -> Image (PixelBaseComponent Pixel16) Source #
LumaPlaneExtractable Pixel32 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: Pixel32 -> PixelBaseComponent Pixel32 Source # extractLumaPlane :: Image Pixel32 -> Image (PixelBaseComponent Pixel32) Source #
LumaPlaneExtractable Pixel8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: Pixel8 -> PixelBaseComponent Pixel8 Source # extractLumaPlane :: Image Pixel8 -> Image (PixelBaseComponent Pixel8) Source #
LumaPlaneExtractable PixelF Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelF -> PixelBaseComponent PixelF Source # extractLumaPlane :: Image PixelF -> Image (PixelBaseComponent PixelF) Source #
LumaPlaneExtractable PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGB16 -> PixelBaseComponent PixelRGB16 Source # extractLumaPlane :: Image PixelRGB16 -> Image (PixelBaseComponent PixelRGB16) Source #
LumaPlaneExtractable PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGB8 -> PixelBaseComponent PixelRGB8 Source # extractLumaPlane :: Image PixelRGB8 -> Image (PixelBaseComponent PixelRGB8) Source #
LumaPlaneExtractable PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source # extractLumaPlane :: Image PixelRGBA8 -> Image (PixelBaseComponent PixelRGBA8) Source #
LumaPlaneExtractable PixelRGBF Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelRGBF -> PixelBaseComponent PixelRGBF Source # extractLumaPlane :: Image PixelRGBF -> Image (PixelBaseComponent PixelRGBF) Source #
LumaPlaneExtractable PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelYA8 -> PixelBaseComponent PixelYA8 Source # extractLumaPlane :: Image PixelYA8 -> Image (PixelBaseComponent PixelYA8) Source #
LumaPlaneExtractable PixelYCbCr8 Source # |
Instance details Defined in Codec.Picture.Types Methods computeLuma :: PixelYCbCr8 -> PixelBaseComponent PixelYCbCr8 Source # extractLumaPlane :: Image PixelYCbCr8 -> Image (PixelBaseComponent PixelYCbCr8) Source #

class (Pixel a, Pixel b) => TransparentPixel a b | a -> b where Source #

Class modeling transparent pixel, should provide a method to combine transparent pixels

Methods

dropTransparency :: a -> b Source #

Just return the opaque pixel value

getTransparency :: a -> PixelBaseComponent a Source #

Deprecated: please use `pixelOpacity` instead

access the transparency (alpha layer) of a given transparent pixel type.

#### Instances

Instances details

TransparentPixel PixelRGBA16 PixelRGB16 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA16 -> PixelRGB16 Source # getTransparency :: PixelRGBA16 -> PixelBaseComponent PixelRGBA16 Source #
TransparentPixel PixelRGBA8 PixelRGB8 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA8 -> PixelRGB8 Source # getTransparency :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 Source #
TransparentPixel PixelYA16 Pixel16 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelYA16 -> Pixel16 Source # getTransparency :: PixelYA16 -> PixelBaseComponent PixelYA16 Source #
TransparentPixel PixelYA8 Pixel8 Source # |
Instance details Defined in Codec.Picture.Types Methods dropTransparency :: PixelYA8 -> Pixel8 Source # getTransparency :: PixelYA8 -> PixelBaseComponent PixelYA8 Source #

# Helper functions

pixelMap :: forall a b. (Pixel a, Pixel b) => (a -> b) -> Image a -> Image b Source #

`map` equivalent for an image, working at the pixel level. Little example : a brightness function for an rgb image

    brightnessRGB8 :: Int -> Image PixelRGB8 -> Image PixelRGB8
    brightnessRGB8 add = pixelMap brightFunction
         where up v = fromIntegral (fromIntegral v + add)
               brightFunction (PixelRGB8 r g b) =
                       PixelRGB8 (up r) (up g) (up b)

pixelMapXY :: forall a b. (Pixel a, Pixel b) => (Int -> Int -> a -> b) -> Image a -> Image b Source #

Just like `pixelMap` only the function takes the pixel coordinates as additional parameters.

pixelFold :: forall acc pixel. Pixel pixel => (acc -> Int -> Int -> pixel -> acc) -> acc -> Image pixel -> acc Source #

Fold over the pixel of an image with a raster scan order: from top to bottom, left to right

pixelFoldM Source #

Arguments

:: (Pixel pixel, Monad m) |
=> (acc -> Int -> Int -> pixel -> m acc) | monadic mapping function
-> acc | Initial state
-> Image pixel | Image to fold over
-> m acc |

Fold over the pixel of an image with a raster scan order: from top to bottom, left to right, carrying out a state

pixelFoldMap :: forall m px. (Pixel px, Monoid m) => (px -> m) -> Image px -> m Source #

Fold over the pixel of an image with a raster scan order: from top to bottom, left to right. This functions is analog to the foldMap from the `Foldable` typeclass, but due to the Pixel constraint, Image cannot be made an instance of it.

dynamicMap :: (forall pixel. Pixel pixel => Image pixel -> a) -> DynamicImage -> a Source #

Helper function to help extract information from dynamic image. To get the width of a dynamic image, you can use the following snippet:

    dynWidth :: DynamicImage -> Int
    dynWidth img = dynamicMap imageWidth img

dynamicPixelMap :: (forall pixel. Pixel pixel => Image pixel -> Image pixel) -> DynamicImage -> DynamicImage Source #

Equivalent of the `pixelMap` function for the dynamic images. You can perform pixel colorspace independant operations with this function.

For instance, if you want to extract a square crop of any image, without caring about colorspace, you can use the following snippet.

    dynSquare :: DynamicImage -> DynamicImage
    dynSquare = dynamicPixelMap squareImage

    squareImage :: Pixel a => Image a -> Image a
    squareImage img = generateImage (\x y -> pixelAt img x y) edge edge
       where edge = min (imageWidth img) (imageHeight img)

palettedToTrueColor :: PalettedImage -> DynamicImage Source #

Flatten a PalettedImage to a DynamicImage

palettedAsImage :: Palette' px -> Image px Source #

Convert a palette to an image. Used mainly for backward compatibility.

dropAlphaLayer :: TransparentPixel a b => Image a -> Image b Source #

For any image with an alpha component (transparency), drop it, returning a pure opaque image.

withImage Source #

Arguments

:: forall m pixel. (Pixel pixel, PrimMonad m) |
=> Int | Image width
-> Int | Image height
-> (Int -> Int -> m pixel) | Generating functions
-> m (Image pixel) |

Create an image using a monadic initializer function. The function will receive values from 0 to width-1 for the x parameter and 0 to height-1 for the y parameter. The coordinates 0,0 are the upper left corner of the image, and (width-1, height-1) the lower right corner.

The function is called for each pixel in the line from left to right (0 to width - 1) and for each line (0 to height - 1).

zipPixelComponent3 :: forall px. Storable (PixelBaseComponent px) => (PixelBaseComponent px -> PixelBaseComponent px -> PixelBaseComponent px -> PixelBaseComponent px) -> Image px -> Image px -> Image px -> Image px Source #

Combine, pixel by pixel and component by component the values of 3 different images. Usage example:

    averageBrightNess c1 c2 c3 = clamp $ toInt c1 + toInt c2 + toInt c3
      where clamp = fromIntegral . min 0 . max 255
            toInt :: a -> Int
            toInt = fromIntegral
    ziPixelComponent3 averageBrightNess img1 img2 img3

generateImage Source #

Arguments

:: forall px. Pixel px |
=> (Int -> Int -> px) | Generating function, with `x` and `y` params.
-> Int | Width in pixels
-> Int | Height in pixels
-> Image px |

Create an image given a function to generate pixels. The function will receive values from 0 to width-1 for the x parameter and 0 to height-1 for the y parameter. The coordinates 0,0 are the upper left corner of the image, and (width-1, height-1) the lower right corner.

for example, to create a small gradient image:

    imageCreator :: String -> IO ()
    imageCreator path = writePng path $ generateImage pixelRenderer 250 300
       where pixelRenderer x y = PixelRGB8 (fromIntegral x) (fromIntegral y) 128

generateFoldImage Source #

Arguments

:: forall a acc. Pixel a |
=> (acc -> Int -> Int -> (acc, a)) | Function taking the state, x and y
-> acc | Initial state
-> Int | Width in pixels
-> Int | Height in pixels
-> (acc, Image a) |

Create an image given a function to generate pixels. The function will receive values from 0 to width-1 for the x parameter and 0 to height-1 for the y parameter. The coordinates 0,0 are the upper left corner of the image, and (width-1, height-1) the lower right corner.

the acc parameter is a user defined one.

The function is called for each pixel in the line from left to right (0 to width - 1) and for each line (0 to height - 1).

gammaCorrection Source #

Arguments

:: PixelF | Gamma value, should be between 0.5 and 3.0
-> Image PixelRGBF | Image to treat.
-> Image PixelRGBF |

Perform a gamma correction for an image with HDR pixels.

toneMapping Source #

Arguments

:: PixelF | Exposure parameter
-> Image PixelRGBF | Image to treat.
-> Image PixelRGBF |

Perform a tone mapping operation on an High dynamic range image.

# Color plane extraction

class ColorPlane pixel planeToken Source #

Class used to describle plane present in the pixel type. If a pixel has a plane description associated, you can use the plane name to extract planes independently.

Minimal complete definition

toComponentIndex

#### Instances

Instances details

ColorPlane PixelCMYK16 PlaneBlack Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneBlack -> Int
ColorPlane PixelCMYK16 PlaneCyan Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneCyan -> Int
ColorPlane PixelCMYK16 PlaneMagenta Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneMagenta -> Int
ColorPlane PixelCMYK16 PlaneYellow Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneYellow -> Int
ColorPlane PixelCMYK8 PlaneBlack Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneBlack -> Int
ColorPlane PixelCMYK8 PlaneCyan Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneCyan -> Int
ColorPlane PixelCMYK8 PlaneMagenta Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneMagenta -> Int
ColorPlane PixelCMYK8 PlaneYellow Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneYellow -> Int
ColorPlane PixelRGB16 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneBlue -> Int
ColorPlane PixelRGB16 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneGreen -> Int
ColorPlane PixelRGB16 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneRed -> Int
ColorPlane PixelRGB8 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneBlue -> Int
ColorPlane PixelRGB8 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneGreen -> Int
ColorPlane PixelRGB8 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneRed -> Int
ColorPlane PixelRGBA16 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneAlpha -> Int
ColorPlane PixelRGBA16 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneBlue -> Int
ColorPlane PixelRGBA16 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneGreen -> Int
ColorPlane PixelRGBA16 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneRed -> Int
ColorPlane PixelRGBA8 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneAlpha -> Int
ColorPlane PixelRGBA8 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneBlue -> Int
ColorPlane PixelRGBA8 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneGreen -> Int
ColorPlane PixelRGBA8 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneRed -> Int
ColorPlane PixelRGBF PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneBlue -> Int
ColorPlane PixelRGBF PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneGreen -> Int
ColorPlane PixelRGBF PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneRed -> Int
ColorPlane PixelYA16 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA16 -> PlaneAlpha -> Int
ColorPlane PixelYA16 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA16 -> PlaneLuma -> Int
ColorPlane PixelYA8 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA8 -> PlaneAlpha -> Int
ColorPlane PixelYA8 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA8 -> PlaneLuma -> Int
ColorPlane PixelYCbCr8 PlaneCb Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneCb -> Int
ColorPlane PixelYCbCr8 PlaneCr Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneCr -> Int
ColorPlane PixelYCbCr8 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneLuma -> Int

data PlaneRed Source #

Define the plane for the red color component

Constructors

PlaneRed |

#### Instances

Instances details

ColorPlane PixelRGB16 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneRed -> Int
ColorPlane PixelRGB8 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneRed -> Int
ColorPlane PixelRGBA16 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneRed -> Int
ColorPlane PixelRGBA8 PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneRed -> Int
ColorPlane PixelRGBF PlaneRed Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneRed -> Int

data PlaneGreen Source #

Define the plane for the green color component

Constructors

PlaneGreen |

#### Instances

Instances details

ColorPlane PixelRGB16 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneGreen -> Int
ColorPlane PixelRGB8 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneGreen -> Int
ColorPlane PixelRGBA16 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneGreen -> Int
ColorPlane PixelRGBA8 PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneGreen -> Int
ColorPlane PixelRGBF PlaneGreen Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneGreen -> Int

data PlaneBlue Source #

Define the plane for the blue color component

Constructors

PlaneBlue |

#### Instances

Instances details

ColorPlane PixelRGB16 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB16 -> PlaneBlue -> Int
ColorPlane PixelRGB8 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneBlue -> Int
ColorPlane PixelRGBA16 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneBlue -> Int
ColorPlane PixelRGBA8 PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneBlue -> Int
ColorPlane PixelRGBF PlaneBlue Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBF -> PlaneBlue -> Int

data PlaneAlpha Source #

Define the plane for the alpha (transparency) component

Constructors

PlaneAlpha |

#### Instances

Instances details

ColorPlane PixelRGBA16 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA16 -> PlaneAlpha -> Int
ColorPlane PixelRGBA8 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGBA8 -> PlaneAlpha -> Int
ColorPlane PixelYA16 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA16 -> PlaneAlpha -> Int
ColorPlane PixelYA8 PlaneAlpha Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA8 -> PlaneAlpha -> Int

data PlaneLuma Source #

Define the plane for the luma component

Constructors

PlaneLuma |

#### Instances

Instances details

ColorPlane PixelYA16 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA16 -> PlaneLuma -> Int
ColorPlane PixelYA8 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYA8 -> PlaneLuma -> Int
ColorPlane PixelYCbCr8 PlaneLuma Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneLuma -> Int

data PlaneCr Source #

Define the plane for the Cr component

Constructors

PlaneCr |

#### Instances

Instances details

ColorPlane PixelYCbCr8 PlaneCr Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneCr -> Int

data PlaneCb Source #

Define the plane for the Cb component

Constructors

PlaneCb |

#### Instances

Instances details

ColorPlane PixelYCbCr8 PlaneCb Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelYCbCr8 -> PlaneCb -> Int

data PlaneCyan Source #

Define plane for the cyan component of the CMYK color space.

Constructors

PlaneCyan |

#### Instances

Instances details

ColorPlane PixelCMYK16 PlaneCyan Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneCyan -> Int
ColorPlane PixelCMYK8 PlaneCyan Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneCyan -> Int

data PlaneMagenta Source #

Define plane for the magenta component of the CMYK color space.

Constructors

PlaneMagenta |

#### Instances

Instances details

ColorPlane PixelCMYK16 PlaneMagenta Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneMagenta -> Int
ColorPlane PixelCMYK8 PlaneMagenta Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneMagenta -> Int

data PlaneYellow Source #

Define plane for the yellow component of the CMYK color space.

Constructors

PlaneYellow |

#### Instances

Instances details

ColorPlane PixelCMYK16 PlaneYellow Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneYellow -> Int
ColorPlane PixelCMYK8 PlaneYellow Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneYellow -> Int

data PlaneBlack Source #

Define plane for the black component of the CMYK color space.

Constructors

PlaneBlack |

#### Instances

Instances details

ColorPlane PixelCMYK16 PlaneBlack Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK16 -> PlaneBlack -> Int
ColorPlane PixelCMYK8 PlaneBlack Source # |
Instance details Defined in Codec.Picture.Types Methods toComponentIndex :: PixelCMYK8 -> PlaneBlack -> Int

extractComponent :: forall px plane. (Pixel px, Pixel (PixelBaseComponent px), PixelBaseComponent (PixelBaseComponent px) ~ PixelBaseComponent px, ColorPlane px plane) => plane -> Image px -> Image (PixelBaseComponent px) Source #

Extract a color plane from an image given a present plane in the image examples:

     extractRedPlane :: Image PixelRGB8 -> Image Pixel8
     extractRedPlane = extractComponent PlaneRed

unsafeExtractComponent Source #

Arguments

:: forall a. (Pixel a, Pixel (PixelBaseComponent a), PixelBaseComponent (PixelBaseComponent a) ~ PixelBaseComponent a) |
=> Int | The component index, beginning at 0 ending at (componentCount - 1)
-> Image a | Source image
-> Image (PixelBaseComponent a) |

Extract a plane of an image. Returns the requested color component as a greyscale image.

If you ask for a component out of bound, the `error` function will be called.

# Packeable writing (unsafe but faster)

class PackeablePixel a where Source #

This typeclass exist for performance reason, it allow to pack a pixel value to a simpler "primitive" data type to allow faster writing to moemory.

Associated Types

type PackedRepresentation a Source #

Primitive type asociated to the current pixel It's Word32 for PixelRGBA8 for instance

Methods

packPixel :: a -> PackedRepresentation a Source #

The packing function, allowing to transform to a primitive.

unpackPixel :: PackedRepresentation a -> a Source #

Inverse transformation, to speed up reading

#### Instances

Instances details

PackeablePixel Pixel16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation Pixel16 Source # Methods packPixel :: Pixel16 -> PackedRepresentation Pixel16 Source # unpackPixel :: PackedRepresentation Pixel16 -> Pixel16 Source #
PackeablePixel Pixel32 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation Pixel32 Source # Methods packPixel :: Pixel32 -> PackedRepresentation Pixel32 Source # unpackPixel :: PackedRepresentation Pixel32 -> Pixel32 Source #
PackeablePixel Pixel8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation Pixel8 Source # Methods packPixel :: Pixel8 -> PackedRepresentation Pixel8 Source # unpackPixel :: PackedRepresentation Pixel8 -> Pixel8 Source #
PackeablePixel PixelCMYK16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelCMYK16 Source # Methods packPixel :: PixelCMYK16 -> PackedRepresentation PixelCMYK16 Source # unpackPixel :: PackedRepresentation PixelCMYK16 -> PixelCMYK16 Source #
PackeablePixel PixelCMYK8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelCMYK8 Source # Methods packPixel :: PixelCMYK8 -> PackedRepresentation PixelCMYK8 Source # unpackPixel :: PackedRepresentation PixelCMYK8 -> PixelCMYK8 Source #
PackeablePixel PixelF Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelF Source # Methods packPixel :: PixelF -> PackedRepresentation PixelF Source # unpackPixel :: PackedRepresentation PixelF -> PixelF Source #
PackeablePixel PixelRGBA16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelRGBA16 Source # Methods packPixel :: PixelRGBA16 -> PackedRepresentation PixelRGBA16 Source # unpackPixel :: PackedRepresentation PixelRGBA16 -> PixelRGBA16 Source #
PackeablePixel PixelRGBA8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelRGBA8 Source # Methods packPixel :: PixelRGBA8 -> PackedRepresentation PixelRGBA8 Source # unpackPixel :: PackedRepresentation PixelRGBA8 -> PixelRGBA8 Source #
PackeablePixel PixelYA16 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelYA16 Source # Methods packPixel :: PixelYA16 -> PackedRepresentation PixelYA16 Source # unpackPixel :: PackedRepresentation PixelYA16 -> PixelYA16 Source #
PackeablePixel PixelYA8 Source # |
Instance details Defined in Codec.Picture.Types Associated Types type PackedRepresentation PixelYA8 Source # Methods packPixel :: PixelYA8 -> PackedRepresentation PixelYA8 Source # unpackPixel :: PackedRepresentation PixelYA8 -> PixelYA8 Source #

fillImageWith :: (Pixel px, PackeablePixel px, PrimMonad m, Storable (PackedRepresentation px)) => MutableImage (PrimState m) px -> px -> m () Source #

This function will fill an image with a simple packeable pixel. It will be faster than any unsafeWritePixel.

readPackedPixelAt Source #

Arguments

:: forall m px. (Pixel px, PackeablePixel px, Storable (PackedRepresentation px), PrimMonad m) |
=> MutableImage (PrimState m) px | Image to read from
-> Int | Index in (PixelBaseComponent px) count
-> m px |

Read a packeable pixel from an image. Equivalent to unsafeReadPixel

writePackedPixelAt Source #

Arguments

:: (Pixel px, PackeablePixel px, Storable (PackedRepresentation px), PrimMonad m) |
=> MutableImage (PrimState m) px | Image to write into
-> Int | Index in (PixelBaseComponent px) count
-> px | Pixel to write
-> m () |

Write a packeable pixel into an image. equivalent to unsafeWritePixel.

unsafeWritePixelBetweenAt Source #

Arguments

:: (PrimMonad m, Pixel px, PackeablePixel px, Storable (PackedRepresentation px)) |
=> MutableImage (PrimState m) px | Image to write into
-> px | Pixel to write
-> Int | Start index in pixel base component
-> Int | pixel count of pixel to write
-> m () |

Fill a packeable pixel between two bounds.