free-game-0.9.3.4: Create graphical applications for free

Portabilitynon-portable
Stabilityexperimental
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellNone

Graphics.UI.FreeGame.Data.Bitmap

Contents

Description

Manipulating bitmaps

Synopsis

Basic types and functions

data Bitmap Source

Concrete bitmap data. Internal representation is stored as y * x * RGBA.

Constructors

BitmapData (Array F DIM3 Word8) (Maybe Int)

This value is used to ensure that two bitmaps are equivalent.

bitmapSize :: Bitmap -> (Int, Int)Source

Get the size of the Bitmap.

Loading from a file

loadBitmapFromFile :: FilePath -> IO BitmapSource

Create a Bitmap from the given file.

Constructing bitmaps

toBitmap :: Array F DIM3 Word8 -> BitmapSource

Create unstable Bitmap from the given array.

toStableBitmap :: Array F DIM3 Word8 -> BitmapSource

Create stable Bitmap from the given array and compute the hash.

makeStableBitmap :: Array F DIM3 Word8 -> IO BitmapSource

Create stable Bitmap with unique hash from the given array.

Bitmap operations

onBitmapWithHashable :: Hashable h => h -> (Array F DIM3 Word8 -> Array F DIM3 Word8) -> Bitmap -> BitmapSource

Convert the Bitmap uniformalized by the Hashable value by the given function.

cropBitmapSource

Arguments

:: Bitmap

original bitmap

-> (Int, Int)

width and height

-> (Int, Int)

x and y

-> Bitmap

result

Extract a Bitmap from the specified range.