pub struct OutputIntent { /* private fields */ }Expand description
Describes the intended output condition for a document.
Maps conceptually to PDF/X /OutputIntents, ODF draw:color-profile, or
embedded ICC profiles in EPUB image resources.
§Examples
use appthere_color::{OutputIntent, IccProfile};
let intent = OutputIntent::new(
"FOGRA39".to_string(),
IccProfile::new_srgb(),
);
assert_eq!(intent.name(), "FOGRA39");Implementations§
Source§impl OutputIntent
impl OutputIntent
Sourcepub fn new(name: String, profile: IccProfile) -> Self
pub fn new(name: String, profile: IccProfile) -> Self
Creates a new output intent with the given name and profile.
§Examples
use appthere_color::{OutputIntent, IccProfile};
let oi = OutputIntent::new("ISOcoated_v2".to_string(), IccProfile::new_srgb());Sourcepub fn with_condition(self, condition: String) -> Self
pub fn with_condition(self, condition: String) -> Self
Sets the output condition identifier (e.g. a registered condition name).
§Examples
use appthere_color::{OutputIntent, IccProfile};
let oi = OutputIntent::new("FOGRA39".to_string(), IccProfile::new_srgb())
.with_condition("FOGRA39L".to_string());
assert_eq!(oi.condition(), Some("FOGRA39L"));Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the output intent name.
§Examples
use appthere_color::{OutputIntent, IccProfile};
let oi = OutputIntent::new("test".to_string(), IccProfile::new_srgb());
assert_eq!(oi.name(), "test");Sourcepub fn profile(&self) -> &IccProfile
pub fn profile(&self) -> &IccProfile
Returns a reference to the output intent’s ICC profile.
§Examples
use appthere_color::{OutputIntent, IccProfile};
let oi = OutputIntent::new("sRGB".to_string(), IccProfile::new_srgb());
let _profile = oi.profile();Trait Implementations§
Source§impl Clone for OutputIntent
impl Clone for OutputIntent
Source§fn clone(&self) -> OutputIntent
fn clone(&self) -> OutputIntent
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 OutputIntent
impl RefUnwindSafe for OutputIntent
impl Send for OutputIntent
impl Sync for OutputIntent
impl Unpin for OutputIntent
impl UnsafeUnpin for OutputIntent
impl UnwindSafe for OutputIntent
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