pub struct Config {
pub minimum: u8,
pub maximum: u8,
pub function: Heuristic,
pub reverse: bool,
pub invert: bool,
pub vertical: bool,
pub mask_alpha: bool,
pub angle: f32,
pub path: Shape,
/* private fields */
}
Expand description
Sorting configuration.
Includes how to traverse the pixel grid, which regions of the image to skip, and what metric to sort by.
Fields§
§minimum: u8
Minimum value to sort
maximum: u8
Maximum value to sort
function: Heuristic
Sort heuristic to use
reverse: bool
Reverse the sort direction
invert: bool
Sort outside specified range rather than inside
vertical: bool
Rotate the sort path by 90 degrees
mask_alpha: bool
Don’t sort pixels that have zero alpha
angle: f32
Rotate the sort path by a custom angle
path: Shape
Path shape to traverse the image
Implementations§
Source§impl Config
impl Config
Sourcepub fn sort(&self, img: DynamicImage) -> DynamicImage
pub fn sort(&self, img: DynamicImage) -> DynamicImage
Sort pixels according to configured settings and return a new image.
Trait Implementations§
Source§impl StructOpt for Config
impl StructOpt for Config
Source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
Creates the struct from
clap::ArgMatches
. It cannot fail
with a parameter generated by clap
by construction.Source§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
Gets the struct from the command line arguments. Print the
error message and quit the program in case of failure.
Source§fn from_iter<I>(iter: I) -> Self
fn from_iter<I>(iter: I) -> Self
Gets the struct from any iterator such as a
Vec
of your making.
Print the error message and quit the program in case of failure.Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
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>
Converts
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>
Converts
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