| Copyright | (c) Alexis Williams 2016 |
|---|---|
| License | BSD3 |
| Maintainer | sasinestro@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.STBImage
Description
Much like the original library, the focus of this library is placed on ease of use rather than richness of feature set, thus the rather spartan interface.
- class Storable a => Color a where
- data YColor = YColor {
- _yGreyscale :: Word8
- data YAColor = YAColor {
- _yaGreyscale :: Word8
- _yaAlpha :: Word8
- data RGBColor = RGBColor {}
- data RGBAColor = RGBAColor {
- _rgbaRed :: Word8
- _rgbaGreen :: Word8
- _rgbaBlue :: Word8
- _rgbaAlpha :: Word8
- data Image a = Image {}
- flipImage :: Storable a => Image a -> Image a
Documentation
class Storable a => Color a where Source #
Methods
loadImage :: ColorFlag a -> FilePath -> IO (Either String (Image a)) Source #
loadImage reads the image (with ColorFlag Y, YA, RGB, or RGBA) at the supplied path.
writePNG :: FilePath -> Image a -> IO () Source #
writePNG writes the image passed to it out at the path path in PNG format. The path must include the extension.
writeBMP :: FilePath -> Image a -> IO () Source #
writeBMP writes the image passed to it out at the path path in BMP format. The path must include the extension.
writeTGA :: FilePath -> Image a -> IO () Source #
writeTGA writes the image passed to it out at the path path in TGA format. The path must include the extension.
Constructors
| YColor | |
Fields
| |
Constructors
| YAColor | |
Fields
| |
Constructors
| RGBAColor | |
Fields
| |
Image is the least opinionated reasonable type to represent an image, just a vector of pixel Colors (laid out top-to-bottom, left-to-right) and a size.