PdfColorSpace

Enum PdfColorSpace 

Source
pub enum PdfColorSpace {
    Unknown = 0,
    DeviceGray = 1,
    DeviceRGB = 2,
    DeviceCMYK = 3,
    CalibratedCIEGray = 4,
    CalibratedCIERGB = 5,
    CalibratedCIELab = 6,
    CalibratedICCProfile = 7,
    Separation = 8,
    DeviceN = 9,
    Indexed = 10,
    Pattern = 11,
}
Expand description

The color space of any displayable object on a PdfPage.

Colors can be described in any of a variety of color systems called color spaces. Some color spaces are related to device color representation (e.g. grayscale, RGB, CMYK); others are related to human visual perception.

Color spaces can be classified into color space families. Spaces within a family share the same general characteristics. Families fall into three broad categories:

Non-RGB color spaces typically define a transform that enables color values in the color space to be converted to an RGB approximation for on-screen display.

For more information on color spaces and their utilization in PDF files, see Section 4.5 of the PDF Reference Manual version 1.7, starting on page 235.

Variants§

§

Unknown = 0

An unknown or unset color space. Color spaces were added to the PDF file format gradually from versions 1.1 to versions 1.3.

§

DeviceGray = 1

Black, white, and intermediate shades of gray are special cases of full color. A grayscale value is represented by a single number in the range 0.0..=1.0, where 0.0 corresponds to black, 1.0 to white, and intermediate values to different gray levels.

This is a non-calibrated color space; the exact color produced for a particular set of component values may vary slightly from device to device.

§

DeviceRGB = 2

Colors in this color space are specified according to the additive Red-Green-Blue color model used by light-emitting displays and projectors. Color values are defined by three components representing the intensities of the additive primary colorants red, green, and blue. Each component is specified by a number in the range 0.0..=1.0, where 0.0 corresponds to a complete absence of the component and 1.0 corresponds to maximum intensity of the component. If all three components have equal intensity, the perceived result theoretically is a pure gray on the scale from black to white. If the intensities are not all equal, the result is some color other than a pure gray.

This is a non-calibrated color space; the exact color produced for a particular set of component values may vary slightly from device to device.

§

DeviceCMYK = 3

Colors in this color space are specified according to the subtractive Cyan-Magenta-Yellow-Black model typical of printers and other paper-based output devices. In theory, each of the three standard process colorants used in printing (cyan, magenta, and yellow) absorbs one of the additive primary colors (red, green, and blue, respectively). Black, a fourth standard process colorant, absorbs all of the additive primaries in equal amounts. Color values are defined by four components representing the concentrations of these process colorants. Each component is specified by a number in the range 0.0..=1.0, where 0.0 denotes the complete absence of a process colorant (that is, absorbs none of the corresponding additive primary) and 1.0 denotes maximum concentration (absorbs as much as possible of the additive primary). Note that the sense of these numbers is opposite to that of RGB color components.

This is a non-calibrated color space; the exact color produced for a particular set of component values may vary slightly from device to device.

§

CalibratedCIEGray = 4

Colors in this color space are specified by a single component, arbitrarily named A, that represents the gray component of a calibrated gray color space.

This is a calibrated color space, based on the tristimulus components of the CIE 1931 XYZ color space. The three components of the color space are defined in terms of human color vision and are independent of any particular output device.

§

CalibratedCIERGB = 5

Colors in this color space are specified by three components, arbitrarily named A, B, and C, representing calibrated red, green, and blue color values. These three color components must be in the range 0.0..=1.0.

This is a calibrated color space, based on the tristimulus components of the CIE 1931 XYZ color space. The three components of the color space are defined in terms of human color vision and are independent of any particular output device.

§

CalibratedCIELab = 6

Colors in this color space are specified by three components, named L*, a*, and b*, of a CIE 1976 L*a*b color space. The range of the first (L*) component is always 0 to 100; the ranges of the second (a*) and third (b*) components are defined by the color space.

This is a calibrated color space; the three components of the color space are defined in terms of human color vision and are independent of any particular output device.

§

CalibratedICCProfile = 7

Colors in this color space are based on a cross-platform color profile defined by the International Color Consortium (ICC).

This is a calibrated color space; colors are defined by international standards and are independent of any particular output device.

§

Separation = 8

Some output devices, such as image-setters, produce a separate, monochromatic rendition of a page - a separation - for each colorant. When the separations are later combined - on a printing press, for example - with proper inks or other colorants added to them, the result is a full-color page.

This special color space provides a means for specifying the use of additional colorants, called a tint, or for isolating the control of individual color components of a device color space for a subtractive device.

§

DeviceN = 9

Colors in this special color space can contain an arbitrary number of color components. This provides greater flexibility than is possible with standard device color spaces or with individual separation color spaces. DeviceN color spaces are used in applications such as high-fidelity color (such as the Pantone Hexachrome system), multi-tone color systems (such as duotone), and spot color systems (using subtractive colorants outside the standard Cyan-Magenta-Yellow-Black model).

§

Indexed = 10

This special color space indicates an object or area should be painted according to color values stored in a lookup table rather than a color space.

§

Pattern = 11

This special color space indicates an object or area should be painted using a pattern, rather than a single color.

Trait Implementations§

Source§

impl Clone for PdfColorSpace

Source§

fn clone(&self) -> PdfColorSpace

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PdfColorSpace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PdfColorSpace

Source§

fn eq(&self, other: &PdfColorSpace) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PdfColorSpace

Source§

impl StructuralPartialEq for PdfColorSpace

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.