pub struct BitmapBuf { /* private fields */ }Expand description
Holds a Bitmap in a .pak file. For data transport only.
Implementations
sourceimpl BitmapBuf
impl BitmapBuf
sourcepub fn new(
color: BitmapColor,
fmt: BitmapFormat,
width: u32,
pixels: Vec<u8>
) -> Self
pub fn new(
color: BitmapColor,
fmt: BitmapFormat,
width: u32,
pixels: Vec<u8>
) -> Self
Pixel data must be tightly packed (no additional stride)
pub fn color(&self) -> BitmapColor
sourcepub fn format(&self) -> BitmapFormat
pub fn format(&self) -> BitmapFormat
Gets a description of the number of channels contained in this Bitmap.
pub fn height(&self) -> u32
pub fn pixel(&self, x: u32, y: u32) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn pixels(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn pixels_as_format(
&self,
dst_fmt: BitmapFormat
) -> impl Iterator<Item = u8> + '_
pub fn width(&self) -> u32
Trait Implementations
sourceimpl<'de> Deserialize<'de> for BitmapBuf
impl<'de> Deserialize<'de> for BitmapBuf
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for BitmapBuf
Auto Trait Implementations
impl RefUnwindSafe for BitmapBuf
impl Send for BitmapBuf
impl Sync for BitmapBuf
impl Unpin for BitmapBuf
impl UnwindSafe for BitmapBuf
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more