Skip to main content

RawImage

Struct RawImage 

Source
pub struct RawImage {
    pub data: Vec<u16>,
    /* private fields */
}
Expand description

Raw image data container.

Holds the decoded raw sensor data along with associated metadata. Use RawImageBuilder to construct new instances.

Fields§

§data: Vec<u16>

Raw pixel data (16-bit values, one per sensor pixel). Stored in row-major order: data[y * width + x]

Implementations§

Source§

impl RawImage

Source

pub fn new( size: Size, active_area: Rect, bit_depth: u8, cfa_pattern: CfaPattern, ) -> Self

Create a new empty RawImage with the given parameters.

Source

pub fn builder( size: Size, active_area: Rect, bit_depth: u8, cfa_pattern: CfaPattern, ) -> RawImageBuilder

Create a builder for constructing a RawImage.

Source

pub fn size(&self) -> Size

Full sensor dimensions.

Source

pub fn width(&self) -> u32

Sensor width in pixels.

Source

pub fn height(&self) -> u32

Sensor height in pixels.

Source

pub fn active_area(&self) -> Rect

Active/crop area (usable image region).

Source

pub fn bit_depth(&self) -> u8

Bits per sample (typically 12, 14, or 16).

Source

pub fn cfa_pattern(&self) -> CfaPattern

CFA (Bayer) pattern.

Source

pub fn xtrans_pattern(&self) -> Option<&XTransPattern>

X-Trans CFA pattern, if applicable.

Source

pub fn black_levels(&self) -> &[u16; 4]

Black level values (per CFA color channel).

Source

pub fn white_level(&self) -> u16

White/saturation level.

Source

pub fn baseline_exposure(&self) -> Option<f32>

Baseline exposure offset in EV.

Source

pub fn default_crop(&self) -> Option<Rect>

Default crop rectangle.

Source

pub fn set_black_levels(&mut self, levels: [u16; 4])

Set black level values.

Source

pub fn set_white_level(&mut self, level: u16)

Set white/saturation level.

Source

pub fn set_baseline_exposure(&mut self, ev: Option<f32>)

Set baseline exposure offset.

Source

pub fn set_default_crop(&mut self, crop: Option<Rect>)

Set default crop rectangle.

Source

pub fn set_xtrans_pattern(&mut self, pattern: Option<XTransPattern>)

Set X-Trans pattern.

Source

pub fn set_bit_depth(&mut self, bit_depth: u8)

Set bit depth.

Source

pub fn get_pixel(&self, x: u32, y: u32) -> Option<u16>

Get pixel value at (x, y).

Source

pub fn set_pixel(&mut self, x: u32, y: u32, value: u16)

Set pixel value at (x, y).

Trait Implementations§

Source§

impl Clone for RawImage

Source§

fn clone(&self) -> RawImage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RawImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.