| 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.
Synopsis
- 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 #
Methods
loadImage :: ColorFlag a -> FilePath -> IO (Either String (Image a)) #
loadImage reads the image (with ColorFlag Y, YA, RGB, or RGBA) at the supplied path.
writePNG :: FilePath -> Image a -> IO () #
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 () #
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 () #
writeTGA writes the image passed to it out at the path path in TGA format. The path must include the extension.
Instances
| Color RGBAColor # | |
| Color RGBColor # | |
| Color YAColor # | |
| Color YColor # | |
Constructors
| YColor | |
Fields
| |
Instances
| Eq YColor # | |
| Generic YColor # | |
| Storable YColor # | |
| Color YColor # | |
| Show (ColorFlag YColor) # | |
| type Rep YColor # | |
Defined in Data.STBImage.ColorTypes | |
| data ColorFlag YColor # | |
Defined in Data.STBImage.Color | |
Constructors
| YAColor | |
Fields
| |
Instances
| Eq YAColor # | |
| Generic YAColor # | |
| Storable YAColor # | |
| Color YAColor # | |
| Show (ColorFlag YAColor) # | |
| type Rep YAColor # | |
Defined in Data.STBImage.ColorTypes type Rep YAColor = D1 (MetaData "YAColor" "Data.STBImage.ColorTypes" "stb-image-redux-0.2.1.2-E7S9cUsCYO6HDGz9siXvk8" False) (C1 (MetaCons "YAColor" PrefixI True) (S1 (MetaSel (Just "_yaGreyscale") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8) :*: S1 (MetaSel (Just "_yaAlpha") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8))) | |
| data ColorFlag YAColor # | |
Defined in Data.STBImage.Color | |
Instances
| Eq RGBColor # | |
| Generic RGBColor # | |
| Storable RGBColor # | |
Defined in Data.STBImage.ColorTypes | |
| Color RGBColor # | |
| Show (ColorFlag RGBColor) # | |
| type Rep RGBColor # | |
Defined in Data.STBImage.ColorTypes type Rep RGBColor = D1 (MetaData "RGBColor" "Data.STBImage.ColorTypes" "stb-image-redux-0.2.1.2-E7S9cUsCYO6HDGz9siXvk8" False) (C1 (MetaCons "RGBColor" PrefixI True) (S1 (MetaSel (Just "_rgbRed") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8) :*: (S1 (MetaSel (Just "_rgbGreen") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8) :*: S1 (MetaSel (Just "_rgbBlue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))) | |
| data ColorFlag RGBColor # | |
Defined in Data.STBImage.Color | |
Constructors
| RGBAColor | |
Fields
| |
Instances
| Eq RGBAColor # | |
| Generic RGBAColor # | |
| Storable RGBAColor # | |
Defined in Data.STBImage.ColorTypes | |
| Color RGBAColor # | |
| Show (ColorFlag RGBAColor) # | |
| type Rep RGBAColor # | |
Defined in Data.STBImage.ColorTypes type Rep RGBAColor = D1 (MetaData "RGBAColor" "Data.STBImage.ColorTypes" "stb-image-redux-0.2.1.2-E7S9cUsCYO6HDGz9siXvk8" False) (C1 (MetaCons "RGBAColor" PrefixI True) ((S1 (MetaSel (Just "_rgbaRed") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8) :*: S1 (MetaSel (Just "_rgbaGreen") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)) :*: (S1 (MetaSel (Just "_rgbaBlue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8) :*: S1 (MetaSel (Just "_rgbaAlpha") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))) | |
| data ColorFlag RGBAColor # | |
Defined in Data.STBImage.Color | |
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.
Instances
| (Storable a, Eq a) => Eq (Image a) # | |
| Show (Image a) # | |
| Generic (Image a) # | |
| type Rep (Image a) # | |
Defined in Data.STBImage.Immutable type Rep (Image a) = D1 (MetaData "Image" "Data.STBImage.Immutable" "stb-image-redux-0.2.1.2-E7S9cUsCYO6HDGz9siXvk8" False) (C1 (MetaCons "Image" PrefixI True) (S1 (MetaSel (Just "_pixels") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector a)) :*: (S1 (MetaSel (Just "_width") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "_height") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)))) | |