Skip to main content

InstanceBatch

Trait InstanceBatch 

Source
pub trait InstanceBatch:
    Any
    + Debug
    + Send
    + Sync {
Show 16 methods // Required methods fn len(&self) -> usize; fn bounds(&self) -> Rect; fn bytes(&self) -> u64; fn work(&self) -> u64; fn validate(&self) -> Result<(), ValidationError>; fn sample( &self, point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError>; fn as_any(&self) -> &dyn Any; fn content_eq(&self, other: &dyn InstanceBatch) -> bool; // Provided methods fn is_empty(&self) -> bool { ... } fn blend(&self) -> InstanceBlend { ... } fn spatial(&self) -> Option<&dyn SpatialInstances> { ... } fn sample_with_zero_identity( &self, point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError> { ... } fn upload_bytes(&self) -> u64 { ... } fn upload(&self) -> Result<Option<InstanceUpload>, ValidationError> { ... } fn analytic_upload(&self) -> Option<&AnalyticInstanceUpload> { ... } fn analytic_fallback(&self) -> Option<&ValidationError> { ... }
}
Expand description

Immutable instance data, independent of a particular renderer or simulator.

Required Methods§

Source

fn len(&self) -> usize

Number of independently painted instances.

Source

fn bounds(&self) -> Rect

Conservative local bounds.

Source

fn bytes(&self) -> u64

Retained logical bytes charged during preparation.

Source

fn work(&self) -> u64

Conservative sampling work per output pixel.

Source

fn validate(&self) -> Result<(), ValidationError>

Validates all stored instance/style values, including hidden instances.

Source

fn sample( &self, point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError>

Samples instances in their declared order using the consumer’s compositor.

Source

fn as_any(&self) -> &dyn Any

Resolves concrete content only within its owning implementation.

Source

fn content_eq(&self, other: &dyn InstanceBatch) -> bool

Compares the logical payload of two instance records.

Provided Methods§

Source

fn is_empty(&self) -> bool

Whether no instances are present.

Source

fn blend(&self) -> InstanceBlend

Batch compositing policy; the default is source-over.

Source

fn spatial(&self) -> Option<&dyn SpatialInstances>

Optional conservative supports and ordered sampling; defaults to full-batch traversal.

Source

fn sample_with_zero_identity( &self, point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError>

Samples with a compositor for which every all-zero source, including signed zeros, is an infallible identity without observable side effects. Implementations may omit those calls, but must preserve nonzero sample order and errors. The default retains the ordinary sampling behavior. Callers with an arbitrary compositor must use Self::sample instead.

Source

fn upload_bytes(&self) -> u64

Exact upload charge for preflight admission; zero by default for CPU-only batches.

Source

fn upload(&self) -> Result<Option<InstanceUpload>, ValidationError>

Checked evaluated primitives, or None when only CPU sampling is available.

Source

fn analytic_upload(&self) -> Option<&AnalyticInstanceUpload>

Optional checked seeded trajectory program replacing evaluated primitive positions. Existing generic batches and fixed-step simulations retain their ordinary uploads.

Source

fn analytic_fallback(&self) -> Option<&ValidationError>

Explicit reason an otherwise analytic batch retains evaluated CPU primitives.

Trait Implementations§

Source§

impl PartialEq for dyn InstanceBatch

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§