pub enum ColorSpace {
DeviceGray,
DeviceRGB,
DeviceCMYK,
Lab {
wp: [f64; 3],
range: [f64; 4],
},
Indexed {
base: Box<ColorSpace>,
hival: usize,
lookup: Vec<u8>,
},
Separation {
n: usize,
alt: Box<ColorSpace>,
tint: Option<Function>,
is_none: bool,
is_all: bool,
},
Pattern(Option<Box<ColorSpace>>),
}Variants§
DeviceGray
DeviceRGB
DeviceCMYK
Lab
CIE Lab* with its white point and /Range.
Indexed
Separation
Separation / DeviceN: n tints through a function into alt.
Fields
§
alt: Box<ColorSpace>Pattern(Option<Box<ColorSpace>>)
A pattern colour space, with the base space of an uncoloured (type 2) tiling pattern’s colour operands.
Implementations§
Source§impl ColorSpace
impl ColorSpace
pub fn components(&self) -> usize
Sourcepub fn initial(&self) -> Vec<f64>
pub fn initial(&self) -> Vec<f64>
The initial colour when the space is selected (cs): black, or all
colorants at 1.0 for Separation/DeviceN.
Sourcepub fn default_decode(&self, bpc: u32) -> Vec<f64>
pub fn default_decode(&self, bpc: u32) -> Vec<f64>
The default /Decode range of image samples in this space for bpc
bits: [0 1] per component, [0 2ᵇᵖᶜ−1] for Indexed, the /Range
for Lab.
Sourcepub fn parse(
doc: &Document,
obj: &Object,
res: Option<&Dictionary>,
) -> Option<ColorSpace>
pub fn parse( doc: &Document, obj: &Object, res: Option<&Dictionary>, ) -> Option<ColorSpace>
Resolve a colour space object; res is the resources dictionary named
spaces are looked up in.
Trait Implementations§
Source§impl Clone for ColorSpace
impl Clone for ColorSpace
Auto Trait Implementations§
impl Freeze for ColorSpace
impl RefUnwindSafe for ColorSpace
impl Send for ColorSpace
impl Sync for ColorSpace
impl Unpin for ColorSpace
impl UnsafeUnpin for ColorSpace
impl UnwindSafe for ColorSpace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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