Struct embedded_graphics_simulator::SimulatorDisplay [−][src]
pub struct SimulatorDisplay<C> { /* fields omitted */ }
Simulator display.
Implementations
impl<C: PixelColor> SimulatorDisplay<C>
[src]
impl<C: PixelColor> SimulatorDisplay<C>
[src]pub fn with_default_color(size: Size, default_color: C) -> Self
[src]
Creates a new display filled with a color.
This constructor can be used if C
doesn’t implement From<BinaryColor>
or another
default color is wanted.
pub fn get_pixel(&self, point: Point) -> C
[src]
impl<C> SimulatorDisplay<C> where
C: PixelColor + From<BinaryColor>,
[src]
impl<C> SimulatorDisplay<C> where
C: PixelColor + From<BinaryColor>,
[src]impl<C> SimulatorDisplay<C> where
C: PixelColor + Into<Rgb888>,
[src]
impl<C> SimulatorDisplay<C> where
C: PixelColor + Into<Rgb888>,
[src]pub fn to_rgb_output_image(
&self,
output_settings: &OutputSettings
) -> OutputImage<Rgb888>
[src]
&self,
output_settings: &OutputSettings
) -> OutputImage<Rgb888>
Converts the display contents into a RGB output image.
Examples
use embedded_graphics::{pixelcolor::Rgb888, prelude::*}; use embedded_graphics_simulator::{OutputSettingsBuilder, SimulatorDisplay}; let output_settings = OutputSettingsBuilder::new().scale(2).build(); let display = SimulatorDisplay::<Rgb888>::new(Size::new(128, 64)); // draw something to the display let output_image = display.to_rgb_output_image(&output_settings); assert_eq!(output_image.size(), Size::new(256, 128)); // use output image: // example: output_image.save_png("out.png")?;
pub fn to_grayscale_output_image(
&self,
output_settings: &OutputSettings
) -> OutputImage<Gray8>
[src]
&self,
output_settings: &OutputSettings
) -> OutputImage<Gray8>
Converts the display contents into a grayscale output image.
Examples
use embedded_graphics::{pixelcolor::Gray8, prelude::*}; use embedded_graphics_simulator::{OutputSettingsBuilder, SimulatorDisplay}; let output_settings = OutputSettingsBuilder::new().scale(2).build(); let display = SimulatorDisplay::<Gray8>::new(Size::new(128, 64)); // draw something to the display let output_image = display.to_grayscale_output_image(&output_settings); assert_eq!(output_image.size(), Size::new(256, 128)); // use output image: // example: output_image.save_png("out.png")?;
Trait Implementations
impl<C: PixelColor> DrawTarget for SimulatorDisplay<C>
[src]
impl<C: PixelColor> DrawTarget for SimulatorDisplay<C>
[src]type Color = C
The pixel color type the targetted display supports.
type Error = Infallible
Error type to return when a drawing operation fails. Read more
fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error> where
I: IntoIterator<Item = Pixel<Self::Color>>,
[src]
I: IntoIterator<Item = Pixel<Self::Color>>,
pub fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I
) -> Result<(), Self::Error> where
I: IntoIterator<Item = Self::Color>,
&mut self,
area: &Rectangle,
colors: I
) -> Result<(), Self::Error> where
I: IntoIterator<Item = Self::Color>,
pub fn fill_solid(
&mut self,
area: &Rectangle,
color: Self::Color
) -> Result<(), Self::Error>
&mut self,
area: &Rectangle,
color: Self::Color
) -> Result<(), Self::Error>
pub fn clear(&mut self, color: Self::Color) -> Result<(), Self::Error>
impl<C> OriginDimensions for SimulatorDisplay<C>
[src]
impl<C> OriginDimensions for SimulatorDisplay<C>
[src]Auto Trait Implementations
impl<C> RefUnwindSafe for SimulatorDisplay<C> where
C: RefUnwindSafe,
impl<C> RefUnwindSafe for SimulatorDisplay<C> where
C: RefUnwindSafe,
impl<C> Send for SimulatorDisplay<C> where
C: Send,
impl<C> Send for SimulatorDisplay<C> where
C: Send,
impl<C> Sync for SimulatorDisplay<C> where
C: Sync,
impl<C> Sync for SimulatorDisplay<C> where
C: Sync,
impl<C> Unpin for SimulatorDisplay<C>
impl<C> Unpin for SimulatorDisplay<C>
impl<C> UnwindSafe for SimulatorDisplay<C> where
C: UnwindSafe,
impl<C> UnwindSafe for SimulatorDisplay<C> where
C: UnwindSafe,
Blanket Implementations
impl<T> Dimensions for T where
T: OriginDimensions,
impl<T> Dimensions for T where
T: OriginDimensions,
pub fn bounding_box(&self) -> Rectangle
impl<T> DrawTargetExt for T where
T: DrawTarget,
[src]
impl<T> DrawTargetExt for T where
T: DrawTarget,
[src]pub fn translated(&mut self, offset: Point) -> Translated<'_, T>
[src]
pub fn cropped(&mut self, area: &Rectangle) -> Cropped<'_, T>
[src]
pub fn clipped(&mut self, area: &Rectangle) -> Clipped<'_, T>
[src]
pub fn color_converted<C>(&mut self) -> ColorConverted<'_, T, C> where
C: PixelColor + Into<<T as DrawTarget>::Color>,
[src]
C: PixelColor + Into<<T as DrawTarget>::Color>,