Struct gemini_engine::elements::containers::PixelContainer
source · pub struct PixelContainer {
pub pixels: Vec<Pixel>,
}Expand description
A PixelContainer only has a pixels property, which gets returned directly to the View during blit
Fields§
§pixels: Vec<Pixel>This is the value that gets returned by active_pixels()
Implementations§
source§impl PixelContainer
impl PixelContainer
sourcepub fn append(&mut self, pixels: &mut Vec<Pixel>)
pub fn append(&mut self, pixels: &mut Vec<Pixel>)
Moves all the pixels into the PixelContainer, leaving the input empty.
sourcepub fn append_points(&mut self, points: &[Vec2D], fill_char: ColChar)
pub fn append_points(&mut self, points: &[Vec2D], fill_char: ColChar)
Append vector of coordinates and a single ColChar for all of them.
sourcepub fn blit<E: ViewElement>(&mut self, element: &E)
pub fn blit<E: ViewElement>(&mut self, element: &E)
Blit a ViewElement to the PixelContainer.
sourcepub fn shade_with(&self, shader: &mut Box<dyn CanShade>) -> Self
pub fn shade_with(&self, shader: &mut Box<dyn CanShade>) -> Self
Applies the shader to the PixelContainer’s active pixels. A “shader” in this case is any object which implements CanShade
Trait Implementations§
source§impl Clone for PixelContainer
impl Clone for PixelContainer
source§fn clone(&self) -> PixelContainer
fn clone(&self) -> PixelContainer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PixelContainer
impl Debug for PixelContainer
source§impl From<&[Pixel]> for PixelContainer
impl From<&[Pixel]> for PixelContainer
source§impl ViewElement for PixelContainer
impl ViewElement for PixelContainer
source§fn active_pixels(&self) -> Vec<Pixel>
fn active_pixels(&self) -> Vec<Pixel>
Return a vector of the element’s
Pixels - A ColChar. If your whole object is a solid colour, consider using utils::points_to_pixels() which will add the same ColChar to every point and can then be used as this function’s outputsource§fn active_points(&self) -> Vec<Vec2D>
fn active_points(&self) -> Vec<Vec2D>
Return the positions the
ViewElement occupies, essentially active_pixels() without the ColChars. This has a default setting that extracts the Vec2Ds from active_pixels but you can set it to something else to make it fasterAuto Trait Implementations§
impl RefUnwindSafe for PixelContainer
impl Send for PixelContainer
impl Sync for PixelContainer
impl Unpin for PixelContainer
impl UnwindSafe for PixelContainer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more