Skip to main content

Module state

Module state 

Source
Expand description

Graphics state and save/restore stack.

GraphicsState is the Rust equivalent of SplashState from splash/SplashState.h/.cc, with the linked-list *next pointer replaced by a StateStack that owns a Vec<GraphicsState>.

§Default values

All defaults match the SplashState constructor exactly:

  • CTM = identity [1, 0, 0, 1, 0, 0]
  • Stroke/fill alpha = 1.0
  • Line cap = Butt, line join = Miter, miter limit = 10.0, flatness = 1.0
  • All transfer LUTs = identity
  • Overprint mask = 0xFFFF_FFFF
  • Clip rect = [0, 0, width-0.001, height-0.001] (intentional sub-pixel inset)

§set_transfer semantics

Matches SplashState::setTransfer: the CMYK and DeviceN[0..4] LUTs are derived from the inverted RGB/gray LUTs before the RGB/gray LUTs are overwritten. See SplashState.cc for the detailed rationale.

Structs§

GraphicsState
The complete graphics state for one rendering context.
StateStack
A Vec-based save/restore stack of GraphicsState values.
TransferSet
Borrowed references to all transfer LUTs from a GraphicsState.