pub struct MtmdBitmap {
pub bitmap: NonNull<mtmd_bitmap>,
}Fields§
§bitmap: NonNull<mtmd_bitmap>Implementations§
Source§impl MtmdBitmap
impl MtmdBitmap
Sourcepub fn from_image_data(
nx: u32,
ny: u32,
data: &[u8],
) -> Result<Self, MtmdBitmapError>
pub fn from_image_data( nx: u32, ny: u32, data: &[u8], ) -> Result<Self, MtmdBitmapError>
§Errors
InvalidDataSize- Data length doesn’t matchnx * ny * 3NullResult- Underlying C function returned null
Sourcepub fn from_audio_data(data: &[f32]) -> Result<Self, MtmdBitmapError>
pub fn from_audio_data(data: &[f32]) -> Result<Self, MtmdBitmapError>
§Errors
NullResult- Underlying C function returned null
Sourcepub fn from_file(ctx: &MtmdContext, path: &str) -> Result<Self, MtmdBitmapError>
pub fn from_file(ctx: &MtmdContext, path: &str) -> Result<Self, MtmdBitmapError>
§Errors
Returns an MtmdBitmapError variant matching the wrapper’s status code.
Sourcepub fn from_buffer(
ctx: &MtmdContext,
data: &[u8],
) -> Result<Self, MtmdBitmapError>
pub fn from_buffer( ctx: &MtmdContext, data: &[u8], ) -> Result<Self, MtmdBitmapError>
§Errors
NullResult- Buffer could not be processed
pub fn nx(&self) -> u32
pub fn ny(&self) -> u32
pub fn data(&self) -> &[u8] ⓘ
pub fn is_audio(&self) -> bool
pub fn id(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for MtmdBitmap
impl Clone for MtmdBitmap
Source§fn clone(&self) -> MtmdBitmap
fn clone(&self) -> MtmdBitmap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MtmdBitmap
impl Debug for MtmdBitmap
Source§impl Drop for MtmdBitmap
impl Drop for MtmdBitmap
impl Send for MtmdBitmap
impl Sync for MtmdBitmap
Auto Trait Implementations§
impl Freeze for MtmdBitmap
impl RefUnwindSafe for MtmdBitmap
impl Unpin for MtmdBitmap
impl UnsafeUnpin for MtmdBitmap
impl UnwindSafe for MtmdBitmap
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