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

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

Data.STBImage

Contents

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

Data types

data Color Source #

The Color type is used to represented the colors that are read out of the image file.

Currently, all images will be read out as RGBA, which is rather storage inefficient, but it's what I need for my application right now and a tagging scheme (to allow a Storable instance for the multiple-form datatype) would be a significant penalty to speed and reduce the space win significantly, and actively penalize the most common case for me.

Constructors

RGBA 

Fields

Instances

data Image 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 Image Source # 

Methods

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

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

Show Image Source # 

Methods

showsPrec :: Int -> Image -> ShowS #

show :: Image -> String #

showList :: [Image] -> ShowS #

Loading images

loadImage :: FilePath -> IO (Either String Image) Source #

loadImage loads the image file at path and returns either an error message from the underlying library or the Image that is stored in the file.

Writing images

writePNG :: FilePath -> Image -> 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 -> 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 -> IO () Source #

writeTGA writes the image passed to it out at the path path in TGA format. The path must include the extension.