Struct pixels_graphics_lib::drawing::PixelWrapper
source ·
[−]pub struct PixelWrapper {
pub pixels: Pixels,
/* private fields */
}
Fields
pixels: Pixels
Implementations
Get the canvas offset in pixels
Set the canvas offset in pixels
All drawing commands will be offset by this value
Adds delta
to the current canvas offset
Copy entire pixels array to an image
Although the method takes &mut self
it doesn’t mutate anything
Get top left pixel coord for letter px coord
Sets every pixel to the same color, this ignores translate
Draw an image at x
, y
Draw a letter at a letter coord See TextSize::get_max_characters for maximum x and y
Draw a letter at pixel coord
Draws text in lines at most width
chars long at pixel coord
Width should be max chars - x See TextSize::get_max_characters for maximum chars
Draws text in lines at most width
chars long at letter coord
Width must be max chars - x See TextSize::get_max_characters for maximum x and y
Get the RGB values for a pixel Alpha will always be 255
If use_translate
is true than the x,y will be updated with self.translate
Although the method takes &mut self
it doesn’t mutate anything
Update a pixel color, using PixelWrapper::set_pixel or PixelWrapper::blend_pixel depending
on whether color
s alpha is 255 or not
Set the RGB values for a pixel by blending it with the provided color This method uses alpha blending, note that the canvas pixels always have 255 alpha
Set the RGB values for a pixel This ignores alpha, so 255,0,0,0 will draw a red pixel
Draw a filled rectangle from x1,y1
to x2,y2
in color
Draw a hollow rectangle from x1,y1
to x2,y2
in color