Safe Haskell | Safe-Infered |
---|
Saving and loading uncompressed bitmaps.
For loading from compressed formats, see the stb-image
library:
http://hackage.haskell.org/package/stb-image.
The goal of this module is to provide the simplest possible interface for loading and saving bitmaps; so you can start experimenting without much hassle.
Note: Endianness is the endianness of the host, so the resulting file is not portable across platforms with different endiannesses.
- readBitmap :: PixelComponent t => FilePath -> IO (IOBitmap t)
- writeBitmap :: PixelComponent t => FilePath -> IOBitmap t -> IO ()
- readRawData :: PixelComponent t => FilePath -> (Size, NChn, PixelComponentType) -> IO (IOBitmap t)
- writeRawData :: PixelComponent t => FilePath -> IOBitmap t -> IO ()
- hPutHeader :: PixelComponent t => Handle -> IOBitmap t -> IO ()
- hPutRawData :: PixelComponent t => Handle -> IOBitmap t -> IO ()
- hGetHeader :: Handle -> IO (Size, NChn, PixelComponentType)
- hGetRawData :: PixelComponent t => Handle -> (Size, NChn, PixelComponentType) -> IO (IOBitmap t)
Documentation
readBitmap :: PixelComponent t => FilePath -> IO (IOBitmap t)Source
writeBitmap :: PixelComponent t => FilePath -> IOBitmap t -> IO ()Source
readRawData :: PixelComponent t => FilePath -> (Size, NChn, PixelComponentType) -> IO (IOBitmap t)Source
writeRawData :: PixelComponent t => FilePath -> IOBitmap t -> IO ()Source
Saves only the raw pixel data, no resolution etc.
hPutHeader :: PixelComponent t => Handle -> IOBitmap t -> IO ()Source
Writes a 16 byte header in the following format:
dword xsize dword ysize dword nchn dword pixelcomponent_type
Pixel component encoding is the following:
- 1 = Word8
- 2 = Word16
- 3 = Word32
- 4 = Float
Endianness is the endianness of the host, so the resulting file is not portable across platform with different endiannesses.
hPutRawData :: PixelComponent t => Handle -> IOBitmap t -> IO ()Source
Saves only the raw pixel data, no resolution etc.
hGetHeader :: Handle -> IO (Size, NChn, PixelComponentType)Source
hGetRawData :: PixelComponent t => Handle -> (Size, NChn, PixelComponentType) -> IO (IOBitmap t)Source