pub struct Graphics { /* private fields */ }Expand description
Graphics post-processor.
Port of LaTeXML::Post::Graphics.
Implementations§
Source§impl Graphics
impl Graphics
pub fn new(dpi: Option<u32>, trivial_scaling: bool) -> Self
Sourcepub fn with_resource_prefix(self, prefix: &str) -> Self
pub fn with_resource_prefix(self, prefix: &str) -> Self
Name generated resources <prefix>N instead of xN (Perl’s resource_prefix option, Post.pm L195).
Sourcepub fn with_cache_policy(self, policy: CachePolicy) -> Self
pub fn with_cache_policy(self, policy: CachePolicy) -> Self
Choose whether conversions may be served from the shared,
host-persistent graphics cache. Defaults to
CachePolicy::Shared.
Pass CachePolicy::Bypass
when the conversion itself is what matters — e.g. a test asserting
on how many converter subprocesses ran, which a cache hit would
silently satisfy without running any. The builder returns self so
it composes with Graphics::new(...).
Sourcepub fn with_svg_threshold_kb(self, kb: u32) -> Self
pub fn with_svg_threshold_kb(self, kb: u32) -> Self
Enable the vector-SVG path for PDFs under kb KB. When kb == 0
(default), the SVG path is fully disabled and all PDFs go through
ImageMagick convert. The builder returns self so it composes with
Graphics::new(...).
Sourcepub fn plan_names(&mut self, doc: &PostDocument) -> bool
pub fn plan_names(&mut self, doc: &PostDocument) -> bool
Name the images of one page before any page is rendered, writing nothing; Self::commit_names then stores the
names of every planned page, in page order. The serial and the parallel render (render_workers.rs) both look
them up, so a page’s names never depend on which process renders it, nor on CrossRef’s copies of other pages’
titles into its navigation, which meet an image before its own page does (issue 995). Whether the page has
images to name.
Sourcepub fn planned(&self) -> bool
pub fn planned(&self) -> bool
Whether a page’s names were planned (Self::plan_names).
Sourcepub fn commit_names(&mut self)
pub fn commit_names(&mut self)
Store the planned pages’ names: one transaction per destination directory, so runs writing into one folder at once never hand out one name twice.
Sourcepub fn planned_names(&self) -> Vec<(String, String, String, Option<String>)>
pub fn planned_names(&self) -> Vec<(String, String, String, Option<String>)>
The planned names, as (destination directory, key, destination, vector render), for the render workers.
Sourcepub fn with_planned_names(
self,
list: Vec<(String, String, String, Option<String>)>,
) -> Self
pub fn with_planned_names( self, list: Vec<(String, String, String, Option<String>)>, ) -> Self
A render worker’s Graphics: the parent’s planned names (Self::planned_names).
Sourcepub fn with_doc_cache(self, cache: DocCache) -> Self
pub fn with_doc_cache(self, cache: DocCache) -> Self
Name images in cache, the run’s (every page’s PostDocument::cache is the run’s too, unless a page was made
apart from the run’s options).
Trait Implementations§
Source§impl Processor for Graphics
impl Processor for Graphics
Source§fn resource_prefix(&self) -> Option<&str>
fn resource_prefix(&self) -> Option<&str>
Source§fn to_process(&self, doc: &PostDocument) -> Vec<Node>
fn to_process(&self, doc: &PostDocument) -> Vec<Node>
Source§fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
to_process.
Returns the resulting document(s) — splitting may produce multiple.