-
Notifications
You must be signed in to change notification settings - Fork 102
Drawing
Currently, the drawing API are rather limited. Feel free to send in patches.
ChunkyPNG bases its coordinate system on how images are encoded. This means, that the top left pixel has coordinates (0, 0). The bottom-left right has coordinates (width – 1, height – 1). Graphical:
(0,0) . (sx-1,0) . . (0,sy-1) . (sx-1,sy-1)
Drawing operations are defined in the ChunkyPNG::Canvas::Drawing
module, which is included in the Canvas class.
Sets a point on the canvas, by blending the given color with the background color using alpha composition.
Draws an anti-aliased line from point 0 to point 1 in the given color.
Canvas operations are defined in the ChunkyPNG::Canvas::Operations
module, which is included in the Canvas class. All the methods without a bang will return a new canvas instance. Add a bang to make them do their work in place.
Composes the other_canvas over the current canvas, using alpha composition.
Replaces current pixels by pixels from the other_canvas.
Slices a new canvas of the given size out of the current canvas. Returns a new canvas object, leaving the current canvas intact.