|
|
|
|
|
|
Synopsis |
|
|
|
Documentation |
|
module Data.Bitmap.Base |
|
Creating bitmaps
|
|
|
:: 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.
|
|
|
createSingleChannelBitmap | Source |
|
:: forall t . PixelComponent t | | => Size | (width,height)
| -> Maybe Alignment | the row alignment of the new image
| -> Int -> Int -> t | the function used to create the bitmap
| -> Bitmap t | | Creates a single channel bitmap from a function.
This is probably a bit slow.
|
|
|
Mapping over bitmaps
|
|
|
Warning: this is probably slow.
|
|
|
Warning: this is probably slow.
|
|
Cropping and extending
|
|
|
|
|
|
:: 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
|
|
|
|
|
|
|
|
|
Bilinear resampling
|
|
|
|
|
|
|
|
Blending
|
|
|
:: PixelComponent t | | => Float | weight 1
| -> Float | weight 2
| -> Bitmap t | source image 1
| -> Bitmap t | source image 2
| -> Maybe Alignment | target alignment
| -> Bitmap t | | Blends two bitmaps with the given weights; that is, the result is
the specified linear combination. If the values are outside the allowed
range (this can happen with the Word8, Word16, Word32 types and weights
whose sum is bigger than 1, or with a negative weight), then they are
clipped. The clipping does not happen with the Float component type.
|
|
|
|
|
|
Gamma correction
|
|
|
:: PixelComponent t | | => Float | gamma
| -> Bitmap t | source image
| -> Maybe Alignment | target image row alignment
| -> Bitmap t | | This is equivalent to componentMap (c -> c^gamma), except that
(^) is defined only for integral exponents; but should be faster anyway.
|
|
|
powerlawGammaCorrectionChannel | Source |
|
|
|
Conversion to ByteString
|
|
|
Note that the data is shared; and also that the resulting ByteString
is encoded using the host machine's endianness.
|
|
Produced by Haddock version 2.4.1 |