- module Data.Bitmap.Base
- emptyBitmap :: forall t. PixelComponent t => Size -> NChn -> Maybe Alignment -> Bitmap t
- componentMap :: PixelComponent s => (s -> s) -> Bitmap s -> Bitmap s
- componentMap' :: (PixelComponent s, PixelComponent t) => (s -> t) -> Bitmap s -> Maybe Alignment -> Bitmap t
- copySubImage :: PixelComponent t => Bitmap t -> Offset -> Size -> Bitmap t
- copySubImage' :: PixelComponent t => Bitmap t -> Offset -> Size -> Size -> Offset -> Bitmap t
- combineChannels :: forall t. PixelComponent t => [Bitmap t] -> Maybe Alignment -> Bitmap t
- extractChannels :: PixelComponent t => Bitmap t -> Maybe Alignment -> [Bitmap t]
- extractSingleChannel :: PixelComponent t => Bitmap t -> Maybe Alignment -> Int -> Bitmap t
- bitmapToByteString :: PixelComponent t => Bitmap t -> ByteString
Documentation
module Data.Bitmap.Base
:: forall t . PixelComponent t | |
=> Size | (width,height) |
-> NChn | number of channels (components/pixel) |
-> Maybe Alignment | the row alignment of the new image |
-> Bitmap t |
A bitmap filled with zero values. Note: we cannot guarantee the alignment of the memory block (but typically it is aligned at least to machine word boundary), but what we can guarantee is that the rows are properly padded.
Mapping over bitmaps
componentMap :: PixelComponent s => (s -> s) -> Bitmap s -> Bitmap sSource
Warning: this is probably slow
componentMap' :: (PixelComponent s, PixelComponent t) => (s -> t) -> Bitmap s -> Maybe Alignment -> Bitmap tSource
Warning: this is probably slow
Cropping and extending
:: PixelComponent t | |
=> Bitmap t | source image |
-> Offset | source rectangle offset |
-> Size | source rectangle size |
-> Bitmap t |
Copies a subrectangle of the source image into a new image.
:: PixelComponent t | |
=> Bitmap t | source image |
-> Offset | source rectangle offset |
-> Size | source rectangle size |
-> Size | target image size |
-> Offset | target rectangle offset |
-> Bitmap t |
Copy into a new "black" bitmap; common generalization of crop and extend.
Manipulating channels
combineChannels :: forall t. PixelComponent t => [Bitmap t] -> Maybe Alignment -> Bitmap tSource
extractChannels :: PixelComponent t => Bitmap t -> Maybe Alignment -> [Bitmap t]Source
Conversion to ByteString
bitmapToByteString :: PixelComponent t => Bitmap t -> ByteStringSource
Note that the data is shared.