struct PNGUtil::Canvas
- PNGUtil::Canvas
- Struct
- Value
- Object
Defined in:
png_util/canvas.crConstructors
Instance Method Summary
-
#==(other)
Two canvases are considered equal if they are of equal size and all their pixels are equal
-
#[](x, y)
Short form for
#get
-
#[]=(x, y, color)
Short form for
#set
-
#each_row(&)
Iterate over each row of the canvas (a
Slice(RGBA)
of size@width
). -
#get(x, y)
Get the value of pixel
(x, y)
without checking if(x, y)
is a valid position. - #height : Int32
- #pixels : Slice(RGBA::Data)
-
#resize(new_width : Int32, new_height : Int32)
very basic nearest neighbor image scaling algorithm
-
#set(x, y, color)
Set the value of pixel
(x, y)
tocolor
without checking if(x, y)
is a valid position. - #width : Int32
Constructor Detail
Instance Method Detail
Two canvases are considered equal if they are of equal size and all their pixels are equal
Iterate over each row of the canvas
(a Slice(RGBA)
of size @width
).
The main usecase for this is
writing code that encodes images
in some file format.
very basic nearest neighbor image scaling algorithm
Set the value of pixel (x, y)
to color
without checking if (x, y)
is a valid position.