Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Bitmap.IO.Pixels
Contents
Description
Accessing individual pixels.
Synopsis
- data IOBitmap1 t
- data IOBitmap2 t
- data IOBitmap3 t
- data IOBitmap4 t
- ioBitmap1 :: IOBitmap t -> IOBitmap1 t
- ioBitmap2 :: IOBitmap t -> IOBitmap2 t
- ioBitmap3 :: IOBitmap t -> IOBitmap3 t
- ioBitmap4 :: IOBitmap t -> IOBitmap4 t
- fromIOBitmap1 :: IOBitmap1 t -> IOBitmap t
- fromIOBitmap2 :: IOBitmap2 t -> IOBitmap t
- fromIOBitmap3 :: IOBitmap3 t -> IOBitmap t
- fromIOBitmap4 :: IOBitmap4 t -> IOBitmap t
- withComponentPtr :: PixelComponent t => IOBitmap t -> Offset -> Int -> (Ptr t -> IO a) -> IO a
- unsafeReadComponent :: PixelComponent t => IOBitmap t -> Offset -> Int -> IO t
- unsafeWriteComponent :: PixelComponent t => IOBitmap t -> Offset -> Int -> t -> IO ()
- unsafeReadComponents :: PixelComponent t => IOBitmap t -> Offset -> Int -> Int -> IO [t]
- unsafeWriteComponents :: PixelComponent t => IOBitmap t -> Offset -> Int -> [t] -> IO ()
- unsafeReadPixel :: PixelComponent t => IOBitmap t -> Offset -> IO [t]
- unsafeReadPixel1 :: PixelComponent t => IOBitmap1 t -> Offset -> IO t
- unsafeReadPixel2 :: PixelComponent t => IOBitmap2 t -> Offset -> IO (t, t)
- unsafeReadPixel3 :: PixelComponent t => IOBitmap3 t -> Offset -> IO (t, t, t)
- unsafeReadPixel4 :: PixelComponent t => IOBitmap4 t -> Offset -> IO (t, t, t, t)
- unsafeWritePixel1 :: PixelComponent t => IOBitmap1 t -> Offset -> t -> IO ()
- unsafeWritePixel2 :: PixelComponent t => IOBitmap2 t -> Offset -> (t, t) -> IO ()
- unsafeWritePixel3 :: PixelComponent t => IOBitmap3 t -> Offset -> (t, t, t) -> IO ()
- unsafeWritePixel4 :: PixelComponent t => IOBitmap4 t -> Offset -> (t, t, t, t) -> IO ()
Types
Newtypes for mutable bitmaps with a fixed number of channels (components per pixel)
Instances
BitmapClass IOBitmap1 Source # | |
Defined in Data.Bitmap.IO.Pixels Methods underlyingBitmap :: IOBitmap1 t -> Bitmap t |
Instances
BitmapClass IOBitmap2 Source # | |
Defined in Data.Bitmap.IO.Pixels Methods underlyingBitmap :: IOBitmap2 t -> Bitmap t |
Instances
BitmapClass IOBitmap3 Source # | |
Defined in Data.Bitmap.IO.Pixels Methods underlyingBitmap :: IOBitmap3 t -> Bitmap t |
Instances
BitmapClass IOBitmap4 Source # | |
Defined in Data.Bitmap.IO.Pixels Methods underlyingBitmap :: IOBitmap4 t -> Bitmap t |
fromIOBitmap1 :: IOBitmap1 t -> IOBitmap t Source #
fromIOBitmap2 :: IOBitmap2 t -> IOBitmap t Source #
fromIOBitmap3 :: IOBitmap3 t -> IOBitmap t Source #
fromIOBitmap4 :: IOBitmap4 t -> IOBitmap t Source #
Reading and writing pixels
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)
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.
Arguments
:: PixelComponent t | |
=> IOBitmap t | the bitmap |
-> Offset | position (x,y) |
-> Int | channel index {0,1,...,nchannels-1} |
-> t | the value to write |
-> IO () |
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.
Arguments
:: PixelComponent t | |
=> IOBitmap t | the bitmap |
-> Offset | position (x,y) |
-> IO [t] |
unsafeReadPixel1 :: PixelComponent t => IOBitmap1 t -> Offset -> IO t Source #
unsafeReadPixel2 :: PixelComponent t => IOBitmap2 t -> Offset -> IO (t, t) Source #
unsafeReadPixel3 :: PixelComponent t => IOBitmap3 t -> Offset -> IO (t, t, t) Source #
unsafeReadPixel4 :: PixelComponent t => IOBitmap4 t -> Offset -> IO (t, t, t, t) Source #
unsafeWritePixel1 :: PixelComponent t => IOBitmap1 t -> Offset -> t -> IO () Source #
unsafeWritePixel2 :: PixelComponent t => IOBitmap2 t -> Offset -> (t, t) -> IO () Source #
unsafeWritePixel3 :: PixelComponent t => IOBitmap3 t -> Offset -> (t, t, t) -> IO () Source #
unsafeWritePixel4 :: PixelComponent t => IOBitmap4 t -> Offset -> (t, t, t, t) -> IO () Source #