Skip to main content

Builtin

Enum Builtin 

Source
pub enum Builtin {
    Srgb,
    DisplayP3,
    AdobeRgbCompat,
    ProPhotoCompat,
    LinearSrgb,
    AcesCg,
    Rec2020,
    GrayGamma22,
    SGray,
    DotGain20Compat,
    LabD50,
    CoatedCmyk,
}
Expand description

Identifiers of the built-in profiles.

Variants§

§

Srgb

sRGB IEC 61966-2.1 (Rec. 709 primaries, D65, sRGB transfer function).

§

DisplayP3

Display P3 (DCI-P3 primaries, D65, sRGB transfer function).

§

AdobeRgbCompat

Adobe RGB (1998)-compatible: its published primaries, D65, gamma 563/256.

§

ProPhotoCompat

ProPhoto-compatible: ROMM RGB primaries, D50, gamma 1.8.

§

LinearSrgb

sRGB primaries with a linear transfer function.

§

AcesCg

ACEScg: AP1 primaries, the ACES white point (~D60), linear transfer. The ACES working space for CG renders.

§

Rec2020

Rec. 2020 primaries, D65, Rec. 709 transfer function.

§

GrayGamma22

Gray, gamma 2.2.

§

SGray

Gray with the sRGB transfer function (sGray): gray v looks like RGB (v, v, v) in sRGB.

§

DotGain20Compat

Gray matching Photoshop’s default working gray (Dot Gain 20 %) with our own curve: a pure gamma of 1.732, fitted on Photoshop 27.11’s RGB → Grayscale (sRGB 64 / 128 / 192 and pure red become 46 / 105 / 177 / 107, all within 1 level). Not Adobe’s profile.

§

LabD50

CIE Lab* D50 identity (device Lab = PCS Lab, ICC v4 encoding).

§

CoatedCmyk

Synthetic coated-offset CMYK (300 % total ink, medium GCR); see crate::synth.

Implementations§

Source§

impl Builtin

Source

pub const ALL: [Builtin; 12]

Source

pub fn id(self) -> &'static str

Stable identifier used by commands and settings.

Source

pub fn description(self) -> &'static str

Profile description (the desc tag).

Source

pub fn from_id(s: &str) -> Option<Builtin>

Looks up an id (case-insensitive; a few aliases and the descriptions are accepted).

Source

pub fn profile(self) -> &'static Profile

The profile (built once per process).

Trait Implementations§

Source§

impl Clone for Builtin

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 Builtin

Source§

impl Debug for Builtin

Source§

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

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

impl Eq for Builtin

Source§

impl Hash for Builtin

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Builtin

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 Builtin

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.