Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Module implementing function to read and write Targa (*.tga) files.
Synopsis
- 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 Source #
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) Source #
Equivalent to decodeTga but also provide metadata
decodeTgaWithPaletteAndMetadata :: ByteString -> Either String (PalettedImage, Metadatas) Source #
Equivalent to decodeTga but with metdata and palette if any
class TgaSaveable a Source #
This typeclass determine if a pixel can be saved in the TGA format.
tgaDataOfImage, tgaPixelDepthOfImage, tgaTypeOfImage
Instances
TgaSaveable Pixel8 Source # | |
Defined in Codec.Picture.Tga tgaDataOfImage :: Image Pixel8 -> ByteString tgaPixelDepthOfImage :: Image Pixel8 -> Word8 tgaTypeOfImage :: Image Pixel8 -> TgaImageType | |
TgaSaveable PixelRGB8 Source # | |
Defined in Codec.Picture.Tga tgaDataOfImage :: Image PixelRGB8 -> ByteString tgaPixelDepthOfImage :: Image PixelRGB8 -> Word8 tgaTypeOfImage :: Image PixelRGB8 -> TgaImageType | |
TgaSaveable PixelRGBA8 Source # | |
Defined in Codec.Picture.Tga tgaDataOfImage :: Image PixelRGBA8 -> ByteString tgaPixelDepthOfImage :: Image PixelRGBA8 -> Word8 tgaTypeOfImage :: Image PixelRGBA8 -> TgaImageType |
encodeTga :: TgaSaveable px => Image px -> ByteString Source #
Transform a compatible image to a raw bytestring representing a Targa file.