8.10
3 RRLL: Abuf Canvas
Racket Rogue-Like Library: Converter from Canvas to Abuf.
3.1 Finding Pixel Matrix Representation Character
(require abuf/partitioning) |
procedure
(quad-find c0 c1 c2 c3) →
char? fixnum? fixnum? c0 : fixnum? c1 : fixnum? c2 : fixnum? c3 : fixnum?
Finds the best approximation of given four colors (upper left, upper right, lower left
and lower right) using a single Unicode quad character and foreground
and background colors.
procedure
(slc-find c0 c1 c2 c3 c4 c5) →
char? fixnum? fixnum? c0 : fixnum? c1 : fixnum? c2 : fixnum? c3 : fixnum? c4 : fixnum? c5 : fixnum?
Finds the best approximation of given six colors (upper left, upper
right, middle left, middle right, lower left and lower right) using
a single Unicode SLC character and foreground and background
colors.
3.2 Canvas Display to ANSI Buffer
(require abuf/canvas) |
procedure
(abuf-put-canvas/halves! ab can [ #:set-dirty set-dirty]) → void? ab : abuf? can : canvas? set-dirty : boolean? = #t
Converts RGB pixels of canvas to dst
ansi-picture?. Uses Unicode lower half character.
This procedure assumes the canvas? and ansi-picture? are of appropriate sizes.
procedure
(abuf-put-canvas/quads! ab can [ #:set-dirty set-dirty]) → void? ab : abuf? can : canvas? set-dirty : boolean? = #t
Converts RGB pixels of canvas to dst
ansi-picture?. Uses Unicode quad symbols.
This procedure assumes the canvas? and ansi-picture? are of appropriate sizes.
procedure
(abuf-put-canvas/slc! ab can [ #:set-dirty set-dirty]) → void? ab : abuf? can : canvas? set-dirty : boolean? = #t
Converts RGB pixels of canvas to dst
ansi-picture?. Uses Unicode 13.0+ Symbols for Legacy Computing sextant characters.
This procedure assumes the canvas? and ansi-picture? are of appropriate sizes.