Skip to main content

Renderer

Struct Renderer 

Source
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: RenderRequest

Reusable requested presentation.

§storage: StorageBudget

Managed 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>

Source

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.

Source

pub fn with_request(self, request: RenderRequest) -> Self

Replace the reusable output requirements.

Source

pub fn with_cms(self, cms: &'a dyn PluggableCms) -> Self

Supply a CMS for profile conversions that require one.

Source

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.

Source

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.

Source

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.

Source

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>>

👎Deprecated:

use render with a PolicySet or BoundPolicy

Compatibility entry point for separately configured presets. Both sets of requirements apply; bound policy preferences take priority.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Renderer<'a>

§

impl<'a> !UnwindSafe for Renderer<'a>

§

impl<'a> Freeze for Renderer<'a>

§

impl<'a> Send for Renderer<'a>

§

impl<'a> Sync for Renderer<'a>

§

impl<'a> Unpin for Renderer<'a>

§

impl<'a> UnsafeUnpin for Renderer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.