[][src]Struct crow::DrawConfig

pub struct DrawConfig {
    pub scale: (u32, u32),
    pub flip_vertically: bool,
    pub flip_horizontally: bool,
    pub depth: Option<f32>,
    pub color_modulation: [[f32; 4]; 4],
    pub invert_color: bool,
    pub blend_mode: BlendMode,
    // some fields omitted
}

How exactly should a texture be drawn?

This struct has a hidden unstable field as it should only be constructed using functional record update (FRU).

Examples

use crow::{DrawConfig, color};

let gray_scale = DrawConfig {
    color_modulation: color::GREYSCALE,
    ..Default::default()
};

let strange = DrawConfig {
    scale: (2, 1),
    flip_horizontally: true,
    depth: Some(0.6),
    ..Default::default()
};

Fields

scale: (u32, u32)

The scale of the drawn texture in drawn pixels per source pixel.

flip_vertically: bool

If the texture should be flipped on the y axis.

flip_horizontally: bool

If the texture should be flipped on the x axis.

depth: Option<f32>

The depth at which the texture should be drawn, pixels with a depth smaller than depth will not be overwritten.

Draw calls with depth >= 1.0 are ignored.

color_modulation: [[f32; 4]; 4]

Changes the color of the given pixel using matrix multiplication.

invert_color: bool

If the red, green and blue color values of the texture should be inverted.

blend_mode: BlendMode

How the texture should be drawn on the target.

Trait Implementations

impl Clone for DrawConfig[src]

impl Debug for DrawConfig[src]

impl Default for DrawConfig[src]

impl<'de> Deserialize<'de> for DrawConfig[src]

impl Serialize for DrawConfig[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.