New node: Pixel Noise (#1267)

Add Pixel Noise Node

Currently only White Noise is implemented, but the Code is written so that other's can be added easily
This commit is contained in:
isiko
2023-08-19 20:30:03 +02:00
committed by GitHub
parent 185106132d
commit a566331f1c
8 changed files with 117 additions and 3 deletions

View File

@@ -532,6 +532,27 @@ impl core::fmt::Display for RedGreenBlue {
}
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "std", derive(specta::Type))]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, DynAny)]
pub enum NoiseType {
WhiteNoise,
}
impl core::fmt::Display for NoiseType {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
NoiseType::WhiteNoise => write!(f, "White Noise"),
}
}
}
impl NoiseType {
pub fn list() -> [NoiseType; 1] {
[NoiseType::WhiteNoise]
}
}
#[derive(Debug, Clone, Copy)]
pub struct ChannelMixerNode<Monochrome, MonochromeR, MonochromeG, MonochromeB, MonochromeC, RedR, RedG, RedB, RedC, GreenR, GreenG, GreenB, GreenC, BlueR, BlueG, BlueB, BlueC> {
monochrome: Monochrome,