|
use crate::raster_types::{CPU, RasterDataTable}; |
|
use crate::vector::VectorDataTable; |
|
use crate::{Color, Ctx}; |
|
use glam::{DAffine2, DVec2}; |
|
|
|
#[node_macro::node(category("Debug"), name("Log to Console"))] |
|
fn log_to_console<T: std::fmt::Debug>(_: impl Ctx, #[implementations(String, bool, f64, u32, u64, DVec2, VectorDataTable, DAffine2, Color, Option<Color>)] value: T) -> T { |
|
|
|
log::debug!("{:#?}", value); |
|
value |
|
} |
|
|
|
|
|
#[node_macro::node(category("Debug"))] |
|
fn size_of(_: impl Ctx, ty: crate::Type) -> Option<usize> { |
|
ty.size() |
|
} |
|
|
|
|
|
#[node_macro::node(category("Debug"))] |
|
fn some<T>(_: impl Ctx, #[implementations(f64, f32, u32, u64, String, Color)] input: T) -> Option<T> { |
|
Some(input) |
|
} |
|
|
|
|
|
#[node_macro::node(category("Debug"))] |
|
fn unwrap<T: Default>(_: impl Ctx, #[implementations(Option<f64>, Option<f32>, Option<u32>, Option<u64>, Option<String>, Option<Color>)] input: Option<T>) -> T { |
|
input.unwrap_or_default() |
|
} |
|
|
|
|
|
#[node_macro::node(category("Debug"))] |
|
fn clone<'i, T: Clone + 'i>(_: impl Ctx, #[implementations(&RasterDataTable<CPU>)] value: &'i T) -> T { |
|
value.clone() |
|
} |
|
|