From b28be1ad55402369dc76a57b6309676a7c344cb6 Mon Sep 17 00:00:00 2001 From: Jules Fouchy Date: Tue, 7 Nov 2023 17:20:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[Nodes]=20Fix=20missing=20conver?= =?UTF-8?q?sions=20between=20Float=5Fwith=5Falpha=20and=20Hue=20/=20Int=20?= =?UTF-8?q?=20/=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cool | 2 +- Nodes/12 Image Blend/Over (Paint).clbnode | 6 +- .../CodeGen_implicit_conversion.cpp | 3 + src/Module_Nodes/gen_primitive_types.py | 329 +- src/Module_Nodes/generated/can_convert.inl | 54 + .../def_implicit_color_conversions.inl | 3386 +++++++++++++++++ .../generated/def_implicit_conversions.inl | 427 +++ .../generated/implicit_color_conversions.inl | 2750 +------------ .../generated/implicit_conversions.inl | 261 +- 9 files changed, 4467 insertions(+), 2751 deletions(-) create mode 100644 src/Module_Nodes/generated/def_implicit_color_conversions.inl create mode 100644 src/Module_Nodes/generated/def_implicit_conversions.inl diff --git a/Cool b/Cool index 28ac7ad0..c43d6fb6 160000 --- a/Cool +++ b/Cool @@ -1 +1 @@ -Subproject commit 28ac7ad0b7ee7aa2058f9f1bcd0af8d7b1193f46 +Subproject commit c43d6fb6a743897c8471003de51c383afcdadadb diff --git a/Nodes/12 Image Blend/Over (Paint).clbnode b/Nodes/12 Image Blend/Over (Paint).clbnode index fe71f6bf..1e6f818a 100644 --- a/Nodes/12 Image Blend/Over (Paint).clbnode +++ b/Nodes/12 Image Blend/Over (Paint).clbnode @@ -6,10 +6,10 @@ sRGB_PremultipliedA main(sRGB_PremultipliedA Foreground) { float new_alpha = Foreground.a + (1. - Foreground.a) * 'Background'.a; return vec4( - premultiply( + Cool_premultiply_color( mixbox_lerp( - unpremultiply('Background'.rgb, 'Background'.a), - unpremultiply(Foreground.rgb, Foreground.a), + Cool_unpremultiply_color('Background'.rgb, 'Background'.a), + Cool_unpremultiply_color(Foreground.rgb, Foreground.a), Foreground.a ), new_alpha diff --git a/src/Module_Nodes/CodeGen_implicit_conversion.cpp b/src/Module_Nodes/CodeGen_implicit_conversion.cpp index 703277f3..b564d866 100644 --- a/src/Module_Nodes/CodeGen_implicit_conversion.cpp +++ b/src/Module_Nodes/CodeGen_implicit_conversion.cpp @@ -3,6 +3,9 @@ namespace Lab { +#include "generated/def_implicit_color_conversions.inl" +#include "generated/def_implicit_conversions.inl" + auto gen_implicit_conversion(PrimitiveType from, PrimitiveType to, CodeGenContext& context) // NOLINT(readability-function-cognitive-complexity) -> std::optional { diff --git a/src/Module_Nodes/gen_primitive_types.py b/src/Module_Nodes/gen_primitive_types.py index 9a62b7c3..af2d66e2 100644 --- a/src/Module_Nodes/gen_primitive_types.py +++ b/src/Module_Nodes/gen_primitive_types.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Optional, List, Any # HACK: Python doesn't allow us to import from a parent folder (e.g. tooling.generate_files) @@ -22,7 +22,8 @@ class Conversion: from_: str to: str - implementation: str # An empty string means that the conversion doesn't need any code (e.g. between UV and Vec2) + implementation: str + intermediate_conversions: List[str] = field(default_factory=list) @dataclass @@ -173,102 +174,113 @@ def all_primitive_types(): def all_conversions(): - return [ - Conversion( - from_="Float", - to="Angle", - implementation=""" + return add_float_with_alpha_conversions( + [ + Conversion( + from_="Float", + to="Angle", + implementation=""" float FUNCTION_NAME(float x) { return x * TAU; } - """, - ), - Conversion( - from_="Angle", - to="Float", - implementation=""" + """, + ), + Conversion( + from_="Angle", + to="Float", + implementation=""" float FUNCTION_NAME(float angle) { return angle / TAU; } """, - ), - Conversion( - from_="Float", - to="Hue", - implementation="", - ), - Conversion( - from_="Hue", - to="Float", - implementation="", - ), - Conversion( - from_="Float", - to="Int", - implementation=""" + ), + Conversion( + from_="Float", + to="Hue", + implementation=""" + float FUNCTION_NAME(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + """, + ), + Conversion( + from_="Hue", + to="Float", + implementation=""" + float FUNCTION_NAME(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + """, + ), + Conversion( + from_="Float", + to="Int", + implementation=""" int FUNCTION_NAME(float x) { return int(floor(x)); } """, - ), - Conversion( - from_="Int", - to="Float", - implementation=""" + ), + Conversion( + from_="Int", + to="Float", + implementation=""" float FUNCTION_NAME(int x) { return float(x); } """, - ), - Conversion( - from_="Float", - to="Bool", - implementation=""" + ), + Conversion( + from_="Float", + to="Bool", + implementation=""" bool FUNCTION_NAME(float x) { return x > 0.5; } """, - ), - Conversion( - from_="Bool", - to="Float", - implementation=""" + ), + Conversion( + from_="Bool", + to="Float", + implementation=""" float FUNCTION_NAME(bool b) { return b ? 1. : 0.; } """, - ), - Conversion( - from_="Angle", - to="Direction2D", - implementation=""" + ), + Conversion( + from_="Angle", + to="Direction2D", + implementation=""" vec2 FUNCTION_NAME(float angle) { return vec2(cos(angle), sin(angle)); } """, - ), - Conversion( - from_="Float", - to="Direction2D", - implementation=""" + ), + Conversion( + from_="Float", + to="Direction2D", + implementation=""" vec2 FUNCTION_NAME(float x) { float angle = x * TAU; return vec2(cos(angle), sin(angle)); } """, - ), - Conversion( - from_="Direction2D", - to="Angle", - implementation=""" + ), + Conversion( + from_="Direction2D", + to="Angle", + implementation=""" float FUNCTION_NAME(vec2 dir) { return dir.x != 0.f @@ -278,28 +290,86 @@ def all_conversions(): : -PI / 2.; } """, - ), - Conversion( - from_="UV", - to="Vec2", - implementation="", - ), - Conversion( - from_="Vec2", - to="UV", - implementation="", - ), - Conversion( - from_="Void", - to="UV", - implementation=""" + ), + Conversion( + from_="UV", + to="Vec2", + implementation=""" + float FUNCTION_NAME(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + """, + ), + Conversion( + from_="Vec2", + to="UV", + implementation=""" + float FUNCTION_NAME(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + """, + ), + Conversion( + from_="Void", + to="UV", + implementation=""" vec2 FUNCTION_NAME() { return coollab_context.uv; } """, - ), - ] + ), + ] + ) + + +def add_float_with_alpha_conversions(conversions: List[Conversion]) -> List[Conversion]: + for conversion in conversions: + if conversion.from_ == "Float": + for alpha_space in non_null_alpha_spaces(): + conversions.append( + Conversion( + from_=f"Float{alpha_space}", + to=conversion.to, + implementation=f""" + {glsl_type_from_cpp_type(conversion.to)} FUNCTION_NAME(vec2 x) + {{ + return Coollab_{conversion.to}_from_Float(Coollab_Float_from_Float{alpha_space}(x)); + }} + """, + intermediate_conversions=[ + f"Coollab_{conversion.to}_from_Float", + f"Coollab_Float_from_Float{alpha_space}", + ], + ) + ) + elif conversion.to == "Float": + for alpha_space in non_null_alpha_spaces(): + conversions.append( + Conversion( + from_=conversion.from_, + to=f"Float{alpha_space}", + implementation=f""" + vec2 FUNCTION_NAME({glsl_type_from_cpp_type(conversion.from_)} x) + {{ + return Coollab_Float{alpha_space}_from_Float(Coollab_Float_from_{conversion.from_}(x)); + }} + """, + intermediate_conversions=[ + f"Coollab_Float{alpha_space}_from_Float", + f"Coollab_Float_from_{conversion.from_}", + ], + ) + ) + return conversions + + +def glsl_type_from_cpp_type(cpp_type: str): + for type in all_primitive_types(): + if type.cpp == cpp_type: + return type.glsl def color_spaces(): @@ -361,6 +431,12 @@ def alpha_spaces(): return ["", "_StraightA", "_PremultipliedA"] +def non_null_alpha_spaces(): + l = alpha_spaces() + l.remove("") + return l + + def vec_type(dimension: int): if dimension == 1: return "float" @@ -373,10 +449,10 @@ def dimension(color: generator_colors.ColorSpace): return 3 -def implicit_color_conversions(): +def implicit_color_conversions_impl(): from itertools import product - res = "" + res = ["", ""] for color1, color2 in product( color_and_greyscale_spaces(), color_and_greyscale_spaces() ): @@ -388,18 +464,29 @@ def implicit_color_conversions(): def gen_code(in_vec: str, out_vec: str, implementation: str): nonlocal res - res += f""" + function_name = f"Coollab_{type2}_from_{type1}" + res[ + 0 + ] += f""" + static auto gen_{function_name}() -> Function + {{ + return {{ + .name = "{function_name}", + .definition = R"STR( + {out_vec} {function_name}/*coollabdef*/({in_vec} from) + {{ + {implementation} + }} + )STR", + }}; + }} + """ + res[ + 1 + ] += f""" if (from == PrimitiveType::{type1} && to == PrimitiveType::{type2}) {{ - return context.push_function({{ - .name = "Coollab_{type2}_from_{type1}", - .definition = R"STR( - {out_vec} Coollab_{type2}_from_{type1}/*coollabdef*/({in_vec} from) - {{ - {implementation} - }} - )STR", - }}); + return context.push_function(gen_{function_name}()); }} """ @@ -410,6 +497,12 @@ def gen_code(in_vec: str, out_vec: str, implementation: str): ) color_components = "xyz" if color1.name_in_code != "Float" else "x" alpha_component = "a" if color1.name_in_code != "Float" else "y" + color_or_greyscale_from = ( + "color" if color1.name_in_code != "Float" else "greyscale" + ) + color_or_greyscale_to = ( + "color" if color2.name_in_code != "Float" else "greyscale" + ) match alpha1, alpha2: case "", "": gen_code( @@ -420,21 +513,21 @@ def gen_code(in_vec: str, out_vec: str, implementation: str): return to; """, ) - case "_StraightA", "": # We can afford to lose the alpha information because it is stored in the coollab_context anyways. + case "_StraightA", "": gen_code( in_vec=vec_type(dimension(color1) + 1), out_vec=vec_type(dimension(color2)), implementation=f""" - {vec_type(dimension(color2))} to = {color_conversion}(from.{color_components}); + {vec_type(dimension(color2))} to = {color_conversion}(Cool_premultiply_{color_or_greyscale_from}(from.{color_components}, from.{alpha_component})); return to; """, ) - case "_PremultipliedA", "": # We can afford to lose the alpha information because it is stored in the coollab_context anyways. + case "_PremultipliedA", "": gen_code( in_vec=vec_type(dimension(color1) + 1), out_vec=vec_type(dimension(color2)), implementation=f""" - {vec_type(dimension(color2))} to = {color_conversion}(unpremultiply(from.{color_components}, from.{alpha_component})); + {vec_type(dimension(color2))} to = {color_conversion}(from.{color_components}); return to; """, ) @@ -462,7 +555,7 @@ def gen_code(in_vec: str, out_vec: str, implementation: str): out_vec=vec_type(dimension(color2) + 1), implementation=f""" {vec_type(dimension(color2))} to = {color_conversion}(from.{color_components}); - return {vec_type(dimension(color2)+1)}(to, from.{alpha_component}); + return Cool_apply_straight_alpha_to_{color_or_greyscale_to}(to, from.{alpha_component}); """, ) case "_PremultipliedA", "_PremultipliedA": @@ -471,8 +564,8 @@ def gen_code(in_vec: str, out_vec: str, implementation: str): out_vec=vec_type(dimension(color2) + 1), implementation=f""" // We need to unpremultiply for the color conversion, and re-premultiply afterwards - {vec_type(dimension(color2))} to = {color_conversion}(unpremultiply(from.{color_components}, from.{alpha_component})); - return {vec_type(dimension(color2)+1)}(premultiply(to, from.{alpha_component}), from.{alpha_component}); + {vec_type(dimension(color2))} to = {color_conversion}(Cool_unpremultiply_{color_or_greyscale_from}(from.{color_components}, from.{alpha_component})); + return Cool_apply_premultiplied_alpha_to_{color_or_greyscale_to}(to, from.{alpha_component}); """, ) case "_PremultipliedA", "_StraightA": @@ -480,8 +573,8 @@ def gen_code(in_vec: str, out_vec: str, implementation: str): in_vec=vec_type(dimension(color1) + 1), out_vec=vec_type(dimension(color2) + 1), implementation=f""" - {vec_type(dimension(color2))} to = {color_conversion}(unpremultiply(from.{color_components}, from.{alpha_component})); - return {vec_type(dimension(color2)+1)}(to, from.{alpha_component}); + {vec_type(dimension(color2))} to = {color_conversion}(Cool_unpremultiply_{color_or_greyscale_from}(from.{color_components}, from.{alpha_component})); + return Cool_apply_straight_alpha_to_{color_or_greyscale_to}(to, from.{alpha_component}); """, ) case "_StraightA", "_PremultipliedA": @@ -490,12 +583,20 @@ def gen_code(in_vec: str, out_vec: str, implementation: str): out_vec=vec_type(dimension(color2) + 1), implementation=f""" {vec_type(dimension(color2))} to = {color_conversion}(from.{color_components}); - return {vec_type(dimension(color2)+1)}(premultiply(to, from.{alpha_component}), from.{alpha_component}); + return Cool_apply_premultiplied_alpha_to_{color_or_greyscale_to}(to, from.{alpha_component}); """, ) return res +def implicit_color_conversions(): + return implicit_color_conversions_impl()[1] + + +def def_implicit_color_conversions(): + return implicit_color_conversions_impl()[0] + + def has_an_alpha_channel(): res = "" for color_space in color_and_greyscale_spaces(): @@ -663,25 +764,35 @@ def string_listing_the_parsed_types(): ) -def implicit_conversions(): +def def_implicit_conversions(): def replace_function_name(code: str, name: str): return code.replace("FUNCTION_NAME", name) def gen_conversion(conversion: Conversion): - if conversion.implementation == "": - return f""" - if (from == PrimitiveType::{conversion.from_} && to == PrimitiveType::{conversion.to}) - return ""; // No need to do anything for this conversion, the difference is purely semantic. - """ - - function_name = f"Coollab_{conversion.from_}_to_{conversion.to}" + function_name = f"Coollab_{conversion.to}_from_{conversion.from_}" return f""" - if (from == PrimitiveType::{conversion.from_} && to == PrimitiveType::{conversion.to}) + static auto gen_{function_name}() -> Function {{ - return context.push_function({{ + return {{ .name = "{function_name}", .definition = R"STR({replace_function_name(conversion.implementation, function_name+"/*coollabdef*/")})STR", - }}); + }}; + }} + """ + + from pipe import map + + return "\n".join(all_conversions() | map(gen_conversion)) + + +def implicit_conversions(): + def gen_conversion(conversion: Conversion): + function_name = f"Coollab_{conversion.to}_from_{conversion.from_}" + return f""" + if (from == PrimitiveType::{conversion.from_} && to == PrimitiveType::{conversion.to}) + {{ + {";\n".join([f"context.push_function(gen_{intermediate}())" for intermediate in conversion.intermediate_conversions])}; + return context.push_function(gen_{function_name}()); }} """ @@ -726,6 +837,7 @@ def code(conversion: Conversion): parse_primitive_type, string_listing_the_parsed_types, implicit_color_conversions, + def_implicit_color_conversions, has_an_alpha_channel, has_straight_alpha_channel, with_straight_alpha, @@ -733,6 +845,7 @@ def code(conversion: Conversion): is_color_type, is_greyscale_type, implicit_conversions, + def_implicit_conversions, can_convert, ], ) diff --git a/src/Module_Nodes/generated/can_convert.inl b/src/Module_Nodes/generated/can_convert.inl index bf8c7c4d..382ade65 100644 --- a/src/Module_Nodes/generated/can_convert.inl +++ b/src/Module_Nodes/generated/can_convert.inl @@ -46,3 +46,57 @@ if (from == PrimitiveType::Vec2 && to == PrimitiveType::UV) if (from == PrimitiveType::Void && to == PrimitiveType::UV) return true; + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Angle) + return true; + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Angle) + return true; + +if (from == PrimitiveType::Angle && to == PrimitiveType::Float_StraightA) + return true; + +if (from == PrimitiveType::Angle && to == PrimitiveType::Float_PremultipliedA) + return true; + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Hue) + return true; + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Hue) + return true; + +if (from == PrimitiveType::Hue && to == PrimitiveType::Float_StraightA) + return true; + +if (from == PrimitiveType::Hue && to == PrimitiveType::Float_PremultipliedA) + return true; + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Int) + return true; + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Int) + return true; + +if (from == PrimitiveType::Int && to == PrimitiveType::Float_StraightA) + return true; + +if (from == PrimitiveType::Int && to == PrimitiveType::Float_PremultipliedA) + return true; + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Bool) + return true; + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Bool) + return true; + +if (from == PrimitiveType::Bool && to == PrimitiveType::Float_StraightA) + return true; + +if (from == PrimitiveType::Bool && to == PrimitiveType::Float_PremultipliedA) + return true; + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Direction2D) + return true; + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Direction2D) + return true; diff --git a/src/Module_Nodes/generated/def_implicit_color_conversions.inl b/src/Module_Nodes/generated/def_implicit_color_conversions.inl new file mode 100644 index 00000000..033d311f --- /dev/null +++ b/src/Module_Nodes/generated/def_implicit_color_conversions.inl @@ -0,0 +1,3386 @@ +/* ----------------------------------------------------------------------------- + * This file was automatically generated by a Python script. + * PLEASE DON'T EDIT IT DIRECTLY, your changes would be overwritten the next time the script is run. + * Instead, go to "gen_primitive_types.py" and edit the "def_implicit_color_conversions" function there. + * ----------------------------------------------------------------------------- + */ + +static auto gen_Coollab_Oklab_StraightA_from_Oklab() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Oklab", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Oklab() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Oklab", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_from_Oklab_StraightA", + .definition = R"STR( + vec3 Coollab_Oklab_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_from_Oklab_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Oklab_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Oklab() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Oklab", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Oklab() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Oklab", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Oklab() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Oklab", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Oklab_StraightA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Oklab_PremultipliedA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_LinearRGB_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Oklab() -> Function +{ + return { + .name = "Coollab_sRGB_from_Oklab", + .definition = R"STR( + vec3 Coollab_sRGB_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_Oklab(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Oklab() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Oklab", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_Oklab(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Oklab() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Oklab", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_Oklab(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_from_Oklab_StraightA", + .definition = R"STR( + vec3 Coollab_sRGB_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Oklab(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Oklab(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Oklab(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_from_Oklab_PremultipliedA", + .definition = R"STR( + vec3 Coollab_sRGB_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Oklab(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_sRGB_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Oklab() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Oklab", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Oklab() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Oklab", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Oklab() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Oklab", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Oklab_StraightA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Oklab_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Oklab_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Okhsl_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Oklab() -> Function +{ + return { + .name = "Coollab_Float_from_Oklab", + .definition = R"STR( + float Coollab_Float_from_Oklab/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_Oklab(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Oklab() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Oklab", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Oklab/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_Oklab(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Oklab() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Oklab", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_Oklab(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Float_from_Oklab_StraightA", + .definition = R"STR( + float Coollab_Float_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Oklab(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Oklab_StraightA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Oklab(from.xyz); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Oklab_StraightA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Oklab_StraightA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Oklab(from.xyz); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_from_Oklab_PremultipliedA", + .definition = R"STR( + float Coollab_Float_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Oklab(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Oklab_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Oklab_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + float to = Cool_Float_from_Oklab(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Oklab_from_LinearRGB", + .definition = R"STR( + vec3 Coollab_Oklab_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_from_LinearRGB_StraightA", + .definition = R"STR( + vec3 Coollab_Oklab_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Oklab_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Oklab_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_LinearRGB_StraightA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_sRGB_from_LinearRGB", + .definition = R"STR( + vec3 Coollab_sRGB_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_from_LinearRGB_StraightA", + .definition = R"STR( + vec3 Coollab_sRGB_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_sRGB_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_sRGB_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Okhsl_from_LinearRGB", + .definition = R"STR( + vec3 Coollab_Okhsl_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_LinearRGB", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_LinearRGB_StraightA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_LinearRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Okhsl_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Float_from_LinearRGB", + .definition = R"STR( + float Coollab_Float_from_LinearRGB/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_LinearRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_LinearRGB", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_LinearRGB(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_LinearRGB() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_LinearRGB", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_LinearRGB(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Float_from_LinearRGB_StraightA", + .definition = R"STR( + float Coollab_Float_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_LinearRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_LinearRGB_StraightA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_LinearRGB(from.xyz); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_LinearRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_LinearRGB_StraightA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_LinearRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_from_LinearRGB_PremultipliedA", + .definition = R"STR( + float Coollab_Float_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_LinearRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_LinearRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_LinearRGB_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + float to = Cool_Float_from_LinearRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_sRGB() -> Function +{ + return { + .name = "Coollab_Oklab_from_sRGB", + .definition = R"STR( + vec3 Coollab_Oklab_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_sRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_sRGB() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_sRGB", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_sRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_sRGB() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_sRGB", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_sRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_from_sRGB_StraightA", + .definition = R"STR( + vec3 Coollab_Oklab_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_sRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_sRGB(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_sRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_from_sRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Oklab_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_sRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Oklab_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_sRGB() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_sRGB", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_sRGB() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_sRGB", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_sRGB() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_sRGB", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_sRGB_StraightA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_sRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_LinearRGB_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_sRGB() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_sRGB", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_sRGB() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_sRGB", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_from_sRGB_StraightA", + .definition = R"STR( + vec3 Coollab_sRGB_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_from_sRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_sRGB_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_sRGB() -> Function +{ + return { + .name = "Coollab_Okhsl_from_sRGB", + .definition = R"STR( + vec3 Coollab_Okhsl_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_sRGB() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_sRGB", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_sRGB() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_sRGB", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_sRGB_StraightA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_sRGB_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_sRGB_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Okhsl_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Okhsl_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_sRGB() -> Function +{ + return { + .name = "Coollab_Float_from_sRGB", + .definition = R"STR( + float Coollab_Float_from_sRGB/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_sRGB(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_sRGB() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_sRGB", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_sRGB/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_sRGB(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_sRGB() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_sRGB", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_sRGB(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Float_from_sRGB_StraightA", + .definition = R"STR( + float Coollab_Float_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_sRGB(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_sRGB_StraightA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_sRGB(from.xyz); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_sRGB_StraightA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_sRGB_StraightA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_sRGB(from.xyz); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_from_sRGB_PremultipliedA", + .definition = R"STR( + float Coollab_Float_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_sRGB(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_sRGB_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_sRGB_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + float to = Cool_Float_from_sRGB(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Oklab_from_Okhsl", + .definition = R"STR( + vec3 Coollab_Oklab_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_from_Okhsl_StraightA", + .definition = R"STR( + vec3 Coollab_Oklab_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Oklab_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_Oklab_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Oklab_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Okhsl() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Okhsl", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Okhsl_StraightA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_LinearRGB_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_LinearRGB_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Okhsl() -> Function +{ + return { + .name = "Coollab_sRGB_from_Okhsl", + .definition = R"STR( + vec3 Coollab_sRGB_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_from_Okhsl_StraightA", + .definition = R"STR( + vec3 Coollab_sRGB_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(from.xyz); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec3 Coollab_sRGB_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = Cool_sRGB_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_sRGB_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Okhsl", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) + { + + vec3 to = (from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Okhsl_StraightA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Okhsl_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return Cool_apply_premultiplied_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + vec3 to = (Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_color(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Float_from_Okhsl", + .definition = R"STR( + float Coollab_Float_from_Okhsl/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_Okhsl(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Okhsl", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Okhsl/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_Okhsl(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Okhsl() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Okhsl", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) + { + + float to = Cool_Float_from_Okhsl(from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Float_from_Okhsl_StraightA", + .definition = R"STR( + float Coollab_Float_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Okhsl(Cool_premultiply_color(from.xyz, from.a)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Okhsl_StraightA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Okhsl(from.xyz); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Okhsl_StraightA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Okhsl_StraightA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Okhsl(from.xyz); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_from_Okhsl_PremultipliedA", + .definition = R"STR( + float Coollab_Float_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Okhsl(from.xyz); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + float to = Cool_Float_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_straight_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Okhsl_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Okhsl_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + float to = Cool_Float_from_Okhsl(Cool_unpremultiply_color(from.xyz, from.a)); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.a); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Float() -> Function +{ + return { + .name = "Coollab_Oklab_from_Float", + .definition = R"STR( + vec3 Coollab_Oklab_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_Oklab_from_Float(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Float() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Float", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_Oklab_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Float() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Float", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_Oklab_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_from_Float_StraightA", + .definition = R"STR( + vec3 Coollab_Oklab_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Oklab_from_Float(Cool_premultiply_greyscale(from.x, from.y)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Oklab_from_Float(from.x); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Oklab_from_Float(from.x); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_from_Float_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Oklab_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Oklab_from_Float(from.x); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_StraightA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_StraightA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Oklab_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Oklab_PremultipliedA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Oklab_PremultipliedA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Oklab_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Oklab_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Float() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Float", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_LinearRGB_from_Float(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Float() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Float", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_LinearRGB_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Float() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Float", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_LinearRGB_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Float_StraightA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_LinearRGB_from_Float(Cool_premultiply_greyscale(from.x, from.y)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_LinearRGB_from_Float(from.x); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_LinearRGB_from_Float(from.x); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_from_Float_PremultipliedA", + .definition = R"STR( + vec3 Coollab_LinearRGB_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_LinearRGB_from_Float(from.x); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_StraightA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_StraightA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_LinearRGB_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_LinearRGB_PremultipliedA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_LinearRGB_PremultipliedA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_LinearRGB_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_LinearRGB_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Float() -> Function +{ + return { + .name = "Coollab_sRGB_from_Float", + .definition = R"STR( + vec3 Coollab_sRGB_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_sRGB_from_Float(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Float() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Float", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_sRGB_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Float() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Float", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_sRGB_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_from_Float_StraightA", + .definition = R"STR( + vec3 Coollab_sRGB_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_sRGB_from_Float(Cool_premultiply_greyscale(from.x, from.y)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_sRGB_from_Float(from.x); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_sRGB_from_Float(from.x); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_from_Float_PremultipliedA", + .definition = R"STR( + vec3 Coollab_sRGB_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_sRGB_from_Float(from.x); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_StraightA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_StraightA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_sRGB_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_sRGB_PremultipliedA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_sRGB_PremultipliedA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_sRGB_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_sRGB_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Float() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Float", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_Okhsl_from_Float(from); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Float() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Float", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_Okhsl_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Float() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Float", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Float/*coollabdef*/(float from) + { + + vec3 to = Cool_Okhsl_from_Float(from); + return vec4(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Float_StraightA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Okhsl_from_Float(Cool_premultiply_greyscale(from.x, from.y)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Okhsl_from_Float(from.x); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Float_StraightA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Okhsl_from_Float(from.x); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_from_Float_PremultipliedA", + .definition = R"STR( + vec3 Coollab_Okhsl_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Okhsl_from_Float(from.x); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_StraightA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_StraightA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + vec3 to = Cool_Okhsl_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_straight_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Okhsl_PremultipliedA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Okhsl_PremultipliedA_from_Float_PremultipliedA", + .definition = R"STR( + vec4 Coollab_Okhsl_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + // We need to unpremultiply for the color conversion, and re-premultiply afterwards + vec3 to = Cool_Okhsl_from_Float(Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_premultiplied_alpha_to_color(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Float() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Float", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Float/*coollabdef*/(float from) + { + + float to = (from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Float() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Float", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Float/*coollabdef*/(float from) + { + + float to = (from); + return vec2(to, 1.); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Float_from_Float_StraightA", + .definition = R"STR( + float Coollab_Float_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + float to = (Cool_premultiply_greyscale(from.x, from.y)); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Float_StraightA", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) + { + + float to = (from.x); + return Cool_apply_premultiplied_alpha_to_greyscale(to, from.y); + + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_from_Float_PremultipliedA", + .definition = R"STR( + float Coollab_Float_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + float to = (from.x); + return to; + + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Float_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) + { + + float to = (Cool_unpremultiply_greyscale(from.x, from.y)); + return Cool_apply_straight_alpha_to_greyscale(to, from.y); + + } + )STR", + }; +} diff --git a/src/Module_Nodes/generated/def_implicit_conversions.inl b/src/Module_Nodes/generated/def_implicit_conversions.inl new file mode 100644 index 00000000..7bb37d32 --- /dev/null +++ b/src/Module_Nodes/generated/def_implicit_conversions.inl @@ -0,0 +1,427 @@ +/* ----------------------------------------------------------------------------- + * This file was automatically generated by a Python script. + * PLEASE DON'T EDIT IT DIRECTLY, your changes would be overwritten the next time the script is run. + * Instead, go to "gen_primitive_types.py" and edit the "def_implicit_conversions" function there. + * ----------------------------------------------------------------------------- + */ + +static auto gen_Coollab_Angle_from_Float() -> Function +{ + return { + .name = "Coollab_Angle_from_Float", + .definition = R"STR( + float Coollab_Angle_from_Float/*coollabdef*/(float x) + { + return x * TAU; + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Angle() -> Function +{ + return { + .name = "Coollab_Float_from_Angle", + .definition = R"STR( + float Coollab_Float_from_Angle/*coollabdef*/(float angle) + { + return angle / TAU; + } + )STR", + }; +} + +static auto gen_Coollab_Hue_from_Float() -> Function +{ + return { + .name = "Coollab_Hue_from_Float", + .definition = R"STR( + float Coollab_Hue_from_Float/*coollabdef*/(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Hue() -> Function +{ + return { + .name = "Coollab_Float_from_Hue", + .definition = R"STR( + float Coollab_Float_from_Hue/*coollabdef*/(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + )STR", + }; +} + +static auto gen_Coollab_Int_from_Float() -> Function +{ + return { + .name = "Coollab_Int_from_Float", + .definition = R"STR( + int Coollab_Int_from_Float/*coollabdef*/(float x) + { + return int(floor(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Int() -> Function +{ + return { + .name = "Coollab_Float_from_Int", + .definition = R"STR( + float Coollab_Float_from_Int/*coollabdef*/(int x) + { + return float(x); + } + )STR", + }; +} + +static auto gen_Coollab_Bool_from_Float() -> Function +{ + return { + .name = "Coollab_Bool_from_Float", + .definition = R"STR( + bool Coollab_Bool_from_Float/*coollabdef*/(float x) + { + return x > 0.5; + } + )STR", + }; +} + +static auto gen_Coollab_Float_from_Bool() -> Function +{ + return { + .name = "Coollab_Float_from_Bool", + .definition = R"STR( + float Coollab_Float_from_Bool/*coollabdef*/(bool b) + { + return b ? 1. : 0.; + } + )STR", + }; +} + +static auto gen_Coollab_Direction2D_from_Angle() -> Function +{ + return { + .name = "Coollab_Direction2D_from_Angle", + .definition = R"STR( + vec2 Coollab_Direction2D_from_Angle/*coollabdef*/(float angle) + { + return vec2(cos(angle), sin(angle)); + } + )STR", + }; +} + +static auto gen_Coollab_Direction2D_from_Float() -> Function +{ + return { + .name = "Coollab_Direction2D_from_Float", + .definition = R"STR( + vec2 Coollab_Direction2D_from_Float/*coollabdef*/(float x) + { + float angle = x * TAU; + return vec2(cos(angle), sin(angle)); + } + )STR", + }; +} + +static auto gen_Coollab_Angle_from_Direction2D() -> Function +{ + return { + .name = "Coollab_Angle_from_Direction2D", + .definition = R"STR( + float Coollab_Angle_from_Direction2D/*coollabdef*/(vec2 dir) + { + return dir.x != 0.f + ? atan(dir.y, dir.x) + : dir.y > 0. + ? PI / 2. + : -PI / 2.; + } + )STR", + }; +} + +static auto gen_Coollab_Vec2_from_UV() -> Function +{ + return { + .name = "Coollab_Vec2_from_UV", + .definition = R"STR( + float Coollab_Vec2_from_UV/*coollabdef*/(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + )STR", + }; +} + +static auto gen_Coollab_UV_from_Vec2() -> Function +{ + return { + .name = "Coollab_UV_from_Vec2", + .definition = R"STR( + float Coollab_UV_from_Vec2/*coollabdef*/(float x) + { + return x; // No need to do anything for this conversion, the difference is purely semantic. + } + )STR", + }; +} + +static auto gen_Coollab_UV_from_Void() -> Function +{ + return { + .name = "Coollab_UV_from_Void", + .definition = R"STR( + vec2 Coollab_UV_from_Void/*coollabdef*/() + { + return coollab_context.uv; + } + )STR", + }; +} + +static auto gen_Coollab_Angle_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Angle_from_Float_StraightA", + .definition = R"STR( + float Coollab_Angle_from_Float_StraightA/*coollabdef*/(vec2 x) + { + return Coollab_Angle_from_Float(Coollab_Float_from_Float_StraightA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Angle_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Angle_from_Float_PremultipliedA", + .definition = R"STR( + float Coollab_Angle_from_Float_PremultipliedA/*coollabdef*/(vec2 x) + { + return Coollab_Angle_from_Float(Coollab_Float_from_Float_PremultipliedA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Angle() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Angle", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Angle/*coollabdef*/(float x) + { + return Coollab_Float_StraightA_from_Float(Coollab_Float_from_Angle(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Angle() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Angle", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Angle/*coollabdef*/(float x) + { + return Coollab_Float_PremultipliedA_from_Float(Coollab_Float_from_Angle(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Hue_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Hue_from_Float_StraightA", + .definition = R"STR( + float Coollab_Hue_from_Float_StraightA/*coollabdef*/(vec2 x) + { + return Coollab_Hue_from_Float(Coollab_Float_from_Float_StraightA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Hue_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Hue_from_Float_PremultipliedA", + .definition = R"STR( + float Coollab_Hue_from_Float_PremultipliedA/*coollabdef*/(vec2 x) + { + return Coollab_Hue_from_Float(Coollab_Float_from_Float_PremultipliedA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Hue() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Hue", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Hue/*coollabdef*/(float x) + { + return Coollab_Float_StraightA_from_Float(Coollab_Float_from_Hue(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Hue() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Hue", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Hue/*coollabdef*/(float x) + { + return Coollab_Float_PremultipliedA_from_Float(Coollab_Float_from_Hue(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Int_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Int_from_Float_StraightA", + .definition = R"STR( + int Coollab_Int_from_Float_StraightA/*coollabdef*/(vec2 x) + { + return Coollab_Int_from_Float(Coollab_Float_from_Float_StraightA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Int_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Int_from_Float_PremultipliedA", + .definition = R"STR( + int Coollab_Int_from_Float_PremultipliedA/*coollabdef*/(vec2 x) + { + return Coollab_Int_from_Float(Coollab_Float_from_Float_PremultipliedA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Int() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Int", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Int/*coollabdef*/(int x) + { + return Coollab_Float_StraightA_from_Float(Coollab_Float_from_Int(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Int() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Int", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Int/*coollabdef*/(int x) + { + return Coollab_Float_PremultipliedA_from_Float(Coollab_Float_from_Int(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Bool_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Bool_from_Float_StraightA", + .definition = R"STR( + bool Coollab_Bool_from_Float_StraightA/*coollabdef*/(vec2 x) + { + return Coollab_Bool_from_Float(Coollab_Float_from_Float_StraightA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Bool_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Bool_from_Float_PremultipliedA", + .definition = R"STR( + bool Coollab_Bool_from_Float_PremultipliedA/*coollabdef*/(vec2 x) + { + return Coollab_Bool_from_Float(Coollab_Float_from_Float_PremultipliedA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_StraightA_from_Bool() -> Function +{ + return { + .name = "Coollab_Float_StraightA_from_Bool", + .definition = R"STR( + vec2 Coollab_Float_StraightA_from_Bool/*coollabdef*/(bool x) + { + return Coollab_Float_StraightA_from_Float(Coollab_Float_from_Bool(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Float_PremultipliedA_from_Bool() -> Function +{ + return { + .name = "Coollab_Float_PremultipliedA_from_Bool", + .definition = R"STR( + vec2 Coollab_Float_PremultipliedA_from_Bool/*coollabdef*/(bool x) + { + return Coollab_Float_PremultipliedA_from_Float(Coollab_Float_from_Bool(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Direction2D_from_Float_StraightA() -> Function +{ + return { + .name = "Coollab_Direction2D_from_Float_StraightA", + .definition = R"STR( + vec2 Coollab_Direction2D_from_Float_StraightA/*coollabdef*/(vec2 x) + { + return Coollab_Direction2D_from_Float(Coollab_Float_from_Float_StraightA(x)); + } + )STR", + }; +} + +static auto gen_Coollab_Direction2D_from_Float_PremultipliedA() -> Function +{ + return { + .name = "Coollab_Direction2D_from_Float_PremultipliedA", + .definition = R"STR( + vec2 Coollab_Direction2D_from_Float_PremultipliedA/*coollabdef*/(vec2 x) + { + return Coollab_Direction2D_from_Float(Coollab_Float_from_Float_PremultipliedA(x)); + } + )STR", + }; +} diff --git a/src/Module_Nodes/generated/implicit_color_conversions.inl b/src/Module_Nodes/generated/implicit_color_conversions.inl index 6ca48ad2..d5e4e99e 100644 --- a/src/Module_Nodes/generated/implicit_color_conversions.inl +++ b/src/Module_Nodes/generated/implicit_color_conversions.inl @@ -7,3380 +7,1050 @@ if (from == PrimitiveType::Oklab && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Oklab", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Oklab", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Oklab()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Oklab_StraightA", - .definition = R"STR( - vec3 Coollab_Oklab_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Oklab_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Oklab_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Oklab", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Oklab", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Oklab", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Oklab()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Oklab_StraightA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Oklab_PremultipliedA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_LinearRGB_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Oklab", - .definition = R"STR( - vec3 Coollab_sRGB_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_Oklab(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Oklab", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_Oklab(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Oklab", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_Oklab(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Oklab()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Oklab_StraightA", - .definition = R"STR( - vec3 Coollab_sRGB_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Oklab(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Oklab(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Oklab(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Oklab_PremultipliedA", - .definition = R"STR( - vec3 Coollab_sRGB_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Oklab(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_sRGB_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Oklab", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Oklab", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Oklab", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Oklab()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Oklab_StraightA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Oklab_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Oklab_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Okhsl_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Oklab", - .definition = R"STR( - float Coollab_Float_from_Oklab/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_Oklab(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Oklab", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Oklab/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_Oklab(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Oklab()); } if (from == PrimitiveType::Oklab && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Oklab", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Oklab/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_Oklab(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Oklab()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Oklab_StraightA", - .definition = R"STR( - float Coollab_Float_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Oklab(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Oklab_StraightA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Oklab(from.xyz); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_StraightA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Oklab_StraightA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Oklab_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Oklab(from.xyz); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Oklab_StraightA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Oklab_PremultipliedA", - .definition = R"STR( - float Coollab_Float_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Oklab(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::Oklab_PremultipliedA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Oklab_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Oklab_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - float to = Cool_Float_from_Oklab(unpremultiply(from.xyz, from.a)); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Oklab_PremultipliedA()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_LinearRGB", - .definition = R"STR( - vec3 Coollab_Oklab_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_LinearRGB_StraightA", - .definition = R"STR( - vec3 Coollab_Oklab_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Oklab_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Oklab_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_LinearRGB_StraightA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_LinearRGB", - .definition = R"STR( - vec3 Coollab_sRGB_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_LinearRGB_StraightA", - .definition = R"STR( - vec3 Coollab_sRGB_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_sRGB_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_sRGB_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_LinearRGB", - .definition = R"STR( - vec3 Coollab_Okhsl_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_LinearRGB", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_LinearRGB_StraightA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_LinearRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Okhsl_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_LinearRGB", - .definition = R"STR( - float Coollab_Float_from_LinearRGB/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_LinearRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_LinearRGB", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_LinearRGB(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_LinearRGB", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_LinearRGB/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_LinearRGB(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_LinearRGB()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_LinearRGB_StraightA", - .definition = R"STR( - float Coollab_Float_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_LinearRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_LinearRGB_StraightA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_LinearRGB(from.xyz); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_StraightA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_LinearRGB_StraightA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_LinearRGB_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_LinearRGB(from.xyz); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_LinearRGB_StraightA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_LinearRGB_PremultipliedA", - .definition = R"STR( - float Coollab_Float_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::LinearRGB_PremultipliedA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_LinearRGB_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_LinearRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - float to = Cool_Float_from_LinearRGB(unpremultiply(from.xyz, from.a)); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_LinearRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_sRGB", - .definition = R"STR( - vec3 Coollab_Oklab_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_sRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_sRGB", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_sRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_sRGB", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_sRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_sRGB()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_sRGB_StraightA", - .definition = R"STR( - vec3 Coollab_Oklab_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_sRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_sRGB(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_sRGB(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_sRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Oklab_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_sRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Oklab_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_sRGB", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_sRGB", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_sRGB", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_sRGB()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_sRGB_StraightA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_sRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_LinearRGB_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_sRGB", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_sRGB", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_sRGB()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_sRGB_StraightA", - .definition = R"STR( - vec3 Coollab_sRGB_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_sRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_sRGB_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_sRGB", - .definition = R"STR( - vec3 Coollab_Okhsl_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_sRGB", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_sRGB", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_sRGB()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_sRGB_StraightA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_sRGB_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_sRGB_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Okhsl_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Okhsl_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_sRGB", - .definition = R"STR( - float Coollab_Float_from_sRGB/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_sRGB(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_sRGB", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_sRGB/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_sRGB(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_sRGB()); } if (from == PrimitiveType::sRGB && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_sRGB", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_sRGB/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_sRGB(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_sRGB()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_sRGB_StraightA", - .definition = R"STR( - float Coollab_Float_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_sRGB(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_sRGB_StraightA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_sRGB(from.xyz); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_StraightA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_sRGB_StraightA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_sRGB_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_sRGB(from.xyz); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_sRGB_StraightA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_sRGB_PremultipliedA", - .definition = R"STR( - float Coollab_Float_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_sRGB(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::sRGB_PremultipliedA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_sRGB_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_sRGB_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - float to = Cool_Float_from_sRGB(unpremultiply(from.xyz, from.a)); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_sRGB_PremultipliedA()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Okhsl", - .definition = R"STR( - vec3 Coollab_Oklab_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Okhsl()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Okhsl_StraightA", - .definition = R"STR( - vec3 Coollab_Oklab_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Oklab_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_Oklab_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Oklab_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Okhsl", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Okhsl()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Okhsl_StraightA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_LinearRGB_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_LinearRGB_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Okhsl", - .definition = R"STR( - vec3 Coollab_sRGB_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Okhsl()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Okhsl_StraightA", - .definition = R"STR( - vec3 Coollab_sRGB_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(from.xyz); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec3 Coollab_sRGB_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = Cool_sRGB_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_sRGB_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Okhsl", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) - { - - vec3 to = (from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Okhsl()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Okhsl_StraightA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Okhsl_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - vec3 to = (from.xyz); - return vec4(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - vec3 to = (unpremultiply(from.xyz, from.a)); - return vec4(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Okhsl", - .definition = R"STR( - float Coollab_Float_from_Okhsl/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_Okhsl(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Okhsl", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Okhsl/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_Okhsl(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Okhsl()); } if (from == PrimitiveType::Okhsl && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Okhsl", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Okhsl/*coollabdef*/(vec3 from) - { - - float to = Cool_Float_from_Okhsl(from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Okhsl()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Okhsl_StraightA", - .definition = R"STR( - float Coollab_Float_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Okhsl(from.xyz); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Okhsl_StraightA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Okhsl(from.xyz); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_StraightA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Okhsl_StraightA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Okhsl_StraightA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Okhsl(from.xyz); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Okhsl_StraightA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Okhsl_PremultipliedA", - .definition = R"STR( - float Coollab_Float_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Okhsl(unpremultiply(from.xyz, from.a)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - float to = Cool_Float_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec2(to, from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Okhsl_PremultipliedA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Okhsl_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Okhsl_PremultipliedA/*coollabdef*/(vec4 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - float to = Cool_Float_from_Okhsl(unpremultiply(from.xyz, from.a)); - return vec2(premultiply(to, from.a), from.a); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Okhsl_PremultipliedA()); } if (from == PrimitiveType::Float && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Float", - .definition = R"STR( - vec3 Coollab_Oklab_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_Oklab_from_Float(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Float", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_Oklab_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Float", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_Oklab_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Float()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Float_StraightA", - .definition = R"STR( - vec3 Coollab_Oklab_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Oklab_from_Float(from.x); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Oklab_from_Float(from.x); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Oklab_from_Float(from.x); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Float_StraightA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Oklab) { - return context.push_function({ - .name = "Coollab_Oklab_from_Float_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Oklab_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Oklab_from_Float(unpremultiply(from.x, from.y)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Oklab_StraightA) { - return context.push_function({ - .name = "Coollab_Oklab_StraightA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Oklab_from_Float(unpremultiply(from.x, from.y)); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_StraightA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Oklab_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Oklab_PremultipliedA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Oklab_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Oklab_from_Float(unpremultiply(from.x, from.y)); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Oklab_PremultipliedA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Float", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_LinearRGB_from_Float(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Float", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_LinearRGB_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Float", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_LinearRGB_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Float()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Float_StraightA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_LinearRGB_from_Float(from.x); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_LinearRGB_from_Float(from.x); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_LinearRGB_from_Float(from.x); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Float_StraightA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::LinearRGB) { - return context.push_function({ - .name = "Coollab_LinearRGB_from_Float_PremultipliedA", - .definition = R"STR( - vec3 Coollab_LinearRGB_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_LinearRGB_from_Float(unpremultiply(from.x, from.y)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::LinearRGB_StraightA) { - return context.push_function({ - .name = "Coollab_LinearRGB_StraightA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_LinearRGB_from_Float(unpremultiply(from.x, from.y)); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_StraightA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::LinearRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_LinearRGB_PremultipliedA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_LinearRGB_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_LinearRGB_from_Float(unpremultiply(from.x, from.y)); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_LinearRGB_PremultipliedA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Float", - .definition = R"STR( - vec3 Coollab_sRGB_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_sRGB_from_Float(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Float", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_sRGB_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Float", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_sRGB_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Float()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Float_StraightA", - .definition = R"STR( - vec3 Coollab_sRGB_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_sRGB_from_Float(from.x); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_sRGB_from_Float(from.x); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_sRGB_from_Float(from.x); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Float_StraightA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::sRGB) { - return context.push_function({ - .name = "Coollab_sRGB_from_Float_PremultipliedA", - .definition = R"STR( - vec3 Coollab_sRGB_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_sRGB_from_Float(unpremultiply(from.x, from.y)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::sRGB_StraightA) { - return context.push_function({ - .name = "Coollab_sRGB_StraightA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_sRGB_from_Float(unpremultiply(from.x, from.y)); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_StraightA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::sRGB_PremultipliedA) { - return context.push_function({ - .name = "Coollab_sRGB_PremultipliedA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_sRGB_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_sRGB_from_Float(unpremultiply(from.x, from.y)); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_sRGB_PremultipliedA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Float", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_Okhsl_from_Float(from); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Float", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_Okhsl_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Float", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Float/*coollabdef*/(float from) - { - - vec3 to = Cool_Okhsl_from_Float(from); - return vec4(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Float()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Float_StraightA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Okhsl_from_Float(from.x); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Okhsl_from_Float(from.x); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Float_StraightA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Okhsl_from_Float(from.x); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Float_StraightA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Okhsl) { - return context.push_function({ - .name = "Coollab_Okhsl_from_Float_PremultipliedA", - .definition = R"STR( - vec3 Coollab_Okhsl_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Okhsl_from_Float(unpremultiply(from.x, from.y)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Okhsl_StraightA) { - return context.push_function({ - .name = "Coollab_Okhsl_StraightA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - vec3 to = Cool_Okhsl_from_Float(unpremultiply(from.x, from.y)); - return vec4(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_StraightA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Okhsl_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Okhsl_PremultipliedA_from_Float_PremultipliedA", - .definition = R"STR( - vec4 Coollab_Okhsl_PremultipliedA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - // We need to unpremultiply for the color conversion, and re-premultiply afterwards - vec3 to = Cool_Okhsl_from_Float(unpremultiply(from.x, from.y)); - return vec4(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Okhsl_PremultipliedA_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Float", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Float/*coollabdef*/(float from) - { - - float to = (from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Float()); } if (from == PrimitiveType::Float && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Float", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Float/*coollabdef*/(float from) - { - - float to = (from); - return vec2(to, 1.); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Float()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Float_StraightA", - .definition = R"STR( - float Coollab_Float_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - float to = (from.x); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Float_StraightA()); } if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Float_PremultipliedA) { - return context.push_function({ - .name = "Coollab_Float_PremultipliedA_from_Float_StraightA", - .definition = R"STR( - vec2 Coollab_Float_PremultipliedA_from_Float_StraightA/*coollabdef*/(vec2 from) - { - - float to = (from.x); - return vec2(premultiply(to, from.y), from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Float_StraightA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Float_from_Float_PremultipliedA", - .definition = R"STR( - float Coollab_Float_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - float to = (unpremultiply(from.x, from.y)); - return to; - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_from_Float_PremultipliedA()); } if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Float_StraightA) { - return context.push_function({ - .name = "Coollab_Float_StraightA_from_Float_PremultipliedA", - .definition = R"STR( - vec2 Coollab_Float_StraightA_from_Float_PremultipliedA/*coollabdef*/(vec2 from) - { - - float to = (unpremultiply(from.x, from.y)); - return vec2(to, from.y); - - } - )STR", - }); + return context.push_function(gen_Coollab_Float_StraightA_from_Float_PremultipliedA()); } diff --git a/src/Module_Nodes/generated/implicit_conversions.inl b/src/Module_Nodes/generated/implicit_conversions.inl index 9426610a..caa089cf 100644 --- a/src/Module_Nodes/generated/implicit_conversions.inl +++ b/src/Module_Nodes/generated/implicit_conversions.inl @@ -7,147 +7,210 @@ if (from == PrimitiveType::Float && to == PrimitiveType::Angle) { - return context.push_function({ - .name = "Coollab_Float_to_Angle", - .definition = R"STR( - float Coollab_Float_to_Angle/*coollabdef*/(float x) - { - return x * TAU; - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Angle_from_Float()); } if (from == PrimitiveType::Angle && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Angle_to_Float", - .definition = R"STR( - float Coollab_Angle_to_Float/*coollabdef*/(float angle) - { - return angle / TAU; - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Float_from_Angle()); } if (from == PrimitiveType::Float && to == PrimitiveType::Hue) - return ""; // No need to do anything for this conversion, the difference is purely semantic. +{ + ; + return context.push_function(gen_Coollab_Hue_from_Float()); +} if (from == PrimitiveType::Hue && to == PrimitiveType::Float) - return ""; // No need to do anything for this conversion, the difference is purely semantic. +{ + ; + return context.push_function(gen_Coollab_Float_from_Hue()); +} if (from == PrimitiveType::Float && to == PrimitiveType::Int) { - return context.push_function({ - .name = "Coollab_Float_to_Int", - .definition = R"STR( - int Coollab_Float_to_Int/*coollabdef*/(float x) - { - return int(floor(x)); - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Int_from_Float()); } if (from == PrimitiveType::Int && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Int_to_Float", - .definition = R"STR( - float Coollab_Int_to_Float/*coollabdef*/(int x) - { - return float(x); - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Float_from_Int()); } if (from == PrimitiveType::Float && to == PrimitiveType::Bool) { - return context.push_function({ - .name = "Coollab_Float_to_Bool", - .definition = R"STR( - bool Coollab_Float_to_Bool/*coollabdef*/(float x) - { - return x > 0.5; - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Bool_from_Float()); } if (from == PrimitiveType::Bool && to == PrimitiveType::Float) { - return context.push_function({ - .name = "Coollab_Bool_to_Float", - .definition = R"STR( - float Coollab_Bool_to_Float/*coollabdef*/(bool b) - { - return b ? 1. : 0.; - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Float_from_Bool()); } if (from == PrimitiveType::Angle && to == PrimitiveType::Direction2D) { - return context.push_function({ - .name = "Coollab_Angle_to_Direction2D", - .definition = R"STR( - vec2 Coollab_Angle_to_Direction2D/*coollabdef*/(float angle) - { - return vec2(cos(angle), sin(angle)); - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Direction2D_from_Angle()); } if (from == PrimitiveType::Float && to == PrimitiveType::Direction2D) { - return context.push_function({ - .name = "Coollab_Float_to_Direction2D", - .definition = R"STR( - vec2 Coollab_Float_to_Direction2D/*coollabdef*/(float x) - { - float angle = x * TAU; - return vec2(cos(angle), sin(angle)); - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Direction2D_from_Float()); } if (from == PrimitiveType::Direction2D && to == PrimitiveType::Angle) { - return context.push_function({ - .name = "Coollab_Direction2D_to_Angle", - .definition = R"STR( - float Coollab_Direction2D_to_Angle/*coollabdef*/(vec2 dir) - { - return dir.x != 0.f - ? atan(dir.y, dir.x) - : dir.y > 0. - ? PI / 2. - : -PI / 2.; - } - )STR", - }); + ; + return context.push_function(gen_Coollab_Angle_from_Direction2D()); } if (from == PrimitiveType::UV && to == PrimitiveType::Vec2) - return ""; // No need to do anything for this conversion, the difference is purely semantic. +{ + ; + return context.push_function(gen_Coollab_Vec2_from_UV()); +} if (from == PrimitiveType::Vec2 && to == PrimitiveType::UV) - return ""; // No need to do anything for this conversion, the difference is purely semantic. +{ + ; + return context.push_function(gen_Coollab_UV_from_Vec2()); +} if (from == PrimitiveType::Void && to == PrimitiveType::UV) { - return context.push_function({ - .name = "Coollab_Void_to_UV", - .definition = R"STR( - vec2 Coollab_Void_to_UV/*coollabdef*/() - { - return coollab_context.uv; - } - )STR", - }); + ; + return context.push_function(gen_Coollab_UV_from_Void()); +} + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Angle) +{ + context.push_function(gen_Coollab_Angle_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_StraightA()); + return context.push_function(gen_Coollab_Angle_from_Float_StraightA()); +} + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Angle) +{ + context.push_function(gen_Coollab_Angle_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_PremultipliedA()); + return context.push_function(gen_Coollab_Angle_from_Float_PremultipliedA()); +} + +if (from == PrimitiveType::Angle && to == PrimitiveType::Float_StraightA) +{ + context.push_function(gen_Coollab_Float_StraightA_from_Float()); + context.push_function(gen_Coollab_Float_from_Angle()); + return context.push_function(gen_Coollab_Float_StraightA_from_Angle()); +} + +if (from == PrimitiveType::Angle && to == PrimitiveType::Float_PremultipliedA) +{ + context.push_function(gen_Coollab_Float_PremultipliedA_from_Float()); + context.push_function(gen_Coollab_Float_from_Angle()); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Angle()); +} + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Hue) +{ + context.push_function(gen_Coollab_Hue_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_StraightA()); + return context.push_function(gen_Coollab_Hue_from_Float_StraightA()); +} + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Hue) +{ + context.push_function(gen_Coollab_Hue_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_PremultipliedA()); + return context.push_function(gen_Coollab_Hue_from_Float_PremultipliedA()); +} + +if (from == PrimitiveType::Hue && to == PrimitiveType::Float_StraightA) +{ + context.push_function(gen_Coollab_Float_StraightA_from_Float()); + context.push_function(gen_Coollab_Float_from_Hue()); + return context.push_function(gen_Coollab_Float_StraightA_from_Hue()); +} + +if (from == PrimitiveType::Hue && to == PrimitiveType::Float_PremultipliedA) +{ + context.push_function(gen_Coollab_Float_PremultipliedA_from_Float()); + context.push_function(gen_Coollab_Float_from_Hue()); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Hue()); +} + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Int) +{ + context.push_function(gen_Coollab_Int_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_StraightA()); + return context.push_function(gen_Coollab_Int_from_Float_StraightA()); +} + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Int) +{ + context.push_function(gen_Coollab_Int_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_PremultipliedA()); + return context.push_function(gen_Coollab_Int_from_Float_PremultipliedA()); +} + +if (from == PrimitiveType::Int && to == PrimitiveType::Float_StraightA) +{ + context.push_function(gen_Coollab_Float_StraightA_from_Float()); + context.push_function(gen_Coollab_Float_from_Int()); + return context.push_function(gen_Coollab_Float_StraightA_from_Int()); +} + +if (from == PrimitiveType::Int && to == PrimitiveType::Float_PremultipliedA) +{ + context.push_function(gen_Coollab_Float_PremultipliedA_from_Float()); + context.push_function(gen_Coollab_Float_from_Int()); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Int()); +} + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Bool) +{ + context.push_function(gen_Coollab_Bool_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_StraightA()); + return context.push_function(gen_Coollab_Bool_from_Float_StraightA()); +} + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Bool) +{ + context.push_function(gen_Coollab_Bool_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_PremultipliedA()); + return context.push_function(gen_Coollab_Bool_from_Float_PremultipliedA()); +} + +if (from == PrimitiveType::Bool && to == PrimitiveType::Float_StraightA) +{ + context.push_function(gen_Coollab_Float_StraightA_from_Float()); + context.push_function(gen_Coollab_Float_from_Bool()); + return context.push_function(gen_Coollab_Float_StraightA_from_Bool()); +} + +if (from == PrimitiveType::Bool && to == PrimitiveType::Float_PremultipliedA) +{ + context.push_function(gen_Coollab_Float_PremultipliedA_from_Float()); + context.push_function(gen_Coollab_Float_from_Bool()); + return context.push_function(gen_Coollab_Float_PremultipliedA_from_Bool()); +} + +if (from == PrimitiveType::Float_StraightA && to == PrimitiveType::Direction2D) +{ + context.push_function(gen_Coollab_Direction2D_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_StraightA()); + return context.push_function(gen_Coollab_Direction2D_from_Float_StraightA()); +} + +if (from == PrimitiveType::Float_PremultipliedA && to == PrimitiveType::Direction2D) +{ + context.push_function(gen_Coollab_Direction2D_from_Float()); + context.push_function(gen_Coollab_Float_from_Float_PremultipliedA()); + return context.push_function(gen_Coollab_Direction2D_from_Float_PremultipliedA()); }