pub struct MeshPaint {
pub mesh: MeshGradient,
pub size: PixelSize,
pub subdivisions: u32,
}Expand description
A MeshGradient evaluated independently by each paint backend.
Size and subdivisions remain the resolution of the explicit Self::pattern bake;
they do not quantize analytic paint evaluation.
Fields§
§mesh: MeshGradientControl lattice to paint with.
size: PixelSizeBaked image size in pixels.
subdivisions: u32Subdivisions per lattice cell edge, in 1..=MAX_MESH_SUBDIVISIONS.
Implementations§
Source§impl MeshPaint
impl MeshPaint
Sourcepub fn new(mesh: MeshGradient, size: PixelSize, subdivisions: u32) -> Self
pub fn new(mesh: MeshGradient, size: PixelSize, subdivisions: u32) -> Self
Pairs a mesh with its bake resolution.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Checks the bake parameters without allocating.
Sourcepub fn pattern(
&self,
bounds: Rect,
limits: RasterLimits,
) -> Result<ImagePattern, ValidationError>
pub fn pattern( &self, bounds: Rect, limits: RasterLimits, ) -> Result<ImagePattern, ValidationError>
Bakes the mesh over bounds as an extend-padded bilinear pattern.
Trait Implementations§
impl StructuralPartialEq for MeshPaint
Auto Trait Implementations§
impl Forget for MeshPaint
impl Freeze for MeshPaint
impl Move for MeshPaint
impl RefUnwindSafe for MeshPaint
impl Send for MeshPaint
impl Sync for MeshPaint
impl Unpin for MeshPaint
impl UnsafeUnpin for MeshPaint
impl UnwindSafe for MeshPaint
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