Struct pixels_graphics_lib::drawing::PixelWrapper[][src]

pub struct PixelWrapper {
    pub pixels: Pixels,
    // some fields omitted
}

Fields

pixels: Pixels

Implementations

Convert an x,y coord to idx for use with self.pixels

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 coord

Get width and height for string

Sets every pixel to the same color, this ignores translate

Draw an image at x, y

Draw a letter at a letter coord XY valid from 0,0 to 47,25 for small 0,0 to 23,12 for normal

Draw a letter at pixel coord

Draws text in lines at most width chars long at pixel coord

Width must be max chars - x max chars is 47 for small 23 for normal So if x was 5 and size was small then max width is 42

Draws text in lines at most width chars long at letter coord

Width must be max chars - x max chars is 47 for small 23 for normal So if x was 5 and size was small then max width is 42

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 colors 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

Draw line from x1,y1 to x2,y2 in color

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.