pub struct Renderer<'a> {
pub request: RenderRequest,
pub storage: StorageBudget,
pub cms: Option<&'a dyn PluggableCms>,
}Expand description
RenderRequest configuration and the admitted destination pool can be reused; a fresh OutputPlan binds each exact held source. Never cache by item/epoch alone.
Fields§
§request: RenderRequestReusable requested presentation.
storage: StorageBudgetManaged output budget; excludes native codec and CMS workspace.
cms: Option<&'a dyn PluggableCms>Optional color-management implementation. Unsupported conversions fail.
Implementations§
Source§impl<'a> Renderer<'a>
impl<'a> Renderer<'a>
Sourcepub fn new(storage: StorageBudget) -> Self
pub fn new(storage: StorageBudget) -> Self
Render to sRGB RGBA8 over the full oriented canvas by default. Color conversion rounds depth reduction and clips to the display range. Use an explicit request for higher precision or extended-range output.
Sourcepub fn with_request(self, request: RenderRequest) -> Self
pub fn with_request(self, request: RenderRequest) -> Self
Replace the reusable output requirements.
Sourcepub fn with_cms(self, cms: &'a dyn PluggableCms) -> Self
pub fn with_cms(self, cms: &'a dyn PluggableCms) -> Self
Supply a CMS for profile conversions that require one.
Sourcepub fn render_first<C: Collection, R: OperationPolicy>(
&self,
images: &mut CheckedCollection<C, R>,
) -> Result<Option<Outcome<ImageOutput>>, At<CollectionOperationError>>
pub fn render_first<C: Collection, R: OperationPolicy>( &self, images: &mut CheckedCollection<C, R>, ) -> Result<Option<Outcome<ImageOutput>>, At<CollectionOperationError>>
Render the first top-level image in discovery order. Returns None only
when discovery succeeds with no images. Discovery, decoding, rendering
and policy errors propagate; unsupported images are never skipped.
Each call starts discovery anew; use a cursor and render_selected to
traverse a collection. This does not choose a thumbnail or child image.
Sourcepub fn render_selected<C: Collection, R: OperationPolicy>(
&self,
images: &mut CheckedCollection<C, R>,
image: &ImageId,
) -> Result<Outcome<ImageOutput>, At<CollectionOperationError>>
pub fn render_selected<C: Collection, R: OperationPolicy>( &self, images: &mut CheckedCollection<C, R>, image: &ImageId, ) -> Result<Outcome<ImageOutput>, At<CollectionOperationError>>
Consumer convenience over the shared collection operation. The current candidate reconstructs the full native selection; its display crop does not promise proportional native work or bypass native dimension limits.
Sourcepub fn render<R: OperationPolicy + ?Sized>(
&self,
image: ImageOutput,
policy: &mut R,
pulse: Option<&dyn Pulse>,
) -> Result<Outcome<ImageOutput>, At<RenderFailure>>
pub fn render<R: OperationPolicy + ?Sized>( &self, image: ImageOutput, policy: &mut R, pulse: Option<&dyn Pulse>, ) -> Result<Outcome<ImageOutput>, At<RenderFailure>>
Render an already decoded image, then publish once through policy.
None adds no per-call control; policy and storage checks still apply.
Sourcepub fn render_with_preset<R: OperationPolicy + ?Sized>(
&self,
image: ImageOutput,
resolver: &mut R,
preset: PolicySet,
pulse: Option<&dyn Pulse>,
) -> Result<Outcome<ImageOutput>, At<RenderFailure>>
👎Deprecated: use render with a PolicySet or BoundPolicy
pub fn render_with_preset<R: OperationPolicy + ?Sized>( &self, image: ImageOutput, resolver: &mut R, preset: PolicySet, pulse: Option<&dyn Pulse>, ) -> Result<Outcome<ImageOutput>, At<RenderFailure>>
use render with a PolicySet or BoundPolicy
Compatibility entry point for separately configured presets. Both sets of requirements apply; bound policy preferences take priority.