Skip to main content

Tvg_Blend_Method

Enum Tvg_Blend_Method 

Source
#[repr(u32)]
pub enum Tvg_Blend_Method {
Show 18 variants TVG_BLEND_METHOD_NORMAL = 0, TVG_BLEND_METHOD_MULTIPLY = 1, TVG_BLEND_METHOD_SCREEN = 2, TVG_BLEND_METHOD_OVERLAY = 3, TVG_BLEND_METHOD_DARKEN = 4, TVG_BLEND_METHOD_LIGHTEN = 5, TVG_BLEND_METHOD_COLORDODGE = 6, TVG_BLEND_METHOD_COLORBURN = 7, TVG_BLEND_METHOD_HARDLIGHT = 8, TVG_BLEND_METHOD_SOFTLIGHT = 9, TVG_BLEND_METHOD_DIFFERENCE = 10, TVG_BLEND_METHOD_EXCLUSION = 11, TVG_BLEND_METHOD_HUE = 12, TVG_BLEND_METHOD_SATURATION = 13, TVG_BLEND_METHOD_COLOR = 14, TVG_BLEND_METHOD_LUMINOSITY = 15, TVG_BLEND_METHOD_ADD = 16, TVG_BLEND_METHOD_COMPOSITION = 255,
}
Expand description

@brief Enumeration indicates the method used for blending paint. Please refer to the respective formulas for each method.

@ingroup ThorVGCapi_Paint

@since 0.15

Variants§

§

TVG_BLEND_METHOD_NORMAL = 0

< Perform the alpha blending(default). S if (Sa == 255), otherwise (Sa * S) + (255 - Sa) * D

§

TVG_BLEND_METHOD_MULTIPLY = 1

< Takes the RGB channel values from 0 to 255 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer. (S * D)

§

TVG_BLEND_METHOD_SCREEN = 2

< The values of the pixels in the two layers are inverted, multiplied, and then inverted again. (S + D) - (S * D)

§

TVG_BLEND_METHOD_OVERLAY = 3

< Combines Multiply and Screen blend modes. (2 * S * D) if (2 * D < Da), otherwise (Sa * Da) - 2 * (Da - S) * (Sa - D)

§

TVG_BLEND_METHOD_DARKEN = 4

< Creates a pixel that retains the smallest components of the top and bottom layer pixels. min(S, D)

§

TVG_BLEND_METHOD_LIGHTEN = 5

< Only has the opposite action of Darken Only. max(S, D)

§

TVG_BLEND_METHOD_COLORDODGE = 6

< Divides the bottom layer by the inverted top layer. D / (255 - S)

§

TVG_BLEND_METHOD_COLORBURN = 7

< Divides the inverted bottom layer by the top layer, and then inverts the result. 255 - (255 - D) / S

§

TVG_BLEND_METHOD_HARDLIGHT = 8

< The same as Overlay but with the color roles reversed. (2 * S * D) if (S < Sa), otherwise (Sa * Da) - 2 * (Da - S) * (Sa - D)

§

TVG_BLEND_METHOD_SOFTLIGHT = 9

< The same as Overlay but with applying pure black or white does not result in pure black or white. (1 - 2 * S) * (D ^ 2) + (2 * S * D)

§

TVG_BLEND_METHOD_DIFFERENCE = 10

< Subtracts the bottom layer from the top layer or the other way around, to always get a non-negative value. (S - D) if (S > D), otherwise (D - S)

§

TVG_BLEND_METHOD_EXCLUSION = 11

< The result is twice the product of the top and bottom layers, subtracted from their sum. s + d - (2 * s * d)

§

TVG_BLEND_METHOD_HUE = 12

< Combine with HSL(Sh + Ds + Dl) then convert it to RGB.

§

TVG_BLEND_METHOD_SATURATION = 13

< Combine with HSL(Dh + Ss + Dl) then convert it to RGB.

§

TVG_BLEND_METHOD_COLOR = 14

< Combine with HSL(Sh + Ss + Dl) then convert it to RGB.

§

TVG_BLEND_METHOD_LUMINOSITY = 15

< Combine with HSL(Dh + Ds + Sl) then convert it to RGB.

§

TVG_BLEND_METHOD_ADD = 16

< Simply adds pixel values of one layer with the other. (S + D)

§

TVG_BLEND_METHOD_COMPOSITION = 255

< Used for intermediate composition. @since 1.0

Trait Implementations§

Source§

impl Clone for Tvg_Blend_Method

Source§

fn clone(&self) -> Tvg_Blend_Method

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tvg_Blend_Method

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Tvg_Blend_Method

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Tvg_Blend_Method

Source§

fn eq(&self, other: &Tvg_Blend_Method) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Tvg_Blend_Method

Source§

impl Eq for Tvg_Blend_Method

Source§

impl StructuralPartialEq for Tvg_Blend_Method

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.