Safe Haskell | None |
---|---|
Language | Haskell2010 |
Modules used for Bitmap file (.bmp) file loading and writing
- writeBitmap :: BmpEncodable pixel => FilePath -> Image pixel -> IO ()
- encodeBitmap :: forall pixel. BmpEncodable pixel => Image pixel -> ByteString
- encodeBitmapWithMetadata :: forall pixel. BmpEncodable pixel => Metadatas -> Image pixel -> ByteString
- decodeBitmap :: ByteString -> Either String DynamicImage
- decodeBitmapWithMetadata :: ByteString -> Either String (DynamicImage, Metadatas)
- encodeDynamicBitmap :: DynamicImage -> Either String ByteString
- encodeBitmapWithPaletteAndMetadata :: forall pixel. BmpEncodable pixel => Metadatas -> BmpPalette -> Image pixel -> ByteString
- writeDynamicBitmap :: FilePath -> DynamicImage -> IO (Either String Bool)
- class BmpEncodable pixel
Functions
writeBitmap :: BmpEncodable pixel => FilePath -> Image pixel -> IO ()
Write an image in a file use the bitmap format.
encodeBitmap :: forall pixel. BmpEncodable pixel => Image pixel -> ByteString
Encode an image into a bytestring in .bmp format ready to be written on disk.
encodeBitmapWithMetadata :: forall pixel. BmpEncodable pixel => Metadatas -> Image pixel -> ByteString
Equivalent to encodeBitmap
but also store
the following metadatas:
decodeBitmap :: ByteString -> Either String DynamicImage
Try to decode a bitmap image. Right now this function can output the following pixel types :
- PixelRGBA8
- PixelRGB8
- Pixel8
decodeBitmapWithMetadata :: ByteString -> Either String (DynamicImage, Metadatas)
Same as decodeBitmap
but also extracts metadata.
encodeDynamicBitmap :: DynamicImage -> Either String ByteString
Encode a dynamic image in bmp if possible, supported pixel type are :
- RGB8
- RGBA8
- Y8
encodeBitmapWithPaletteAndMetadata :: forall pixel. BmpEncodable pixel => Metadatas -> BmpPalette -> Image pixel -> ByteString
writeDynamicBitmap :: FilePath -> DynamicImage -> IO (Either String Bool)
Write a dynamic image in a .bmp image file if possible. The same restriction as encodeDynamicBitmap apply.
Accepted format in output
class BmpEncodable pixel
All the instance of this class can be written as a bitmap file using this library.
bitsPerPixel, bmpEncode