Skip to main content

RawDecodeConfig

Struct RawDecodeConfig 

Source
#[non_exhaustive]
pub struct RawDecodeConfig { pub demosaic: DemosaicMethod, pub max_pixels: u64, pub output: OutputMode, pub target: OutputPrimaries, pub exposure_ev: f32, pub apply_crop: bool, pub apply_orientation: bool, pub wb_override: Option<[f32; 3]>, }
Expand description

Configuration for RAW/DNG decoding.

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.
§demosaic: DemosaicMethod

Demosaicing algorithm to use.

§max_pixels: u64

Maximum pixel count (width × height) before rejecting.

§output: OutputMode

Output rendering mode.

  • Develop (default): display-ready u16 sRGB with WB, color matrix, tone curve, and sRGB gamma.
  • Linear: scene-referred f32 linear with WB and color matrix applied.
  • CameraRaw: raw camera values as f32, no WB or color matrix.
§target: OutputPrimaries

Target output color primaries.

Controls the RGB primaries of the output buffer. Only affects Develop and Linear modes; CameraRaw ignores this.

Default: Srgb.

§exposure_ev: f32

Exposure compensation in EV (stops).

Applied as a linear multiplier (2^exposure_ev) after WB + color matrix, before tone mapping and gamma. Positive values brighten; negative darken. Only affects Develop and Linear.

Default: 0.0 (no adjustment).

§apply_crop: bool

Whether to apply the crop specified in the RAW metadata.

§apply_orientation: bool

Whether to apply EXIF orientation (rotation/flip) to the output.

When true (default), the decoded image is rotated/flipped to match display orientation, and RawInfo::orientation is set to 1. When false, the raw sensor orientation is preserved.

§wb_override: Option<[f32; 3]>

Override white balance coefficients (RGB multipliers).

When set, these multipliers replace the camera’s as-shot WB during the color pipeline. Only has effect in Develop and Linear modes.

Values are relative multipliers (e.g., [1.0, 1.0, 1.0] = no WB, [2.0, 1.0, 1.5] = boost red, slight blue).

Implementations§

Source§

impl RawDecodeConfig

Source

pub fn new() -> Self

Create a config with default settings.

Source

pub fn with_demosaic(self, method: DemosaicMethod) -> Self

Set the demosaicing method.

Source

pub fn with_max_pixels(self, max: u64) -> Self

Set maximum allowed pixel count.

Source

pub fn with_output(self, mode: OutputMode) -> Self

Set the output rendering mode.

  • Develop (default): display-ready u16 sRGB
  • Linear: scene-referred f32 linear
  • CameraRaw: raw camera f32 values
Source

pub fn with_target(self, primaries: OutputPrimaries) -> Self

Set the target output color primaries.

Affects Develop and Linear; ignored for CameraRaw.

Source

pub fn with_exposure_ev(self, ev: f32) -> Self

Set exposure compensation in EV (stops).

Applied as 2^ev multiplier after WB + color matrix. Positive brightens, negative darkens.

Source

pub fn with_crop(self, apply: bool) -> Self

Set whether to apply the crop from RAW metadata (default: true).

Source

pub fn with_orientation(self, apply: bool) -> Self

Set whether to apply EXIF orientation transform (default: true).

When enabled, the output image matches display orientation and width/height reflect the rotated dimensions.

Source

pub fn with_wb(self, rgb: [f32; 3]) -> Self

Override white balance with custom RGB multipliers.

Replaces the camera’s as-shot WB during color pipeline processing. Only effective in Develop and Linear modes.

Trait Implementations§

Source§

impl Clone for RawDecodeConfig

Source§

fn clone(&self) -> RawDecodeConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RawDecodeConfig

Source§

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

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

impl Default for RawDecodeConfig

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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 = 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.