pub struct BitMapElement<'a, Coord, P: PixelFormat = RGBPixel> { /* private fields */ }
Expand description

The element that contains a bitmap on it

Implementations

Create a new empty bitmap element. This can be use as the draw and blit pattern.

  • pos: The left upper coordinate for the element
  • size: The size of the bitmap

Create a new bitmap element with an pre-allocated owned buffer, this function will take the ownership of the buffer.

  • pos: The left upper coordinate of the elelent
  • size: The size of the bitmap
  • buf: The buffer to use
  • returns: The newly created image element, if the buffer isn’t fit the image dimension, this will returns an None.

Create a new bitmap element with a mut borrow to an existing buffer

  • pos: The left upper coordinate of the elelent
  • size: The size of the bitmap
  • buf: The buffer to use
  • returns: The newly created image element, if the buffer isn’t fit the image dimension, this will returns an None.

Create a new bitmap element with a shared borrowed buffer. This means if we want to modifiy the content of the image, the buffer is automatically copied

  • pos: The left upper coordinate of the elelent
  • size: The size of the bitmap
  • buf: The buffer to use
  • returns: The newly created image element, if the buffer isn’t fit the image dimension, this will returns an None.

Copy the existing bitmap element to another location

  • pos: The new location to copy

Move the existing bitmap element to a new position

  • pos: The new position

Make the bitmap element as a bitmap backend, so that we can use plotters drawing functionality on the bitmap element

Trait Implementations

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly Read more

Converts to this type from the input type.

Converts to this type from the input type.

The item in point iterator

The point iterator

framework to do the coordinate mapping

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.