Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data BitmapString = BitmapString {
- _bmps_data :: GenString
- _bmps_dimensions :: Dimensions (BIndexType BitmapString)
- _bmps_rowAlignment :: Int
- _bmps_redHead :: Bool
- _bmps_alphaHead :: Maybe Bool
- _bmps_paddingHead :: Int
- _bmps_paddingTail :: Int
- _bmps_rowFromTop :: Bool
- _bmps_columnFromLeft :: Bool
- _bmps_rowFromBeg :: Int
- _bmps_rowFromEnd :: Int
- _bmps_columnFromBeg :: Int
- _bmps_columnFromEnd :: Int
- bmps_data :: forall cat. ArrowApply cat => Lens cat BitmapString GenString
- bmps_dimensions :: forall cat. ArrowApply cat => Lens cat BitmapString (Dimensions (BIndexType BitmapString))
- bmps_rowAlignment :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- bmps_redHead :: forall cat. ArrowApply cat => Lens cat BitmapString Bool
- bmps_alphaHead :: forall cat. ArrowApply cat => Lens cat BitmapString (Maybe Bool)
- bmps_paddingHead :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- bmps_paddingTail :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- bmps_rowFromTop :: forall cat. ArrowApply cat => Lens cat BitmapString Bool
- bmps_columnFromLeft :: forall cat. ArrowApply cat => Lens cat BitmapString Bool
- bmps_rowFromBeg :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- bmps_rowFromEnd :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- bmps_columnFromBeg :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- bmps_columnFromEnd :: forall cat. ArrowApply cat => Lens cat BitmapString Int
- formatEq :: BitmapString -> BitmapString -> Bool
- defaultBSFormat :: BitmapString
- rowPadding :: BIndexType BitmapString -> Int -> Int -> (Int, Int)
- bytesPerPixel :: BitmapString -> Int
- rowPaddingBS :: BitmapString -> (Int, Int)
- rgbOffsets :: BitmapString -> (Int, Int, Int)
- alphaOffset :: BitmapString -> Maybe Int
- pixelPart :: BitmapString -> BPixelType BitmapString -> Int -> StringCellChar GenStringDefault
- imageSizeBS :: BitmapString -> Int
- constructBitmapStringFormatted :: BitmapString -> Dimensions (BIndexType BitmapString) -> (Coordinates (BIndexType BitmapString) -> BPixelType BitmapString) -> BitmapString
- bitmapFmtBGR24A4VR :: BitmapString
- bitmapFmtRGB24A4VR :: BitmapString
- bitmapFmtRGB24A4 :: BitmapString
- bitmapFmtRGB32 :: BitmapString
- encodeBSFormat :: Stringy s => BitmapString -> BitmapString -> s
- encodeIBF_BGR24A4VR' :: Stringy s => BitmapString -> s
- encodeIBF_RGB24A4VR' :: Stringy s => BitmapString -> s
- encodeIBF_RGB24A4' :: Stringy s => BitmapString -> s
- encodeIBF_RGB32' :: Stringy s => BitmapString -> s
- tryBSFormat :: Stringy s => String -> BitmapString -> BitmapString -> s -> Either String BitmapString
- tryIBF_BGR24A4VR' :: Stringy s => BitmapString -> s -> Either String BitmapString
- tryIBF_RGB24A4VR' :: Stringy s => BitmapString -> s -> Either String BitmapString
- tryIBF_RGB24A4' :: Stringy s => BitmapString -> s -> Either String BitmapString
- tryIBF_RGB32' :: Stringy s => BitmapString -> s -> Either String BitmapString
Documentation
data BitmapString Source
A bitmap represented as a string or stored as bytes
By default, the RGB32 format (where the most significant byte, the head-most one, is unused) is used.
The bitmap must be stored by pixels not separated by component. Each pixel must contain at least the red, blue, and green component, each one byte wide (bytes are assumed to be octets), either in that order or reversed. There may be an alpha component either immediately before the other three components or immediately after. Thus there are four possible arrangements of components for each pixel, which must be consistent for every pixel. Any amount of padding or unused bytes is permitted before each pixel, but the amount must be fixed. The same is true also after each pixel.
This type is most efficient with lazy bytestrings.
BitmapString | |
|
bmps_data :: forall cat. ArrowApply cat => Lens cat BitmapString GenString Source
bmps_dimensions :: forall cat. ArrowApply cat => Lens cat BitmapString (Dimensions (BIndexType BitmapString)) Source
bmps_rowAlignment :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
bmps_redHead :: forall cat. ArrowApply cat => Lens cat BitmapString Bool Source
bmps_alphaHead :: forall cat. ArrowApply cat => Lens cat BitmapString (Maybe Bool) Source
bmps_paddingHead :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
bmps_paddingTail :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
bmps_rowFromTop :: forall cat. ArrowApply cat => Lens cat BitmapString Bool Source
bmps_columnFromLeft :: forall cat. ArrowApply cat => Lens cat BitmapString Bool Source
bmps_rowFromBeg :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
bmps_rowFromEnd :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
bmps_columnFromBeg :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
bmps_columnFromEnd :: forall cat. ArrowApply cat => Lens cat BitmapString Int Source
formatEq :: BitmapString -> BitmapString -> Bool Source
defaultBSFormat :: BitmapString Source
Default BitmapString
format
This is equivalent to IBF_BGRU32
rowPadding :: BIndexType BitmapString -> Int -> Int -> (Int, Int) Source
Return (rowSize, paddingSize) based on width, bytes per pixel, and alignment
Be careful when using the results of this function that you're actually using the right value.
bytesPerPixel :: BitmapString -> Int Source
rowPaddingBS :: BitmapString -> (Int, Int) Source
Return (rowSize, paddingSize)
Be careful when using the results of this function that you're actually using the right value.
rgbOffsets :: BitmapString -> (Int, Int, Int) Source
alphaOffset :: BitmapString -> Maybe Int Source
pixelPart :: BitmapString -> BPixelType BitmapString -> Int -> StringCellChar GenStringDefault Source
Get part of a pixel as a cell of GenStringDefault
The bitmap passed is only used for its format; its dimensions and data are not used. This function doesn't return any alpha parts; for those it returns pad bytes, which are zero.
imageSizeBS :: BitmapString -> Int Source
constructBitmapStringFormatted :: BitmapString -> Dimensions (BIndexType BitmapString) -> (Coordinates (BIndexType BitmapString) -> BPixelType BitmapString) -> BitmapString Source
Construct a bitmap in the format of the meta bitmap passed
Only the format fields of the bitmap is used, so the data and dimensions of it can be undefined
.
The data in the new bitmap is what GenStringDefault
is aliased to.
encodeBSFormat :: Stringy s => BitmapString -> BitmapString -> s Source
Used by the encoders
encodeIBF_BGR24A4VR' :: Stringy s => BitmapString -> s Source
encodeIBF_RGB24A4VR' :: Stringy s => BitmapString -> s Source
encodeIBF_RGB24A4' :: Stringy s => BitmapString -> s Source
encodeIBF_RGB32' :: Stringy s => BitmapString -> s Source
tryBSFormat :: Stringy s => String -> BitmapString -> BitmapString -> s -> Either String BitmapString Source
Used by the decoders
tryIBF_BGR24A4VR' :: Stringy s => BitmapString -> s -> Either String BitmapString Source
tryIBF_RGB24A4VR' :: Stringy s => BitmapString -> s -> Either String BitmapString Source
tryIBF_RGB24A4' :: Stringy s => BitmapString -> s -> Either String BitmapString Source
tryIBF_RGB32' :: Stringy s => BitmapString -> s -> Either String BitmapString Source