hip-1.1.0.1: Haskell Image Processing (HIP) Library.

Copyright(c) Alexey Kuleshevich 2016
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Graphics.Image.ColorSpace

Contents

Description

 

Synopsis

ColorSpace

class (Eq cs, Enum cs, Show cs, Typeable cs) => ColorSpace cs Source #

This class has all included color spaces installed into it and is also intended for implementing any other possible custom color spaces. Every instance of this class automatically installs an associated Pixel into Num, Fractional, Floating, Functor, Applicative and Foldable, which in turn make it possible to be used by the rest of the library.

Minimal complete definition

fromChannel, toElt, fromElt, getPxCh, chOp, pxOp, chApp, pxFoldMap, csColour

Associated Types

data Pixel cs e Source #

A concrete Pixel representation for a particular color space.

Instances

ColorSpace YCbCrA Source # 

Associated Types

type PixelElt YCbCrA e :: * Source #

data Pixel YCbCrA e :: * Source #

ColorSpace YCbCr Source # 

Associated Types

type PixelElt YCbCr e :: * Source #

data Pixel YCbCr e :: * Source #

Methods

fromChannel :: e -> Pixel YCbCr e Source #

toElt :: Pixel YCbCr e -> PixelElt YCbCr e Source #

fromElt :: PixelElt YCbCr e -> Pixel YCbCr e Source #

getPxCh :: Pixel YCbCr e -> YCbCr -> e Source #

chOp :: (YCbCr -> e' -> e) -> Pixel YCbCr e' -> Pixel YCbCr e Source #

pxOp :: (e' -> e) -> Pixel YCbCr e' -> Pixel YCbCr e Source #

chApp :: Pixel YCbCr (e' -> e) -> Pixel YCbCr e' -> Pixel YCbCr e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel YCbCr e -> m Source #

csColour :: YCbCr -> AlphaColour Double Source #

ColorSpace RGBA Source # 

Associated Types

type PixelElt RGBA e :: * Source #

data Pixel RGBA e :: * Source #

Methods

fromChannel :: e -> Pixel RGBA e Source #

toElt :: Pixel RGBA e -> PixelElt RGBA e Source #

fromElt :: PixelElt RGBA e -> Pixel RGBA e Source #

getPxCh :: Pixel RGBA e -> RGBA -> e Source #

chOp :: (RGBA -> e' -> e) -> Pixel RGBA e' -> Pixel RGBA e Source #

pxOp :: (e' -> e) -> Pixel RGBA e' -> Pixel RGBA e Source #

chApp :: Pixel RGBA (e' -> e) -> Pixel RGBA e' -> Pixel RGBA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel RGBA e -> m Source #

csColour :: RGBA -> AlphaColour Double Source #

ColorSpace RGB Source # 

Associated Types

type PixelElt RGB e :: * Source #

data Pixel RGB e :: * Source #

Methods

fromChannel :: e -> Pixel RGB e Source #

toElt :: Pixel RGB e -> PixelElt RGB e Source #

fromElt :: PixelElt RGB e -> Pixel RGB e Source #

getPxCh :: Pixel RGB e -> RGB -> e Source #

chOp :: (RGB -> e' -> e) -> Pixel RGB e' -> Pixel RGB e Source #

pxOp :: (e' -> e) -> Pixel RGB e' -> Pixel RGB e Source #

chApp :: Pixel RGB (e' -> e) -> Pixel RGB e' -> Pixel RGB e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel RGB e -> m Source #

csColour :: RGB -> AlphaColour Double Source #

ColorSpace YA Source # 

Associated Types

type PixelElt YA e :: * Source #

data Pixel YA e :: * Source #

Methods

fromChannel :: e -> Pixel YA e Source #

toElt :: Pixel YA e -> PixelElt YA e Source #

fromElt :: PixelElt YA e -> Pixel YA e Source #

getPxCh :: Pixel YA e -> YA -> e Source #

chOp :: (YA -> e' -> e) -> Pixel YA e' -> Pixel YA e Source #

pxOp :: (e' -> e) -> Pixel YA e' -> Pixel YA e Source #

chApp :: Pixel YA (e' -> e) -> Pixel YA e' -> Pixel YA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel YA e -> m Source #

csColour :: YA -> AlphaColour Double Source #

ColorSpace Y Source # 

Associated Types

type PixelElt Y e :: * Source #

data Pixel Y e :: * Source #

Methods

fromChannel :: e -> Pixel Y e Source #

toElt :: Pixel Y e -> PixelElt Y e Source #

fromElt :: PixelElt Y e -> Pixel Y e Source #

getPxCh :: Pixel Y e -> Y -> e Source #

chOp :: (Y -> e' -> e) -> Pixel Y e' -> Pixel Y e Source #

pxOp :: (e' -> e) -> Pixel Y e' -> Pixel Y e Source #

chApp :: Pixel Y (e' -> e) -> Pixel Y e' -> Pixel Y e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel Y e -> m Source #

csColour :: Y -> AlphaColour Double Source #

ColorSpace HSIA Source # 

Associated Types

type PixelElt HSIA e :: * Source #

data Pixel HSIA e :: * Source #

Methods

fromChannel :: e -> Pixel HSIA e Source #

toElt :: Pixel HSIA e -> PixelElt HSIA e Source #

fromElt :: PixelElt HSIA e -> Pixel HSIA e Source #

getPxCh :: Pixel HSIA e -> HSIA -> e Source #

chOp :: (HSIA -> e' -> e) -> Pixel HSIA e' -> Pixel HSIA e Source #

pxOp :: (e' -> e) -> Pixel HSIA e' -> Pixel HSIA e Source #

chApp :: Pixel HSIA (e' -> e) -> Pixel HSIA e' -> Pixel HSIA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel HSIA e -> m Source #

csColour :: HSIA -> AlphaColour Double Source #

ColorSpace HSI Source # 

Associated Types

type PixelElt HSI e :: * Source #

data Pixel HSI e :: * Source #

Methods

fromChannel :: e -> Pixel HSI e Source #

toElt :: Pixel HSI e -> PixelElt HSI e Source #

fromElt :: PixelElt HSI e -> Pixel HSI e Source #

getPxCh :: Pixel HSI e -> HSI -> e Source #

chOp :: (HSI -> e' -> e) -> Pixel HSI e' -> Pixel HSI e Source #

pxOp :: (e' -> e) -> Pixel HSI e' -> Pixel HSI e Source #

chApp :: Pixel HSI (e' -> e) -> Pixel HSI e' -> Pixel HSI e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel HSI e -> m Source #

csColour :: HSI -> AlphaColour Double Source #

ColorSpace Gray Source # 

Associated Types

type PixelElt Gray e :: * Source #

data Pixel Gray e :: * Source #

Methods

fromChannel :: e -> Pixel Gray e Source #

toElt :: Pixel Gray e -> PixelElt Gray e Source #

fromElt :: PixelElt Gray e -> Pixel Gray e Source #

getPxCh :: Pixel Gray e -> Gray -> e Source #

chOp :: (Gray -> e' -> e) -> Pixel Gray e' -> Pixel Gray e Source #

pxOp :: (e' -> e) -> Pixel Gray e' -> Pixel Gray e Source #

chApp :: Pixel Gray (e' -> e) -> Pixel Gray e' -> Pixel Gray e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel Gray e -> m Source #

csColour :: Gray -> AlphaColour Double Source #

ColorSpace CMYKA Source # 

Associated Types

type PixelElt CMYKA e :: * Source #

data Pixel CMYKA e :: * Source #

Methods

fromChannel :: e -> Pixel CMYKA e Source #

toElt :: Pixel CMYKA e -> PixelElt CMYKA e Source #

fromElt :: PixelElt CMYKA e -> Pixel CMYKA e Source #

getPxCh :: Pixel CMYKA e -> CMYKA -> e Source #

chOp :: (CMYKA -> e' -> e) -> Pixel CMYKA e' -> Pixel CMYKA e Source #

pxOp :: (e' -> e) -> Pixel CMYKA e' -> Pixel CMYKA e Source #

chApp :: Pixel CMYKA (e' -> e) -> Pixel CMYKA e' -> Pixel CMYKA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel CMYKA e -> m Source #

csColour :: CMYKA -> AlphaColour Double Source #

ColorSpace CMYK Source # 

Associated Types

type PixelElt CMYK e :: * Source #

data Pixel CMYK e :: * Source #

Methods

fromChannel :: e -> Pixel CMYK e Source #

toElt :: Pixel CMYK e -> PixelElt CMYK e Source #

fromElt :: PixelElt CMYK e -> Pixel CMYK e Source #

getPxCh :: Pixel CMYK e -> CMYK -> e Source #

chOp :: (CMYK -> e' -> e) -> Pixel CMYK e' -> Pixel CMYK e Source #

pxOp :: (e' -> e) -> Pixel CMYK e' -> Pixel CMYK e Source #

chApp :: Pixel CMYK (e' -> e) -> Pixel CMYK e' -> Pixel CMYK e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel CMYK e -> m Source #

csColour :: CMYK -> AlphaColour Double Source #

ColorSpace Binary Source # 

Associated Types

type PixelElt Binary e :: * Source #

data Pixel Binary e :: * Source #

class (ColorSpace (Opaque cs), ColorSpace cs) => Alpha cs Source #

A color space that supports transparency.

Minimal complete definition

getAlpha, addAlpha, dropAlpha, opaque

Associated Types

type Opaque cs Source #

An corresponding opaque version of this color space.

Instances

class Elevator e where Source #

A class with a set of convenient functions that allow for changing precision of channels within pixels, while scaling the values to keep them in an appropriate range.

>>> let rgb = PixelRGB 0.0 0.5 1.0 :: Pixel RGB Double
>>> toWord8 rgb
<RGB:(0|128|255)>

Minimal complete definition

toWord8, toWord16, toWord32, toWord64, toFloat, toDouble, fromDouble

Luma

data Y Source #

Luma or brightness, that is usually denoted as Y'.

Constructors

Y 

Instances

Enum Y Source # 

Methods

succ :: Y -> Y #

pred :: Y -> Y #

toEnum :: Int -> Y #

fromEnum :: Y -> Int #

enumFrom :: Y -> [Y] #

enumFromThen :: Y -> Y -> [Y] #

enumFromTo :: Y -> Y -> [Y] #

enumFromThenTo :: Y -> Y -> Y -> [Y] #

Eq Y Source # 

Methods

(==) :: Y -> Y -> Bool #

(/=) :: Y -> Y -> Bool #

Show Y Source # 

Methods

showsPrec :: Int -> Y -> ShowS #

show :: Y -> String #

showList :: [Y] -> ShowS #

ColorSpace Y Source # 

Associated Types

type PixelElt Y e :: * Source #

data Pixel Y e :: * Source #

Methods

fromChannel :: e -> Pixel Y e Source #

toElt :: Pixel Y e -> PixelElt Y e Source #

fromElt :: PixelElt Y e -> Pixel Y e Source #

getPxCh :: Pixel Y e -> Y -> e Source #

chOp :: (Y -> e' -> e) -> Pixel Y e' -> Pixel Y e Source #

pxOp :: (e' -> e) -> Pixel Y e' -> Pixel Y e Source #

chApp :: Pixel Y (e' -> e) -> Pixel Y e' -> Pixel Y e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel Y e -> m Source #

csColour :: Y -> AlphaColour Double Source #

Monad (Pixel Y) Source # 

Methods

(>>=) :: Pixel Y a -> (a -> Pixel Y b) -> Pixel Y b #

(>>) :: Pixel Y a -> Pixel Y b -> Pixel Y b #

return :: a -> Pixel Y a #

fail :: String -> Pixel Y a #

Array arr Y Double => Readable [Image arr Y Double] [GIF] Source # 
Array arr Y Word16 => Readable [Image arr Y Word16] [PGM] Source # 
Array arr Y Word8 => Readable [Image arr Y Word8] [PGM] Source # 

Methods

decode :: [PGM] -> ByteString -> Either String [Image arr Y Word8] Source #

Eq e => Eq (Pixel Y e) Source # 

Methods

(==) :: Pixel Y e -> Pixel Y e -> Bool #

(/=) :: Pixel Y e -> Pixel Y e -> Bool #

Ord e => Ord (Pixel Y e) Source # 

Methods

compare :: Pixel Y e -> Pixel Y e -> Ordering #

(<) :: Pixel Y e -> Pixel Y e -> Bool #

(<=) :: Pixel Y e -> Pixel Y e -> Bool #

(>) :: Pixel Y e -> Pixel Y e -> Bool #

(>=) :: Pixel Y e -> Pixel Y e -> Bool #

max :: Pixel Y e -> Pixel Y e -> Pixel Y e #

min :: Pixel Y e -> Pixel Y e -> Pixel Y e #

Show e => Show (Pixel Y e) Source # 

Methods

showsPrec :: Int -> Pixel Y e -> ShowS #

show :: Pixel Y e -> String #

showList :: [Pixel Y e] -> ShowS #

ManifestArray arr Y Double => Writable (Image arr Y Double) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Word16 => Writable (Image arr Y Word16) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr Y Word16 -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr Y Double => Writable (Image arr Y Double) TGA Source # 

Methods

encode :: TGA -> [SaveOption TGA] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TGA Source # 

Methods

encode :: TGA -> [SaveOption TGA] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr Y Double => Writable (Image arr Y Double) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Word16 => Writable (Image arr Y Word16) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr Y Word16 -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr Y Double => Writable (Image arr Y Double) JPG Source # 

Methods

encode :: JPG -> [SaveOption JPG] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) JPG Source # 

Methods

encode :: JPG -> [SaveOption JPG] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr Y Double => Writable (Image arr Y Double) HDR Source # 

Methods

encode :: HDR -> [SaveOption HDR] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Double => Writable (Image arr Y Double) GIF Source # 

Methods

encode :: GIF -> [SaveOption GIF] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Double => Writable (Image arr Y Double) BMP Source # 

Methods

encode :: BMP -> [SaveOption BMP] -> Image arr Y Double -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) BMP Source # 

Methods

encode :: BMP -> [SaveOption BMP] -> Image arr Y Word8 -> ByteString Source #

Array arr Y Double => Readable (Image arr Y Double) TIF Source # 
Array arr Y Word16 => Readable (Image arr Y Word16) TIF Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) TIF Source # 
Array arr Y Double => Readable (Image arr Y Double) TGA Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) TGA Source # 
Array arr Y Double => Readable (Image arr Y Double) PNG Source # 
Array arr Y Word16 => Readable (Image arr Y Word16) PNG Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) PNG Source # 
Array arr Y Double => Readable (Image arr Y Double) JPG Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) JPG Source # 
Array arr Y Double => Readable (Image arr Y Double) HDR Source # 
Array arr Y Double => Readable (Image arr Y Double) GIF Source # 
Array arr Y Double => Readable (Image arr Y Double) BMP Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) BMP Source # 
Array arr Y Word16 => Readable (Image arr Y Word16) PGM Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) PGM Source # 
Array arr Y Double => Readable (Image arr Y Double) PPM Source # 
Array arr Y Double => Readable (Image arr Y Double) PGM Source # 
Array arr Y Double => Readable (Image arr Y Double) PBM Source # 
data Pixel Y Source # 
data Pixel Y = PixelY !e
type PixelElt Y e Source # 
type PixelElt Y e = e

data YA Source #

Luma with Alpha channel.

Constructors

YA

Luma

AlphaYA

Alpha channel

Instances

Enum YA Source # 

Methods

succ :: YA -> YA #

pred :: YA -> YA #

toEnum :: Int -> YA #

fromEnum :: YA -> Int #

enumFrom :: YA -> [YA] #

enumFromThen :: YA -> YA -> [YA] #

enumFromTo :: YA -> YA -> [YA] #

enumFromThenTo :: YA -> YA -> YA -> [YA] #

Eq YA Source # 

Methods

(==) :: YA -> YA -> Bool #

(/=) :: YA -> YA -> Bool #

Show YA Source # 

Methods

showsPrec :: Int -> YA -> ShowS #

show :: YA -> String #

showList :: [YA] -> ShowS #

Alpha YA Source # 

Associated Types

type Opaque YA :: * Source #

ColorSpace YA Source # 

Associated Types

type PixelElt YA e :: * Source #

data Pixel YA e :: * Source #

Methods

fromChannel :: e -> Pixel YA e Source #

toElt :: Pixel YA e -> PixelElt YA e Source #

fromElt :: PixelElt YA e -> Pixel YA e Source #

getPxCh :: Pixel YA e -> YA -> e Source #

chOp :: (YA -> e' -> e) -> Pixel YA e' -> Pixel YA e Source #

pxOp :: (e' -> e) -> Pixel YA e' -> Pixel YA e Source #

chApp :: Pixel YA (e' -> e) -> Pixel YA e' -> Pixel YA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel YA e -> m Source #

csColour :: YA -> AlphaColour Double Source #

Array arr YA Double => Readable [Image arr YA Double] [GIF] Source # 
Eq e => Eq (Pixel YA e) Source # 

Methods

(==) :: Pixel YA e -> Pixel YA e -> Bool #

(/=) :: Pixel YA e -> Pixel YA e -> Bool #

Show e => Show (Pixel YA e) Source # 

Methods

showsPrec :: Int -> Pixel YA e -> ShowS #

show :: Pixel YA e -> String #

showList :: [Pixel YA e] -> ShowS #

ManifestArray arr YA Double => Writable (Image arr YA Double) TIF Source # 
ManifestArray arr YA Word16 => Writable (Image arr YA Word16) TIF Source # 
ManifestArray arr YA Word8 => Writable (Image arr YA Word8) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr YA Word8 -> ByteString Source #

ManifestArray arr YA Double => Writable (Image arr YA Double) TGA Source # 
ManifestArray arr YA Double => Writable (Image arr YA Double) PNG Source # 
ManifestArray arr YA Word16 => Writable (Image arr YA Word16) PNG Source # 
ManifestArray arr YA Word8 => Writable (Image arr YA Word8) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr YA Word8 -> ByteString Source #

ManifestArray arr YA Double => Writable (Image arr YA Double) JPG Source # 
ManifestArray arr YA Double => Writable (Image arr YA Double) HDR Source # 
ManifestArray arr YA Double => Writable (Image arr YA Double) GIF Source # 
ManifestArray arr YA Double => Writable (Image arr YA Double) BMP Source # 
Array arr YA Double => Readable (Image arr YA Double) TIF Source # 
Array arr YA Word16 => Readable (Image arr YA Word16) TIF Source # 
Array arr YA Word8 => Readable (Image arr YA Word8) TIF Source # 
Array arr YA Double => Readable (Image arr YA Double) TGA Source # 
Array arr YA Double => Readable (Image arr YA Double) PNG Source # 
Array arr YA Word16 => Readable (Image arr YA Word16) PNG Source # 
Array arr YA Word8 => Readable (Image arr YA Word8) PNG Source # 
Array arr YA Double => Readable (Image arr YA Double) JPG Source # 
Array arr YA Word8 => Readable (Image arr YA Word8) JPG Source # 
Array arr YA Double => Readable (Image arr YA Double) HDR Source # 
Array arr YA Double => Readable (Image arr YA Double) GIF Source # 
Array arr YA Double => Readable (Image arr YA Double) BMP Source # 
Array arr YA Double => Readable (Image arr YA Double) PPM Source # 
type Opaque YA Source # 
type Opaque YA = Y
data Pixel YA Source # 
data Pixel YA = PixelYA !e !e
type PixelElt YA e Source # 
type PixelElt YA e = (e, e)

class ColorSpace cs => ToY cs where Source #

Conversion to Luma color space.

Minimal complete definition

toPixelY

Methods

toPixelY :: Pixel cs Double -> Pixel Y Double Source #

Convert a pixel to Luma pixel.

toImageY :: (Array arr cs Double, Array arr Y Double) => Image arr cs Double -> Image arr Y Double Source #

Convert an image to Luma image.

class (ToY (Opaque cs), Alpha cs) => ToYA cs where Source #

Conversion to Luma from another color space with Alpha channel.

Methods

toPixelYA :: Pixel cs Double -> Pixel YA Double Source #

Convert a pixel to Luma pixel with Alpha.

toImageYA :: (Array arr cs Double, Array arr YA Double) => Image arr cs Double -> Image arr YA Double Source #

Convert an image to Luma image with Alpha.

RGB

data RGB Source #

Red, Green and Blue color space.

Constructors

RedRGB 
GreenRGB 
BlueRGB 

Instances

Enum RGB Source # 

Methods

succ :: RGB -> RGB #

pred :: RGB -> RGB #

toEnum :: Int -> RGB #

fromEnum :: RGB -> Int #

enumFrom :: RGB -> [RGB] #

enumFromThen :: RGB -> RGB -> [RGB] #

enumFromTo :: RGB -> RGB -> [RGB] #

enumFromThenTo :: RGB -> RGB -> RGB -> [RGB] #

Eq RGB Source # 

Methods

(==) :: RGB -> RGB -> Bool #

(/=) :: RGB -> RGB -> Bool #

Show RGB Source # 

Methods

showsPrec :: Int -> RGB -> ShowS #

show :: RGB -> String #

showList :: [RGB] -> ShowS #

ColorSpace RGB Source # 

Associated Types

type PixelElt RGB e :: * Source #

data Pixel RGB e :: * Source #

Methods

fromChannel :: e -> Pixel RGB e Source #

toElt :: Pixel RGB e -> PixelElt RGB e Source #

fromElt :: PixelElt RGB e -> Pixel RGB e Source #

getPxCh :: Pixel RGB e -> RGB -> e Source #

chOp :: (RGB -> e' -> e) -> Pixel RGB e' -> Pixel RGB e Source #

pxOp :: (e' -> e) -> Pixel RGB e' -> Pixel RGB e Source #

chApp :: Pixel RGB (e' -> e) -> Pixel RGB e' -> Pixel RGB e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel RGB e -> m Source #

csColour :: RGB -> AlphaColour Double Source #

ManifestArray arr RGB Double => Writable [(GifDelay, Image arr RGB Double)] [GIF] Source # 

Methods

encode :: [GIF] -> [SaveOption [GIF]] -> [(GifDelay, Image arr RGB Double)] -> ByteString Source #

ManifestArray arr RGB Word8 => Writable [(GifDelay, Image arr RGB Word8)] [GIF] Source # 

Methods

encode :: [GIF] -> [SaveOption [GIF]] -> [(GifDelay, Image arr RGB Word8)] -> ByteString Source #

Array arr RGB Double => Readable [Image arr RGB Double] [GIF] Source # 
Array arr RGB Word8 => Readable [Image arr RGB Word8] [GIF] Source # 
Array arr RGB Word16 => Readable [Image arr RGB Word16] [PPM] Source # 
Array arr RGB Word8 => Readable [Image arr RGB Word8] [PPM] Source # 
Eq e => Eq (Pixel RGB e) Source # 

Methods

(==) :: Pixel RGB e -> Pixel RGB e -> Bool #

(/=) :: Pixel RGB e -> Pixel RGB e -> Bool #

Show e => Show (Pixel RGB e) Source # 

Methods

showsPrec :: Int -> Pixel RGB e -> ShowS #

show :: Pixel RGB e -> String #

showList :: [Pixel RGB e] -> ShowS #

ManifestArray arr RGB Double => Writable (Image arr RGB Double) TIF Source # 
ManifestArray arr RGB Word16 => Writable (Image arr RGB Word16) TIF Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) TIF Source # 
ManifestArray arr RGB Double => Writable (Image arr RGB Double) TGA Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) TGA Source # 
ManifestArray arr RGB Double => Writable (Image arr RGB Double) PNG Source # 
ManifestArray arr RGB Word16 => Writable (Image arr RGB Word16) PNG Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) PNG Source # 
ManifestArray arr RGB Double => Writable (Image arr RGB Double) JPG Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) JPG Source # 
ManifestArray arr RGB Double => Writable (Image arr RGB Double) HDR Source # 
ManifestArray arr RGB Float => Writable (Image arr RGB Float) HDR Source # 
ManifestArray arr RGB Double => Writable (Image arr RGB Double) GIF Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) GIF Source # 
ManifestArray arr RGB Double => Writable (Image arr RGB Double) BMP Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) BMP Source # 
Array arr RGB Double => Readable (Image arr RGB Double) TIF Source # 
Array arr RGB Word16 => Readable (Image arr RGB Word16) TIF Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) TIF Source # 
Array arr RGB Double => Readable (Image arr RGB Double) TGA Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) TGA Source # 
Array arr RGB Double => Readable (Image arr RGB Double) PNG Source # 
Array arr RGB Word16 => Readable (Image arr RGB Word16) PNG Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) PNG Source # 
Array arr RGB Double => Readable (Image arr RGB Double) JPG Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) JPG Source # 
Array arr RGB Double => Readable (Image arr RGB Double) HDR Source # 
Array arr RGB Float => Readable (Image arr RGB Float) HDR Source # 
Array arr RGB Double => Readable (Image arr RGB Double) GIF Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) GIF Source # 
Array arr RGB Double => Readable (Image arr RGB Double) BMP Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) BMP Source # 
Array arr RGB Word16 => Readable (Image arr RGB Word16) PPM Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) PPM Source # 
Array arr RGB Double => Readable (Image arr RGB Double) PPM Source # 
data Pixel RGB Source # 
data Pixel RGB = PixelRGB !e !e !e
type PixelElt RGB e Source # 
type PixelElt RGB e = (e, e, e)

data RGBA Source #

Red, Green and Blue color space with Alpha channel.

Instances

Enum RGBA Source # 

Methods

succ :: RGBA -> RGBA #

pred :: RGBA -> RGBA #

toEnum :: Int -> RGBA #

fromEnum :: RGBA -> Int #

enumFrom :: RGBA -> [RGBA] #

enumFromThen :: RGBA -> RGBA -> [RGBA] #

enumFromTo :: RGBA -> RGBA -> [RGBA] #

enumFromThenTo :: RGBA -> RGBA -> RGBA -> [RGBA] #

Eq RGBA Source # 

Methods

(==) :: RGBA -> RGBA -> Bool #

(/=) :: RGBA -> RGBA -> Bool #

Show RGBA Source # 

Methods

showsPrec :: Int -> RGBA -> ShowS #

show :: RGBA -> String #

showList :: [RGBA] -> ShowS #

Alpha RGBA Source # 

Associated Types

type Opaque RGBA :: * Source #

ColorSpace RGBA Source # 

Associated Types

type PixelElt RGBA e :: * Source #

data Pixel RGBA e :: * Source #

Methods

fromChannel :: e -> Pixel RGBA e Source #

toElt :: Pixel RGBA e -> PixelElt RGBA e Source #

fromElt :: PixelElt RGBA e -> Pixel RGBA e Source #

getPxCh :: Pixel RGBA e -> RGBA -> e Source #

chOp :: (RGBA -> e' -> e) -> Pixel RGBA e' -> Pixel RGBA e Source #

pxOp :: (e' -> e) -> Pixel RGBA e' -> Pixel RGBA e Source #

chApp :: Pixel RGBA (e' -> e) -> Pixel RGBA e' -> Pixel RGBA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel RGBA e -> m Source #

csColour :: RGBA -> AlphaColour Double Source #

Array arr RGBA Double => Readable [Image arr RGBA Double] [GIF] Source # 
Array arr RGBA Word8 => Readable [Image arr RGBA Word8] [GIF] Source # 
Eq e => Eq (Pixel RGBA e) Source # 

Methods

(==) :: Pixel RGBA e -> Pixel RGBA e -> Bool #

(/=) :: Pixel RGBA e -> Pixel RGBA e -> Bool #

Show e => Show (Pixel RGBA e) Source # 

Methods

showsPrec :: Int -> Pixel RGBA e -> ShowS #

show :: Pixel RGBA e -> String #

showList :: [Pixel RGBA e] -> ShowS #

ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) TIF Source # 
ManifestArray arr RGBA Word16 => Writable (Image arr RGBA Word16) TIF Source # 
ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) TIF Source # 
ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) TGA Source # 
ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) TGA Source # 
ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) PNG Source # 
ManifestArray arr RGBA Word16 => Writable (Image arr RGBA Word16) PNG Source # 
ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) PNG Source # 
ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) JPG Source # 
ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) HDR Source # 
ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) GIF Source # 
ManifestArray arr RGBA Double => Writable (Image arr RGBA Double) BMP Source # 
ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) BMP Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) TIF Source # 
Array arr RGBA Word16 => Readable (Image arr RGBA Word16) TIF Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) TIF Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) TGA Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) TGA Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) PNG Source # 
Array arr RGBA Word16 => Readable (Image arr RGBA Word16) PNG Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) PNG Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) JPG Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) HDR Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) GIF Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) GIF Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) BMP Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) BMP Source # 
Array arr RGBA Double => Readable (Image arr RGBA Double) PPM Source # 
type Opaque RGBA Source # 
type Opaque RGBA = RGB
data Pixel RGBA Source # 
data Pixel RGBA = PixelRGBA !e !e !e !e
type PixelElt RGBA e Source # 
type PixelElt RGBA e = (e, e, e, e)

class ColorSpace cs => ToRGB cs where Source #

Conversion to RGB color space.

Minimal complete definition

toPixelRGB

Methods

toPixelRGB :: Pixel cs Double -> Pixel RGB Double Source #

Convert to an RGB pixel.

toImageRGB :: (Array arr cs Double, Array arr RGB Double) => Image arr cs Double -> Image arr RGB Double Source #

Convert to an RGB image.

class (ToRGB (Opaque cs), Alpha cs) => ToRGBA cs where Source #

Conversion to RGBA from another color space with Alpha channel.

Methods

toPixelRGBA :: Pixel cs Double -> Pixel RGBA Double Source #

Convert to an RGBA pixel.

toImageRGBA :: (Array arr cs Double, Array arr RGBA Double) => Image arr cs Double -> Image arr RGBA Double Source #

Convert to an RGBA image.

HSI

data HSI Source #

Hue, Saturation and Intensity color space.

Constructors

HueHSI

Hue

SatHSI

Saturation

IntHSI

Intensity

Instances

Enum HSI Source # 

Methods

succ :: HSI -> HSI #

pred :: HSI -> HSI #

toEnum :: Int -> HSI #

fromEnum :: HSI -> Int #

enumFrom :: HSI -> [HSI] #

enumFromThen :: HSI -> HSI -> [HSI] #

enumFromTo :: HSI -> HSI -> [HSI] #

enumFromThenTo :: HSI -> HSI -> HSI -> [HSI] #

Eq HSI Source # 

Methods

(==) :: HSI -> HSI -> Bool #

(/=) :: HSI -> HSI -> Bool #

Show HSI Source # 

Methods

showsPrec :: Int -> HSI -> ShowS #

show :: HSI -> String #

showList :: [HSI] -> ShowS #

ColorSpace HSI Source # 

Associated Types

type PixelElt HSI e :: * Source #

data Pixel HSI e :: * Source #

Methods

fromChannel :: e -> Pixel HSI e Source #

toElt :: Pixel HSI e -> PixelElt HSI e Source #

fromElt :: PixelElt HSI e -> Pixel HSI e Source #

getPxCh :: Pixel HSI e -> HSI -> e Source #

chOp :: (HSI -> e' -> e) -> Pixel HSI e' -> Pixel HSI e Source #

pxOp :: (e' -> e) -> Pixel HSI e' -> Pixel HSI e Source #

chApp :: Pixel HSI (e' -> e) -> Pixel HSI e' -> Pixel HSI e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel HSI e -> m Source #

csColour :: HSI -> AlphaColour Double Source #

Eq e => Eq (Pixel HSI e) Source # 

Methods

(==) :: Pixel HSI e -> Pixel HSI e -> Bool #

(/=) :: Pixel HSI e -> Pixel HSI e -> Bool #

Show e => Show (Pixel HSI e) Source # 

Methods

showsPrec :: Int -> Pixel HSI e -> ShowS #

show :: Pixel HSI e -> String #

showList :: [Pixel HSI e] -> ShowS #

data Pixel HSI Source # 
data Pixel HSI = PixelHSI !e !e !e
type PixelElt HSI e Source # 
type PixelElt HSI e = (e, e, e)

data HSIA Source #

Hue, Saturation and Intensity color space with Alpha channel.

Constructors

HueHSIA

Hue

SatHSIA

Saturation

IntHSIA

Intensity

AlphaHSIA

Alpha

Instances

Enum HSIA Source # 

Methods

succ :: HSIA -> HSIA #

pred :: HSIA -> HSIA #

toEnum :: Int -> HSIA #

fromEnum :: HSIA -> Int #

enumFrom :: HSIA -> [HSIA] #

enumFromThen :: HSIA -> HSIA -> [HSIA] #

enumFromTo :: HSIA -> HSIA -> [HSIA] #

enumFromThenTo :: HSIA -> HSIA -> HSIA -> [HSIA] #

Eq HSIA Source # 

Methods

(==) :: HSIA -> HSIA -> Bool #

(/=) :: HSIA -> HSIA -> Bool #

Show HSIA Source # 

Methods

showsPrec :: Int -> HSIA -> ShowS #

show :: HSIA -> String #

showList :: [HSIA] -> ShowS #

Alpha HSIA Source # 

Associated Types

type Opaque HSIA :: * Source #

ColorSpace HSIA Source # 

Associated Types

type PixelElt HSIA e :: * Source #

data Pixel HSIA e :: * Source #

Methods

fromChannel :: e -> Pixel HSIA e Source #

toElt :: Pixel HSIA e -> PixelElt HSIA e Source #

fromElt :: PixelElt HSIA e -> Pixel HSIA e Source #

getPxCh :: Pixel HSIA e -> HSIA -> e Source #

chOp :: (HSIA -> e' -> e) -> Pixel HSIA e' -> Pixel HSIA e Source #

pxOp :: (e' -> e) -> Pixel HSIA e' -> Pixel HSIA e Source #

chApp :: Pixel HSIA (e' -> e) -> Pixel HSIA e' -> Pixel HSIA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel HSIA e -> m Source #

csColour :: HSIA -> AlphaColour Double Source #

Eq e => Eq (Pixel HSIA e) Source # 

Methods

(==) :: Pixel HSIA e -> Pixel HSIA e -> Bool #

(/=) :: Pixel HSIA e -> Pixel HSIA e -> Bool #

Show e => Show (Pixel HSIA e) Source # 

Methods

showsPrec :: Int -> Pixel HSIA e -> ShowS #

show :: Pixel HSIA e -> String #

showList :: [Pixel HSIA e] -> ShowS #

type Opaque HSIA Source # 
type Opaque HSIA = HSI
data Pixel HSIA Source # 
data Pixel HSIA = PixelHSIA !e !e !e !e
type PixelElt HSIA e Source # 
type PixelElt HSIA e = (e, e, e, e)

class ColorSpace cs => ToHSI cs where Source #

Conversion to HSI color space.

Minimal complete definition

toPixelHSI

Methods

toPixelHSI :: Pixel cs Double -> Pixel HSI Double Source #

Convert to an HSI pixel.

toImageHSI :: (Array arr cs Double, Array arr HSI Double) => Image arr cs Double -> Image arr HSI Double Source #

Convert to an HSI image.

class (ToHSI (Opaque cs), Alpha cs) => ToHSIA cs where Source #

Conversion to HSIA from another color space with Alpha channel.

Methods

toPixelHSIA :: Pixel cs Double -> Pixel HSIA Double Source #

Convert to an HSIA pixel.

toImageHSIA :: (Array arr cs Double, Array arr HSIA Double) => Image arr cs Double -> Image arr HSIA Double Source #

Convert to an HSIA image.

CMYK

data CMYK Source #

Cyan, Magenta, Yellow and Black color space.

Constructors

CyanCMYK

Cyan

MagCMYK

Magenta

YelCMYK

Yellow

KeyCMYK

Key (Black)

Instances

Enum CMYK Source # 

Methods

succ :: CMYK -> CMYK #

pred :: CMYK -> CMYK #

toEnum :: Int -> CMYK #

fromEnum :: CMYK -> Int #

enumFrom :: CMYK -> [CMYK] #

enumFromThen :: CMYK -> CMYK -> [CMYK] #

enumFromTo :: CMYK -> CMYK -> [CMYK] #

enumFromThenTo :: CMYK -> CMYK -> CMYK -> [CMYK] #

Eq CMYK Source # 

Methods

(==) :: CMYK -> CMYK -> Bool #

(/=) :: CMYK -> CMYK -> Bool #

Show CMYK Source # 

Methods

showsPrec :: Int -> CMYK -> ShowS #

show :: CMYK -> String #

showList :: [CMYK] -> ShowS #

ColorSpace CMYK Source # 

Associated Types

type PixelElt CMYK e :: * Source #

data Pixel CMYK e :: * Source #

Methods

fromChannel :: e -> Pixel CMYK e Source #

toElt :: Pixel CMYK e -> PixelElt CMYK e Source #

fromElt :: PixelElt CMYK e -> Pixel CMYK e Source #

getPxCh :: Pixel CMYK e -> CMYK -> e Source #

chOp :: (CMYK -> e' -> e) -> Pixel CMYK e' -> Pixel CMYK e Source #

pxOp :: (e' -> e) -> Pixel CMYK e' -> Pixel CMYK e Source #

chApp :: Pixel CMYK (e' -> e) -> Pixel CMYK e' -> Pixel CMYK e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel CMYK e -> m Source #

csColour :: CMYK -> AlphaColour Double Source #

Eq e => Eq (Pixel CMYK e) Source # 

Methods

(==) :: Pixel CMYK e -> Pixel CMYK e -> Bool #

(/=) :: Pixel CMYK e -> Pixel CMYK e -> Bool #

Show e => Show (Pixel CMYK e) Source # 

Methods

showsPrec :: Int -> Pixel CMYK e -> ShowS #

show :: Pixel CMYK e -> String #

showList :: [Pixel CMYK e] -> ShowS #

ManifestArray arr CMYK Double => Writable (Image arr CMYK Double) TIF Source # 
ManifestArray arr CMYK Word16 => Writable (Image arr CMYK Word16) TIF Source # 
ManifestArray arr CMYK Word8 => Writable (Image arr CMYK Word8) TIF Source # 
ManifestArray arr CMYK Word8 => Writable (Image arr CMYK Word8) JPG Source # 
Array arr CMYK Word16 => Readable (Image arr CMYK Word16) TIF Source # 
Array arr CMYK Word8 => Readable (Image arr CMYK Word8) TIF Source # 
Array arr CMYK Word8 => Readable (Image arr CMYK Word8) JPG Source # 
data Pixel CMYK Source # 
data Pixel CMYK = PixelCMYK !e !e !e !e
type PixelElt CMYK e Source # 
type PixelElt CMYK e = (e, e, e, e)

data CMYKA Source #

Cyan, Magenta, Yellow and Black color space with Alpha channel.

Constructors

CyanCMYKA

Cyan

MagCMYKA

Magenta

YelCMYKA

Yellow

KeyCMYKA

Key (Black)

AlphaCMYKA

Alpha

Instances

Enum CMYKA Source # 
Eq CMYKA Source # 

Methods

(==) :: CMYKA -> CMYKA -> Bool #

(/=) :: CMYKA -> CMYKA -> Bool #

Show CMYKA Source # 

Methods

showsPrec :: Int -> CMYKA -> ShowS #

show :: CMYKA -> String #

showList :: [CMYKA] -> ShowS #

Alpha CMYKA Source # 

Associated Types

type Opaque CMYKA :: * Source #

ColorSpace CMYKA Source # 

Associated Types

type PixelElt CMYKA e :: * Source #

data Pixel CMYKA e :: * Source #

Methods

fromChannel :: e -> Pixel CMYKA e Source #

toElt :: Pixel CMYKA e -> PixelElt CMYKA e Source #

fromElt :: PixelElt CMYKA e -> Pixel CMYKA e Source #

getPxCh :: Pixel CMYKA e -> CMYKA -> e Source #

chOp :: (CMYKA -> e' -> e) -> Pixel CMYKA e' -> Pixel CMYKA e Source #

pxOp :: (e' -> e) -> Pixel CMYKA e' -> Pixel CMYKA e Source #

chApp :: Pixel CMYKA (e' -> e) -> Pixel CMYKA e' -> Pixel CMYKA e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel CMYKA e -> m Source #

csColour :: CMYKA -> AlphaColour Double Source #

Eq e => Eq (Pixel CMYKA e) Source # 

Methods

(==) :: Pixel CMYKA e -> Pixel CMYKA e -> Bool #

(/=) :: Pixel CMYKA e -> Pixel CMYKA e -> Bool #

Show e => Show (Pixel CMYKA e) Source # 

Methods

showsPrec :: Int -> Pixel CMYKA e -> ShowS #

show :: Pixel CMYKA e -> String #

showList :: [Pixel CMYKA e] -> ShowS #

type Opaque CMYKA Source # 
data Pixel CMYKA Source # 
data Pixel CMYKA = PixelCMYKA !e !e !e !e !e
type PixelElt CMYKA e Source # 
type PixelElt CMYKA e = (e, e, e, e, e)

class ColorSpace cs => ToCMYK cs where Source #

Conversion to CMYK color space.

Minimal complete definition

toPixelCMYK

Methods

toPixelCMYK :: Pixel cs Double -> Pixel CMYK Double Source #

Convert to a CMYK pixel.

toImageCMYK :: (Array arr cs Double, Array arr CMYK Double) => Image arr cs Double -> Image arr CMYK Double Source #

Convert to a CMYK image.

class (ToCMYK (Opaque cs), Alpha cs) => ToCMYKA cs where Source #

Conversion to CMYKA from another color space with Alpha channel.

Methods

toPixelCMYKA :: Pixel cs Double -> Pixel CMYKA Double Source #

Convert to a CMYKA pixel.

toImageCMYKA :: (Array arr cs Double, Array arr CMYKA Double) => Image arr cs Double -> Image arr CMYKA Double Source #

Convert to a CMYKA image.

YCbCr

data YCbCr Source #

Color space is used to encode RGB information and is used in JPEG compression.

Constructors

LumaYCbCr

Luma component (commonly denoted as Y')

CBlueYCbCr

Blue difference chroma component

CRedYCbCr

Red difference chroma component

Instances

Enum YCbCr Source # 
Eq YCbCr Source # 

Methods

(==) :: YCbCr -> YCbCr -> Bool #

(/=) :: YCbCr -> YCbCr -> Bool #

Show YCbCr Source # 

Methods

showsPrec :: Int -> YCbCr -> ShowS #

show :: YCbCr -> String #

showList :: [YCbCr] -> ShowS #

ColorSpace YCbCr Source # 

Associated Types

type PixelElt YCbCr e :: * Source #

data Pixel YCbCr e :: * Source #

Methods

fromChannel :: e -> Pixel YCbCr e Source #

toElt :: Pixel YCbCr e -> PixelElt YCbCr e Source #

fromElt :: PixelElt YCbCr e -> Pixel YCbCr e Source #

getPxCh :: Pixel YCbCr e -> YCbCr -> e Source #

chOp :: (YCbCr -> e' -> e) -> Pixel YCbCr e' -> Pixel YCbCr e Source #

pxOp :: (e' -> e) -> Pixel YCbCr e' -> Pixel YCbCr e Source #

chApp :: Pixel YCbCr (e' -> e) -> Pixel YCbCr e' -> Pixel YCbCr e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel YCbCr e -> m Source #

csColour :: YCbCr -> AlphaColour Double Source #

Eq e => Eq (Pixel YCbCr e) Source # 

Methods

(==) :: Pixel YCbCr e -> Pixel YCbCr e -> Bool #

(/=) :: Pixel YCbCr e -> Pixel YCbCr e -> Bool #

Show e => Show (Pixel YCbCr e) Source # 

Methods

showsPrec :: Int -> Pixel YCbCr e -> ShowS #

show :: Pixel YCbCr e -> String #

showList :: [Pixel YCbCr e] -> ShowS #

ManifestArray arr YCbCr Double => Writable (Image arr YCbCr Double) TIF Source # 
ManifestArray arr YCbCr Word8 => Writable (Image arr YCbCr Word8) TIF Source # 
ManifestArray arr YCbCr Word8 => Writable (Image arr YCbCr Word8) JPG Source # 
Array arr YCbCr Word8 => Readable (Image arr YCbCr Word8) JPG Source # 
data Pixel YCbCr Source # 
data Pixel YCbCr = PixelYCbCr !e !e !e
type PixelElt YCbCr e Source # 
type PixelElt YCbCr e = (e, e, e)

data YCbCrA Source #

YCbCr color space with Alpha channel.

Constructors

LumaYCbCrA

Luma component (commonly denoted as Y')

CBlueYCbCrA

Blue difference chroma component

CRedYCbCrA

Red difference chroma component

AlphaYCbCrA

Alpha component.

Instances

Enum YCbCrA Source # 
Eq YCbCrA Source # 

Methods

(==) :: YCbCrA -> YCbCrA -> Bool #

(/=) :: YCbCrA -> YCbCrA -> Bool #

Show YCbCrA Source # 
Alpha YCbCrA Source # 
ColorSpace YCbCrA Source # 

Associated Types

type PixelElt YCbCrA e :: * Source #

data Pixel YCbCrA e :: * Source #

Eq e => Eq (Pixel YCbCrA e) Source # 

Methods

(==) :: Pixel YCbCrA e -> Pixel YCbCrA e -> Bool #

(/=) :: Pixel YCbCrA e -> Pixel YCbCrA e -> Bool #

Show e => Show (Pixel YCbCrA e) Source # 
type Opaque YCbCrA Source # 
data Pixel YCbCrA Source # 
data Pixel YCbCrA = PixelYCbCrA !e !e !e !e
type PixelElt YCbCrA e Source # 
type PixelElt YCbCrA e = (e, e, e, e)

class ColorSpace cs => ToYCbCr cs where Source #

Conversion to YCbCr color space.

Minimal complete definition

toPixelYCbCr

Methods

toPixelYCbCr :: Pixel cs Double -> Pixel YCbCr Double Source #

Convert to an YCbCr pixel.

toImageYCbCr :: (Array arr cs Double, Array arr YCbCr Double) => Image arr cs Double -> Image arr YCbCr Double Source #

Convert to an YCbCr image.

class (ToYCbCr (Opaque cs), Alpha cs) => ToYCbCrA cs where Source #

Conversion to YCbCrA from another color space with Alpha channel.

Methods

toPixelYCbCrA :: Pixel cs Double -> Pixel YCbCrA Double Source #

Convert to an YCbCrA pixel.

toImageYCbCrA :: (Array arr cs Double, Array arr YCbCrA Double) => Image arr cs Double -> Image arr YCbCrA Double Source #

Convert to an YCbCrA image.

Gray

data Gray Source #

This is a signgle channel colorspace, that is designed to hold any channel from any other colorspace, hence it is not convertible to and from, but rather is here to allow separation of channels from other multichannel colorspaces. If you are looking for a true grayscale colorspace Y should be used instead.

Constructors

Gray 

Instances

Enum Gray Source # 

Methods

succ :: Gray -> Gray #

pred :: Gray -> Gray #

toEnum :: Int -> Gray #

fromEnum :: Gray -> Int #

enumFrom :: Gray -> [Gray] #

enumFromThen :: Gray -> Gray -> [Gray] #

enumFromTo :: Gray -> Gray -> [Gray] #

enumFromThenTo :: Gray -> Gray -> Gray -> [Gray] #

Eq Gray Source # 

Methods

(==) :: Gray -> Gray -> Bool #

(/=) :: Gray -> Gray -> Bool #

Show Gray Source # 

Methods

showsPrec :: Int -> Gray -> ShowS #

show :: Gray -> String #

showList :: [Gray] -> ShowS #

ColorSpace Gray Source # 

Associated Types

type PixelElt Gray e :: * Source #

data Pixel Gray e :: * Source #

Methods

fromChannel :: e -> Pixel Gray e Source #

toElt :: Pixel Gray e -> PixelElt Gray e Source #

fromElt :: PixelElt Gray e -> Pixel Gray e Source #

getPxCh :: Pixel Gray e -> Gray -> e Source #

chOp :: (Gray -> e' -> e) -> Pixel Gray e' -> Pixel Gray e Source #

pxOp :: (e' -> e) -> Pixel Gray e' -> Pixel Gray e Source #

chApp :: Pixel Gray (e' -> e) -> Pixel Gray e' -> Pixel Gray e Source #

pxFoldMap :: Monoid m => (e -> m) -> Pixel Gray e -> m Source #

csColour :: Gray -> AlphaColour Double Source #

Monad (Pixel Gray) Source # 

Methods

(>>=) :: Pixel Gray a -> (a -> Pixel Gray b) -> Pixel Gray b #

(>>) :: Pixel Gray a -> Pixel Gray b -> Pixel Gray b #

return :: a -> Pixel Gray a #

fail :: String -> Pixel Gray a #

Eq e => Eq (Pixel Gray e) Source # 

Methods

(==) :: Pixel Gray e -> Pixel Gray e -> Bool #

(/=) :: Pixel Gray e -> Pixel Gray e -> Bool #

Ord e => Ord (Pixel Gray e) Source # 

Methods

compare :: Pixel Gray e -> Pixel Gray e -> Ordering #

(<) :: Pixel Gray e -> Pixel Gray e -> Bool #

(<=) :: Pixel Gray e -> Pixel Gray e -> Bool #

(>) :: Pixel Gray e -> Pixel Gray e -> Bool #

(>=) :: Pixel Gray e -> Pixel Gray e -> Bool #

max :: Pixel Gray e -> Pixel Gray e -> Pixel Gray e #

min :: Pixel Gray e -> Pixel Gray e -> Pixel Gray e #

Show e => Show (Pixel Gray e) Source # 

Methods

showsPrec :: Int -> Pixel Gray e -> ShowS #

show :: Pixel Gray e -> String #

showList :: [Pixel Gray e] -> ShowS #

data Pixel Gray Source # 
data Pixel Gray = PixelGray !e
type PixelElt Gray e Source # 
type PixelElt Gray e = e

toGrayImages :: (Array arr cs e, Array arr Gray e) => Image arr cs e -> [Image arr Gray e] Source #

Separate an image into a list of images with Gray pixels containing every channel from the source image.

>>> frog <- readImageRGB "images/frog.jpg"
>>> let [frog_red, frog_green, frog_blue] = toGrayImages frog
>>> writeImage "images/frog_red.png" $ toImageY frog_red
>>> writeImage "images/frog_green.jpg" $ toImageY frog_green
>>> writeImage "images/frog_blue.jpg" $ toImageY frog_blue

fromGrayImages :: forall arr cs e. (Array arr Gray e, Array arr cs e) => [Image arr Gray e] -> [cs] -> Image arr cs e Source #

Combine a list of images with Gray pixels into an image of any color space, by supplying an order of color space channels.

For example here is a frog with swapped BlueRGB and GreenRGB channels.

>>> writeImage "images/frog_rbg.jpg" $ fromGrayImages [frog_red, frog_green, frog_blue] [RedRGB, BlueRGB, GreenRGB]

It is worth noting though, that separating image channels can be sometimes pretty useful, the same effect as above can be achieved in a much simpler and more efficient way:

 map ((PixelRGB r g b) -> PixelRGB r b g) frog

Binary

data Binary Source #

This is a Binary colorspace, pixel's of which can be created using these constructors:

on
Represents value 1 or True. It's a foreground pixel and is displayed in black.
off
Represents value 0 or False. It's a background pixel and is displayed in white.

Note, that values are inverted before writing to or reading from file, since grayscale images represent black as a 0 value and white as 1 on a [0,1] scale.

Binary pixels also behave as binary numbers with a size of 1-bit, for instance:

>>> on + on -- equivalent to: 1 .|. 1
<Binary:(1)>
>>> (on + on) * off -- equivalent to: (1 .|. 1) .&. 0
<Binary:(0)>
>>> (on + on) - on
<Binary:(0)>

Instances

Enum Binary Source # 
Eq Binary Source # 

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Show Binary Source # 
ColorSpace Binary Source # 

Associated Types

type PixelElt Binary e :: * Source #

data Pixel Binary e :: * Source #

Array arr Binary Bit => Readable [Image arr Binary Bit] [PBM] Source # 
Eq e => Eq (Pixel Binary e) Source # 

Methods

(==) :: Pixel Binary e -> Pixel Binary e -> Bool #

(/=) :: Pixel Binary e -> Pixel Binary e -> Bool #

Show (Pixel Binary Bit) Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) TIF Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) TGA Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) PNG Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) BMP Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) TIF Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) TGA Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) PNG Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) BMP Source # 
Array arr Binary Bit => Readable (Image arr Binary Bit) PBM Source # 
data Pixel Binary Source # 
type PixelElt Binary e Source # 
type PixelElt Binary e = e

data Bit Source #

Under the hood, Binary pixels are represented as Word8 that can only take values of 0 or 1.

Instances

Eq Bit Source # 

Methods

(==) :: Bit -> Bit -> Bool #

(/=) :: Bit -> Bit -> Bool #

Num Bit Source # 

Methods

(+) :: Bit -> Bit -> Bit #

(-) :: Bit -> Bit -> Bit #

(*) :: Bit -> Bit -> Bit #

negate :: Bit -> Bit #

abs :: Bit -> Bit #

signum :: Bit -> Bit #

fromInteger :: Integer -> Bit #

Ord Bit Source # 

Methods

compare :: Bit -> Bit -> Ordering #

(<) :: Bit -> Bit -> Bool #

(<=) :: Bit -> Bit -> Bool #

(>) :: Bit -> Bit -> Bool #

(>=) :: Bit -> Bit -> Bool #

max :: Bit -> Bit -> Bit #

min :: Bit -> Bit -> Bit #

Array arr Binary Bit => Readable [Image arr Binary Bit] [PBM] Source # 
Show (Pixel Binary Bit) Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) TIF Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) TGA Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) PNG Source # 
ManifestArray arr Binary Bit => Writable (Image arr Binary Bit) BMP Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) TIF Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) TGA Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) PNG Source # 
(Array arr Y Word8, Array arr Binary Bit) => Readable (Image arr Binary Bit) BMP Source # 
Array arr Binary Bit => Readable (Image arr Binary Bit) PBM Source # 
data Vector Bit # 
data MVector s Bit # 

on :: Pixel Binary Bit Source #

Represents value True or 1 in binary. Often also called a foreground pixel of an object.

off :: Pixel Binary Bit Source #

Represents value False or 0 in binary. Often also called a background pixel.

isOn :: Pixel Binary Bit -> Bool Source #

Test if Pixel's value is on.

isOff :: Pixel Binary Bit -> Bool Source #

Test if Pixel's value is off.

fromBool :: Bool -> Pixel Binary Bit Source #

Convert a Bool to a PixelBin pixel.

>>> isOn (fromBool True)
True

complement :: Pixel Binary Bit -> Pixel Binary Bit Source #

Invert value of a pixel. Equivalent of not for Bool's.

toPixelBinary :: (ColorSpace cs, Eq (Pixel cs e), Num e) => Pixel cs e -> Pixel Binary Bit Source #

Convert any pixel to binary pixel.

fromPixelBinary :: Pixel Binary Bit -> Pixel Y Word8 Source #

Convert a Binary pixel to Luma pixel

toImageBinary :: (Array arr cs e, Array arr Binary Bit, Eq (Pixel cs e)) => Image arr cs e -> Image arr Binary Bit Source #

Convert any image to binary image.

fromImageBinary :: (Array arr Binary Bit, Array arr Y Word8) => Image arr Binary Bit -> Image arr Y Word8 Source #

Convert a Binary image to Luma image

Complex

Rectangular form

data Complex a :: * -> * #

Complex numbers are an algebraic type.

For a complex number z, abs z is a number with the magnitude of z, but oriented in the positive real direction, whereas signum z has the phase of z, but unit magnitude.

The Foldable and Traversable instances traverse the real part first.

Constructors

~a :+ ~a infix 6

forms a complex number from its real and imaginary rectangular components.

Instances

Monad Complex 

Methods

(>>=) :: Complex a -> (a -> Complex b) -> Complex b #

(>>) :: Complex a -> Complex b -> Complex b #

return :: a -> Complex a #

fail :: String -> Complex a #

Functor Complex 

Methods

fmap :: (a -> b) -> Complex a -> Complex b #

(<$) :: a -> Complex b -> Complex a #

Applicative Complex 

Methods

pure :: a -> Complex a #

(<*>) :: Complex (a -> b) -> Complex a -> Complex b #

(*>) :: Complex a -> Complex b -> Complex b #

(<*) :: Complex a -> Complex b -> Complex a #

Foldable Complex 

Methods

fold :: Monoid m => Complex m -> m #

foldMap :: Monoid m => (a -> m) -> Complex a -> m #

foldr :: (a -> b -> b) -> b -> Complex a -> b #

foldr' :: (a -> b -> b) -> b -> Complex a -> b #

foldl :: (b -> a -> b) -> b -> Complex a -> b #

foldl' :: (b -> a -> b) -> b -> Complex a -> b #

foldr1 :: (a -> a -> a) -> Complex a -> a #

foldl1 :: (a -> a -> a) -> Complex a -> a #

toList :: Complex a -> [a] #

null :: Complex a -> Bool #

length :: Complex a -> Int #

elem :: Eq a => a -> Complex a -> Bool #

maximum :: Ord a => Complex a -> a #

minimum :: Ord a => Complex a -> a #

sum :: Num a => Complex a -> a #

product :: Num a => Complex a -> a #

Traversable Complex 

Methods

traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) #

sequenceA :: Applicative f => Complex (f a) -> f (Complex a) #

mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) #

sequence :: Monad m => Complex (m a) -> m (Complex a) #

Generic1 Complex 

Associated Types

type Rep1 (Complex :: * -> *) :: * -> * #

Methods

from1 :: Complex a -> Rep1 Complex a #

to1 :: Rep1 Complex a -> Complex a #

Representable Complex 

Associated Types

type Rep (Complex :: * -> *) :: * #

Methods

tabulate :: (Rep Complex -> a) -> Complex a #

index :: Complex a -> Rep Complex -> a #

Additive Complex 

Methods

zero :: Num a => Complex a #

(^+^) :: Num a => Complex a -> Complex a -> Complex a #

(^-^) :: Num a => Complex a -> Complex a -> Complex a #

lerp :: Num a => a -> Complex a -> Complex a -> Complex a #

liftU2 :: (a -> a -> a) -> Complex a -> Complex a -> Complex a #

liftI2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c #

Affine Complex 

Associated Types

type Diff (Complex :: * -> *) :: * -> * #

Methods

(.-.) :: Num a => Complex a -> Complex a -> Diff Complex a #

(.+^) :: Num a => Complex a -> Diff Complex a -> Complex a #

(.-^) :: Num a => Complex a -> Diff Complex a -> Complex a #

Complicated Complex 

Methods

_e :: Functor f => (a -> f a) -> Complex a -> f (Complex a) #

_i :: Functor f => (a -> f a) -> Complex a -> f (Complex a) #

(RealFloat a, Unbox a) => Vector Vector (Complex a) 
(RealFloat a, Unbox a) => MVector MVector (Complex a) 
Eq a => Eq (Complex a) 

Methods

(==) :: Complex a -> Complex a -> Bool #

(/=) :: Complex a -> Complex a -> Bool #

RealFloat a => Floating (Complex a) 

Methods

pi :: Complex a #

exp :: Complex a -> Complex a #

log :: Complex a -> Complex a #

sqrt :: Complex a -> Complex a #

(**) :: Complex a -> Complex a -> Complex a #

logBase :: Complex a -> Complex a -> Complex a #

sin :: Complex a -> Complex a #

cos :: Complex a -> Complex a #

tan :: Complex a -> Complex a #

asin :: Complex a -> Complex a #

acos :: Complex a -> Complex a #

atan :: Complex a -> Complex a #

sinh :: Complex a -> Complex a #

cosh :: Complex a -> Complex a #

tanh :: Complex a -> Complex a #

asinh :: Complex a -> Complex a #

acosh :: Complex a -> Complex a #

atanh :: Complex a -> Complex a #

log1p :: Complex a -> Complex a #

expm1 :: Complex a -> Complex a #

log1pexp :: Complex a -> Complex a #

log1mexp :: Complex a -> Complex a #

RealFloat a => Fractional (Complex a) 

Methods

(/) :: Complex a -> Complex a -> Complex a #

recip :: Complex a -> Complex a #

fromRational :: Rational -> Complex a #

Data a => Data (Complex a) 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Complex a -> c (Complex a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Complex a) #

toConstr :: Complex a -> Constr #

dataTypeOf :: Complex a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Complex a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Complex a)) #

gmapT :: (forall b. Data b => b -> b) -> Complex a -> Complex a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Complex a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Complex a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a) #

RealFloat a => Num (Complex a) 

Methods

(+) :: Complex a -> Complex a -> Complex a #

(-) :: Complex a -> Complex a -> Complex a #

(*) :: Complex a -> Complex a -> Complex a #

negate :: Complex a -> Complex a #

abs :: Complex a -> Complex a #

signum :: Complex a -> Complex a #

fromInteger :: Integer -> Complex a #

Read a => Read (Complex a) 
Show a => Show (Complex a) 

Methods

showsPrec :: Int -> Complex a -> ShowS #

show :: Complex a -> String #

showList :: [Complex a] -> ShowS #

Generic (Complex a) 

Associated Types

type Rep (Complex a) :: * -> * #

Methods

from :: Complex a -> Rep (Complex a) x #

to :: Rep (Complex a) x -> Complex a #

(Default a, RealFloat a) => Default (Complex a) 

Methods

def :: Complex a #

Storable a => Storable (Complex a) 

Methods

sizeOf :: Complex a -> Int #

alignment :: Complex a -> Int #

peekElemOff :: Ptr (Complex a) -> Int -> IO (Complex a) #

pokeElemOff :: Ptr (Complex a) -> Int -> Complex a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Complex a) #

pokeByteOff :: Ptr b -> Int -> Complex a -> IO () #

peek :: Ptr (Complex a) -> IO (Complex a) #

poke :: Ptr (Complex a) -> Complex a -> IO () #

NFData a => NFData (Complex a) 

Methods

rnf :: Complex a -> () #

(RealFloat a, Unbox a) => Unbox (Complex a) 
type Rep1 Complex 
type Rep Complex 
type Diff Complex 
data MVector s (Complex a) 
data MVector s (Complex a) = MV_Complex (MVector s (a, a))
type Rep (Complex a) 
type Index (Complex a) 
type Index (Complex a) = Int
data Vector (Complex a) 
data Vector (Complex a) = V_Complex (Vector (a, a))

(+:) :: ColorSpace cs => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e) infix 6 Source #

Constrcut a complex pixel from two pixels representing real and imaginary parts.

 PixelRGB 4 8 6 +: PixelRGB 7 1 1 == PixelRGB (4 :+ 7) (8 :+ 1) (6 :+ 1)

realPart :: (ColorSpace cs, RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #

Extracts the real part of a complex pixel.

imagPart :: (ColorSpace cs, RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #

Extracts the imaginary part of a complex pixel.

Polar form

mkPolar :: (ColorSpace cs, RealFloat e) => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e) Source #

Form a complex pixel from polar components of magnitude and phase.

cis :: (ColorSpace cs, RealFloat e) => Pixel cs e -> Pixel cs (Complex e) Source #

cis t is a complex pixel with magnitude 1 and phase t (modulo 2*pi).

polar :: (ColorSpace cs, RealFloat e) => Pixel cs (Complex e) -> (Pixel cs e, Pixel cs e) Source #

The function polar takes a complex pixel and returns a (magnitude, phase) pair of pixels in canonical form: the magnitude is nonnegative, and the phase in the range (-pi, pi]; if the magnitude is zero, then so is the phase.

magnitude :: (ColorSpace cs, RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #

The nonnegative magnitude of a complex pixel.

phase :: (ColorSpace cs, RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #

The phase of a complex pixel, in the range (-pi, pi]. If the magnitude is zero, then so is the phase.

Conjugate

conjugate :: (ColorSpace cs, RealFloat e) => Pixel cs (Complex e) -> Pixel cs (Complex e) Source #

The conjugate of a complex pixel.

Re-exports

data Word8 :: * #

8-bit unsigned integer type

Instances

Bounded Word8 
Enum Word8 
Eq Word8 

Methods

(==) :: Word8 -> Word8 -> Bool #

(/=) :: Word8 -> Word8 -> Bool #

Integral Word8 
Num Word8 
Ord Word8 

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Read Word8 
Real Word8 

Methods

toRational :: Word8 -> Rational #

Show Word8 

Methods

showsPrec :: Int -> Word8 -> ShowS #

show :: Word8 -> String #

showList :: [Word8] -> ShowS #

Ix Word8 
Lift Word8 

Methods

lift :: Word8 -> Q Exp #

Default Word8 

Methods

def :: Word8 #

Unpackable Word8

The Word8 instance is just a passthrough, to avoid copying memory twice

Associated Types

type StorageType Word8 :: *

Methods

outAlloc :: Word8 -> Int -> ST s (STVector s (StorageType Word8))

allocTempBuffer :: Word8 -> STVector s (StorageType Word8) -> Int -> ST s (STVector s Word8)

offsetStride :: Word8 -> Int -> Int -> (Int, Int)

mergeBackTempBuffer :: Word8 -> Endianness -> STVector s Word8 -> Int -> Int -> Word32 -> Int -> STVector s (StorageType Word8) -> ST s ()

TiffSaveable Pixel8 
JpgEncodable Pixel8 

Methods

additionalBlocks :: Image Pixel8 -> [JpgFrame]

componentsOfColorSpace :: Image Pixel8 -> [JpgComponent]

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

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

scanSpecificationOfColorSpace :: Image Pixel8 -> [JpgScanSpecification]

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

maximumSubSamplingOf :: Image Pixel8 -> Int

BmpEncodable Pixel8 
TgaSaveable Pixel8 
PngSavable Pixel8 
Pixel Pixel8 
LumaPlaneExtractable Pixel8 
PackeablePixel Pixel8 
Storable Word8 

Methods

sizeOf :: Word8 -> Int #

alignment :: Word8 -> Int #

peekElemOff :: Ptr Word8 -> Int -> IO Word8 #

pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Word8 #

pokeByteOff :: Ptr b -> Int -> Word8 -> IO () #

peek :: Ptr Word8 -> IO Word8 #

poke :: Ptr Word8 -> Word8 -> IO () #

Bits Word8 
FiniteBits Word8 
NFData Word8 

Methods

rnf :: Word8 -> () #

Hashable Word8 

Methods

hashWithSalt :: Int -> Word8 -> Int #

hash :: Word8 -> Int #

Prim Word8 
Unbox Word8 
Elt Word8 

Methods

touch :: Word8 -> IO () #

zero :: Word8 #

one :: Word8 #

Decimable Pixel16 Pixel8 
Decimable PixelF Pixel8 
TransparentPixel PixelYA8 Pixel8 
ColorConvertible Pixel8 Pixel16 
ColorConvertible Pixel8 PixelF 
ColorConvertible Pixel8 PixelYA8 
ColorConvertible Pixel8 PixelRGB8 
ColorConvertible Pixel8 PixelRGBA8 
IArray UArray Word8 

Methods

bounds :: Ix i => UArray i Word8 -> (i, i) #

numElements :: Ix i => UArray i Word8 -> Int

unsafeArray :: Ix i => (i, i) -> [(Int, Word8)] -> UArray i Word8

unsafeAt :: Ix i => UArray i Word8 -> Int -> Word8

unsafeReplace :: Ix i => UArray i Word8 -> [(Int, Word8)] -> UArray i Word8

unsafeAccum :: Ix i => (Word8 -> e' -> Word8) -> UArray i Word8 -> [(Int, e')] -> UArray i Word8

unsafeAccumArray :: Ix i => (Word8 -> e' -> Word8) -> Word8 -> (i, i) -> [(Int, e')] -> UArray i Word8

Vector Vector Word8 
Source B Word8

Read elements from a ByteString.

Associated Types

data Array B sh Word8 :: * #

Methods

extent :: Shape sh => Array B sh Word8 -> sh #

index :: Shape sh => Array B sh Word8 -> sh -> Word8 #

unsafeIndex :: Shape sh => Array B sh Word8 -> sh -> Word8 #

linearIndex :: Shape sh => Array B sh Word8 -> Int -> Word8 #

unsafeLinearIndex :: Shape sh => Array B sh Word8 -> Int -> Word8 #

deepSeqArray :: Shape sh => Array B sh Word8 -> b -> b #

MVector MVector Word8 
Structured B Word8 b 

Associated Types

type TR B :: * #

Methods

smap :: Shape sh => (Word8 -> b) -> Array B sh Word8 -> Array (TR B) sh b #

szipWith :: (Shape sh, Source r c) => (c -> Word8 -> b) -> Array r sh c -> Array B sh Word8 -> Array (TR B) sh b #

MArray (STUArray s) Word8 (ST s) 

Methods

getBounds :: Ix i => STUArray s i Word8 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word8 -> ST s Int

newArray :: Ix i => (i, i) -> Word8 -> ST s (STUArray s i Word8) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word8) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word8)

unsafeRead :: Ix i => STUArray s i Word8 -> Int -> ST s Word8

unsafeWrite :: Ix i => STUArray s i Word8 -> Int -> Word8 -> ST s ()

ManifestArray arr RGB Word8 => Writable [(GifDelay, Image arr RGB Word8)] [GIF] Source # 

Methods

encode :: [GIF] -> [SaveOption [GIF]] -> [(GifDelay, Image arr RGB Word8)] -> ByteString Source #

Array arr RGBA Word8 => Readable [Image arr RGBA Word8] [GIF] Source # 
Array arr RGB Word8 => Readable [Image arr RGB Word8] [GIF] Source # 
Array arr RGB Word8 => Readable [Image arr RGB Word8] [PPM] Source # 
Array arr Y Word8 => Readable [Image arr Y Word8] [PGM] Source # 

Methods

decode :: [PGM] -> ByteString -> Either String [Image arr Y Word8] Source #

Read sh => Read (Array B sh Word8) 
Show sh => Show (Array B sh Word8) 

Methods

showsPrec :: Int -> Array B sh Word8 -> ShowS #

show :: Array B sh Word8 -> String #

showList :: [Array B sh Word8] -> ShowS #

ManifestArray arr CMYK Word8 => Writable (Image arr CMYK Word8) TIF Source # 
ManifestArray arr YCbCr Word8 => Writable (Image arr YCbCr Word8) TIF Source # 
ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) TIF Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) TIF Source # 
ManifestArray arr YA Word8 => Writable (Image arr YA Word8) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr YA Word8 -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) TGA Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) TGA Source # 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TGA Source # 

Methods

encode :: TGA -> [SaveOption TGA] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) PNG Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) PNG Source # 
ManifestArray arr YA Word8 => Writable (Image arr YA Word8) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr YA Word8 -> ByteString Source #

ManifestArray arr Y Word8 => Writable (Image arr Y Word8) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr YCbCr Word8 => Writable (Image arr YCbCr Word8) JPG Source # 
ManifestArray arr CMYK Word8 => Writable (Image arr CMYK Word8) JPG Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) JPG Source # 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) JPG Source # 

Methods

encode :: JPG -> [SaveOption JPG] -> Image arr Y Word8 -> ByteString Source #

ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) GIF Source # 
ManifestArray arr RGBA Word8 => Writable (Image arr RGBA Word8) BMP Source # 
ManifestArray arr RGB Word8 => Writable (Image arr RGB Word8) BMP Source # 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) BMP Source # 

Methods

encode :: BMP -> [SaveOption BMP] -> Image arr Y Word8 -> ByteString Source #

Array arr CMYK Word8 => Readable (Image arr CMYK Word8) TIF Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) TIF Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) TIF Source # 
Array arr YA Word8 => Readable (Image arr YA Word8) TIF Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) TIF Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) TGA Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) TGA Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) TGA Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) PNG Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) PNG Source # 
Array arr YA Word8 => Readable (Image arr YA Word8) PNG Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) PNG Source # 
Array arr YCbCr Word8 => Readable (Image arr YCbCr Word8) JPG Source # 
Array arr CMYK Word8 => Readable (Image arr CMYK Word8) JPG Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) JPG Source # 
Array arr YA Word8 => Readable (Image arr YA Word8) JPG Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) JPG Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) GIF Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) GIF Source # 
Array arr RGBA Word8 => Readable (Image arr RGBA Word8) BMP Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) BMP Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) BMP Source # 
Array arr RGB Word8 => Readable (Image arr RGB Word8) PPM Source # 
Array arr Y Word8 => Readable (Image arr Y Word8) PGM Source # 
type StorageType Word8 
type StorageType Word8 = Word8
type PixelBaseComponent Pixel8 
type PackedRepresentation Pixel8 
type Unsigned Word8 
type Signed Word8 
data Vector Word8 
data MVector s Word8 
data Array B sh Word8 

data Word16 :: * #

16-bit unsigned integer type

Instances

Bounded Word16 
Enum Word16 
Eq Word16 

Methods

(==) :: Word16 -> Word16 -> Bool #

(/=) :: Word16 -> Word16 -> Bool #

Integral Word16 
Num Word16 
Ord Word16 
Read Word16 
Real Word16 
Show Word16 
Ix Word16 
Lift Word16 

Methods

lift :: Word16 -> Q Exp #

Default Word16 

Methods

def :: Word16 #

Unpackable Word16 

Associated Types

type StorageType Word16 :: *

Methods

outAlloc :: Word16 -> Int -> ST s (STVector s (StorageType Word16))

allocTempBuffer :: Word16 -> STVector s (StorageType Word16) -> Int -> ST s (STVector s Word8)

offsetStride :: Word16 -> Int -> Int -> (Int, Int)

mergeBackTempBuffer :: Word16 -> Endianness -> STVector s Word8 -> Int -> Int -> Word32 -> Int -> STVector s (StorageType Word16) -> ST s ()

TiffSaveable Pixel16 
PngSavable Pixel16 
Pixel Pixel16 
LumaPlaneExtractable Pixel16 
PackeablePixel Pixel16 
Storable Word16 
Bits Word16 
FiniteBits Word16 
NFData Word16 

Methods

rnf :: Word16 -> () #

Hashable Word16 

Methods

hashWithSalt :: Int -> Word16 -> Int #

hash :: Word16 -> Int #

Prim Word16 
Unbox Word16 
Elt Word16 

Methods

touch :: Word16 -> IO () #

zero :: Word16 #

one :: Word16 #

Decimable Pixel16 Pixel8 
TransparentPixel PixelYA16 Pixel16 
ColorConvertible Pixel8 Pixel16 
ColorConvertible Pixel16 PixelYA16 
ColorConvertible Pixel16 PixelRGB16 
ColorConvertible Pixel16 PixelRGBA16 
IArray UArray Word16 

Methods

bounds :: Ix i => UArray i Word16 -> (i, i) #

numElements :: Ix i => UArray i Word16 -> Int

unsafeArray :: Ix i => (i, i) -> [(Int, Word16)] -> UArray i Word16

unsafeAt :: Ix i => UArray i Word16 -> Int -> Word16

unsafeReplace :: Ix i => UArray i Word16 -> [(Int, Word16)] -> UArray i Word16

unsafeAccum :: Ix i => (Word16 -> e' -> Word16) -> UArray i Word16 -> [(Int, e')] -> UArray i Word16

unsafeAccumArray :: Ix i => (Word16 -> e' -> Word16) -> Word16 -> (i, i) -> [(Int, e')] -> UArray i Word16

Vector Vector Word16 
MVector MVector Word16 
MArray (STUArray s) Word16 (ST s) 

Methods

getBounds :: Ix i => STUArray s i Word16 -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i Word16 -> ST s Int

newArray :: Ix i => (i, i) -> Word16 -> ST s (STUArray s i Word16) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word16) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i Word16)

unsafeRead :: Ix i => STUArray s i Word16 -> Int -> ST s Word16

unsafeWrite :: Ix i => STUArray s i Word16 -> Int -> Word16 -> ST s ()

Array arr RGB Word16 => Readable [Image arr RGB Word16] [PPM] Source # 
Array arr Y Word16 => Readable [Image arr Y Word16] [PGM] Source # 
ManifestArray arr CMYK Word16 => Writable (Image arr CMYK Word16) TIF Source # 
ManifestArray arr RGBA Word16 => Writable (Image arr RGBA Word16) TIF Source # 
ManifestArray arr RGB Word16 => Writable (Image arr RGB Word16) TIF Source # 
ManifestArray arr YA Word16 => Writable (Image arr YA Word16) TIF Source # 
ManifestArray arr Y Word16 => Writable (Image arr Y Word16) TIF Source # 

Methods

encode :: TIF -> [SaveOption TIF] -> Image arr Y Word16 -> ByteString Source #

ManifestArray arr RGBA Word16 => Writable (Image arr RGBA Word16) PNG Source # 
ManifestArray arr RGB Word16 => Writable (Image arr RGB Word16) PNG Source # 
ManifestArray arr YA Word16 => Writable (Image arr YA Word16) PNG Source # 
ManifestArray arr Y Word16 => Writable (Image arr Y Word16) PNG Source # 

Methods

encode :: PNG -> [SaveOption PNG] -> Image arr Y Word16 -> ByteString Source #

Array arr CMYK Word16 => Readable (Image arr CMYK Word16) TIF Source # 
Array arr RGBA Word16 => Readable (Image arr RGBA Word16) TIF Source # 
Array arr RGB Word16 => Readable (Image arr RGB Word16) TIF Source # 
Array arr YA Word16 => Readable (Image arr YA Word16) TIF Source # 
Array arr Y Word16 => Readable (Image arr Y Word16) TIF Source # 
Array arr RGBA Word16 => Readable (Image arr RGBA Word16) PNG Source # 
Array arr RGB Word16 => Readable (Image arr RGB Word16) PNG Source # 
Array arr YA Word16 => Readable (Image arr YA Word16) PNG Source # 
Array arr Y Word16 => Readable (Image arr Y Word16) PNG Source # 
Array arr RGB Word16 => Readable (Image arr RGB Word16) PPM Source # 
Array arr Y Word16 => Readable (Image arr Y Word16) PGM Source # 
type StorageTy