ass_convert_clip_scale
Convert vector clip coordinates to a target \p scale, preserving rendered appearance. Measures ink bounding box before and after to prove the conversion.
Instructions
Rewrite vector clip coordinates from their current \p scale to target_scale.
A clip made at level S renders each unit at 2 ** (1 - S) script
pixels; to keep the rendered result identical at level T every
coordinate is multiplied by 2 ** (T - S) and rounded to the nearest
integer. The clip is rewritten with an explicit \clip(T,...) level.
The tool proves the conversion by measuring the rendered ink bounding
box with measure.measure_render before and after (at the midpoint of the
first selected line) and reporting both, plus converged. Measurement
failing (no ffmpeg) is reported as measurement.error instead of an
exception.
Both measurements carry an empty flag: if the line renders no ink at
all (for example a drawing with no \pos/\an whose geometry lands
off-screen) then before and after are both empty and converged
is true for a trivial reason. A caller that wants a real proof must check
not measurement["before"]["empty"] first, which is what the test suite
does.
dry_run=True computes everything and reports the measurement proof
without touching the document.
Returns {doc_id, target_scale, dry_run, converted, lines: [{index, source_scale, target_scale, ratio, before_arg, after_arg, text}], measurement: {before, after, delta, converged, time_ms}}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | No | ||
| dry_run | No | ||
| selection | No | ||
| target_scale | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||