| 1 | use craterust-analyzer cargo palette 0.7.6 crate/::{ |
| 2 | bool_maskrust-analyzer cargo palette 0.7.6 bool_mask/::LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#, |
| 3 | castrust-analyzer cargo palette 0.7.6 cast/::{selfrust-analyzer cargo palette 0.7.6 cast/, ArrayCastrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#}, |
| 4 | numrust-analyzer cargo palette 0.7.6 num/::{Absrust-analyzer cargo palette 0.7.6 num/Abs#, Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics#, Clamprust-analyzer cargo palette 0.7.6 num/Clamp#, MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax#, Onerust-analyzer cargo palette 0.7.6 num/One#, PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp#, Realrust-analyzer cargo palette 0.7.6 num/Real#, Sqrtrust-analyzer cargo palette 0.7.6 num/Sqrt#, Zerorust-analyzer cargo palette 0.7.6 num/Zero#}, |
| 5 | stimulusrust-analyzer cargo palette 0.7.6 stimulus/::{Stimulusrust-analyzer cargo palette 0.7.6 stimulus/Stimulus#, StimulusColorrust-analyzer cargo palette 0.7.6 stimulus/StimulusColor#}, |
| 6 | Alpharust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#, |
| 7 | }; |
| 8 | |
| 9 | use superrust-analyzer cargo palette 0.7.6 blend/::{blend_alpharust-analyzer cargo palette 0.7.6 blend/blend_alpha()., PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#, Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#}; |
| 10 | |
| 11 | /// A trait for different ways of mixing colors together. |
| 12 | /// |
| 13 | /// This implements the classic separable blend modes, [as described by |
| 14 | /// W3C](https://www.w3.org/TR/compositing-1/#blending). |
| 15 | /// |
| 16 | /// _Note: The default implementations of the blend modes are meant for color |
| 17 | /// components in the range [0.0, 1.0] and may otherwise produce strange |
| 18 | /// results._ |
| 19 | pub trait Blendrust-analyzer cargo palette 0.7.6 blend/blend/Blend# { |
| 20 | /// Multiply `self` with `other`. This uses the alpha component to regulate |
| 21 | /// the effect, so it's not just plain component wise multiplication. |
| 22 | #[must_use] |
| 23 | fn multiplyrust-analyzer cargo palette 0.7.6 blend/blend/Blend#multiply().(self, other: Self) -> Self; |
| 24 | |
| 25 | /// Make a color which is at least as light as `self` or `other`. |
| 26 | #[must_use] |
| 27 | fn screenrust-analyzer cargo palette 0.7.6 blend/blend/Blend#screen().(self, other: Self) -> Self; |
| 28 | |
| 29 | /// Multiply `self` or `other` if other is dark, or screen them if `other` |
| 30 | /// is light. This results in an S curve. |
| 31 | #[must_use] |
| 32 | fn overlayrust-analyzer cargo palette 0.7.6 blend/blend/Blend#overlay().(self, other: Self) -> Self; |
| 33 | |
| 34 | /// Return the darkest parts of `self` and `other`. |
| 35 | #[must_use] |
| 36 | fn darkenrust-analyzer cargo palette 0.7.6 blend/blend/Blend#darken().(self, other: Self) -> Self; |
| 37 | |
| 38 | /// Return the lightest parts of `self` and `other`. |
| 39 | #[must_use] |
| 40 | fn lightenrust-analyzer cargo palette 0.7.6 blend/blend/Blend#lighten().(self, other: Self) -> Self; |
| 41 | |
| 42 | /// Lighten `other` to reflect `self`. Results in `other` if `self` is |
| 43 | /// black. |
| 44 | #[must_use] |
| 45 | fn dodgerust-analyzer cargo palette 0.7.6 blend/blend/Blend#dodge().(self, other: Self) -> Self; |
| 46 | |
| 47 | /// Darken `other` to reflect `self`. Results in `other` if `self` is |
| 48 | /// white. |
| 49 | #[must_use] |
| 50 | fn burnrust-analyzer cargo palette 0.7.6 blend/blend/Blend#burn().(self, other: Self) -> Self; |
| 51 | |
| 52 | /// Multiply `self` or `other` if other is dark, or screen them if `self` |
| 53 | /// is light. This is similar to `overlay`, but depends on `self` instead |
| 54 | /// of `other`. |
| 55 | #[must_use] |
| 56 | fn hard_lightrust-analyzer cargo palette 0.7.6 blend/blend/Blend#hard_light().(self, other: Self) -> Self; |
| 57 | |
| 58 | /// Lighten `other` if `self` is light, or darken `other` as if it's burned |
| 59 | /// if `self` is dark. The effect is increased if the components of `self` |
| 60 | /// is further from 0.5. |
| 61 | #[must_use] |
| 62 | fn soft_lightrust-analyzer cargo palette 0.7.6 blend/blend/Blend#soft_light().(self, other: Self) -> Self; |
| 63 | |
| 64 | /// Return the absolute difference between `self` and `other`. It's |
| 65 | /// basically `abs(self - other)`, but regulated by the alpha component. |
| 66 | #[must_use] |
| 67 | fn differencerust-analyzer cargo palette 0.7.6 blend/blend/Blend#difference().(self, other: Self) -> Self; |
| 68 | |
| 69 | /// Similar to `difference`, but appears to result in a lower contrast. |
| 70 | /// `other` is inverted if `self` is white, and preserved if `self` is |
| 71 | /// black. |
| 72 | #[must_use] |
| 73 | fn exclusionrust-analyzer cargo palette 0.7.6 blend/blend/Blend#exclusion().(self, other: Self) -> Self; |
| 74 | } |
| 75 | |
| 76 | impl<C, T, const N: usize> Blendrust-analyzer cargo palette 0.7.6 blend/blend/Blend# for PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#<C> |
| 77 | where |
| 78 | C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#<Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar# = T> + StimulusColorrust-analyzer cargo palette 0.7.6 stimulus/StimulusColor# + ArrayCastrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#<Arrayrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#Array# = [T; N]> + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 79 | T: Realrust-analyzer cargo palette 0.7.6 num/Real# + Zerorust-analyzer cargo palette 0.7.6 num/Zero# + Onerust-analyzer cargo palette 0.7.6 num/One# + MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax# + Clamprust-analyzer cargo palette 0.7.6 num/Clamp# + Sqrtrust-analyzer cargo palette 0.7.6 num/Sqrt# + Absrust-analyzer cargo palette 0.7.6 num/Abs# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 80 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 81 | { |
| 82 | #[inline] |
| 83 | fn multiplyrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]multiply().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 84 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), multiply_blendrust-analyzer cargo palette 0.7.6 blend/blend/multiply_blend().) |
| 85 | } |
| 86 | |
| 87 | #[inline] |
| 88 | fn screenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]screen().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 89 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), screen_blendrust-analyzer cargo palette 0.7.6 blend/blend/screen_blend().) |
| 90 | } |
| 91 | |
| 92 | #[inline] |
| 93 | fn overlayrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]overlay().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 94 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), overlay_blendrust-analyzer cargo palette 0.7.6 blend/blend/overlay_blend().) |
| 95 | } |
| 96 | |
| 97 | #[inline] |
| 98 | fn darkenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]darken().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 99 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), darken_blendrust-analyzer cargo palette 0.7.6 blend/blend/darken_blend().) |
| 100 | } |
| 101 | |
| 102 | #[inline] |
| 103 | fn lightenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]lighten().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 104 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), lighten_blendrust-analyzer cargo palette 0.7.6 blend/blend/lighten_blend().) |
| 105 | } |
| 106 | |
| 107 | #[inline] |
| 108 | fn dodgerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]dodge().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 109 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), dodge_blendrust-analyzer cargo palette 0.7.6 blend/blend/dodge_blend().) |
| 110 | } |
| 111 | |
| 112 | #[inline] |
| 113 | fn burnrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]burn().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 114 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), burn_blendrust-analyzer cargo palette 0.7.6 blend/blend/burn_blend().) |
| 115 | } |
| 116 | |
| 117 | #[inline] |
| 118 | fn hard_lightrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]hard_light().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 119 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), hard_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/hard_light_blend().) |
| 120 | } |
| 121 | |
| 122 | #[inline] |
| 123 | fn soft_lightrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]soft_light().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 124 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), soft_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/soft_light_blend().) |
| 125 | } |
| 126 | |
| 127 | #[inline] |
| 128 | fn differencerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]difference().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 129 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), difference_blendrust-analyzer cargo palette 0.7.6 blend/blend/difference_blend().) |
| 130 | } |
| 131 | |
| 132 | #[inline] |
| 133 | fn exclusionrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]exclusion().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`PreAlpha<C>`][Blend] { |
| 134 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), exclusion_blendrust-analyzer cargo palette 0.7.6 blend/blend/exclusion_blend().) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | impl<C, T, const N: usize> Blendrust-analyzer cargo palette 0.7.6 blend/blend/Blend# for C |
| 139 | where |
| 140 | C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#<Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar# = T> + StimulusColorrust-analyzer cargo palette 0.7.6 stimulus/StimulusColor# + ArrayCastrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#<Arrayrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#Array# = [T; N]> + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 141 | T: Realrust-analyzer cargo palette 0.7.6 num/Real# + Zerorust-analyzer cargo palette 0.7.6 num/Zero# + Onerust-analyzer cargo palette 0.7.6 num/One# + MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax# + Clamprust-analyzer cargo palette 0.7.6 num/Clamp# + Sqrtrust-analyzer cargo palette 0.7.6 num/Sqrt# + Absrust-analyzer cargo palette 0.7.6 num/Abs# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 142 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 143 | { |
| 144 | fn multiplyrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]multiply().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 145 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 146 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 147 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, multiply_blendrust-analyzer cargo palette 0.7.6 blend/blend/multiply_blend().) |
| 148 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 149 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 150 | } |
| 151 | |
| 152 | fn screenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]screen().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 153 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 154 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 155 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, screen_blendrust-analyzer cargo palette 0.7.6 blend/blend/screen_blend().) |
| 156 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 157 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 158 | } |
| 159 | |
| 160 | fn overlayrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]overlay().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 161 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 162 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 163 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, overlay_blendrust-analyzer cargo palette 0.7.6 blend/blend/overlay_blend().) |
| 164 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 165 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 166 | } |
| 167 | |
| 168 | fn darkenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]darken().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 169 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 170 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 171 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, darken_blendrust-analyzer cargo palette 0.7.6 blend/blend/darken_blend().) |
| 172 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 173 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 174 | } |
| 175 | |
| 176 | fn lightenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]lighten().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 177 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 178 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 179 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, lighten_blendrust-analyzer cargo palette 0.7.6 blend/blend/lighten_blend().) |
| 180 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 181 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 182 | } |
| 183 | |
| 184 | fn dodgerust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]dodge().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 185 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 186 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 187 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, dodge_blendrust-analyzer cargo palette 0.7.6 blend/blend/dodge_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().().colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 188 | } |
| 189 | |
| 190 | fn burnrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]burn().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 191 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 192 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 193 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, burn_blendrust-analyzer cargo palette 0.7.6 blend/blend/burn_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().().colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 194 | } |
| 195 | |
| 196 | fn hard_lightrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]hard_light().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 197 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 198 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 199 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, hard_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/hard_light_blend().) |
| 200 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 201 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 202 | } |
| 203 | |
| 204 | fn soft_lightrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]soft_light().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 205 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 206 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 207 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, soft_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/soft_light_blend().) |
| 208 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 209 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 210 | } |
| 211 | |
| 212 | fn differencerust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]difference().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 213 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 214 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 215 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, difference_blendrust-analyzer cargo palette 0.7.6 blend/blend/difference_blend().) |
| 216 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 217 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 218 | } |
| 219 | |
| 220 | fn exclusionrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]exclusion().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[C][Blend] { |
| 221 | let src = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(self); |
| 222 | let dst = BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#::new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(other); |
| 223 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(src, dst, exclusion_blendrust-analyzer cargo palette 0.7.6 blend/blend/exclusion_blend().) |
| 224 | .unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 225 | .colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color. |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | impl<C, T, const N: usize> Blendrust-analyzer cargo palette 0.7.6 blend/blend/Blend# for Alpharust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#<C, T> |
| 230 | where |
| 231 | C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#<Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar# = T> + StimulusColorrust-analyzer cargo palette 0.7.6 stimulus/StimulusColor# + ArrayCastrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#<Arrayrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#Array# = [T; N]> + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 232 | T: Realrust-analyzer cargo palette 0.7.6 num/Real# + Zerorust-analyzer cargo palette 0.7.6 num/Zero# + Onerust-analyzer cargo palette 0.7.6 num/One# + MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax# + Clamprust-analyzer cargo palette 0.7.6 num/Clamp# + Sqrtrust-analyzer cargo palette 0.7.6 num/Sqrt# + Absrust-analyzer cargo palette 0.7.6 num/Abs# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 233 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 234 | { |
| 235 | #[inline] |
| 236 | fn multiplyrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]multiply().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 237 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), multiply_blendrust-analyzer cargo palette 0.7.6 blend/blend/multiply_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 238 | } |
| 239 | |
| 240 | #[inline] |
| 241 | fn screenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]screen().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 242 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), screen_blendrust-analyzer cargo palette 0.7.6 blend/blend/screen_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 243 | } |
| 244 | |
| 245 | #[inline] |
| 246 | fn overlayrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]overlay().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 247 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), overlay_blendrust-analyzer cargo palette 0.7.6 blend/blend/overlay_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 248 | } |
| 249 | |
| 250 | #[inline] |
| 251 | fn darkenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]darken().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 252 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), darken_blendrust-analyzer cargo palette 0.7.6 blend/blend/darken_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 253 | } |
| 254 | |
| 255 | #[inline] |
| 256 | fn lightenrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]lighten().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 257 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), lighten_blendrust-analyzer cargo palette 0.7.6 blend/blend/lighten_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 258 | } |
| 259 | |
| 260 | #[inline] |
| 261 | fn dodgerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]dodge().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 262 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), dodge_blendrust-analyzer cargo palette 0.7.6 blend/blend/dodge_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 263 | } |
| 264 | |
| 265 | #[inline] |
| 266 | fn burnrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]burn().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 267 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), burn_blendrust-analyzer cargo palette 0.7.6 blend/blend/burn_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 268 | } |
| 269 | |
| 270 | #[inline] |
| 271 | fn hard_lightrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]hard_light().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 272 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), hard_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/hard_light_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 273 | } |
| 274 | |
| 275 | #[inline] |
| 276 | fn soft_lightrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]soft_light().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 277 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), soft_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/soft_light_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 278 | } |
| 279 | |
| 280 | #[inline] |
| 281 | fn differencerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]difference().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 282 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), difference_blendrust-analyzer cargo palette 0.7.6 blend/blend/difference_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 283 | } |
| 284 | |
| 285 | #[inline] |
| 286 | fn exclusionrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]exclusion().(self, other: Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend]) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`Alpha<C, T>`][Blend] { |
| 287 | blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().(self.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), exclusion_blendrust-analyzer cargo palette 0.7.6 blend/blend/exclusion_blend().).unpremultiplyrust-analyzer cargo palette 0.7.6 blend/pre_alpha/impl#[`PreAlpha<C>`]unpremultiply().() |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | struct BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#> { |
| 292 | colorrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color.: C, |
| 293 | color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre.: C, |
| 294 | alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha.: C::Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar#, |
| 295 | } |
| 296 | |
| 297 | impl<C> BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C> |
| 298 | where |
| 299 | C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 300 | { |
| 301 | fn new_opaquerust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`]new_opaque().(color: C) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`] { |
| 302 | BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput# { |
| 303 | color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre.: color.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(), |
| 304 | colorrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color., |
| 305 | alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha.: C::Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar#::max_intensityrust-analyzer cargo palette 0.7.6 stimulus/Stimulus#max_intensity().(), |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | impl<C> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Alpharust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#<C, C::Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar#>> for BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C> |
| 311 | where |
| 312 | C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 313 | { |
| 314 | fn fromrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`][`From<Alpha<C, <C as Premultiply>::Scalar>>`]from().(color: Alpharust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#<C, C::Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar#>) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`][`From<Alpha<C, <C as Premultiply>::Scalar>>`] { |
| 315 | let color_pre: PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#<C> = color.colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().().premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#premultiply().(color.alpharust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#alpha.); |
| 316 | BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput# { |
| 317 | colorrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color.: color.colorrust-analyzer cargo palette 0.7.6 alpha/alpha/Alpha#color., |
| 318 | color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre.: color_pre.colorrust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#color., |
| 319 | alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha.: color_pre.alpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#alpha., |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | impl<C> Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#<C>> for BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C> |
| 325 | where |
| 326 | C: Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 327 | { |
| 328 | fn fromrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`][`From<PreAlpha<C>>`]from().(color: PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#<C>) -> Selfrust-analyzer cargo palette 0.7.6 blend/blend/impl#[`BlendInput<C>`][`From<PreAlpha<C>>`] { |
| 329 | let color_pre = color.colorrust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#color..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(); |
| 330 | let (color, alpha) = C::unpremultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#unpremultiply().(color); |
| 331 | BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput# { |
| 332 | colorrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color., |
| 333 | color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre., |
| 334 | alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha., |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | #[inline] |
| 340 | fn multiply_blendrust-analyzer cargo palette 0.7.6 blend/blend/multiply_blend().<T>(src: T, dst: T) -> T |
| 341 | where |
| 342 | T: Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics#, |
| 343 | { |
| 344 | src rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().dst |
| 345 | } |
| 346 | |
| 347 | #[inline] |
| 348 | fn screen_blendrust-analyzer cargo palette 0.7.6 blend/blend/screen_blend().<T>(src: T, dst: T) -> T |
| 349 | where |
| 350 | T: Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 351 | { |
| 352 | src.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().&dst rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().src rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().dst |
| 353 | } |
| 354 | |
| 355 | #[inline] |
| 356 | fn overlay_blendrust-analyzer cargo palette 0.7.6 blend/blend/overlay_blend().<T>(src: T, dst: T) -> T |
| 357 | where |
| 358 | T: Onerust-analyzer cargo palette 0.7.6 num/One# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 359 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 360 | { |
| 361 | hard_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/hard_light_blend().(dst, src) |
| 362 | } |
| 363 | |
| 364 | #[inline] |
| 365 | fn darken_blendrust-analyzer cargo palette 0.7.6 blend/blend/darken_blend().<T>(src: T, dst: T) -> T |
| 366 | where |
| 367 | T: MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax#, |
| 368 | { |
| 369 | src.minrust-analyzer cargo palette 0.7.6 num/MinMax#min().(dst) |
| 370 | } |
| 371 | |
| 372 | #[inline] |
| 373 | fn lighten_blendrust-analyzer cargo palette 0.7.6 blend/blend/lighten_blend().<T>(src: T, dst: T) -> T |
| 374 | where |
| 375 | T: MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax#, |
| 376 | { |
| 377 | src.maxrust-analyzer cargo palette 0.7.6 num/MinMax#max().(dst) |
| 378 | } |
| 379 | |
| 380 | #[inline] |
| 381 | fn dodge_blendrust-analyzer cargo palette 0.7.6 blend/blend/dodge_blend().<T>(src: T, dst: T) -> T |
| 382 | where |
| 383 | T: Onerust-analyzer cargo palette 0.7.6 num/One# + Zerorust-analyzer cargo palette 0.7.6 num/Zero# + MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp#, |
| 384 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 385 | { |
| 386 | // The original algorithm assumes values within [0, 1], but we check for |
| 387 | // values outside it and clamp. |
| 388 | lazy_selectrust-analyzer cargo palette 0.7.6 macros/lazy_select/lazy_select!! { |
| 389 | if dst.lt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#lt_eq().(&T::zerorust-analyzer cargo palette 0.7.6 num/Zero#zero().()) => T::zerorust-analyzer cargo palette 0.7.6 num/Zero#zero().(), |
| 390 | if src.gt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#gt_eq().(&T::onerust-analyzer cargo palette 0.7.6 num/One#one().()) => T::onerust-analyzer cargo palette 0.7.6 num/One#one().(), |
| 391 | else => T::onerust-analyzer cargo palette 0.7.6 num/One#one().().minrust-analyzer cargo palette 0.7.6 num/MinMax#min().(dst /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div(). (T::onerust-analyzer cargo palette 0.7.6 num/One#one().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). src)), |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | #[inline] |
| 396 | fn burn_blendrust-analyzer cargo palette 0.7.6 blend/blend/burn_blend().<T>(src: T, dst: T) -> T |
| 397 | where |
| 398 | T: Onerust-analyzer cargo palette 0.7.6 num/One# + Zerorust-analyzer cargo palette 0.7.6 num/Zero# + MinMaxrust-analyzer cargo palette 0.7.6 num/MinMax# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp#, |
| 399 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 400 | { |
| 401 | // The original algorithm assumes values within [0, 1], but we check for |
| 402 | // values outside it and clamp. |
| 403 | lazy_selectrust-analyzer cargo palette 0.7.6 macros/lazy_select/lazy_select!! { |
| 404 | if dst.gt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#gt_eq().(&T::onerust-analyzer cargo palette 0.7.6 num/One#one().()) => T::onerust-analyzer cargo palette 0.7.6 num/One#one().(), |
| 405 | if src.lt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#lt_eq().(&T::zerorust-analyzer cargo palette 0.7.6 num/Zero#zero().()) => T::zerorust-analyzer cargo palette 0.7.6 num/Zero#zero().(), |
| 406 | else => T::onerust-analyzer cargo palette 0.7.6 num/One#one().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). T::onerust-analyzer cargo palette 0.7.6 num/One#one().().minrust-analyzer cargo palette 0.7.6 num/MinMax#min().((T::onerust-analyzer cargo palette 0.7.6 num/One#one().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). dst) /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div(). src), |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | #[inline] |
| 411 | fn hard_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/hard_light_blend().<T>(src: T, dst: T) -> T |
| 412 | where |
| 413 | T: Onerust-analyzer cargo palette 0.7.6 num/One# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 414 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 415 | { |
| 416 | let two_src = src.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().src; |
| 417 | |
| 418 | lazy_selectrust-analyzer cargo palette 0.7.6 macros/lazy_select/lazy_select!! { |
| 419 | if two_src.lt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#lt_eq().(&T::onerust-analyzer cargo palette 0.7.6 num/One#one().()) => multiply_blendrust-analyzer cargo palette 0.7.6 blend/blend/multiply_blend().(two_src.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(), dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()), |
| 420 | else => screen_blendrust-analyzer cargo palette 0.7.6 blend/blend/screen_blend().(two_src.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). T::onerust-analyzer cargo palette 0.7.6 num/One#one().(), dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()), |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | #[inline] |
| 425 | fn soft_light_blendrust-analyzer cargo palette 0.7.6 blend/blend/soft_light_blend().<T>(src: T, dst: T) -> T |
| 426 | where |
| 427 | T: Realrust-analyzer cargo palette 0.7.6 num/Real# + Onerust-analyzer cargo palette 0.7.6 num/One# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + Sqrtrust-analyzer cargo palette 0.7.6 num/Sqrt# + PartialCmprust-analyzer cargo palette 0.7.6 num/PartialCmp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 428 | T::Maskrust-analyzer cargo palette 0.7.6 bool_mask/HasBoolMask#Mask#: LazySelectrust-analyzer cargo palette 0.7.6 bool_mask/LazySelect#<T>, |
| 429 | { |
| 430 | let four = T::from_f64rust-analyzer cargo palette 0.7.6 num/Real#from_f64().(4.0); |
| 431 | let twelve = T::from_f64rust-analyzer cargo palette 0.7.6 num/Real#from_f64().(12.0); |
| 432 | |
| 433 | let four_dst = dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().&four; |
| 434 | let two_src = src.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().&src; |
| 435 | |
| 436 | let d_dst = lazy_selectrust-analyzer cargo palette 0.7.6 macros/lazy_select/lazy_select!! { |
| 437 | if four_dst.lt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#lt_eq().(&T::onerust-analyzer cargo palette 0.7.6 num/One#one().()) => { |
| 438 | let sixteen_dst = four_dst *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). &four; |
| 439 | ((sixteen_dst -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). twelve) *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). &dst +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). four) *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). &dst |
| 440 | }, |
| 441 | else => dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().().sqrtrust-analyzer cargo palette 0.7.6 num/Sqrt#sqrt().(), |
| 442 | }; |
| 443 | |
| 444 | lazy_selectrust-analyzer cargo palette 0.7.6 macros/lazy_select/lazy_select!! { |
| 445 | if two_src.lt_eqrust-analyzer cargo palette 0.7.6 num/PartialCmp#lt_eq().(&T::onerust-analyzer cargo palette 0.7.6 num/One#one().()) => { |
| 446 | dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). (T::onerust-analyzer cargo palette 0.7.6 num/One#one().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). &two_src) *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). &dst *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). (T::onerust-analyzer cargo palette 0.7.6 num/One#one().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). &dst) |
| 447 | }, |
| 448 | else => dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). (two_src.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). T::onerust-analyzer cargo palette 0.7.6 num/One#one().()) *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). (d_dst -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). &dst), |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | #[inline] |
| 453 | fn difference_blendrust-analyzer cargo palette 0.7.6 blend/blend/difference_blend().<T>(src: T, dst: T) -> T |
| 454 | where |
| 455 | T: Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + Absrust-analyzer cargo palette 0.7.6 num/Abs#, |
| 456 | { |
| 457 | (dst rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().src).absrust-analyzer cargo palette 0.7.6 num/Abs#abs().() |
| 458 | } |
| 459 | |
| 460 | #[inline] |
| 461 | fn exclusion_blendrust-analyzer cargo palette 0.7.6 blend/blend/exclusion_blend().<T>(src: T, dst: T) -> T |
| 462 | where |
| 463 | T: Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 464 | { |
| 465 | dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().&src rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().(dst.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().dst) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().src |
| 466 | } |
| 467 | |
| 468 | #[inline] |
| 469 | fn blend_separablerust-analyzer cargo palette 0.7.6 blend/blend/blend_separable().<C, T, F, const N: usize>( |
| 470 | src: BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C>, |
| 471 | mut dst: BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C>, |
| 472 | mut blend: F, |
| 473 | ) -> PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#<C> |
| 474 | where |
| 475 | C: ArrayCastrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#<Arrayrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#Array# = [T; N]> + Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#<Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar# = T>, |
| 476 | T: Onerust-analyzer cargo palette 0.7.6 num/One# + Zerorust-analyzer cargo palette 0.7.6 num/Zero# + Arithmeticsrust-analyzer cargo palette 0.7.6 num/Arithmetics# + Clamprust-analyzer cargo palette 0.7.6 num/Clamp# + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 477 | F: FnMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/function/FnMut#(T, T) -> T, |
| 478 | { |
| 479 | let src_alpha = src.alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(); |
| 480 | let zipped_input = zip_inputrust-analyzer cargo palette 0.7.6 blend/blend/zip_input().(src, dst.colorrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color., &mut dst.color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre., dst.alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()); |
| 481 | |
| 482 | for (src, src_pre, src_alpha, dst, dst_pre, dst_alpha) in zipped_input { |
| 483 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().dst_pre = src_pre rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().(T::onerust-analyzer cargo palette 0.7.6 num/One#one().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().&dst_alpha) |
| 484 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().blend(src, dst) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().&src_alpha rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().dst_alpha |
| 485 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().(T::onerust-analyzer cargo palette 0.7.6 num/One#one().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().src_alpha) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().&*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().dst_pre; |
| 486 | } |
| 487 | |
| 488 | PreAlpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha# { |
| 489 | colorrust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#color.: dst.color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre., |
| 490 | alpharust-analyzer cargo palette 0.7.6 blend/pre_alpha/PreAlpha#alpha.: blend_alpharust-analyzer cargo palette 0.7.6 blend/blend_alpha().(src_alpha, dst.alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha.), |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | fn zip_inputrust-analyzer cargo palette 0.7.6 blend/blend/zip_input().<'a, C, T, const N: usize>( |
| 495 | src: BlendInputrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#<C>, |
| 496 | dst: C, |
| 497 | dst_pre: &'a mut C, |
| 498 | dst_alpha: T, |
| 499 | ) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = (T, T, T, T, &'a mut T, T)> |
| 500 | where |
| 501 | C: ArrayCastrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#<Arrayrust-analyzer cargo palette 0.7.6 cast/array/ArrayCast#Array# = [T; N]> + Premultiplyrust-analyzer cargo palette 0.7.6 blend/Premultiply#<Scalarrust-analyzer cargo palette 0.7.6 blend/Premultiply#Scalar# = T>, |
| 502 | T: 'a + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 503 | { |
| 504 | let src_alpha = src.alpharust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#alpha.; |
| 505 | IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#::into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().(castrust-analyzer cargo palette 0.7.6 cast/::into_arrayrust-analyzer cargo palette 0.7.6 cast/array/into_array().(src.colorrust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color.)) |
| 506 | .ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(castrust-analyzer cargo palette 0.7.6 cast/::into_arrayrust-analyzer cargo palette 0.7.6 cast/array/into_array().(src.color_prerust-analyzer cargo palette 0.7.6 blend/blend/BlendInput#color_pre.)) |
| 507 | .ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(castrust-analyzer cargo palette 0.7.6 cast/::into_arrayrust-analyzer cargo palette 0.7.6 cast/array/into_array().(dst)) |
| 508 | .ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(castrust-analyzer cargo palette 0.7.6 cast/::into_array_mutrust-analyzer cargo palette 0.7.6 cast/array/into_array_mut().(dst_pre)) |
| 509 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(move |(((src_color, src_pre), dst_color), dst_pre)| { |
| 510 | ( |
| 511 | src_color, |
| 512 | src_pre, |
| 513 | src_alpha.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(), |
| 514 | dst_color, |
| 515 | dst_pre, |
| 516 | dst_alpha.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().(), |
| 517 | ) |
| 518 | }) |
| 519 | } |