Add color weights to Grayscale node and improve luminance handling (#1015)

* Add weighted grayscale node

* Rename nodes, fix grayscale weighting, add luma calc options

* Fix tests

* Add Tint Option

* Improve (but not full fix) tint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
isiko 2023-02-10 21:55:01 +01:00 committed by Keavon Chambers
parent d456640bb8
commit a709a772d5
7 changed files with 285 additions and 34 deletions

View file

@ -371,11 +371,14 @@ mod test {
use super::*;
#[ignore]
#[test]
fn map_node() {
// let array = &mut [Color::from_rgbaf32(1.0, 0.0, 0.0, 1.0).unwrap()];
GrayscaleNode.eval(Color::from_rgbf32_unchecked(1., 0., 0.));
/*let map = ForEachNode(MutWrapper(GrayscaleNode));
// LuminanceNode.eval(Color::from_rgbf32_unchecked(1., 0., 0.));
/*let map = ForEachNode(MutWrapper(LuminanceNode));
(&map).eval(array.iter_mut());
assert_eq!(array[0], Color::from_rgbaf32(0.33333334, 0.33333334, 0.33333334, 1.0).unwrap());*/
}