HDRUtils-1.0.2: Utilities for reading, manipulating, and writing HDR imagesSource codeContentsIndex
Graphics.Image.PixelMap
Synopsis
type Channel = StorableArray (Int, Int) CFloat
data PixelMap = PixelMap {
tags :: [(String, String)]
pixels :: Map String (StorableArray (Int, Int) CFloat)
width :: Int
height :: Int
colorspace :: ColourSpace
}
class ImageData a where
toPixelMap :: a -> PixelMap
fromPixelMap :: PixelMap -> a
data ColourSpace
= Ciea
| Rgba (RGBSpace CFloat)
| Srgba
| SrgbaLinear
(!!) :: PixelMap -> (Int, Int) -> IO (AlphaColour CFloat)
(!/) :: PixelMap -> (Int, Int, String) -> IO CFloat
(!/=) :: (CFloat -> IO ()) -> CFloat -> IO ()
refChan :: PixelMap -> (Int, Int) -> String -> CFloat -> IO ()
(!=) :: (AlphaColour CFloat -> IO ()) -> AlphaColour CFloat -> IO ()
refPixel :: PixelMap -> (Int, Int) -> AlphaColour CFloat -> IO ()
Documentation
type Channel = StorableArray (Int, Int) CFloatSource
type of channels
data PixelMap Source
A pixel map, stored as separate 2D mutable, C-compatible arrays for each channel in w,h order
Constructors
PixelMap
tags :: [(String, String)]tags for TIFF files
pixels :: Map String (StorableArray (Int, Int) CFloat)the actual pixels. if the image is an CIE one then channels will be "X", "Y", "Z" (and possibly more). If it's RGB, then it's "R" "G" "B" (and possibly more)
width :: Intthe width of the image
height :: Intthe height of the image
colorspace :: ColourSpacethe color space of the image (see Data.Colour for more details)
class ImageData a whereSource
Converting to and from this portable PixelMap format
Methods
toPixelMapSource
:: a
-> PixelMapGo to a pixel map from an arbitrary type.
fromPixelMapSource
:: PixelMap
-> aGo from a pixel map to an arbitrary type.
show/hide Instances
data ColourSpace Source
Colourspace monikers representing different spaces in Data.Colour
Constructors
CieaCIE XYZa format. Don't worry if you don't have an alpha channel, it will be filled in if you don't.
Rgba (RGBSpace CFloat)RGBa with a defined colourspace
SrgbaSRGBa
SrgbaLinearLinear SRGBa colourspace
(!!) :: PixelMap -> (Int, Int) -> IO (AlphaColour CFloat)Source
Read an arbitrary pixel
(!/) :: PixelMap -> (Int, Int, String) -> IO CFloatSource
Read one channel from an arbitrary pixel
(!/=) :: (CFloat -> IO ()) -> CFloat -> IO ()Source
Write one channel of an arbitrary pixel
refChan :: PixelMap -> (Int, Int) -> String -> CFloat -> IO ()Source
Usage: refChan image (0,0) "R" !/= 1.0
(!=) :: (AlphaColour CFloat -> IO ()) -> AlphaColour CFloat -> IO ()Source
Write a colour to an arbitrary pixel
refPixel :: PixelMap -> (Int, Int) -> AlphaColour CFloat -> IO ()Source
Usage: refPixel image (0,0) != opaque black
Produced by Haddock version 2.4.2