New node: 'Split Segments'

This commit is contained in:
Keavon Chambers
2025-06-24 04:55:27 -07:00
parent fdb09e334b
commit 11ba2cc0fe
4 changed files with 70 additions and 27 deletions

View File

@@ -441,30 +441,6 @@ fn color_value(_: impl Ctx, _primary: (), #[default(Color::BLACK)] color: Option
color
}
// // Aims for interoperable compatibility with:
// // https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=%27grdm%27%20%3D%20Gradient%20Map
// // https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#:~:text=Gradient%20settings%20(Photoshop%206.0)
// #[node_macro::node(category("Raster: Adjustment"))]
// async fn gradient_map<T: Adjust<Color>>(
// _: impl Ctx,
// #[implementations(
// Color,
// RasterDataTable<CPU>,
// GradientStops,
// )]
// mut image: T,
// gradient: GradientStops,
// reverse: bool,
// ) -> T {
// image.adjust(|color| {
// let intensity = color.luminance_srgb();
// let intensity = if reverse { 1. - intensity } else { intensity };
// gradient.evaluate(intensity as f64)
// });
// image
// }
/// Gets the color at the specified position along the gradient, given a position from 0 (left) to 1 (right).
#[node_macro::node(category("Color"))]
fn sample_gradient(_: impl Ctx, _primary: (), gradient: GradientStops, position: Fraction) -> Color {