Make use of ImageFrame in the node system more extensively (#1055) (#1062)

Make the node system use ImageFrame more extensively (#1055)
This commit is contained in:
Alexandru Ică
2023-03-02 15:55:10 +02:00
committed by GitHub
parent 0e13338fc7
commit ebd31d07f0
6 changed files with 215 additions and 158 deletions

View File

@@ -291,6 +291,7 @@ mod image {
use super::{Color, ImageSlice};
use crate::Node;
use alloc::vec::Vec;
use core::hash::{Hash, Hasher};
use dyn_any::{DynAny, StaticType};
use glam::DAffine2;
@@ -389,6 +390,13 @@ mod image {
}
}
}
impl Hash for ImageFrame {
fn hash<H: Hasher>(&self, state: &mut H) {
self.image.hash(state);
self.transform.to_cols_array().iter().for_each(|x| x.to_bits().hash(state))
}
}
}
#[cfg(test)]