#[repr(C)]pub struct ImageRef {
pub data: *const DecodedImage,
pub copies: *const AtomicUsize,
pub run_destructor: bool,
}Fields§
§data: *const DecodedImageShared pointer to an opaque implementation of the decoded image
copies: *const AtomicUsizeHow many copies does this image have (if 0, the font data will be deleted on drop)
run_destructor: boolImplementations§
Source§impl ImageRef
impl ImageRef
Sourcepub fn into_inner(self) -> Option<DecodedImage>
pub fn into_inner(self) -> Option<DecodedImage>
If *copies = 1, returns the internal image data
pub fn get_data<'a>(&'a self) -> &'a DecodedImage
pub fn get_image_callback<'a>(&'a self) -> Option<&'a ImageCallback>
pub fn get_image_callback_mut<'a>(&'a mut self) -> Option<&'a mut ImageCallback>
Sourcepub fn deep_copy(&self) -> Self
pub fn deep_copy(&self) -> Self
In difference to the default shallow copy, creates a new image ref
pub fn is_null_image(&self) -> bool
pub fn is_gl_texture(&self) -> bool
pub fn is_raw_image(&self) -> bool
pub fn is_callback(&self) -> bool
pub fn get_rawimage(&self) -> Option<RawImage>
Sourcepub fn get_size(&self) -> LogicalSize
pub fn get_size(&self) -> LogicalSize
NOTE: returns (0, 0) for a Callback
pub fn get_hash(&self) -> ImageRefHash
pub fn null_image( width: usize, height: usize, format: RawImageFormat, tag: Vec<u8>, ) -> Self
pub fn callback(gl_callback: RenderImageCallbackType, data: RefAny) -> Self
pub fn new_rawimage(image_data: RawImage) -> Option<Self>
pub fn new_gltexture(texture: Texture) -> Self
Trait Implementations§
Source§impl Ord for ImageRef
impl Ord for ImageRef
Source§impl PartialOrd for ImageRef
impl PartialOrd for ImageRef
impl Eq for ImageRef
impl Send for ImageRef
impl Sync for ImageRef
Auto Trait Implementations§
impl Freeze for ImageRef
impl RefUnwindSafe for ImageRef
impl Unpin for ImageRef
impl UnwindSafe for ImageRef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more