hip-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.

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.

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)>

Luma

data Y Source

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

Constructors

Y 

Instances

Enum Y Source 
Eq Y Source 
Show Y Source 
ColorSpace Y Source 
Monad (Pixel Y) Source 
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 
Eq e => Eq (Pixel Y e) Source 
Ord e => Ord (Pixel Y e) Source 
Show e => Show (Pixel Y e) Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) TIF Source 
ManifestArray arr Y Word16 => Writable (Image arr Y Word16) TIF Source 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TIF Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) TGA Source 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TGA Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) PNG Source 
ManifestArray arr Y Word16 => Writable (Image arr Y Word16) PNG Source 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) PNG Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) JPG Source 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) JPG Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) HDR Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) GIF Source 
ManifestArray arr Y Double => Writable (Image arr Y Double) BMP Source 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) BMP 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 = PixelY !e Source 
type PixelElt Y e = e Source 

data YA Source

Luma with Alpha channel.

Constructors

YA

Luma

AlphaYA

Alpha channel

Instances

Enum YA Source 
Eq YA Source 
Show YA Source 
Alpha YA Source 
ColorSpace YA Source 
Array arr YA Double => Readable [Image arr YA Double] [GIF] Source 
Eq e => Eq (Pixel YA e) Source 
Show e => Show (Pixel YA e) Source 
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 
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 
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 = Y Source 
data Pixel YA = PixelYA !e !e Source 
type PixelElt YA e = (e, e) Source 

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.

Minimal complete definition

Nothing

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 
Eq RGB Source 
Show RGB Source 
ColorSpace RGB Source 
ManifestArray arr RGB Double => Writable [(GifDelay, Image arr RGB Double)] [GIF] Source 
ManifestArray arr RGB Word8 => Writable [(GifDelay, Image arr RGB Word8)] [GIF] 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 
Show e => Show (Pixel RGB e) Source 
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 = PixelRGB !e !e !e Source 
type PixelElt RGB e = (e, e, e) Source 

data RGBA Source

Red, Green and Blue color space with Alpha channel.

Instances

Enum RGBA Source 
Eq RGBA Source 
Show RGBA Source 
Alpha RGBA Source 
ColorSpace RGBA 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 
Show e => Show (Pixel RGBA e) Source 
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) 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 = RGB Source 
data Pixel RGBA = PixelRGBA !e !e !e !e Source 
type PixelElt RGBA e = (e, e, e, e) Source 

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.

Minimal complete definition

Nothing

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 
Eq HSI Source 
Show HSI Source 
ColorSpace HSI Source 
Eq e => Eq (Pixel HSI e) Source 
Show e => Show (Pixel HSI e) Source 
data Pixel HSI = PixelHSI !e !e !e Source 
type PixelElt HSI e = (e, e, e) Source 

data HSIA Source

Hue, Saturation and Intensity color space with Alpha channel.

Constructors

HueHSIA

Hue

SatHSIA

Saturation

IntHSIA

Intensity

AlphaHSIA

Alpha

Instances

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.

Minimal complete definition

Nothing

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 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

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.

Minimal complete definition

Nothing

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

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.

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.

Minimal complete definition

Nothing

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 

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)>

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.

Constructors

!a :+ !a infix 6

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

Instances

Representable Complex 
(RealFloat a, Unbox a) => Vector Vector (Complex a) 
(RealFloat a, Unbox a) => MVector MVector (Complex a) 
Eq a => Eq (Complex a) 
RealFloat a => Floating (Complex a) 
RealFloat a => Fractional (Complex a) 
Data a => Data (Complex a) 
RealFloat a => Num (Complex a) 
Read a => Read (Complex a) 
Show a => Show (Complex a) 
Storable a => Storable (Complex a) 
NFData a => NFData (Complex a) 
(RealFloat a, Unbox a) => Unbox (Complex a) 
type Rep Complex = Bool 
data MVector s (Complex a) = MV_Complex (MVector s (a, a)) 
type Index (Complex a) = Int 
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 
Integral Word8 
Num Word8 
Ord Word8 
Read Word8 
Real Word8 
Show Word8 
Ix Word8 
Unpackable Word8

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

JpgEncodable Pixel8 
TiffSaveable Pixel8 
PngSavable Pixel8 
TgaSaveable Pixel8 
BmpEncodable Pixel8 
Pixel Pixel8 
LumaPlaneExtractable Pixel8 
PackeablePixel Pixel8 
Storable Word8 
Bits Word8 
FiniteBits Word8 
NFData Word8 
Hashable Word8 
Prim Word8 
Unbox Word8 
Elt Word8 
Lift 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 
Vector Vector Word8 
Source B Word8

Read elements from a ByteString.

MVector MVector Word8 
Structured B Word8 b 
MArray (STUArray s) Word8 (ST s) 
ManifestArray arr RGB Word8 => Writable [(GifDelay, Image arr RGB Word8)] [GIF] 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 
Read sh => Read (Array B sh Word8) 
Show sh => Show (Array B sh Word8) 
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 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) TIF 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 
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 
ManifestArray arr Y Word8 => Writable (Image arr Y Word8) PNG 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 
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 
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 = Word8 
type PixelBaseComponent Pixel8 = Word8 
type PackedRepresentation Pixel8 = Pixel8 
data Vector Word8 = V_Word8 (Vector Word8) 
data MVector s Word8 = MV_Word8 (MVector s Word8) 
data Array B sh Word8 = AByteString !sh !ByteString 

data Word16 :: *

16-bit unsigned integer type

Instances

Bounded Word16 
Enum Word16 
Eq Word16 
Integral Word16 
Num Word16 
Ord Word16 
Read Word16 
Real Word16 
Show Word16 
Ix Word16 
Unpackable Word16 
TiffSaveable Pixel16 
PngSavable Pixel16 
Pixel Pixel16 
LumaPlaneExtractable Pixel16 
PackeablePixel Pixel16 
Storable Word16 
Bits Word16 
FiniteBits Word16 
NFData Word16 
Hashable Word16 
Prim Word16 
Unbox Word16 
Elt Word16 
Lift Word16 
Decimable Pixel16 Pixel8 
TransparentPixel PixelYA16 Pixel16 
ColorConvertible Pixel8 Pixel16 
ColorConvertible Pixel16 PixelYA16 
ColorConvertible Pixel16 PixelRGB16 
ColorConvertible Pixel16 PixelRGBA16 
IArray UArray Word16 
Vector Vector Word16 
MVector MVector Word16 
MArray (STUArray s) 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 
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 
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 StorageType Word16 = Word16 
type PixelBaseComponent Pixel16 = Word16 
type PackedRepresentation Pixel16 = Pixel16 
data Vector Word16 = V_Word16 (Vector Word16) 
data MVector s Word16 = MV_Word16 (MVector s Word16)