Skip to main content

ProofingConfig

Struct ProofingConfig 

Source
pub struct ProofingConfig { /* private fields */ }
Expand description

Configuration for soft proofing transforms.

Built via ProofingConfig::builder(), this struct captures the profiles, intents, and optional gamut warning needed for a two-stage proofing pipeline.

§Examples

use appthere_color::{ProofingConfig, IccProfile, RenderingIntent};

let config = ProofingConfig::builder()
    .source(&IccProfile::new_srgb())
    .simulation(&IccProfile::new_srgb())
    .display(&IccProfile::new_srgb())
    .simulation_intent(RenderingIntent::Perceptual)
    .build()
    .unwrap();

Implementations§

Source§

impl ProofingConfig

Source

pub fn builder() -> ProofingConfigBuilder

Creates a new ProofingConfigBuilder.

§Examples
use appthere_color::ProofingConfig;

let builder = ProofingConfig::builder();
Source

pub fn proof(&self, src: &[f32], dst: &mut [f32]) -> ColorResult<()>

Executes the two-stage proofing transform on pixel data.

Transform 1: source → simulation profile (simulation_intent). Transform 2: simulation → display profile (display_intent).

§Errors

Returns ColorError::TransformExecution if either stage fails.

§Examples
use appthere_color::{ProofingConfig, IccProfile, RenderingIntent};

let config = ProofingConfig::builder()
    .source(&IccProfile::new_srgb())
    .simulation(&IccProfile::new_srgb())
    .display(&IccProfile::new_srgb())
    .build()
    .unwrap();

let input = [0.5_f32, 0.3, 0.8];
let mut output = [0.0_f32; 3];
config.proof(&input, &mut output).unwrap();
Source

pub fn gamut_warning(&self) -> GamutWarning

Returns the gamut warning mode configured for this proofing config.

§Examples
use appthere_color::{ProofingConfig, IccProfile, GamutWarning};

let config = ProofingConfig::builder()
    .source(&IccProfile::new_srgb())
    .simulation(&IccProfile::new_srgb())
    .display(&IccProfile::new_srgb())
    .build()
    .unwrap();
assert_eq!(config.gamut_warning(), GamutWarning::None);
Source

pub fn source_channels(&self) -> usize

Returns the number of channels in the source color space.

§Examples
use appthere_color::{ProofingConfig, IccProfile};

let config = ProofingConfig::builder()
    .source(&IccProfile::new_srgb())
    .simulation(&IccProfile::new_srgb())
    .display(&IccProfile::new_srgb())
    .build()
    .unwrap();
assert_eq!(config.source_channels(), 3);
Source

pub fn destination_channels(&self) -> usize

Returns the number of channels in the display color space.

§Examples
use appthere_color::{ProofingConfig, IccProfile};

let config = ProofingConfig::builder()
    .source(&IccProfile::new_srgb())
    .simulation(&IccProfile::new_srgb())
    .display(&IccProfile::new_srgb())
    .build()
    .unwrap();
assert_eq!(config.destination_channels(), 3);

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, 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.