Class: Mosaiq::Image
- Inherits:
-
Object
- Object
- Mosaiq::Image
- Defined in:
- lib/mosaiq/image.rb
Overview
Main class to create a Mosaiq Image
Instance Attribute Summary collapse
-
#canvas ⇒ Object
readonly
Returns the value of attribute canvas.
Instance Method Summary collapse
-
#initialize(width:, height:, palette: Palette.black_and_white) ⇒ Image
constructor
A new instance of Image.
- #svg ⇒ Object
Constructor Details
#initialize(width:, height:, palette: Palette.black_and_white) ⇒ Image
Returns a new instance of Image.
10 11 12 13 14 15 16 |
# File 'lib/mosaiq/image.rb', line 10 def initialize(width:, height:, palette: Palette.black_and_white) @width = read_positive_integer(width: width) @height = read_positive_integer(height: height) @palette = read_palette(palette) build_canvas end |
Instance Attribute Details
#canvas ⇒ Object (readonly)
Returns the value of attribute canvas.
8 9 10 |
# File 'lib/mosaiq/image.rb', line 8 def canvas @canvas end |