#[non_exhaustive]pub struct ConvertPlan {
pub input: String,
pub input_pages: Option<PageSelector>,
pub ops: Vec<Op>,
pub output: String,
pub output_template: Option<PrintfTemplate>,
pub help: bool,
pub ping: bool,
pub probe: bool,
pub probe_json: bool,
pub probe_watch: bool,
pub mesh3d_options: Mesh3DOptions,
}Expand description
The parsed result of one oxideav convert invocation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.input: StringInput URI WITH any [N]/[N-M] page selector stripped.
Currently exactly one — IM’s multi-input stack is a documented
follow-up.
input_pages: Option<PageSelector>Page selector parsed from the input arg’s […] suffix, when
present. None means “all pages” for Scene-shaped inputs and
is ignored for raster inputs.
ops: Vec<Op>Chain of operations in source order.
output: StringOutput path (literal). Empty string when ping is on and the
caller omitted it.
output_template: Option<PrintfTemplate>Parsed printf template if output contains %[0-9]*d. Used by
the convert runner to fan out per-page when the input is a
Scene-shaped source (PDF) and the output codec doesn’t natively
accept Scenes.
help: bool--help / -help mode — print the usage synopsis (generated
from the parser’s own flag table, so it cannot drift) to stdout
and do nothing else. Outranks every other mode; positional
arguments become optional and are not validated.
ping: bool-ping mode — read only the headers, print one IM-format line
per “image” (page / video stream) to stdout, skip pixel decode
and any output write. Output positional becomes optional.
probe: bool--probe mode — decode the input far enough to extract
structural metadata (page count, mesh count, sample rate, …),
print a compact summary to stdout, and skip any output write.
Mutually exclusive with an output positional: --probe in.gltf
is the supported shape; --probe in.gltf out.obj errors at
the parser. The summary defaults to a pretty-printed
key: value block; pair with probe_json
for a single-line JSON object instead.
probe_json: bool--json mode — emit machine-readable JSON instead of the
pretty-printed summary. Today this only applies to --probe;
passing --json without --probe is a parser-level error
since there’s nothing else for it to format.
probe_watch: bool--watch mode (paired with --probe) — re-run the probe
whenever the input file’s mtime changes. Each re-probe emits a
fresh summary; in JSON mode each summary is on its own line so
convert --probe --json --watch in.png | jq is well-formed
JSON-lines. Polls the input mtime once per second; the loop
runs forever and exits only on Ctrl+C / signal. Useful for
live-monitoring a render-in-progress.
mesh3d_options: Mesh3DOptionsPer-format encoder options for the 3D side-channel
(-stl-format, -gltf-format, …). Default = “use the
registry’s default factory for each format” so callers who
don’t pass any of these flags see no behaviour change.
Implementations§
Source§impl ConvertPlan
impl ConvertPlan
Sourcepub fn new(input: impl Into<String>, output: impl Into<String>) -> Self
pub fn new(input: impl Into<String>, output: impl Into<String>) -> Self
A plain conversion of input to output: no ops, no page
selector or output template, no mode switch, default 3D options.
The arg parser produces the same shape through
args::parse; use the with_* setters
for the rest.
Sourcepub fn with_input_pages(self, v: impl Into<Option<PageSelector>>) -> Self
pub fn with_input_pages(self, v: impl Into<Option<PageSelector>>) -> Self
[N] / [N-M] / [A,B,…] page selector on the input.
Sourcepub fn with_output_template(self, v: impl Into<Option<PrintfTemplate>>) -> Self
pub fn with_output_template(self, v: impl Into<Option<PrintfTemplate>>) -> Self
Parsed %d template of output (the caller keeps the two in
sync, as args::parse does).
Sourcepub fn with_probe(self, v: bool) -> Self
pub fn with_probe(self, v: bool) -> Self
--probe mode.
Sourcepub fn with_probe_json(self, v: bool) -> Self
pub fn with_probe_json(self, v: bool) -> Self
--json (with --probe).
Sourcepub fn with_probe_watch(self, v: bool) -> Self
pub fn with_probe_watch(self, v: bool) -> Self
--watch (with --probe).
Sourcepub fn with_mesh3d_options(self, v: Mesh3DOptions) -> Self
pub fn with_mesh3d_options(self, v: Mesh3DOptions) -> Self
3D side-channel options.