Skip to main content

apply_graphicx_ops

Function apply_graphicx_ops 

Source
pub fn apply_graphicx_ops(
    w: f64,
    h: f64,
    ops: &[GraphicxOp],
    units_per_bp: f64,
    quantize: bool,
) -> (f64, f64)
Expand description

Apply a compiled transformation sequence to a natural size.

Port of Perl image_graphicx_size (Util/Image.pm L221-256), generalised over the output unit so the engine and the post-processor share one algebra:

  • units_per_bp scales a bp-valued option into the caller’s unit — DPI/72.27 for device pixels (Perl’s $dppt), 72.27/72 for TeX pt.
  • quantize applies Perl’s ceil at each sizing step. True in pixel space, where a fractional device pixel is meaningless; false in pt space, where rounding the box to 1/100 inch would be a needless loss of precision.

Page is a selector, not a geometric transform, so it is skipped here — callers read it out separately.