Struct embedded_graphics_simulator::OutputImage
source · pub struct OutputImage<C> { /* private fields */ }
Expand description
Output image.
An output image is the result of applying OutputSettings
to a SimulatorDisplay
. It can
be used to save a simulator display to a PNG file.
Implementations§
source§impl<C> OutputImage<C>
impl<C> OutputImage<C>
sourcepub fn update<DisplayC>(&mut self, display: &SimulatorDisplay<DisplayC>)
pub fn update<DisplayC>(&mut self, display: &SimulatorDisplay<DisplayC>)
Updates the image from a SimulatorDisplay
.
source§impl<C: OutputImageColor> OutputImage<C>
impl<C: OutputImageColor> OutputImage<C>
sourcepub fn save_png<PATH: AsRef<Path>>(&self, path: PATH) -> ImageResult<()>
pub fn save_png<PATH: AsRef<Path>>(&self, path: PATH) -> ImageResult<()>
Saves the image content to a PNG file.
sourcepub fn to_base64_png(&self) -> ImageResult<String>
pub fn to_base64_png(&self) -> ImageResult<String>
Returns the image as a base64 encoded PNG.
sourcepub fn as_image_buffer(&self) -> ImageBuffer<C::ImageColor, &[u8]>
pub fn as_image_buffer(&self) -> ImageBuffer<C::ImageColor, &[u8]>
Returns the output image as an image
crate ImageBuffer
.
Trait Implementations§
source§impl<C: Clone> Clone for OutputImage<C>
impl<C: Clone> Clone for OutputImage<C>
source§fn clone(&self) -> OutputImage<C>
fn clone(&self) -> OutputImage<C>
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<C: Debug> Debug for OutputImage<C>
impl<C: Debug> Debug for OutputImage<C>
source§impl<C> OriginDimensions for OutputImage<C>
impl<C> OriginDimensions for OutputImage<C>
source§impl<C: PartialEq> PartialEq for OutputImage<C>
impl<C: PartialEq> PartialEq for OutputImage<C>
impl<C: Eq> Eq for OutputImage<C>
impl<C> StructuralPartialEq for OutputImage<C>
Auto Trait Implementations§
impl<C> Freeze for OutputImage<C>
impl<C> RefUnwindSafe for OutputImage<C>where
C: RefUnwindSafe,
impl<C> Send for OutputImage<C>where
C: Send,
impl<C> Sync for OutputImage<C>where
C: Sync,
impl<C> Unpin for OutputImage<C>where
C: Unpin,
impl<C> UnwindSafe for OutputImage<C>where
C: UnwindSafe,
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Dimensions for Twhere
T: OriginDimensions,
impl<T> Dimensions for Twhere
T: OriginDimensions,
source§fn bounding_box(&self) -> Rectangle
fn bounding_box(&self) -> Rectangle
Returns the bounding box.
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.