Struct gemini_engine::elements::PixelContainer
source · pub struct PixelContainer {
pub pixels: Vec<Point>,
}
Expand description
A PixelContainer
only has a pixels
property, which gets returned directly to the View during blit
Fields§
§pixels: Vec<Point>
Implementations§
source§impl PixelContainer
impl PixelContainer
pub const fn new() -> Self
sourcepub fn append(&mut self, pixels: &mut Vec<Point>)
pub fn append(&mut self, pixels: &mut Vec<Point>)
Moves all the pixels into the PixelContainer
, leaving the input empty.
sourcepub fn append_points(&mut self, points: Vec<Vec2D>, fill_char: ColChar)
pub fn append_points(&mut self, points: Vec<Vec2D>, fill_char: ColChar)
Append vector of coordinates and a single ColChar
for all of them.
sourcepub fn blit<T: ViewElement>(&mut self, element: &T)
pub fn blit<T: ViewElement>(&mut self, element: &T)
Blit a ViewElement
to the PixelContainer.
Trait Implementations§
source§impl ViewElement for PixelContainer
impl ViewElement for PixelContainer
source§fn active_pixels(&self) -> Vec<Point>
fn active_pixels(&self) -> Vec<Point>
Return a vector of every coordinate where a pixel should be placed and its respective
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 outputAuto 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