Safe Haskell | Safe-Infered |
---|
Accessing individual pixels.
- 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)
fromIOBitmap1 :: IOBitmap1 t -> IOBitmap tSource
fromIOBitmap2 :: IOBitmap2 t -> IOBitmap tSource
fromIOBitmap3 :: IOBitmap3 t -> IOBitmap tSource
fromIOBitmap4 :: IOBitmap4 t -> IOBitmap tSource
Reading and writing pixels
:: 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)
:: 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.
:: 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.
:: 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.
:: PixelComponent t | |
=> IOBitmap t | the bitmap |
-> Offset | position (x,y) |
-> IO [t] |
unsafeReadPixel1 :: PixelComponent t => IOBitmap1 t -> Offset -> IO tSource
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