pub struct IccProfile {
pub name: String,
pub data: Vec<u8>,
pub components: u8,
pub color_space: IccColorSpace,
pub range: Option<Vec<f64>>,
pub metadata: HashMap<String, String>,
}Expand description
ICC color profile data
Fields§
§name: StringProfile name for referencing
data: Vec<u8>Raw ICC profile data
components: u8Number of color components
color_space: IccColorSpaceColor space type (RGB, CMYK, Lab, etc.)
range: Option<Vec<f64>>Range array for color components
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl IccProfile
impl IccProfile
Sourcepub fn new(name: String, data: Vec<u8>, color_space: IccColorSpace) -> Self
pub fn new(name: String, data: Vec<u8>, color_space: IccColorSpace) -> Self
Create a new ICC profile
Sourcepub fn from_standard(profile: StandardIccProfile) -> Self
pub fn from_standard(profile: StandardIccProfile) -> Self
Create ICC profile from standard profile
Sourcepub fn with_range(self, range: Vec<f64>) -> Self
pub fn with_range(self, range: Vec<f64>) -> Self
Set custom range for color components
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Add metadata to the profile
Sourcepub fn to_pdf_color_space_array(&self) -> Result<Vec<Object>>
pub fn to_pdf_color_space_array(&self) -> Result<Vec<Object>>
Generate ICC-based color space array for PDF
Trait Implementations§
Source§impl Clone for IccProfile
impl Clone for IccProfile
Source§fn clone(&self) -> IccProfile
fn clone(&self) -> IccProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IccProfile
impl RefUnwindSafe for IccProfile
impl Send for IccProfile
impl Sync for IccProfile
impl Unpin for IccProfile
impl UnwindSafe for IccProfile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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