Skip to main content

ScalarModel

Struct ScalarModel 

Source
pub struct ScalarModel {
    pub curve: [[f64; 4]; 3],
    pub paper: [f64; 4],
    pub toe_transition: [f64; 4],
    pub shoulder_transition: [f64; 4],
    pub base_density: [f64; 3],
    pub print_shift: [f64; 3],
    pub exposure_shift: f64,
    pub reversal: bool,
}
Expand description

The scalar model, flattened into the numbers another backend needs.

A GPU cannot call into this crate, and re-deriving the model from its parameters on the other side would be a second implementation that could drift. So the prepared render hands over the numbers it solved, in the shape a shader wants: per layer, a base density, a span, a slope and an inflection point; then the paper’s two numbers and the enlarger’s four.

Only the pure scalar path has one. The spectral exposure, the spectral print and the spectral scan integrate over wavelength, and a backend that wants them has to port the integration rather than the numbers.

Fields§

§curve: [[f64; 4]; 3]

Per layer: d_min, d_max, gamma, log_e0.

§paper: [f64; 4]

The paper’s d_min, d_max, gamma and log_e0.

§toe_transition: [f64; 4]

How sharply each curve’s toe turns: the three layers, then the paper.

It rides on the curve rather than on the model because it is a property of the material — see crate::curve.

§shoulder_transition: [f64; 4]

How sharply each curve’s shoulder turns: the three layers, then the paper. Equal to toe_transition for every material whose two corners were measured as one.

§base_density: [f64; 3]

The film’s minimum density in status terms: base, fog and mask.

§print_shift: [f64; 3]

The enlarger’s exposure shift per layer, in decades.

§exposure_shift: f64

Exposure offset applied before the curve, in decades.

§reversal: bool

Whether the film is its own picture. A reversal keeps its density and stops: there is no paper between the development and the eye.

Trait Implementations§

Source§

impl Clone for ScalarModel

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 Copy for ScalarModel

Source§

impl Debug for ScalarModel

Source§

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

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

impl PartialEq for ScalarModel

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 ScalarModel

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.