Files
Graphite/node-graph/gcore/src/logic.rs
Dennis Kobert 7e3469fa3f Update graphene-cli and fix no-std compilation for graphene-core (#1428)
* Initialize wgpu executor from graphene cli

* Make `graphene-core` `no-std` complient again

* Implemnt image similarity calculation

* Add nan checks

* Make image comparison optional

* Feature gate quantization to reduce the number of warnings
2023-09-30 11:20:17 +02:00

45 lines
804 B
Rust

use crate::Node;
pub struct LogToConsoleNode;
#[node_macro::node_fn(LogToConsoleNode)]
fn log_to_console<T: core::fmt::Debug>(value: T) -> T {
#[cfg(not(target_arch = "spirv"))]
debug!("{:#?}", value);
value
}
pub struct LogicOrNode<Second> {
second: Second,
}
#[node_macro::node_fn(LogicOrNode)]
fn logic_or(first: bool, second: bool) -> bool {
first || second
}
pub struct LogicAndNode<Second> {
second: Second,
}
#[node_macro::node_fn(LogicAndNode)]
fn logic_and(first: bool, second: bool) -> bool {
first && second
}
pub struct LogicXorNode<Second> {
second: Second,
}
#[node_macro::node_fn(LogicXorNode)]
fn logic_xor(first: bool, second: bool) -> bool {
first ^ second
}
pub struct LogicNotNode;
#[node_macro::node_fn(LogicNotNode)]
fn logic_not(first: bool) -> bool {
!first
}