class UnicodePlot::BlockCanvas
The `BlockCanvas` is also Unicode-based. It has half the resolution of the `BrailleCanvas`. In contrast to BrailleCanvas
, the pixels don't have visible spacing between them. This canvas effectively turns every character into 4 pixels that can individually be manipulated using binary operations.
Constants
- BLOCK_DECODE
- BLOCK_SIGNS
- X_PIXEL_PER_CHAR
- Y_PIXEL_PER_CHAR
Public Class Methods
new(width, height, fill_char=0, **kw)
click to toggle source
Calls superclass method
# File lib/unicode_plot/canvas/block_canvas.rb, line 15 def initialize(width, height, fill_char=0, **kw) super(width, height, X_PIXEL_PER_CHAR, Y_PIXEL_PER_CHAR, fill_char, **kw) end
Public Instance Methods
lookup_decode(x)
click to toggle source
# File lib/unicode_plot/canvas/block_canvas.rb, line 36 def lookup_decode(x) ; BLOCK_DECODE[x] ; end
lookup_encode(x,y)
click to toggle source
# File lib/unicode_plot/canvas/block_canvas.rb, line 35 def lookup_encode(x,y) ; BLOCK_SIGNS[x][y] ; end