Struct Prefs

Source
pub struct Prefs {
    pub unit_size: u32,
    pub padding: u32,
    pub uv_inset: f32,
    pub trim_transparent: bool,
    pub atlas_size_limit: u32,
    pub atlas_square: bool,
    pub atlas_pot: bool,
    pub ppu: f32,
    pub pivot: Pivot,
    pub on_progress: Option<ProgressCallback>,
}
Expand description

Preferences for a dicing operation.

Fields§

§unit_size: u32

The size of a single diced unit, in pixels. Larger values result in less generated mesh overhead, but may also diminish number of reused texture regions.

§padding: u32

The size of border, in pixels, to add between adjacent diced units inside atlas textures. Increase to prevent texture bleeding artifacts. Larger values consume more texture space, but yield better anti-bleeding results.

§uv_inset: f32

Relative inset (in 0.0-1.0 range) of the diced units UV coordinates. Can be used in addition to (or instead of) [padding] to prevent texture bleeding artifacts. Won’t consume texture space, but higher values could visually distort the rendered sprite.

§trim_transparent: bool

Whether to trim transparent areas on the built meshes. Disable to preserve aspect ratio of the source sprites (usable for animations).

§atlas_size_limit: u32

Maximum size (width or height) of a single generated atlas texture; will generate multiple textures when the limit is reached.

§atlas_square: bool

The generated atlas textures will always be square. Less efficient, but required for PVRTC compression.

§atlas_pot: bool

The generated atlas textures will always have width and height be power of two. Extremely inefficient, but required by some older GPUs.

§ppu: f32

Pixel per unit ratio to use when evaluating positions of the generated mesh vertices. Higher values will make sprite smaller in conventional space units.

§pivot: Pivot

Origin of the generated mesh, in relative offsets from top-left corner of the sprite rect.

§on_progress: Option<ProgressCallback>

Callback to invoke when dicing operation progress changes in a meaningful way.

Trait Implementations§

Source§

impl Default for Prefs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Prefs

§

impl !RefUnwindSafe for Prefs

§

impl !Send for Prefs

§

impl !Sync for Prefs

§

impl Unpin for Prefs

§

impl !UnwindSafe for Prefs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.