class

Breadbin::Image::Hires

Inherits Breadbin::Image < Reference < Object

A high resolution image using any two colors within each 8x8 pixel cell.

Constructors

new(width : Int32, height : Int32, palette : Breadbin::Palette)

Creates an image with the given width, height and palette

Source

Class methods

from_png(pathname : String, rect : Tuple | Rectangle | Nil = nil)
Source

Instance methods

byte_at(x : Int32, y : Int32, color : UInt8) : UInt8

Get the byte representation of the 8x1 pixel area at x and y, with color getting a "1" bit and any other color getting a "0" bit

Source
cell_at(col : Int32, row : Int32, sort_first : Bool = false) : Array(UInt8)

Get a 9 bytes representation of the 8x8 pixel cell at the given col and row, where the first byte holds the color nybbles and the remaining 8 bytes hold the bitmap data

Source
sprite_at(x : Int32, y : Int32, color : UInt8) : Array(UInt8)

Get a 63 bytes sprite representation of the 24x21 pixel region at the given x and y position, with clist holding the triplet of colors that should be mapped to the "01", "10" and "11" bit pairs respectively

Source
to_bytes(pad : Bool = false) : Bytes

Get a bytes representation of an image whose dimensions are 320x200 pixels. If optional parameter pad if set to true, pads bitmap data so the following section is page aligned

Source