pub enum PaintDocument {
Runs(PaintRuns),
Trees(PaintTrees),
}Expand description
A surface paint document.
Variants§
Runs(PaintRuns)
Version 1: one value per triangle.
Trees(PaintTrees)
Version 2: a tree per painted triangle.
Implementations§
Source§impl PaintDocument
impl PaintDocument
Sourcepub fn triangle_count(&self) -> u32
pub fn triangle_count(&self) -> u32
How many triangles the painted mesh has.
Sourcepub fn fingerprint(&self) -> &[u8; 48]
pub fn fingerprint(&self) -> &[u8; 48]
The painted mesh’s fingerprint.
Sourcepub fn max_value(&self) -> u8
pub fn max_value(&self) -> u8
The largest value anywhere in the document, 0 when nothing is painted.
Sourcepub fn allows_kind(&self, kind: u8) -> bool
pub fn allows_kind(&self, kind: u8) -> bool
Whether the document’s values are allowed for paint of kind: any
value for kinds 0 to 2, at most 2 for kind 3, and nothing for the
reserved kinds.
Sourcepub fn fits(&self, triangle_count: usize, fingerprint: &[u8; 48]) -> bool
pub fn fits(&self, triangle_count: usize, fingerprint: &[u8; 48]) -> bool
Whether the document was made on mesh, of triangle_count
triangles and with fingerprint, and covers it: version 1 runs that
add up to the triangle count. Version 2 documents are checked against
the triangle count when they are decoded.
Trait Implementations§
Source§impl Clone for PaintDocument
impl Clone for PaintDocument
Source§impl Debug for PaintDocument
impl Debug for PaintDocument
impl Eq for PaintDocument
Source§impl PartialEq for PaintDocument
impl PartialEq for PaintDocument
impl StructuralPartialEq for PaintDocument
Auto Trait Implementations§
impl Forget for PaintDocument
impl Freeze for PaintDocumentwhere
*const u8 is !null: Freeze,
PhantomData<PaintRun>: Freeze,
PhantomData<PaintedTriangle>: Freeze,
impl Move for PaintDocument
impl RefUnwindSafe for PaintDocument
impl Send for PaintDocumentwhere
RawVecInner: Send,
impl Sync for PaintDocumentwhere
RawVecInner: Sync,
impl Unpin for PaintDocument
impl UnsafeUnpin for PaintDocumentwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<PaintRun>: UnsafeUnpin,
PhantomData<PaintedTriangle>: UnsafeUnpin,
impl UnwindSafe for PaintDocumentwhere
RawVecInner: UnwindSafe,
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