pdf_writer::writers

Struct DeviceN

source
pub struct DeviceN<'a> { /* private fields */ }
Expand description

Writer for a DeviceN color space array with attributes. PDF 1.6+.

First, one of the alternate_... methods must be called to specify the alternate color space. Then, one of the tint_... methods must be called to specify the tint transform method. Finally, the attrs function may optionally be called. If any function is called out of order, the function panics.

This struct is created by ColorSpace::device_n.

Implementations§

source§

impl<'a> DeviceN<'a>

source

pub fn alternate_device(&mut self, device_space: DeviceColorSpace) -> &mut Self

Write the alternateSpace element as a device color space.

source

pub fn alternate_color_space(&mut self) -> ColorSpace<'_>

Start writing the alternateSpace element as a color space array. The color space must not be another Pattern, Separation, or DeviceN color space.

source

pub fn alternate_color_space_ref(&mut self, id: Ref) -> &mut Self

Write the alternateSpace element as an indirect reference. The color space must not be another Pattern, Separation, or DeviceN color space.

source

pub fn tint_exponential(&mut self) -> ExponentialFunction<'_>

Start writing the tintTransform element as an exponential interpolation function.

source

pub fn tint_stitching(&mut self) -> StitchingFunction<'_>

Start writing the tintTransform element as a stitching function.

source

pub fn tint_ref(&mut self, id: Ref) -> &mut Self

Write the tintTransform element as an indirect reference to a function. The function must take n numbers as input and produce a color in the alternate color space as output. This must be used if a stream function like SampledFunction or PostScriptFunction is used.

source

pub fn attrs(&mut self) -> DeviceNAttrs<'_>

Start writing the attrs dictionary. PDF 1.6+.

Auto Trait Implementations§

§

impl<'a> Freeze for DeviceN<'a>

§

impl<'a> RefUnwindSafe for DeviceN<'a>

§

impl<'a> Send for DeviceN<'a>

§

impl<'a> Sync for DeviceN<'a>

§

impl<'a> Unpin for DeviceN<'a>

§

impl<'a> !UnwindSafe for DeviceN<'a>

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> Finish for T

source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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.