mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-31 02:07:21 +00:00
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:
parent
561b671f8d
commit
6f46f21e21
6 changed files with 118 additions and 13 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue