Safe Haskell | None |
---|---|
Language | Haskell98 |
Graphics.Gloss.Data.Bitmap
Description
Functions to load bitmap data from various places.
Synopsis
- data Rectangle = Rectangle {}
- data BitmapData
- bitmapSize :: BitmapData -> (Int, Int)
- data BitmapFormat = BitmapFormat {}
- data RowOrder
- data PixelFormat
- bitmapOfForeignPtr :: Int -> Int -> BitmapFormat -> ForeignPtr Word8 -> Bool -> Picture
- bitmapDataOfForeignPtr :: Int -> Int -> BitmapFormat -> ForeignPtr Word8 -> Bool -> BitmapData
- bitmapOfByteString :: Int -> Int -> BitmapFormat -> ByteString -> Bool -> Picture
- bitmapDataOfByteString :: Int -> Int -> BitmapFormat -> ByteString -> Bool -> BitmapData
- bitmapOfBMP :: BMP -> Picture
- bitmapDataOfBMP :: BMP -> BitmapData
- loadBMP :: FilePath -> IO Picture
Documentation
Represents a rectangular section in a bitmap
Constructors
Rectangle | |
Instances
Eq Rectangle | |
Data Rectangle | |
Defined in Graphics.Gloss.Internals.Rendering.Bitmap Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Rectangle -> c Rectangle Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Rectangle Source # toConstr :: Rectangle -> Constr Source # dataTypeOf :: Rectangle -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Rectangle) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rectangle) Source # gmapT :: (forall b. Data b => b -> b) -> Rectangle -> Rectangle Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Rectangle -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Rectangle -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Rectangle -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Rectangle -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Rectangle -> m Rectangle Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Rectangle -> m Rectangle Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Rectangle -> m Rectangle Source # | |
Ord Rectangle | |
Defined in Graphics.Gloss.Internals.Rendering.Bitmap | |
Read Rectangle | |
Show Rectangle | |
data BitmapData Source #
Abstract 32-bit RGBA bitmap data.
Instances
Eq BitmapData | |
Defined in Graphics.Gloss.Internals.Rendering.Bitmap Methods (==) :: BitmapData -> BitmapData -> Bool Source # (/=) :: BitmapData -> BitmapData -> Bool Source # | |
Data BitmapData | |
Defined in Graphics.Gloss.Internals.Rendering.Bitmap Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BitmapData -> c BitmapData Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BitmapData Source # toConstr :: BitmapData -> Constr Source # dataTypeOf :: BitmapData -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BitmapData) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BitmapData) Source # gmapT :: (forall b. Data b => b -> b) -> BitmapData -> BitmapData Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BitmapData -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BitmapData -> r Source # gmapQ :: (forall d. Data d => d -> u) -> BitmapData -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> BitmapData -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BitmapData -> m BitmapData Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BitmapData -> m BitmapData Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BitmapData -> m BitmapData Source # | |
Show BitmapData | |
Defined in Graphics.Gloss.Internals.Rendering.Bitmap |
bitmapSize :: BitmapData -> (Int, Int) Source #
width, height in pixels
data BitmapFormat Source #
Description of how the bitmap is layed out in memory.
- Prior version of Gloss assumed `BitmapFormat BottomToTop PxAGBR`
Constructors
BitmapFormat | |
Fields |
Instances
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 |
Instances
data PixelFormat Source #
Pixel formats describe the order of the color channels in memory.
Instances
bitmapOfForeignPtr :: Int -> Int -> BitmapFormat -> ForeignPtr Word8 -> Bool -> Picture Source #
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
.
bitmapDataOfForeignPtr :: Int -> Int -> BitmapFormat -> ForeignPtr Word8 -> Bool -> BitmapData Source #
bitmapOfByteString :: Int -> Int -> BitmapFormat -> ByteString -> Bool -> Picture Source #
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
.
bitmapDataOfByteString :: Int -> Int -> BitmapFormat -> ByteString -> Bool -> BitmapData Source #
bitmapOfBMP :: BMP -> Picture Source #
O(size). Copy a BMP
file into a bitmap.
bitmapDataOfBMP :: BMP -> BitmapData Source #
O(size). Copy a BMP
file into a bitmap.