stb-image-redux-0.2.0.0: Image loading and writing microlibrary

Copyright(c) Alexis Williams 2016
LicenseBSD3
Maintainersasinestro@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

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

Documentation

class Color a where Source #

Minimal complete definition

loadImage, writePNG, writeBMP, writeTGA, red, green, blue, alpha

Associated Types

data ColorFlag a :: * 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.

red :: a -> Word8 Source #

green :: a -> Word8 Source #

blue :: a -> Word8 Source #

alpha :: a -> Word8 Source #

Instances

Color RGBAColor Source # 
Color RGBColor Source # 
Color YAColor Source # 
Color YColor Source # 

data Image a Source #

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.

Constructors

Image 

Fields

Instances

(Eq a, Storable a) => Eq (Image a) Source # 

Methods

(==) :: Image a -> Image a -> Bool #

(/=) :: Image a -> Image a -> Bool #

Show (Image a) Source # 

Methods

showsPrec :: Int -> Image a -> ShowS #

show :: Image a -> String #

showList :: [Image a] -> ShowS #