#[repr(u8)]pub enum ImageInner {
None = 0,
EmbeddedImage {
cache_key: ImageCacheKey,
buffer: SharedImageBuffer,
},
Svg(VRc<OpaqueImageVTable, ParsedSVG>),
StaticTextures(&'static StaticTextures),
BackendStorage(VRc<OpaqueImageVTable>),
BorrowedOpenGLTexture(BorrowedOpenGLTexture),
NineSlice(VRc<OpaqueImageVTable, NineSliceImage>),
}
Expand description
A resource is a reference to binary data, for example images. They can be accessible on the file system or embedded in the resulting binary. Or they might be URLs to a web server and a downloaded is necessary before they can be used. cbindgen:prefix-with-name
Variants§
None = 0
A resource that does not represent any data.
EmbeddedImage
Svg(VRc<OpaqueImageVTable, ParsedSVG>)
StaticTextures(&'static StaticTextures)
BackendStorage(VRc<OpaqueImageVTable>)
BorrowedOpenGLTexture(BorrowedOpenGLTexture)
NineSlice(VRc<OpaqueImageVTable, NineSliceImage>)
Implementations§
Source§impl ImageInner
impl ImageInner
Sourcepub fn render_to_buffer(
&self,
_target_size_for_scalable_source: Option<Size2D<u32, PhysicalPx>>,
) -> Option<SharedImageBuffer>
pub fn render_to_buffer( &self, _target_size_for_scalable_source: Option<Size2D<u32, PhysicalPx>>, ) -> Option<SharedImageBuffer>
Return or render the image into a buffer
target_size_for_scalable_source
is the size to use if the image is scalable.
(when unspecified, will default to the intrinsic size of the image)
Returns None if the image can’t be rendered in a buffer or if the image is empty
Trait Implementations§
Source§impl Clone for ImageInner
impl Clone for ImageInner
Source§fn clone(&self) -> ImageInner
fn clone(&self) -> ImageInner
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 ImageInner
impl Debug for ImageInner
Source§impl Default for ImageInner
impl Default for ImageInner
Source§fn default() -> ImageInner
fn default() -> ImageInner
Returns the “default value” for a type. Read more
Source§impl<'a> From<&'a Image> for &'a ImageInner
impl<'a> From<&'a Image> for &'a ImageInner
Source§impl From<ImageInner> for Image
impl From<ImageInner> for Image
Source§fn from(value: ImageInner) -> Self
fn from(value: ImageInner) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ImageInner
impl PartialEq for ImageInner
Auto Trait Implementations§
impl Freeze for ImageInner
impl !RefUnwindSafe for ImageInner
impl !Send for ImageInner
impl !Sync for ImageInner
impl Unpin for ImageInner
impl !UnwindSafe for ImageInner
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