Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module implementing function to read and write Targa (*.tga) files.
- decodeTga :: ByteString -> Either String DynamicImage
- decodeTgaWithMetadata :: ByteString -> Either String (DynamicImage, Metadatas)
- decodeTgaWithPaletteAndMetadata :: ByteString -> Either String (PalettedImage, Metadatas)
- class TgaSaveable a
- encodeTga :: TgaSaveable px => Image px -> ByteString
- writeTga :: TgaSaveable pixel => FilePath -> Image pixel -> IO ()
Documentation
decodeTga :: ByteString -> Either String DynamicImage #
Transform a raw tga image to an image, without modifying the underlying pixel type.
This function can output the following images:
decodeTgaWithMetadata :: ByteString -> Either String (DynamicImage, Metadatas) #
Equivalent to decodeTga but also provide metadata
decodeTgaWithPaletteAndMetadata :: ByteString -> Either String (PalettedImage, Metadatas) #
Equivalent to decodeTga but with metdata and palette if any
class TgaSaveable a #
This typeclass determine if a pixel can be saved in the TGA format.
tgaDataOfImage, tgaPixelDepthOfImage, tgaTypeOfImage
encodeTga :: TgaSaveable px => Image px -> ByteString #
Transform a compatible image to a raw bytestring representing a Targa file.