#[non_exhaustive]pub struct CardTrimOptions {
pub threshold: u8,
pub max_vertices: u32,
pub padding: f32,
pub wrap: AlphaWrap,
pub vertex_cost: f32,
}Expand description
Settings for trim_alpha_cards. Not in C++ meshoptimizer.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.threshold: u8Texels with alpha at or above this value are visible (default 128, the byte form of a 0.5 cutoff). Zero keeps every card unchanged.
max_vertices: u32Most vertices of the fitted polygon per card, 3..=16 (default 8).
padding: f32Footprint expansion in texels around each visible texel, finite and
within 0..=64 (default 0.5). 0.5 covers bilinear sampling of the full
resolution mask; 0 covers nearest sampling. For box-filtered mip level
L use 1.5 * 2^L - 1. Alpha rescaled per mip is not covered.
wrap: AlphaWrapLookup outside the mask (default AlphaWrap::Clamp).
vertex_cost: f32Cost of one polygon vertex in square mask texels, finite and at least
zero (default 0, always use the full budget). A card takes the vertex
count c that minimizes polygon area + vertex_cost * c, so a vertex
is added only while it removes at least this much transparent area.
Where the area saved per extra vertex never grows with the count (the
usual case) this is the same as stopping at the first vertex that saves
less than the cost. Ties go to fewer vertices. The cost is compared
with the area of the fitted polygon, before the per-triangle clipping
of split cards.
Trait Implementations§
Source§impl Clone for CardTrimOptions
impl Clone for CardTrimOptions
impl Copy for CardTrimOptions
Source§impl Debug for CardTrimOptions
impl Debug for CardTrimOptions
Source§impl Default for CardTrimOptions
impl Default for CardTrimOptions
Source§impl PartialEq for CardTrimOptions
impl PartialEq for CardTrimOptions
impl StructuralPartialEq for CardTrimOptions
Auto Trait Implementations§
impl Forget for CardTrimOptions
impl Freeze for CardTrimOptions
impl Move for CardTrimOptions
impl RefUnwindSafe for CardTrimOptions
impl Send for CardTrimOptions
impl Sync for CardTrimOptions
impl Unpin for CardTrimOptions
impl UnsafeUnpin for CardTrimOptions
impl UnwindSafe for CardTrimOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more