Skip to main content

GraphicsState

Struct GraphicsState 

Source
pub struct GraphicsState {
Show 50 fields pub ctm: Matrix, pub color: DeviceColor, pub color_space: ColorSpace, pub path: PsPath, pub current_point: Option<(f64, f64)>, pub clip_path: Option<PsPath>, pub clip_path_version: u32, pub line_width: f64, pub line_cap: LineCap, pub line_join: LineJoin, pub miter_limit: f64, pub dash_pattern: DashPattern, pub flatness: f64, pub stroke_adjust: bool, pub overprint: bool, pub smoothness: f64, pub default_ctm: Matrix, pub clip_stack: Vec<Option<PsPath>>, pub current_font: Option<PsObject>, pub root_font: Option<PsObject>, pub page_device: Option<EntityId>, pub screen_freq: f64, pub screen_angle: f64, pub screen_proc: Option<PsObject>, pub color_screen: Option<[(f64, f64, PsObject); 4]>, pub halftone: Option<PsObject>, pub transfer_function: Option<PsObject>, pub color_transfer: Option<[PsObject; 4]>, pub sampled_transfer: Option<Arc<Vec<f64>>>, pub sampled_color_transfer: Option<[Option<Arc<Vec<f64>>>; 4]>, pub precomputed_halftone: Option<Arc<HalftoneScreen>>, pub precomputed_color_halftone: Option<[Option<Arc<HalftoneScreen>>; 4]>, pub black_generation: Option<PsObject>, pub undercolor_removal: Option<PsObject>, pub sampled_black_generation: Option<Arc<Vec<f64>>>, pub sampled_ucr: Option<Arc<Vec<f64>>>, pub color_rendering: Option<PsObject>, pub rendering_intent: u8, pub current_pattern: Option<u32>, pub pattern_underlying_color: Option<DeviceColor>, pub current_pattern_dict: Option<EntityId>, pub pattern_components: Vec<f64>, pub bbox: Option<[f64; 4]>, pub tint_values: Option<Vec<f64>>, pub cached_tint_table: Option<Arc<TintLookupTable>>, pub fill_opacity: f64, pub stroke_opacity: f64, pub blend_mode: u8, pub alpha_is_shape: bool, pub text_knockout: bool,
}
Expand description

Complete graphics state (cloned for gsave/grestore).

Fields§

§ctm: Matrix§color: DeviceColor§color_space: ColorSpace§path: PsPath§current_point: Option<(f64, f64)>§clip_path: Option<PsPath>§clip_path_version: u32§line_width: f64§line_cap: LineCap§line_join: LineJoin§miter_limit: f64§dash_pattern: DashPattern§flatness: f64§stroke_adjust: bool§overprint: bool§smoothness: f64§default_ctm: Matrix§clip_stack: Vec<Option<PsPath>>§current_font: Option<PsObject>§root_font: Option<PsObject>§page_device: Option<EntityId>§screen_freq: f64§screen_angle: f64§screen_proc: Option<PsObject>§color_screen: Option<[(f64, f64, PsObject); 4]>

Per-component color screen: [red, green, blue, gray] × (freq, angle, proc)

§halftone: Option<PsObject>

Halftone dictionary (set by sethalftone)

§transfer_function: Option<PsObject>§color_transfer: Option<[PsObject; 4]>

Per-component transfer: [red, green, blue, gray]

§sampled_transfer: Option<Arc<Vec<f64>>>

Pre-sampled transfer function (256 entries). None = identity.

§sampled_color_transfer: Option<[Option<Arc<Vec<f64>>>; 4]>

Pre-sampled per-component transfer [R, G, B, Gray].

§precomputed_halftone: Option<Arc<HalftoneScreen>>

Pre-computed halftone screen for PDF output. None = default (suppressed).

§precomputed_color_halftone: Option<[Option<Arc<HalftoneScreen>>; 4]>

Pre-computed per-component halftone [R, G, B, Gray] (from setcolorscreen).

§black_generation: Option<PsObject>§undercolor_removal: Option<PsObject>§sampled_black_generation: Option<Arc<Vec<f64>>>

Pre-sampled black generation function (256 entries, domain [0,1] → range [0,1]).

§sampled_ucr: Option<Arc<Vec<f64>>>

Pre-sampled undercolor removal function (256 entries, domain [0,1] → range [-1,1]).

§color_rendering: Option<PsObject>§rendering_intent: u8

Rendering intent: 0=RelativeColorimetric, 1=AbsoluteColorimetric, 2=Perceptual, 3=Saturation. Default is RelativeColorimetric.

§current_pattern: Option<u32>

Index into Context.pattern_store for the active tiling pattern.

§pattern_underlying_color: Option<DeviceColor>

Underlying color for uncolored (PaintType 2) patterns.

§current_pattern_dict: Option<EntityId>

The pattern dictionary installed by setpattern (or by setcolor in a Pattern color space). PLRM 4.9.6 makes the pattern part of the current color, so currentcolor has to hand the same object back.

§pattern_components: Vec<f64>

Components of the underlying color for an uncolored (PaintType 2) pattern, in the Pattern space’s base color space. Empty for colored patterns; currentcolor pushes these ahead of the pattern dictionary.

§bbox: Option<[f64; 4]>§tint_values: Option<Vec<f64>>

Tint values from the most recent setcolor (for Separation/DeviceN). 1 value for Separation, N values for DeviceN. None for device color spaces.

§cached_tint_table: Option<Arc<TintLookupTable>>

Cached pre-sampled tint lookup table for the current Separation/DeviceN color space. Set when setcolorspace installs a Separation/DeviceN space.

§fill_opacity: f64

Constant fill opacity (PDF ca). Range [0,1]. Default 1.0.

§stroke_opacity: f64

Constant stroke opacity (PDF CA). Range [0,1]. Default 1.0.

§blend_mode: u8

Blend mode index. 0=Normal, 1=Multiply, …, 15=Luminosity. Default 0.

§alpha_is_shape: bool

Alpha-is-shape flag (PDF AIS). Default false.

§text_knockout: bool

Text knockout flag (PDF TK). Default true.

Implementations§

Source§

impl GraphicsState

Source

pub fn new() -> Self

Create default graphics state (PostScript initial state).

Trait Implementations§

Source§

impl Clone for GraphicsState

Source§

fn clone(&self) -> GraphicsState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphicsState

Source§

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

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

impl Default for GraphicsState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.