Improve the HTTP request nodes and add new related nodes (#2896)

* Improve the network request nodes and add new ones to process data

* Use Content-Type: application/octet-stream

* Add 'Gamma Correction' node
This commit is contained in:
Keavon Chambers 2025-07-18 05:03:50 -07:00 committed by GitHub
parent 561b671f8d
commit 6f46f21e21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 118 additions and 13 deletions

View file

@ -65,6 +65,26 @@ fn luminance<T: Adjust<Color>>(
input
}
#[node_macro::node(category("Raster"))]
fn gamma_correction<T: Adjust<Color>>(
_: impl Ctx,
#[implementations(
Color,
RasterDataTable<CPU>,
GradientStops,
)]
mut input: T,
#[default(2.2)]
#[range((0.01, 10.))]
#[hard_min(0.0001)]
gamma: f64,
inverse: bool,
) -> T {
let exponent = if inverse { 1. / gamma } else { gamma };
input.adjust(|color| color.gamma(exponent as f32));
input
}
#[node_macro::node(category("Raster: Channels"))]
fn extract_channel<T: Adjust<Color>>(
_: impl Ctx,