pub struct ColorSpace<'a> { /* private fields */ }
Expand description
Writer for a color space.
This struct is created by Chunk::color_space
,
Chunk::color_space
, ImageXObject::color_space
,
Separation::alternate_color_space
and Group::color_space
.
Implementations§
source§impl ColorSpace<'_>
impl ColorSpace<'_>
CIE-based color spaces.
sourcepub fn cal_rgb(
self,
white_point: [f32; 3],
black_point: Option<[f32; 3]>,
gamma: Option<[f32; 3]>,
matrix: Option<[f32; 9]>,
)
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.
sourcepub fn cal_gray(
self,
white_point: [f32; 3],
black_point: Option<[f32; 3]>,
gamma: Option<f32>,
)
pub fn cal_gray( self, white_point: [f32; 3], black_point: Option<[f32; 3]>, gamma: Option<f32>, )
Write a CalGray
color space.
sourcepub fn lab(
self,
white_point: [f32; 3],
black_point: Option<[f32; 3]>,
range: Option<[f32; 4]>,
)
pub fn lab( self, white_point: [f32; 3], black_point: Option<[f32; 3]>, range: Option<[f32; 4]>, )
Write a Lab
color space.
sourcepub fn icc_based(self, stream: Ref)
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<'_>
impl ColorSpace<'_>
Common calibrated color spaces.
sourcepub fn srgb(self)
pub fn srgb(self)
Write a CalRGB
color space approximating sRGB.
Use an ICC profile for more accurate results.
sourcepub fn adobe_rgb(self)
pub fn adobe_rgb(self)
Write a CalRGB
color space approximating Adobe RGB.
Use an ICC profile for more accurate results.
sourcepub fn display_p3(self)
pub fn display_p3(self)
Write a CalRGB
color space approximating Display P3.
Use an ICC profile for more accurate results.
sourcepub fn pro_photo(self)
pub fn pro_photo(self)
Write a CalRGB
color space approximating ProPhoto.
Use an ICC profile for more accurate results.
sourcepub fn d65_gray(self)
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, …
sourcepub fn d50_gray(self, gamma: Option<f32>)
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§impl ColorSpace<'_>
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.
sourcepub fn device_rgb(self)
pub fn device_rgb(self)
Write a DeviceRGB
color space.
sourcepub fn device_cmyk(self)
pub fn device_cmyk(self)
Write a DeviceCMYK
color space.
sourcepub fn device_gray(self)
pub fn device_gray(self)
Write a DeviceGray
color space.
source§impl<'a> ColorSpace<'a>
impl<'a> ColorSpace<'a>
Special color spaces.
sourcepub fn separation(self, color_name: Name<'_>) -> Separation<'a>
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.
sourcepub fn device_n<'n>(
self,
names: impl IntoIterator<Item = Name<'n>>,
) -> DeviceN<'a>
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.