[][src]Struct pxsort::Config

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,
    // some fields omitted
}

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

Methods

impl Config[src]

pub fn sort(&self, img: DynamicImage) -> DynamicImage[src]

Sort pixels according to configured settings and return a new image.

Trait Implementations

impl Default for Config[src]

impl StructOpt for Config[src]

fn from_args() -> Self[src]

Gets the struct from the command line arguments. Print the error message and quit the program in case of failure. Read more

fn from_iter<I>(iter: I) -> Self where
    I: IntoIterator,
    <I as IntoIterator>::Item: Into<OsString>,
    <I as IntoIterator>::Item: Clone
[src]

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. Read more

fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
    I: IntoIterator,
    <I as IntoIterator>::Item: Into<OsString>,
    <I as IntoIterator>::Item: Clone
[src]

Gets the struct from any iterator such as a Vec of your making. Read more

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.