pdf_writer::writers

Struct ColorSpace

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

Implementations§

source§

impl ColorSpace<'_>

CIE-based color spaces.

source

pub fn cal_rgb( self, white_point: [f32; 3], black_point: Option<[f32; 3]>, gamma: Option<[f32; 3]>, matrix: Option<[f32; 9]>, )

Write a CalRGB color space.

source

pub fn cal_gray( self, white_point: [f32; 3], black_point: Option<[f32; 3]>, gamma: Option<f32>, )

Write a CalGray color space.

source

pub fn lab( self, white_point: [f32; 3], black_point: Option<[f32; 3]>, range: Option<[f32; 4]>, )

Write a Lab color space.

source

pub fn icc_based(self, stream: Ref)

Write an ICCBased color space.

The stream argument should be an indirect reference to an ICC profile stream.

source§

impl ColorSpace<'_>

Common calibrated color spaces.

source

pub fn srgb(self)

Write a CalRGB color space approximating sRGB.

Use an ICC profile for more accurate results.

source

pub fn adobe_rgb(self)

Write a CalRGB color space approximating Adobe RGB.

Use an ICC profile for more accurate results.

source

pub fn display_p3(self)

Write a CalRGB color space approximating Display P3.

Use an ICC profile for more accurate results.

source

pub fn pro_photo(self)

Write a CalRGB color space approximating ProPhoto.

Use an ICC profile for more accurate results.

source

pub fn eci_rgb(self)

Write a CalRGB color space for ECI RGB v1.

source

pub fn ntsc(self)

Write a CalRGB color space for NTSC RGB.

source

pub fn pal(self)

Write a CalRGB color space for PAL/SECAM RGB.

source

pub fn d65_gray(self)

Write a CalGray color space for CIE D65 at a 2.2 gamma, equivalent to sRGB, Adobe RGB, Display P3, PAL, …

source

pub fn d50_gray(self, gamma: Option<f32>)

Write a CalGray color space for CIE D50 (horizon light). Set a 1.8 gamma for ProPhoto or ECI RGB equivalency, 2.2 is another common value.

source

pub fn c_gray(self)

Write a CalGray color space for CIE C (north sky daylight) at 2.2 gamma, equivalent to NTSC.

source

pub fn e_gray(self, gamma: Option<f32>)

Write a CalGray color space for CIE E (equal emission). Common gamma values include 1.8 or 2.2.

source§

impl ColorSpace<'_>

Device color spaces.

Please note that the use of the device color spaces is restricted by several PDF standards such as PDF/A, PDF/X, et cetera. Their appearance will be governed by any applicable output intent and default color spaces.

source

pub fn device_rgb(self)

Write a DeviceRGB color space.

source

pub fn device_cmyk(self)

Write a DeviceCMYK color space.

source

pub fn device_gray(self)

Write a DeviceGray color space.

source§

impl<'a> ColorSpace<'a>

Special color spaces.

source

pub fn separation(self, color_name: Name<'_>) -> Separation<'a>

Start writing a Separation color space. PDF 1.2+.

The color_name argument is the name of the colorant that will be used by the printer.

source

pub fn device_n<'n>( self, names: impl IntoIterator<Item = Name<'n>>, ) -> DeviceN<'a>

Write a DeviceN color space. PDF 1.3+.

The names argument contains the N names of the colorants for the respective components.

source

pub fn indexed(self, base: Name<'_>, hival: i32, lookup: &[u8])

Write an Indexed color space. PDF 1.2+.

The length of the lookup slice must be the product of the dimensions of the base color space and (hival + 1) and hival shall be at most 255.

source

pub fn pattern(self, base: Name<'_>)

Write a Pattern color space for uncolored patterns. PDF 1.2+.

The base attribute is the color space in which the pattern’s tint color is specified upon use.

Trait Implementations§

source§

impl<'a, 'any> Rewrite<'a> for ColorSpace<'any>

source§

type Output = ColorSpace<'a>

The writer with the rewritten lifetime.
source§

impl<'a> Writer<'a> for ColorSpace<'a>

source§

fn start(obj: Obj<'a>) -> Self

Start writing the object.

Auto Trait Implementations§

§

impl<'a> Freeze for ColorSpace<'a>

§

impl<'a> RefUnwindSafe for ColorSpace<'a>

§

impl<'a> Send for ColorSpace<'a>

§

impl<'a> Sync for ColorSpace<'a>

§

impl<'a> Unpin for ColorSpace<'a>

§

impl<'a> !UnwindSafe for ColorSpace<'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.