pub enum Channel {
Source(Source),
Lerp {
a: Source,
b: Source,
t: Source,
},
Threshold {
v: Source,
m: Source,
k: [f32; 4],
},
Product {
sources: Vec<Source>,
},
Power {
v: Source,
exponent: u8,
},
Expression(Expression),
}Expand description
One weight channel per pixel: a named form of its sources, or an Expression of them for what no named form
spells. Every form follows the numeric rules and is the operations of its Channel::expression.
Variants§
Source(Source)
Lerp
lerp(a, b, t).
Threshold
saturate(k0 + k1 v + k2 m + k3 v m) (saturate), summed from the left with k3 v before its m.
Product
Product of 2 to PRODUCT_LIMIT sources, multiplied from left to right without clamping.
Power
v^exponent (power), exponent 1 to 16.
Expression(Expression)
Operations on its sources, in its canonical spelling and no named form’s (Channel::from_expression).
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn expression(&self) -> Result<Expression, String>
pub fn expression(&self) -> Result<Expression, String>
Its operations as an Expression, in the canonical spelling: what it means under the numeric rules.
Sourcepub fn from_expression(e: &Expression) -> Result<Channel, String>
pub fn from_expression(e: &Expression) -> Result<Channel, String>
The channel e spells: the named form whose operations it makes, else e in its canonical spelling.
Trait Implementations§
impl StructuralPartialEq for Channel
Auto Trait Implementations§
impl Forget for Channel
impl Freeze for Channel
impl RefUnwindSafe for Channel
impl Send for Channel
impl Sync for Channel
impl Unpin for Channel
impl UnsafeUnpin for Channel
impl UnwindSafe for Channel
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