pub struct SliceOptions {Show 16 fields
pub input: PathBuf,
pub output: PathBuf,
pub frame_width: u32,
pub frame_height: u32,
pub columns: Option<u32>,
pub rows: Option<u32>,
pub offset_x: u32,
pub offset_y: u32,
pub gap_x: u32,
pub gap_y: u32,
pub skip_empty: bool,
pub alpha_threshold: u8,
pub min_opaque_pixels: u32,
pub bg_hex: Option<String>,
pub bg_threshold: u8,
pub manifest_name: String,
}Expand description
Options for slicing a regular sprite sheet into fixed-size frames.
Fields§
§input: PathBufInput sprite sheet path.
output: PathBufOutput directory where frames and manifests will be written.
frame_width: u32Width of a single frame.
frame_height: u32Height of a single frame.
columns: Option<u32>Number of columns in the sheet. When None, the value is derived.
rows: Option<u32>Number of rows in the sheet. When None, the value is derived.
offset_x: u32Horizontal offset from the left edge of the sheet.
offset_y: u32Vertical offset from the top edge of the sheet.
gap_x: u32Horizontal gap between frames.
gap_y: u32Vertical gap between frames.
skip_empty: boolWhen true, frames below min_opaque_pixels are not exported.
alpha_threshold: u8Pixels with alpha less than or equal to this value count as transparent.
min_opaque_pixels: u32Minimum number of foreground pixels required to keep a frame.
bg_hex: Option<String>Optional background color used to ignore solid-color backdrops.
bg_threshold: u8Allowed per-channel distance when comparing to bg_hex.
manifest_name: StringOutput file name for the manifest, usually frames.toml.
Trait Implementations§
Source§impl Clone for SliceOptions
impl Clone for SliceOptions
Source§fn clone(&self) -> SliceOptions
fn clone(&self) -> SliceOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SliceOptions
impl RefUnwindSafe for SliceOptions
impl Send for SliceOptions
impl Sync for SliceOptions
impl Unpin for SliceOptions
impl UnsafeUnpin for SliceOptions
impl UnwindSafe for SliceOptions
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