gloss-1.10.1.1: Painless 2D vector graphics, animations and simulations.

Safe HaskellNone
LanguageHaskell98

Graphics.Gloss.Data.Bitmap

Description

Functions to load bitmap data from various places.

Synopsis

Documentation

data BitmapData :: *

Abstract 32-bit RGBA bitmap data.

data BitmapFormat :: *

Description of how the bitmap is layed out in memory.

  • Prior version of Gloss assumed `BitmapFormat BottomToTop PxAGBR`

data RowOrder :: *

Order of rows in an image are either:

  • TopToBottom - the top row, followed by the next-lower row and so on.
  • BottomToTop - the bottom row followed by the next-higher row and so on.

Constructors

TopToBottom 
BottomToTop 

data PixelFormat :: *

Pixel formats describe the order of the color channels in memory.

Constructors

PxRGBA 
PxABGR 

bitmapOfForeignPtr :: Int -> Int -> BitmapFormat -> ForeignPtr Word8 -> Bool -> Picture

O(1). Use a ForeignPtr of RGBA data as a bitmap with the given width and height.

The boolean flag controls whether Gloss should cache the data between frames for speed. If you are programatically generating the image for each frame then use False. If you have loaded it from a file then use True.

bitmapOfByteString :: Int -> Int -> BitmapFormat -> ByteString -> Bool -> Picture

O(size). Copy a ByteString of RGBA data into a bitmap with the given width and height.

The boolean flag controls whether Gloss should cache the data between frames for speed. If you are programatically generating the image for each frame then use False. If you have loaded it from a file then use True.

bitmapOfBMP :: BMP -> Picture

O(size). Copy a BMP file into a bitmap.

loadBMP :: FilePath -> IO Picture

Load an uncompressed 24 or 32bit RGBA BMP file as a bitmap.