pub trait SpatialInstances:
Debug
+ Send
+ Sync {
// Required methods
fn support(&self, index: usize, antialias: f64) -> Rect;
fn sample_indices(
&self,
indices: &[usize],
point: Point,
antialias: f64,
destination: [f32; 4],
space: BlendSpace,
composite: InstanceComposite,
) -> Result<[f32; 4], ValidationError>;
}Expand description
Optional ordered CPU sampling with conservative per-instance support. Outside a declared support rectangle an instance must produce an all-zero source.
Required Methods§
Sourcefn support(&self, index: usize, antialias: f64) -> Rect
fn support(&self, index: usize, antialias: f64) -> Rect
Local support, including antialiasing and numeric guards, for one instance.
Sourcefn sample_indices(
&self,
indices: &[usize],
point: Point,
antialias: f64,
destination: [f32; 4],
space: BlendSpace,
composite: InstanceComposite,
) -> Result<[f32; 4], ValidationError>
fn sample_indices( &self, indices: &[usize], point: Point, antialias: f64, destination: [f32; 4], space: BlendSpace, composite: InstanceComposite, ) -> Result<[f32; 4], ValidationError>
Samples only the ascending, in-range instance indices supplied by a consumer. The compositor must treat all-zero sources as infallible identities.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".