bitmap-0.0.2: A library for handling and manipulating bitmaps (rectangular pixel arrays).
Safe HaskellNone
LanguageHaskell98

Data.Bitmap.IO.Pixels

Description

Accessing individual pixels.

Synopsis

Types

data IOBitmap1 t Source #

Newtypes for mutable bitmaps with a fixed number of channels (components per pixel)

Instances

Instances details
BitmapClass IOBitmap1 Source # 
Instance details

Defined in Data.Bitmap.IO.Pixels

data IOBitmap2 t Source #

Instances

Instances details
BitmapClass IOBitmap2 Source # 
Instance details

Defined in Data.Bitmap.IO.Pixels

data IOBitmap3 t Source #

Instances

Instances details
BitmapClass IOBitmap3 Source # 
Instance details

Defined in Data.Bitmap.IO.Pixels

data IOBitmap4 t Source #

Instances

Instances details
BitmapClass IOBitmap4 Source # 
Instance details

Defined in Data.Bitmap.IO.Pixels

Reading and writing pixels

withComponentPtr Source #

Arguments

:: PixelComponent t 
=> IOBitmap t

the bitmap

-> Offset

position (x,y)

-> Int

channel index {0,1,...,nchannels-1}

-> (Ptr t -> IO a)

user action

-> IO a 

Note that the resulting pointer is valid only within a line (because of the padding)

unsafeReadComponent Source #

Arguments

:: PixelComponent t 
=> IOBitmap t

the bitmap

-> Offset

position (x,y)

-> Int

channel index {0,1,...,nchannels-1}

-> IO t 

It is not very efficient to read/write lots of pixels this way.

unsafeWriteComponent Source #

Arguments

:: PixelComponent t 
=> IOBitmap t

the bitmap

-> Offset

position (x,y)

-> Int

channel index {0,1,...,nchannels-1}

-> t

the value to write

-> IO () 

unsafeReadComponents Source #

Arguments

:: PixelComponent t 
=> IOBitmap t

the bitmap

-> Offset

position (x,y)

-> Int

channel index {0,1,...,nchannels-1}

-> Int

the number of components to read

-> IO [t] 

Please note that the component array to read shouldn't cross the boundary between lines.

unsafeWriteComponents Source #

Arguments

:: PixelComponent t 
=> IOBitmap t

the bitmap

-> Offset

position (x,y)

-> Int

channel index {0,1,...,nchannels-1}

-> [t]

the components to write

-> IO () 

Please note that the component array to write shouldn't cross the boundary between lines.

unsafeReadPixel Source #

Arguments

:: PixelComponent t 
=> IOBitmap t

the bitmap

-> Offset

position (x,y)

-> IO [t] 

unsafeWritePixel3 :: PixelComponent t => IOBitmap3 t -> Offset -> (t, t, t) -> IO () Source #

unsafeWritePixel4 :: PixelComponent t => IOBitmap4 t -> Offset -> (t, t, t, t) -> IO () Source #