UnicodePlot::Canvas
Inherits UnicodePlot::GraphicsArea < Reference < Object
Abstract pixel-based canvas. The grid is stored as a flat row-major array: index = row * ncols + col (0-based).
Constructors
new(nrows : Int32, ncols : Int32, visible : Bool, blend : Bool, yflip : Bool, xflip : Bool, pixel_height : Int32, pixel_width : Int32, origin_y : Float64, origin_x : Float64, height : Float64, width : Float64, yscale : Proc(Float64, Float64), xscale : Proc(Float64, Float64), fill_value : UInt32)
SourceInstance methods
Annotate a character at canvas coords (x, y)
annotate!(x : Float64, y : Float64, text : String, color : UInt32, blend : Bool, halign : Symbol = :center, valign : Symbol = :center) : self
Sourceblank
Sourceblend?
SourceMap grid value to display character. Must be overridden by subclasses.
height
SourceDigital differential analyser (DDA) line drawing
Vector line drawing (polyline)
lines!(xs : Array(Float64), ys : Array(Float64), segment_colors : Array(UInt32), blend : Bool) : self
Vector line drawing (polyline) with per-segment colors
ncols
Sourcenrows
Sourceorigin_x
Sourceorigin_y
SourceHigh-level pixel placement (color conversion from symbol/int done by caller)
pixel_height
Sourcepixel_width
SourcePlot a single point (canvas coordinates)
Plot a vector of points
Plot a vector of points with per-point colors
Print a single row. Implementations add ANSI color via use_color.
Set the color at char cell (col, row), blending if requested
visible?
Sourcewidth
Sourcex_pixel_per_char
Sourcexflip?
Sourcexscale
Sourcey_pixel_per_char
Sourceyflip?
Sourceyscale
Source