Copyright | (c) Alexey Kuleshevich 2017 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
- data family Pixel cs e :: *
- toPixelY :: ToY cs e => Pixel cs e -> Pixel Y Double
- toImageY :: (ToY cs e, Array arr cs e, Array arr Y Double) => Image arr cs e -> Image arr Y Double
- toPixelYA :: ToYA cs e => Pixel cs e -> Pixel YA Double
- toImageYA :: (ToYA cs e, Array arr cs e, Array arr YA Double) => Image arr cs e -> Image arr YA Double
- toPixelRGB :: ToRGB cs e => Pixel cs e -> Pixel RGB Double
- toImageRGB :: (ToRGB cs e, Array arr cs e, Array arr RGB Double) => Image arr cs e -> Image arr RGB Double
- toPixelRGBA :: ToRGBA cs e => Pixel cs e -> Pixel RGBA Double
- toImageRGBA :: (ToRGBA cs e, Array arr cs e, Array arr RGBA Double) => Image arr cs e -> Image arr RGBA Double
- toPixelHSI :: ToHSI cs e => Pixel cs e -> Pixel HSI Double
- toImageHSI :: (ToHSI cs e, Array arr cs e, Array arr HSI Double) => Image arr cs e -> Image arr HSI Double
- toPixelHSIA :: ToHSIA cs e => Pixel cs e -> Pixel HSIA Double
- toImageHSIA :: (ToHSIA cs e, Array arr cs e, Array arr HSIA Double) => Image arr cs e -> Image arr HSIA Double
- toPixelCMYK :: ToCMYK cs e => Pixel cs e -> Pixel CMYK Double
- toImageCMYK :: (ToCMYK cs e, Array arr cs e, Array arr CMYK Double) => Image arr cs e -> Image arr CMYK Double
- toPixelCMYKA :: ToCMYKA cs e => Pixel cs e -> Pixel CMYKA Double
- toImageCMYKA :: (ToCMYKA cs e, Array arr cs e, Array arr CMYKA Double) => Image arr cs e -> Image arr CMYKA Double
- toPixelYCbCr :: ToYCbCr cs e => Pixel cs e -> Pixel YCbCr Double
- toImageYCbCr :: (ToYCbCr cs e, Array arr cs e, Array arr YCbCr Double) => Image arr cs e -> Image arr YCbCr Double
- toPixelYCbCrA :: ToYCbCrA cs e => Pixel cs e -> Pixel YCbCrA Double
- toImageYCbCrA :: (ToYCbCrA cs e, Array arr cs e, Array arr YCbCrA Double) => Image arr cs e -> Image arr YCbCrA Double
- toPixelBinary :: ColorSpace cs e => Pixel cs e -> Pixel X Bit
- fromPixelBinary :: Pixel X Bit -> Pixel Y Word8
- toImageBinary :: (Array arr cs e, Array arr X Bit) => Image arr cs e -> Image arr X Bit
- fromImageBinary :: (Array arr X Bit, Array arr Y Word8) => Image arr X Bit -> Image arr Y Word8
- newtype Bit = Bit Word8
- on :: Pixel X Bit
- off :: Pixel X Bit
- isOn :: Pixel X Bit -> Bool
- isOff :: Pixel X Bit -> Bool
- fromBool :: Bool -> Pixel X Bit
- zero :: Bit
- one :: Bit
- bit2bool :: Bit -> Bool
- bool2bit :: Bool -> Bit
- toNum :: Num a => Bit -> a
- fromNum :: (Eq a, Num a) => a -> Bit
- data Complex a :: * -> * = ~a :+ ~a
- (+:) :: Applicative (Pixel cs) => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e)
- realPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- imagPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- mkPolar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs e -> Pixel cs e -> Pixel cs (Complex e)
- cis :: (Applicative (Pixel cs), RealFloat e) => Pixel cs e -> Pixel cs (Complex e)
- polar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> (Pixel cs e, Pixel cs e)
- magnitude :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- phase :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e
- conjugate :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs (Complex e)
- squashWith :: (Array arr cs e, Array arr X b) => (b -> e -> b) -> b -> Image arr cs e -> Image arr X b
- squashWith2 :: (Array arr cs e, Array arr X b) => (b -> e -> e -> b) -> b -> Image arr cs e -> Image arr cs e -> Image arr X b
- toPixelsX :: ColorSpace cs e => Pixel cs e -> [Pixel X e]
- fromPixelsX :: ColorSpace cs e => [(cs, Pixel X e)] -> Pixel cs e
- toImagesX :: (Array arr cs e, Array arr X e) => Image arr cs e -> [Image arr X e]
- fromImagesX :: (Array arr X e, Array arr cs e) => [(cs, Image arr X e)] -> Image arr cs e
- eqTolPx :: (ColorSpace cs e, Ord e) => e -> Pixel cs e -> Pixel cs e -> Bool
- data Y = LumaY
- data YA
- class ColorSpace cs e => ToY cs e where
- class ToY cs e => ToYA cs e where
- data RGB
- data RGBA
- class ColorSpace cs e => ToRGB cs e where
- class ToRGB cs e => ToRGBA cs e where
- data HSI
- data HSIA
- class ColorSpace cs e => ToHSI cs e where
- class ToHSI cs e => ToHSIA cs e where
- data CMYK
- data CMYKA
- class ColorSpace cs e => ToCMYK cs e where
- class ToCMYK cs e => ToCMYKA cs e where
- data YCbCr
- data YCbCrA
- class ColorSpace cs e => ToYCbCr cs e where
- class ToYCbCr cs e => ToYCbCrA cs e where
- data X = X
- toWord8I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word8) => Image arr cs e -> Image arr cs Word8
- toWord16I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word16) => Image arr cs e -> Image arr cs Word16
- toWord32I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word32) => Image arr cs e -> Image arr cs Word32
- toFloatI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Float) => Image arr cs e -> Image arr cs Float
- toDoubleI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Double) => Image arr cs e -> Image arr cs Double
- toWord8Px :: (Functor (Pixel cs), Elevator e) => Pixel cs e -> Pixel cs Word8
- data Word8 :: *
- data Word16 :: *
- data Word32 :: *
- data Word64 :: *
Pixels
Family of Pixels
Pixel is a type family for all available color spaces. Below is the listed of all class instances, that pixels are installed in, as well as all pixel constructors.
>>>
:t (PixelY 0) -- Black pixel in Luma
(PixelY 0) :: Num e => Pixel Y e>>>
PixelRGB 255 0 0 :: Pixel RGB Word8 -- Red pixel in RGB
<RGB:(255|0|0)>>>>
PixelRGB 1 0 0 :: Pixel RGB Double -- Same red pixel in RGB with Double precision.
<RGB:(1.0|0.0|0.0)>>>>
(PixelRGB 255 0 0 :: Pixel RGB Word8) == (toWord8 <$> (PixelRGB 1 0 0 :: Pixel RGB Double))
True
data family Pixel cs e :: * Source #
A Pixel family with a color space and a precision of elements.
Luma (gray scale)
Conversion to Luma from other color spaces.
toImageY :: (ToY cs e, Array arr cs e, Array arr Y Double) => Image arr cs e -> Image arr Y Double Source #
Convert an image to Luma image.
toPixelYA :: ToYA cs e => Pixel cs e -> Pixel YA Double Source #
Convert a pixel to Luma pixel with Alpha.
toImageYA :: (ToYA cs e, Array arr cs e, Array arr YA Double) => Image arr cs e -> Image arr YA Double Source #
Convert an image to Luma image with Alpha.
RGB
Conversion to RGB from other color spaces.
toImageRGB :: (ToRGB cs e, Array arr cs e, Array arr RGB Double) => Image arr cs e -> Image arr RGB Double Source #
Convert to an RGB
image.
toImageRGBA :: (ToRGBA cs e, Array arr cs e, Array arr RGBA Double) => Image arr cs e -> Image arr RGBA Double Source #
Convert to an RGBA
image.
HSI
Conversion to HSI from other color spaces.
toImageHSI :: (ToHSI cs e, Array arr cs e, Array arr HSI Double) => Image arr cs e -> Image arr HSI Double Source #
Convert to an HSI
image.
toImageHSIA :: (ToHSIA cs e, Array arr cs e, Array arr HSIA Double) => Image arr cs e -> Image arr HSIA Double Source #
Convert to an HSIA
image.
CMYK
Conversion to CMYK from other color spaces.
toImageCMYK :: (ToCMYK cs e, Array arr cs e, Array arr CMYK Double) => Image arr cs e -> Image arr CMYK Double Source #
Convert to a CMYK
image.
toImageCMYKA :: (ToCMYKA cs e, Array arr cs e, Array arr CMYKA Double) => Image arr cs e -> Image arr CMYKA Double Source #
Convert to a CMYKA
image.
YCbCr
Conversion to YCbCr from other color spaces.
toImageYCbCr :: (ToYCbCr cs e, Array arr cs e, Array arr YCbCr Double) => Image arr cs e -> Image arr YCbCr Double Source #
Convert to an YCbCr
image.
toPixelYCbCrA :: ToYCbCrA cs e => Pixel cs e -> Pixel YCbCrA Double Source #
Convert to an YCbCrA
pixel.
toImageYCbCrA :: (ToYCbCrA cs e, Array arr cs e, Array arr YCbCrA Double) => Image arr cs e -> Image arr YCbCrA Double Source #
Convert to an YCbCrA
image.
Binary
This is a Binary colorspace, pixel's of which can be created using these constructors:
on
- Represents value
1
orTrue
. It's a foreground pixel and is displayed in black. off
- Represents value
0
orFalse
. 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)>
toPixelBinary :: ColorSpace cs e => Pixel cs e -> Pixel X Bit Source #
Convert to a Binary
pixel.
toImageBinary :: (Array arr cs e, Array arr X Bit) => Image arr cs e -> Image arr X Bit Source #
Convert to a Binary
image.
fromImageBinary :: (Array arr X Bit, Array arr Y Word8) => Image arr X Bit -> Image arr Y Word8 Source #
Convert a Binary image to Luma image
Under the hood, binary pixels are represented as Word8
, but can only take
values of 0
or 1
. Use zero
/one
to construct a bit and on
/off
to
construct a binary pixel.
Eq Bit Source # | |
Num Bit Source # | |
Ord Bit Source # | |
Show Bit Source # | |
Storable Bit Source # | |
Bits Bit Source # | |
Unbox Bit Source # | Unboxing of a |
Elevator Bit Source # | Values: |
Vector Vector Bit Source # | |
MVector MVector Bit Source # | |
ToRGBA X Bit Source # | |
ToRGB X Bit Source # | |
ToYA X Bit Source # | |
Readable [Image VS X Bit] (Seq PBM) Source # | |
Bits (Pixel X Bit) Source # | |
Writable (Image VS X Bit) TIF Source # | |
Writable (Image VS X Bit) TGA Source # | |
Writable (Image VS X Bit) PNG Source # | |
Writable (Image VS X Bit) BMP Source # | |
Readable (Image VS X Bit) TIF Source # | |
Readable (Image VS X Bit) TGA Source # | |
Readable (Image VS X Bit) PNG Source # | |
Readable (Image VS X Bit) BMP Source # | |
Readable (Image VS X Bit) PBM Source # | |
data Vector Bit Source # | |
data MVector s Bit Source # | |
Represents value True
or 1
in binary. Often also called a foreground
pixel of an object.
Represents value False
or 0
in binary. Often also called a background
pixel.
fromBool :: Bool -> Pixel X Bit Source #
Convert a Bool
to a binary pixel.
>>>
isOn (fromBool True)
True
Complex
Rectangular form
Complex numbers are an algebraic type.
For a complex number z
,
is a number with the magnitude of abs
zz
,
but oriented in the positive real direction, whereas
has the phase of signum
zz
, but unit magnitude.
The Foldable
and Traversable
instances traverse the real part first.
~a :+ ~a infix 6 | forms a complex number from its real and imaginary rectangular components. |
realPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #
Extracts the real part of a complex pixel.
imagPart :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #
Extracts the imaginary part of a complex pixel.
Polar form
mkPolar :: (Applicative (Pixel 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.
polar :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> (Pixel cs e, Pixel cs e) Source #
magnitude :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs e Source #
The nonnegative magnitude of a complex pixel.
Conjugate
conjugate :: (Applicative (Pixel cs), RealFloat e) => Pixel cs (Complex e) -> Pixel cs (Complex e) Source #
The conjugate of a complex pixel.
X
squashWith :: (Array arr cs e, Array arr X b) => (b -> e -> b) -> b -> Image arr cs e -> Image arr X b Source #
Apply a left fold to each of the pixels in the image.
squashWith2 :: (Array arr cs e, Array arr X b) => (b -> e -> e -> b) -> b -> Image arr cs e -> Image arr cs e -> Image arr X b Source #
Combination of zipWith and simultanious left fold on two pixels at the same time.
toPixelsX :: ColorSpace cs e => Pixel cs e -> [Pixel X e] Source #
Separate a Pixel into a list of components with X
pixels containing every
component from the pixel.
>>>
toPixelsX (PixelRGB 4 5 6)
[<X:(4)>,<X:(5)>,<X:(6)>]
fromPixelsX :: ColorSpace cs e => [(cs, Pixel X e)] -> Pixel cs e Source #
Combine a list of X
pixels into a Pixel with a specified channel
order. Not the most efficient way to construct a pixel, but might prove
useful to someone.
>>>
fromPixelsX [(RedRGB, 3), (BlueRGB, 5), (GreenRGB, 4)]
<RGB:(3.0|4.0|5.0)>>>>
fromPixelsX $ zip (enumFrom RedRGB) (toPixelsX $ PixelRGB 4 5 6)
<RGB:(4.0|5.0|6.0)>
toImagesX :: (Array arr cs e, Array arr X e) => Image arr cs e -> [Image arr X e] Source #
Separate an image into a list of images with X
pixels containing every
channel from the source image.
>>>
frog <- readImageRGB "images/frog.jpg"
>>>
let [frog_red, frog_green, frog_blue] = toImagesX 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
fromImagesX :: (Array arr X e, Array arr cs e) => [(cs, Image arr X e)] -> Image arr cs e Source #
Combine a list of images with X
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" $ fromImagesX [(RedRGB, frog_red), (BlueRGB, frog_green), (GreenRGB, frog_blue)]
It is worth noting though, despite that separating image channels can be sometimes pretty useful, exactly the same effect as in example above can be achieved in a much simpler and a more efficient way:
map
(\(PixelRGB r g b) -> PixelRGB r b g) frog
ColorSpace
Operations on Pixels
Luma
Luma or brightness, which is usually denoted as Y'
.
Luma with Alpha channel.
class ColorSpace cs e => ToY cs e where Source #
Conversion to Luma color space.
Elevator e => ToY YCbCrA e Source # | |
Elevator e => ToY YCbCr e Source # | |
Elevator e => ToY YA e Source # | |
Elevator e => ToY Y e Source # | |
Elevator e => ToY X e Source # | |
Elevator e => ToY RGBA e Source # | |
Elevator e => ToY RGB e Source # | Computes Luma: |
Elevator e => ToY HSIA e Source # | |
Elevator e => ToY HSI e Source # | |
Elevator e => ToY CMYKA e Source # | |
Elevator e => ToY CMYK e Source # | |
class ToY cs e => ToYA cs e where Source #
Conversion to Luma from another color space.
Elevator e => ToYA YCbCrA e Source # | |
ToY YCbCr e => ToYA YCbCr e Source # | |
Elevator e => ToYA YA e Source # | |
ToY Y e => ToYA Y e Source # | |
ToYA X Bit Source # | |
Elevator e => ToYA RGBA e Source # | |
ToY RGB e => ToYA RGB e Source # | |
Elevator e => ToYA HSIA e Source # | |
ToY HSI e => ToYA HSI e Source # | |
Elevator e => ToYA CMYKA e Source # | |
ToY CMYK e => ToYA CMYK e Source # | |
RGB
Red, Green and Blue color space.
Red, Green and Blue color space with Alpha channel.
class ColorSpace cs e => ToRGB cs e where Source #
Conversion to RGB
color space.
Elevator e => ToRGB YCbCrA e Source # | |
Elevator e => ToRGB YCbCr e Source # | |
Elevator e => ToRGB YA e Source # | |
Elevator e => ToRGB Y e Source # | |
ToRGB X Bit Source # | |
Elevator e => ToRGB RGBA e Source # | |
Elevator e => ToRGB RGB e Source # | |
Elevator e => ToRGB HSIA e Source # | |
Elevator e => ToRGB HSI e Source # | |
Elevator e => ToRGB CMYKA e Source # | |
Elevator e => ToRGB CMYK e Source # | |
class ToRGB cs e => ToRGBA cs e where Source #
Conversion to RGBA
from another color space with Alpha channel.
Elevator e => ToRGBA YCbCrA e Source # | |
ToRGB YCbCr e => ToRGBA YCbCr e Source # | |
Elevator e => ToRGBA YA e Source # | |
ToRGB Y e => ToRGBA Y e Source # | |
ToRGBA X Bit Source # | |
Elevator e => ToRGBA RGBA e Source # | |
ToRGB RGB e => ToRGBA RGB e Source # | |
Elevator e => ToRGBA HSIA e Source # | |
ToRGB HSI e => ToRGBA HSI e Source # | |
Elevator e => ToRGBA CMYKA e Source # | |
ToRGB CMYK e => ToRGBA CMYK e Source # | |
HSI
Hue, Saturation and Intensity color space.
Bounded HSI Source # | |
Enum HSI Source # | |
Eq HSI Source # | |
Show HSI Source # | |
ChannelColour HSI Source # | |
Elevator e => ColorSpace HSI e Source # | |
ToYCbCr HSI e => ToYCbCrA HSI e Source # | |
Elevator e => ToYCbCr HSI e Source # | |
ToCMYK HSI e => ToCMYKA HSI e Source # | |
Elevator e => ToCMYK HSI e Source # | |
ToHSI HSI e => ToHSIA HSI e Source # | |
Elevator e => ToHSI HSI e Source # | |
ToRGB HSI e => ToRGBA HSI e Source # | |
Elevator e => ToRGB HSI e Source # | |
ToY HSI e => ToYA HSI e Source # | |
Elevator e => ToY HSI e Source # | |
Functor (Pixel HSI) Source # | |
Applicative (Pixel HSI) Source # | |
Foldable (Pixel HSI) Source # | |
Eq e => Eq (Pixel HSI e) Source # | |
Show e => Show (Pixel HSI e) Source # | |
Storable e => Storable (Pixel HSI e) Source # | |
data Pixel HSI Source # | |
type Components HSI e Source # | |
Hue, Saturation and Intensity color space with Alpha channel.
Bounded HSIA Source # | |
Enum HSIA Source # | |
Eq HSIA Source # | |
Show HSIA Source # | |
ChannelColour HSIA Source # | |
Elevator e => AlphaSpace HSIA e Source # | |
Elevator e => ColorSpace HSIA e Source # | |
Elevator e => ToYCbCrA HSIA e Source # | |
Elevator e => ToYCbCr HSIA e Source # | |
Elevator e => ToCMYKA HSIA e Source # | |
Elevator e => ToCMYK HSIA e Source # | |
Elevator e => ToHSIA HSIA e Source # | |
Elevator e => ToHSI HSIA e Source # | |
Elevator e => ToRGBA HSIA e Source # | |
Elevator e => ToRGB HSIA e Source # | |
Elevator e => ToYA HSIA e Source # | |
Elevator e => ToY HSIA e Source # | |
Functor (Pixel HSIA) Source # | |
Applicative (Pixel HSIA) Source # | |
Foldable (Pixel HSIA) Source # | |
Eq e => Eq (Pixel HSIA e) Source # | |
Show e => Show (Pixel HSIA e) Source # | |
Storable e => Storable (Pixel HSIA e) Source # | |
type Opaque HSIA Source # | |
data Pixel HSIA Source # | |
type Components HSIA e Source # | |
class ColorSpace cs e => ToHSI cs e where Source #
Conversion to HSI
color space.
Elevator e => ToHSI YCbCrA e Source # | |
Elevator e => ToHSI YCbCr e Source # | |
Elevator e => ToHSI YA e Source # | |
Elevator e => ToHSI Y e Source # | |
Elevator e => ToHSI RGBA e Source # | |
Elevator e => ToHSI RGB e Source # | |
Elevator e => ToHSI HSIA e Source # | |
Elevator e => ToHSI HSI e Source # | |
Elevator e => ToHSI CMYKA e Source # | |
Elevator e => ToHSI CMYK e Source # | |
class ToHSI cs e => ToHSIA cs e where Source #
Conversion to HSIA
from another color space with Alpha channel.
Elevator e => ToHSIA YCbCrA e Source # | |
ToHSI YCbCr e => ToHSIA YCbCr e Source # | |
Elevator e => ToHSIA YA e Source # | |
ToHSI Y e => ToHSIA Y e Source # | |
Elevator e => ToHSIA RGBA e Source # | |
ToHSI RGB e => ToHSIA RGB e Source # | |
Elevator e => ToHSIA HSIA e Source # | |
ToHSI HSI e => ToHSIA HSI e Source # | |
Elevator e => ToHSIA CMYKA e Source # | |
ToHSI CMYK e => ToHSIA CMYK e Source # | |
CMYK
Cyan, Magenta, Yellow and Black color space.
Cyan, Magenta, Yellow and Black color space with Alpha channel.
CyanCMYKA | Cyan |
MagCMYKA | Magenta |
YelCMYKA | Yellow |
KeyCMYKA | Key (Black) |
AlphaCMYKA | Alpha |
Bounded CMYKA Source # | |
Enum CMYKA Source # | |
Eq CMYKA Source # | |
Show CMYKA Source # | |
ChannelColour CMYKA Source # | |
Elevator e => AlphaSpace CMYKA e Source # | |
Elevator e => ColorSpace CMYKA e Source # | |
Elevator e => ToYCbCrA CMYKA e Source # | |
Elevator e => ToYCbCr CMYKA e Source # | |
Elevator e => ToCMYKA CMYKA e Source # | |
Elevator e => ToCMYK CMYKA e Source # | |
Elevator e => ToHSIA CMYKA e Source # | |
Elevator e => ToHSI CMYKA e Source # | |
Elevator e => ToRGBA CMYKA e Source # | |
Elevator e => ToRGB CMYKA e Source # | |
Elevator e => ToYA CMYKA e Source # | |
Elevator e => ToY CMYKA e Source # | |
Functor (Pixel CMYKA) Source # | |
Applicative (Pixel CMYKA) Source # | |
Foldable (Pixel CMYKA) Source # | |
Eq e => Eq (Pixel CMYKA e) Source # | |
Show e => Show (Pixel CMYKA e) Source # | |
Storable e => Storable (Pixel CMYKA e) Source # | |
type Opaque CMYKA Source # | |
data Pixel CMYKA Source # | |
type Components CMYKA e Source # | |
class ColorSpace cs e => ToCMYK cs e where Source #
Conversion to CMYK
color space.
Elevator e => ToCMYK YCbCrA e Source # | |
Elevator e => ToCMYK YCbCr e Source # | |
Elevator e => ToCMYK YA e Source # | |
Elevator e => ToCMYK Y e Source # | |
Elevator e => ToCMYK RGBA e Source # | |
Elevator e => ToCMYK RGB e Source # | |
Elevator e => ToCMYK HSIA e Source # | |
Elevator e => ToCMYK HSI e Source # | |
Elevator e => ToCMYK CMYKA e Source # | |
Elevator e => ToCMYK CMYK e Source # | |
class ToCMYK cs e => ToCMYKA cs e where Source #
Conversion to CMYKA
.
Elevator e => ToCMYKA YCbCrA e Source # | |
ToCMYK YCbCr e => ToCMYKA YCbCr e Source # | |
Elevator e => ToCMYKA YA e Source # | |
ToCMYK Y e => ToCMYKA Y e Source # | |
Elevator e => ToCMYKA RGBA e Source # | |
ToCMYK RGB e => ToCMYKA RGB e Source # | |
Elevator e => ToCMYKA HSIA e Source # | |
ToCMYK HSI e => ToCMYKA HSI e Source # | |
Elevator e => ToCMYKA CMYKA e Source # | |
ToCMYK CMYK e => ToCMYKA CMYK e Source # | |
YCbCr
Color space is used to encode RGB information and is used in JPEG compression.
LumaYCbCr | Luma component (commonly denoted as Y') |
CBlueYCbCr | Blue difference chroma component |
CRedYCbCr | Red difference chroma component |
YCbCr color space with Alpha channel.
LumaYCbCrA | Luma component (commonly denoted as Y') |
CBlueYCbCrA | Blue difference chroma component |
CRedYCbCrA | Red difference chroma component |
AlphaYCbCrA | Alpha component. |
Bounded YCbCrA Source # | |
Enum YCbCrA Source # | |
Eq YCbCrA Source # | |
Show YCbCrA Source # | |
ChannelColour YCbCrA Source # | |
Elevator e => AlphaSpace YCbCrA e Source # | |
Elevator e => ColorSpace YCbCrA e Source # | |
Elevator e => ToYCbCrA YCbCrA e Source # | |
Elevator e => ToYCbCr YCbCrA e Source # | |
Elevator e => ToCMYKA YCbCrA e Source # | |
Elevator e => ToCMYK YCbCrA e Source # | |
Elevator e => ToHSIA YCbCrA e Source # | |
Elevator e => ToHSI YCbCrA e Source # | |
Elevator e => ToRGBA YCbCrA e Source # | |
Elevator e => ToRGB YCbCrA e Source # | |
Elevator e => ToYA YCbCrA e Source # | |
Elevator e => ToY YCbCrA e Source # | |
Functor (Pixel YCbCrA) Source # | |
Applicative (Pixel YCbCrA) Source # | |
Foldable (Pixel YCbCrA) Source # | |
Eq e => Eq (Pixel YCbCrA e) Source # | |
Show e => Show (Pixel YCbCrA e) Source # | |
Storable e => Storable (Pixel YCbCrA e) Source # | |
type Opaque YCbCrA Source # | |
data Pixel YCbCrA Source # | |
type Components YCbCrA e Source # | |
class ColorSpace cs e => ToYCbCr cs e where Source #
Conversion to YCbCr
color space.
Elevator e => ToYCbCr YCbCrA e Source # | |
Elevator e => ToYCbCr YCbCr e Source # | |
Elevator e => ToYCbCr YA e Source # | |
Elevator e => ToYCbCr Y e Source # | |
Elevator e => ToYCbCr RGBA e Source # | |
Elevator e => ToYCbCr RGB e Source # | |
Elevator e => ToYCbCr HSIA e Source # | |
Elevator e => ToYCbCr HSI e Source # | |
Elevator e => ToYCbCr CMYKA e Source # | |
Elevator e => ToYCbCr CMYK e Source # | |
class ToYCbCr cs e => ToYCbCrA cs e where Source #
Conversion to YCbCrA
from another color space with Alpha channel.
Elevator e => ToYCbCrA YCbCrA e Source # | |
ToYCbCr YCbCr e => ToYCbCrA YCbCr e Source # | |
Elevator e => ToYCbCrA YA e Source # | |
ToYCbCr Y e => ToYCbCrA Y e Source # | |
Elevator e => ToYCbCrA RGBA e Source # | |
ToYCbCr RGB e => ToYCbCrA RGB e Source # | |
Elevator e => ToYCbCrA HSIA e Source # | |
ToYCbCr HSI e => ToYCbCrA HSI e Source # | |
Elevator e => ToYCbCrA CMYKA e Source # | |
ToYCbCr CMYK e => ToYCbCrA CMYK e Source # | |
X
This is a single channel colorspace, that is designed to separate Gray
level values from other types of colorspace, hence it is not convertible to
or from, but rather is here to allow operation on arbirtary single channel
images. If you are looking for a true grayscale colorspace
Y
should be used instead.
Bounded X Source # | |
Enum X Source # | |
Eq X Source # | |
Show X Source # | |
ChannelColour X Source # | |
Elevator e => ColorSpace X e Source # | |
ToRGBA X Bit Source # | |
ToRGB X Bit Source # | |
ToYA X Bit Source # | |
Elevator e => ToY X e Source # | |
Monad (Pixel X) Source # | |
Functor (Pixel X) Source # | |
Applicative (Pixel X) Source # | |
Foldable (Pixel X) Source # | |
Readable [Image VS X Bit] (Seq PBM) Source # | |
Eq e => Eq (Pixel X e) Source # | |
Ord e => Ord (Pixel X e) Source # | |
Show e => Show (Pixel X e) Source # | |
Storable e => Storable (Pixel X e) Source # | |
Bits (Pixel X Bit) # | |
Writable (Image VS X Bit) TIF Source # | |
Writable (Image VS X Bit) TGA Source # | |
Writable (Image VS X Bit) PNG Source # | |
Writable (Image VS X Bit) BMP Source # | |
Readable (Image VS X Bit) TIF Source # | |
Readable (Image VS X Bit) TGA Source # | |
Readable (Image VS X Bit) PNG Source # | |
Readable (Image VS X Bit) BMP Source # | |
Readable (Image VS X Bit) PBM Source # | |
data Pixel X Source # | |
type Components X e Source # | |
Precision
Image
toWord8I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word8) => Image arr cs e -> Image arr cs Word8 Source #
Change image precision to Word8
.
toWord16I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word16) => Image arr cs e -> Image arr cs Word16 Source #
Change image precision to Word16
.
toWord32I :: (Functor (Pixel cs), Array arr cs e, Array arr cs Word32) => Image arr cs e -> Image arr cs Word32 Source #
Change image precision to Word32
.
toFloatI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Float) => Image arr cs e -> Image arr cs Float Source #
Change image precision to Float
.
toDoubleI :: (Functor (Pixel cs), Array arr cs e, Array arr cs Double) => Image arr cs e -> Image arr cs Double Source #
Change image precision to Double
.
Pixel
toWord8Px :: (Functor (Pixel cs), Elevator e) => Pixel cs e -> Pixel cs Word8 Source #
Change pixel precision to Word8
.
Componenet
8-bit unsigned integer type
16-bit unsigned integer type
32-bit unsigned integer type
Bounded Word32 | |
Enum Word32 | |
Eq Word32 | |
Integral Word32 | |
Num Word32 | |
Ord Word32 | |
Read Word32 | |
Real Word32 | |
Show Word32 | |
Ix Word32 | |
Lift Word32 | |
Default Word32 | |
Unpackable Word32 | |
Pixel Pixel32 | |
LumaPlaneExtractable Pixel32 | |
PackeablePixel Pixel32 | |
Storable Word32 | |
Bits Word32 | |
FiniteBits Word32 | |
NFData Word32 | |
Prim Word32 | |
Unbox Word32 | |
Elt Word32 | |
Elevator Word32 Source # | Values between |
IArray UArray Word32 | |
Vector Vector Word32 | |
MVector MVector Word32 | |
MArray (STUArray s) Word32 (ST s) | |
type StorageType Word32 | |
type PixelBaseComponent Pixel32 | |
type PackedRepresentation Pixel32 | |
type Unsigned Word32 | |
type Signed Word32 | |
data Vector Word32 | |
data MVector s Word32 | |
64-bit unsigned integer type
Bounded Word64 | |
Enum Word64 | |
Eq Word64 | |
Integral Word64 | |
Num Word64 | |
Ord Word64 | |
Read Word64 | |
Real Word64 | |
Show Word64 | |
Ix Word64 | |
Lift Word64 | |
Default Word64 | |
Storable Word64 | |
Bits Word64 | |
FiniteBits Word64 | |
NFData Word64 | |
Prim Word64 | |
Unbox Word64 | |
Elt Word64 | |
Elevator Word64 Source # | Values between |
IArray UArray Word64 | |
Vector Vector Word64 | |
MVector MVector Word64 | |
MArray (STUArray s) Word64 (ST s) | |
type Unsigned Word64 | |
type Signed Word64 | |
data Vector Word64 | |
data MVector s Word64 | |