Skip to main content

RawBitmap

Struct RawBitmap 

Source
pub struct RawBitmap {
    pub data: Vec<u8>,
    pub width: u32,
    pub height: u32,
    pub bit_depth: u8,
    pub num_components: u8,
    pub bytes_per_sample: u8,
}
Expand description

Raw decoded pixel data at native bit depth (no 8-bit scaling).

For bit depths ≤ 8, data contains one byte per sample. For bit depths > 8 (e.g., 12 or 16), data contains two bytes per sample in little-endian byte order (u16 LE).

Samples are interleaved: for a 3-component image, the layout is [R0, G0, B0, R1, G1, B1, ...].

Fields§

§data: Vec<u8>

The raw pixel data at native bit depth.

§width: u32

The width of the image in pixels.

§height: u32

The height of the image in pixels.

§bit_depth: u8

The original bit depth per sample (e.g., 8, 12, 16).

§num_components: u8

The number of components (e.g., 1 for grayscale, 3 for RGB).

§bytes_per_sample: u8

Bytes per sample: 1 for bit_depth ≤ 8, 2 for bit_depth > 8.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.