class Breadbin::Image::Hires
- Breadbin::Image::Hires
- Reference
- Object
Overview
A high resolution image using any two colors within each 8x8 pixel cell.
Included Modules
Defined in:
breadbin/image/hires.crConstructors
-
.new(width : Int32, height : Int32, palette : Breadbin::Palette)
Creates an image with the given width, height and palette
Class Method Summary
Instance Method Summary
-
#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
-
#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
-
#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
-
#to_bytes(pad : Bool = false) : Bytes
Get a bytes representation of an image whose dimensions are 320x200 pixels.
Instance methods inherited from module Breadbin::Image
[](x : Int32, y : Int32)
[],
[]=(x : Int32, y : Int32, color : Int32 | Color)
[]=,
cell_height : Int32
cell_height,
cell_width : Int32
cell_width,
colfix : String | Nil
colfix,
colfix=(colfix : String | Nil)
colfix=,
convert_png(png : StumpyPNG::PNG, rect : Rectangle)
convert_png,
height : Int32
height,
height=(height : Int32)
height=,
palette : Palette
palette,
palette=(palette : Palette)
palette=,
width : Int32
width,
width=(width : Int32)
width=,
write_png(pathname : String)
write_png
Constructor Detail
Creates an image with the given width, height and palette
Class Method Detail
Instance Method Detail
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
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
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
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