Skip to main content

FrameInfo

Struct FrameInfo 

Source
#[non_exhaustive]
pub struct FrameInfo {
Show 20 fields pub width: u32, pub height: u32, pub cpp: u32, pub bits_per_sample: u8, pub sample_format: SampleFormat, pub cfa: Option<CfaPattern>, pub layout: SensorLayout, pub active_area: Rect, pub crop: Rect, pub masked_areas: Vec<Rect>, pub black_level: BlackLevel, pub black_from_masked: bool, pub white_level: WhiteLevel, pub white_balance: Option<WhiteBalance>, pub white_balance_applied: bool, pub color_matrices: ColorMatrices, pub orientation: Orientation, pub pixel_aspect: f32, pub compression: Compression, pub opcodes: Option<Arc<OpcodeLists>>,
}
Expand description

Geometry and calibration of the decoded sensor buffer.

Everything here is known after parsing, before any pixel is decoded.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§width: u32

Full decoded buffer width (including masked areas).

§height: u32

Full decoded buffer height (including masked areas).

§cpp: u32

Samples per pixel.

§bits_per_sample: u8

Significant bits per sample (e.g. 12 or 14).

§sample_format: SampleFormat

Numeric format of the decoded samples.

§cfa: Option<CfaPattern>

Colour filter pattern anchored at buffer (0, 0); None for monochrome and multi-sample (linear, Foveon) data.

§layout: SensorLayout

How samples are arranged on the sensor.

§active_area: Rect

Region of valid image pixels (excludes optical black / masked borders).

§crop: Rect

Recommended default crop (DNG DefaultCrop or vendor equivalent); inside active_area.

§masked_areas: Vec<Rect>

Masked (optical black) regions usable for black-level estimation.

§black_level: BlackLevel

Black level (see also black_from_masked).

§black_from_masked: bool

When true, black_level is a fallback: the actual per-CFA-colour black is measured from masked_areas after decoding (done by the high-level API).

§white_level: WhiteLevel

Saturation level of the stored samples.

§white_balance: Option<WhiteBalance>

As-shot white balance; None when the file records none.

§white_balance_applied: bool

True when the camera already applied white_balance to the stored samples (Sony lossless YCbCr M/S, Nikon sNEF): developing them needs unit multipliers, and white_balance (still the as-shot multipliers) only serves to change the balance.

§color_matrices: ColorMatrices

Colour calibration (file or camera database).

§orientation: Orientation

Orientation to apply for display.

§pixel_aspect: f32

Pixel aspect ratio (width / height of a sensor site); 1.0 for almost all cameras.

§compression: Compression

Payload compression scheme.

§opcodes: Option<Arc<OpcodeLists>>

DNG opcode lists carried by the file (applied by the high-level API).

Implementations§

Source§

impl FrameInfo

Source

pub fn new(width: u32, height: u32, bits: u8) -> Self

A default description for a width x height CFA buffer; formats fill in the rest.

Source

pub fn sanitize(&mut self)

Clamp active_area/crop/masked areas into the buffer so later stages can trust them.

Trait Implementations§

Source§

impl Clone for FrameInfo

Source§

fn clone(&self) -> Self

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 FrameInfo

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FrameInfo

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FrameInfo

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.