Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.TI85.Var.Pic
Contents
Description
Picture variable types and utilities.
Synopsis
- data TIBitmap
- emptyBitmap :: TIBitmap
- fromBytes :: ByteString -> Maybe TIBitmap
- toBytes :: TIBitmap -> ByteString
- showAsciiArt :: TIBitmap -> Text
- writePicPng :: FilePath -> TIBitmap -> IO ()
TI Bitmap
A TI Picture variable is encoded as a packed bitmap, and is always 128x63 binary pixels.
emptyBitmap :: TIBitmap Source #
A blank (all zero) bitmap
fromBytes :: ByteString -> Maybe TIBitmap Source #
Create a bitmap from a packed ByteString
. If the data
is the wrong size, returns Nothing
.
toBytes :: TIBitmap -> ByteString Source #
Extract the raw ByteString
from a bitmap.
Display utilities
showAsciiArt :: TIBitmap -> Text Source #
Create a text-based representation of a picture. Background pixels are rendered as spaces, while foreground are rendered as full block glyphs (█).