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_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(...).
Trait Implementations§
Source§impl Processor for Graphics
impl Processor for Graphics
Source§fn to_process(&self, doc: &PostDocument) -> Vec<Node>
fn to_process(&self, doc: &PostDocument) -> Vec<Node>
Return the nodes to be processed; by default the document element.
This allows processors to focus on specific kinds of nodes,
or to skip processing if there are none to process.
Source§fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
fn process(&mut self, doc: PostDocument, nodes: Vec<Node>) -> ProcessResult
Process the document given the nodes returned by
to_process.
Returns the resulting document(s) — splitting may produce multiple.Source§fn resource_directory(&self) -> Option<&str>
fn resource_directory(&self) -> Option<&str>
Resource directory for generated resources (images, etc.).
Source§fn resource_prefix(&self) -> Option<&str>
fn resource_prefix(&self) -> Option<&str>
Resource prefix for generated resource filenames.
Source§fn desired_resource_pathname(
&self,
_doc: &PostDocument,
_node: &Node,
_source: Option<&str>,
_type_ext: Option<&str>,
) -> Option<PathBuf>
fn desired_resource_pathname( &self, _doc: &PostDocument, _node: &Node, _source: Option<&str>, _type_ext: Option<&str>, ) -> Option<PathBuf>
Hint for a desired resource pathname.
Source§fn generate_resource_pathname(
&self,
doc: &mut PostDocument,
_node: &Node,
_source: Option<&str>,
type_ext: Option<&str>,
) -> PathBuf
fn generate_resource_pathname( &self, doc: &mut PostDocument, _node: &Node, _source: Option<&str>, type_ext: Option<&str>, ) -> PathBuf
Auto-generate a unique resource pathname using a counter from the doc cache.
Auto Trait Implementations§
impl Freeze for Graphics
impl RefUnwindSafe for Graphics
impl Send for Graphics
impl Sync for Graphics
impl Unpin for Graphics
impl UnsafeUnpin for Graphics
impl UnwindSafe for Graphics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more