Update nodes to work with linear color by default (#1135)

* Update nodes to work with linear color by default

* Make tests work in linear not gamma
This commit is contained in:
Keavon Chambers 2023-04-16 12:20:44 -07:00
parent f68bc42fc9
commit fa23e9d55b
8 changed files with 131 additions and 102 deletions

View file

@ -154,13 +154,16 @@ fn translate_node<Data: TransformMut>(offset: DVec2, mut translatable: Data) ->
mod test {
use super::*;
use crate::raster::*;
use glam::DAffine2;
#[allow(unused_imports)]
use graphene_core::ops::{AddNode, CloneNode};
use graphene_core::raster::*;
use graphene_core::structural::Then;
use graphene_core::transform::{Transform, TransformMut};
use graphene_core::value::{ClonedNode, ValueNode};
use glam::DAffine2;
#[test]
fn test_translate_node() {
let image = Image::new(10, 10, Color::TRANSPARENT);

View file

@ -1,7 +1,7 @@
use dyn_any::{DynAny, StaticType, StaticTypeSized};
use glam::{BVec2, DAffine2, DVec2};
use graphene_core::raster::{Alpha, Channel, Color, Image, ImageFrame, Luminance, Pixel, RasterMut, Sample};
use glam::{DAffine2, DVec2};
use graphene_core::raster::{Alpha, Channel, Image, ImageFrame, Luminance, Pixel, RasterMut, Sample};
use graphene_core::transform::Transform;
use graphene_core::value::{ClonedNode, ValueNode};
use graphene_core::Node;
@ -300,7 +300,6 @@ fn blend_image<_P: Clone, MapFn, Frame: Sample<Pixel = _P> + Transform, Backgrou
where
MapFn: for<'any_input> Node<'any_input, (_P, _P), Output = _P> + 'input,
{
let foreground_size = foreground.transform().decompose_scale();
let background_size = DVec2::new(background.width() as f64, background.height() as f64);
// Transforms a point from the background image to the forground image