brushcue
Examples
- 1950s Filter
- 1960s Filter
- 1970s Filter
- 1980s Filter
- 1990s Filter
- 2000s Filter
- 2010s Filter
- Add Frame
- Adjust Channels
- Afternoon Filter
- Amber Plains
- Auto Contrast
- Autumn Filter
- Black And White Negative Filter
- Bloom
- Blue Channel
- Blue Hour Filter
- Blur Reveal Animation
- Box Blur
- Brightness Adjust
- Brightness Contrast Adjust
- Camera Moving Distortion
- Canopy Light
- Cartoon Filter
- Channel Mixer
- Chroma Offset
- Circle Area
- Circle Crop
- Coachella Aesthetic
- Color Gradient
- Color Invert
- Color Rectangle
- Color Reducer
- Color Threshold
- Conic Gradient
- Contrast Adjust
- Convert To BT 709
- Convert To Display P3
- Convert To sRGB
- Coquette Filter
- Cosine Degrees
- Cosine Radians
- Cottagecore Filter
- Crop 16 9
- Crop 4 5
- Crop 9 16
- Cross Process Filter
- CRT Monitor Filter
- Custom Color Shader
- Custom Spacial Shader
- Cyan Nocturne
- Cyberpunk Filter
- Dark Academia Filter
- Darken
- Dawn Filter
- Degrees To Radians
- Desert Frame
- Desert Mirage Filter
- Dilate
- Dithering Effect
- Drift Animation
- Duotone Effect
- Ellipse Area
- Ember Rock
- Emboss
- Erode
- Exposure Adjust
- Fade Filter
- Faded Postcard
- Film Grain
- Film Noir
- Fisheye
- Frost Line
- Gamma Adjust
- Gaussian Blur
- Glitch Filter Animation
- Golden Hour Filter
- Grayscale Gradient
- Grayscale
- Green Channel
- Grunge Filter
- Halftone
- High Contrast Grayscale
- Honey Hour
- Horizontal Mirror
- Hue Adjust
- Image Resizer
- Image To Video
- Indie Sleaze Filter
- Kaleidoscope Animation
- Kaleidoscope
- Kelvin Tuner
- Light Leak
- Lighten
- Lightness Threshold
- Linear Transform
- Liquify
- Matte Filter
- Median Filter
- Midnight Filter
- Milk Glass
- Morning Filter
- Negative Filter
- Noon Filter
- Old Money Filter
- Opacity Scale
- Parallelogram Area
- Peachfeed
- Pencil Sketch
- Petal Haze
- Pixelate Reveal Animation
- Pixelate
- Powder Blue
- Pythagorean Theorem
- Radial Gradient
- Radians To Degrees
- Rectangle Area
- Red Channel
- Reef Current
- RGB Color Mix Aesthetic
- RGB Color Shift
- Riviera Pop
- Rose Replay
- Rose Tint
- Rotate 180
- Rotate 90 Clockwise
- Rotate 90 Counter Clockwise
- Rotate Straighten
- Salt Flat
- Saturation Adjust
- Scale By Factor
- Scan Lines
- Sepia
- Shadow Tint
- Sharpen
- Silverpine 800
- Sine Degrees
- Sine Radians
- Sobel Edge Detection
- Solarize
- Solpeach 400
- Sootline Mono
- Spinning Reveal Animation
- Spring Filter
- Square Area
- Square Crop
- Star Cut Out
- Static Noise
- Summer Filter
- Summit Air
- Sunday 76
- Sunset Filter
- Swirl
- Terracotta Sun
- Tint Toward Color
- Trapezoid Area
- Triangle Area
- Tropic Chrome
- Vaporwave Filter
- Verdant Mist
- Vertical Mirror
- Vibrancy
- Vignette
- Vintage Filter
- Warmth Adjust
- Watercolor Effect
- Whiten Image
- Winter Filter
- Y2k Filter
- Zoom Blur
1# (c) Dito Technologies LLC. Auto-generated. Do not modify directly. 2# hash: 8ec5d96ea23900fe6f3494e02d28694ef22c2536cf1393fcd37ea597d535aad4 3# generated from templates/py_brushcue_init.jinja 4 5from __future__ import annotations 6 7"""Typed Python bindings for BrushCue graph construction.""" 8 9from . import _py as _internal 10from ._graph import Project 11from .fn import brushcue_fn 12from ._py import ( 13 Bounds, 14 Context, 15 ImageRecipe, 16 MovieRecipe, 17 TypeDefinition, 18) 19from . import input_parsers 20 21def float_list_empty() -> FloatList: 22 result = _internal.float_list_empty_internal() 23 from .float_list import FloatList 24 return FloatList(result) 25 26 27def int_list_empty() -> IntList: 28 result = _internal.int_list_empty_internal() 29 from .int_list import IntList 30 return IntList(result) 31 32 33def null_value() -> Null: 34 result = _internal.null_value_internal() 35 from .null import Null 36 return Null(result) 37 38 39def point2f_list_empty() -> Point2fList: 40 result = _internal.point2f_list_empty_internal() 41 from .point2f_list import Point2fList 42 return Point2fList(result) 43 44 45def point2i_list_empty() -> Point2iList: 46 result = _internal.point2i_list_empty_internal() 47 from .point2i_list import Point2iList 48 return Point2iList(result) 49 50 51def string_list_empty() -> StringList: 52 result = _internal.string_list_empty_internal() 53 from .string_list import StringList 54 return StringList(result) 55 56 57from .bool import Bool 58 59from .bounds2f import Bounds2f 60 61from .bounds2f_list import Bounds2fList 62 63from .bounds2i import Bounds2i 64 65from .bounds2i_list import Bounds2iList 66 67from .brush import Brush 68 69from .bytes import Bytes 70 71from .color_profile import ColorProfile 72 73from .color_representation import ColorRepresentation 74 75from .composition import Composition 76 77from .curve import Curve 78 79from .dictionary import Dictionary 80 81from .fill import Fill 82 83from .float import Float 84 85from .float_list import FloatList 86 87from .image import Image 88 89from .int import Int 90 91from .int_list import IntList 92 93from .l_m_s_a import LMSA 94 95from .null import Null 96 97from .ok_lab_a import OkLabA 98 99from .ok_lab_color import OkLabColor 100 101from .ok_lab_hist import OkLabHist 102 103from .painter import Painter 104 105from .path import Path 106 107from .pixel_encoding import PixelEncoding 108 109from .point2f import Point2f 110 111from .point2f_list import Point2fList 112 113from .point2i import Point2i 114 115from .point2i_list import Point2iList 116 117from .profiled_color import ProfiledColor 118 119from .profiled_color_list import ProfiledColorList 120 121from .r_g_b_a_color import RGBAColor 122 123from .r_g_b_color import RGBColor 124 125from .render_style import RenderStyle 126 127from .sequence import Sequence 128 129from .string import String 130 131from .string_list import StringList 132 133from .transform2 import Transform2 134 135from .transform2_list import Transform2List 136 137from .vector2f import Vector2f 138 139from .vector2i import Vector2i 140 141from .vector3f import Vector3f 142 143from .void import Void 144 145from .x_y_z import XYZ 146 147from .x_y_z_a import XYZA 148 149from .any_graph import AnyGraph 150 151from .stream import Stream 152 153from .list import List 154 155from .object import Object 156 157 158from ._operators import setup_operators 159 160setup_operators() 161 162__all__ = [ 163 "Context", "Project", "brushcue_fn", "ImageRecipe", "MovieRecipe", "Bounds", "TypeDefinition", 164 165 "float_list_empty", 166 167 "int_list_empty", 168 169 "null_value", 170 171 "point2f_list_empty", 172 173 "point2i_list_empty", 174 175 "string_list_empty", 176 177 "Bool", 178 179 "Bounds2f", 180 181 "Bounds2fList", 182 183 "Bounds2i", 184 185 "Bounds2iList", 186 187 "Brush", 188 189 "Bytes", 190 191 "ColorProfile", 192 193 "ColorRepresentation", 194 195 "Composition", 196 197 "Curve", 198 199 "Dictionary", 200 201 "Fill", 202 203 "Float", 204 205 "FloatList", 206 207 "Image", 208 209 "Int", 210 211 "IntList", 212 213 "LMSA", 214 215 "Null", 216 217 "OkLabA", 218 219 "OkLabColor", 220 221 "OkLabHist", 222 223 "Painter", 224 225 "Path", 226 227 "PixelEncoding", 228 229 "Point2f", 230 231 "Point2fList", 232 233 "Point2i", 234 235 "Point2iList", 236 237 "ProfiledColor", 238 239 "ProfiledColorList", 240 241 "RGBAColor", 242 243 "RGBColor", 244 245 "RenderStyle", 246 247 "Sequence", 248 249 "String", 250 251 "StringList", 252 253 "Transform2", 254 255 "Transform2List", 256 257 "Vector2f", 258 259 "Vector2i", 260 261 "Vector3f", 262 263 "Void", 264 265 "XYZ", 266 267 "XYZA", 268 269 "AnyGraph", 270 271 "Stream", 272 273 "List", 274 275 "Object", 276]
151class Project: 152 """A Python façade for a Rust graph project.""" 153 154 def __init__(self, inner: _internal.Project | None = None): 155 self._inner = _internal.Project() if inner is None else inner 156 157 def add_graph(self, graph: _GraphWrapper | _internal.Graph) -> Project: 158 return Project(self._inner.add_graph(unwrap_graph(graph))) 159 160 def execute(self, context: _internal.Context, graph_id: int) -> _internal.Type: 161 return self._inner.execute(context, graph_id)
A Python façade for a Rust graph project.
9def brushcue_fn(fn): 10 @wraps(fn) 11 def wrapper(*args, **kwargs): 12 return fn(*args, **kwargs) 13 14 def brushcue_make_graph( 15 type_definitions: list[brushcue.TypeDefinition], 16 ): 17 inputs = [ 18 brushcue.Object.input(type_definition) 19 for type_definition in type_definitions 20 ] 21 output = fn(*inputs) 22 wrapper.__brushcue_output_graph__ = output 23 return *(unwrap_graph(graph) for graph in inputs), unwrap_graph(output) 24 25 wrapper.__brushcue_make_graph__ = brushcue_make_graph 26 return wrapper
Wraps image_recipe::ImageRecipe for Python. Methods return new PyImageRecipe instances following ImageRecipe's immutable builder pattern.
Wraps movie_recipe::MovieRecipe for Python.
17class Bool(Object): 18 """A bool""" 19 20 def execute(self, context): 21 return self._inner.execute(context).as_bool() 22 23 if TYPE_CHECKING: 24 # Implemented at runtime via monkeypatching in `_operators.py`; declared 25 # here only so static type checkers recognize these operators. 26 def __and__(self, other: Bool | builtins.bool) -> Bool: ... 27 def __rand__(self, other: Bool | builtins.bool) -> Bool: ... 28 def __or__(self, other: Bool | builtins.bool) -> Bool: ... 29 def __ror__(self, other: Bool | builtins.bool) -> Bool: ... 30 def __xor__(self, other: Bool | builtins.bool) -> Bool: ... 31 def __rxor__(self, other: Bool | builtins.bool) -> Bool: ... 32 def __invert__(self) -> Bool: ... 33 34 def and_(self, bool2) -> Bool: 35 """And 36 37 Returns true if both inputs are true. 38 39 Args: 40 bool2: Graph of Bool 41 42 Returns: 43 Graph: A graph node producing a Bool. 44 """ 45 bool1_parsed = input_parsers.parse_bool_graph(self) 46 bool2_parsed = input_parsers.parse_bool_graph(bool2) 47 result = _internal.and_internal(bool1_parsed, bool2_parsed) 48 return Bool(result) 49 50 def not_(self) -> Bool: 51 """Not 52 53 Returns the opposite of a boolean 54 55 Returns: 56 Graph: A graph node producing a Bool. 57 """ 58 bool_parsed = input_parsers.parse_bool_graph(self) 59 result = _internal.not_internal(bool_parsed) 60 return Bool(result) 61 62 def or_(self, bool2) -> Bool: 63 """Or 64 65 Returns true if either inputs are true. 66 67 Args: 68 bool2: Graph of Bool 69 70 Returns: 71 Graph: A graph node producing a Bool. 72 """ 73 bool1_parsed = input_parsers.parse_bool_graph(self) 74 bool2_parsed = input_parsers.parse_bool_graph(bool2) 75 result = _internal.or_internal(bool1_parsed, bool2_parsed) 76 return Bool(result) 77 78 def xor(self, bool2) -> Bool: 79 """Exclusive Or 80 81 Returns true if either the inputs are true. But false if both are true. 82 83 Args: 84 bool2: Graph of Bool 85 86 Returns: 87 Graph: A graph node producing a Bool. 88 """ 89 bool1_parsed = input_parsers.parse_bool_graph(self) 90 bool2_parsed = input_parsers.parse_bool_graph(bool2) 91 result = _internal.xor_internal(bool1_parsed, bool2_parsed) 92 return Bool(result)
A bool
34 def and_(self, bool2) -> Bool: 35 """And 36 37 Returns true if both inputs are true. 38 39 Args: 40 bool2: Graph of Bool 41 42 Returns: 43 Graph: A graph node producing a Bool. 44 """ 45 bool1_parsed = input_parsers.parse_bool_graph(self) 46 bool2_parsed = input_parsers.parse_bool_graph(bool2) 47 result = _internal.and_internal(bool1_parsed, bool2_parsed) 48 return Bool(result)
And
Returns true if both inputs are true.
Args: bool2: Graph of Bool
Returns: Graph: A graph node producing a Bool.
50 def not_(self) -> Bool: 51 """Not 52 53 Returns the opposite of a boolean 54 55 Returns: 56 Graph: A graph node producing a Bool. 57 """ 58 bool_parsed = input_parsers.parse_bool_graph(self) 59 result = _internal.not_internal(bool_parsed) 60 return Bool(result)
Not
Returns the opposite of a boolean
Returns: Graph: A graph node producing a Bool.
62 def or_(self, bool2) -> Bool: 63 """Or 64 65 Returns true if either inputs are true. 66 67 Args: 68 bool2: Graph of Bool 69 70 Returns: 71 Graph: A graph node producing a Bool. 72 """ 73 bool1_parsed = input_parsers.parse_bool_graph(self) 74 bool2_parsed = input_parsers.parse_bool_graph(bool2) 75 result = _internal.or_internal(bool1_parsed, bool2_parsed) 76 return Bool(result)
Or
Returns true if either inputs are true.
Args: bool2: Graph of Bool
Returns: Graph: A graph node producing a Bool.
78 def xor(self, bool2) -> Bool: 79 """Exclusive Or 80 81 Returns true if either the inputs are true. But false if both are true. 82 83 Args: 84 bool2: Graph of Bool 85 86 Returns: 87 Graph: A graph node producing a Bool. 88 """ 89 bool1_parsed = input_parsers.parse_bool_graph(self) 90 bool2_parsed = input_parsers.parse_bool_graph(bool2) 91 result = _internal.xor_internal(bool1_parsed, bool2_parsed) 92 return Bool(result)
Exclusive Or
Returns true if either the inputs are true. But false if both are true.
Args: bool2: Graph of Bool
Returns: Graph: A graph node producing a Bool.
17class Bounds2f(Object): 18 """A 2D bounding box of Floats""" 19 20 def execute(self, context): 21 return self._inner.execute(context).as_bounds2f() 22 23 @staticmethod 24 def from_x_y_width_height(x, y, width, height) -> Bounds2f: 25 """Bounds 2D Float from X, Y, Width & Height 26 27 Creates the bounds of a 2D float region from its X, Y, Width and Height. 28 29 Args: 30 x: Graph of Float 31 y: Graph of Float 32 width: Graph of Float 33 height: Graph of Float 34 35 Returns: 36 Graph: A graph node producing a Bounds2f. 37 """ 38 x_parsed = input_parsers.parse_float_graph(x) 39 y_parsed = input_parsers.parse_float_graph(y) 40 width_parsed = input_parsers.parse_float_graph(width) 41 height_parsed = input_parsers.parse_float_graph(height) 42 result = _internal.bounds2f_from_x_y_width_height_internal(x_parsed, y_parsed, width_parsed, height_parsed) 43 return Bounds2f(result) 44 45 def height(self) -> float.Float: 46 """Bounds2f Height 47 48 Gets the height of the bounds. 49 50 Returns: 51 Graph: A graph node producing a Float. 52 """ 53 bounds_parsed = input_parsers.parse_graph(self) 54 result = _internal.bounds2f_height_internal(bounds_parsed) 55 from .float import Float 56 return Float(result) 57 58 def min_x(self) -> float.Float: 59 """Bounds2f Min X 60 61 Gets the minimum X coordinate (left edge) of the bounds. 62 63 Returns: 64 Graph: A graph node producing a Float. 65 """ 66 bounds_parsed = input_parsers.parse_graph(self) 67 result = _internal.bounds2f_min_x_internal(bounds_parsed) 68 from .float import Float 69 return Float(result) 70 71 def min_y(self) -> float.Float: 72 """Bounds2f Min Y 73 74 Gets the minimum Y coordinate (top edge) of the bounds. 75 76 Returns: 77 Graph: A graph node producing a Float. 78 """ 79 bounds_parsed = input_parsers.parse_graph(self) 80 result = _internal.bounds2f_min_y_internal(bounds_parsed) 81 from .float import Float 82 return Float(result) 83 84 def width(self) -> float.Float: 85 """Bounds2f Width 86 87 Gets the width of the bounds. 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 bounds_parsed = input_parsers.parse_graph(self) 93 result = _internal.bounds2f_width_internal(bounds_parsed) 94 from .float import Float 95 return Float(result)
A 2D bounding box of Floats
23 @staticmethod 24 def from_x_y_width_height(x, y, width, height) -> Bounds2f: 25 """Bounds 2D Float from X, Y, Width & Height 26 27 Creates the bounds of a 2D float region from its X, Y, Width and Height. 28 29 Args: 30 x: Graph of Float 31 y: Graph of Float 32 width: Graph of Float 33 height: Graph of Float 34 35 Returns: 36 Graph: A graph node producing a Bounds2f. 37 """ 38 x_parsed = input_parsers.parse_float_graph(x) 39 y_parsed = input_parsers.parse_float_graph(y) 40 width_parsed = input_parsers.parse_float_graph(width) 41 height_parsed = input_parsers.parse_float_graph(height) 42 result = _internal.bounds2f_from_x_y_width_height_internal(x_parsed, y_parsed, width_parsed, height_parsed) 43 return Bounds2f(result)
Bounds 2D Float from X, Y, Width & Height
Creates the bounds of a 2D float region from its X, Y, Width and Height.
Args: x: Graph of Float y: Graph of Float width: Graph of Float height: Graph of Float
Returns: Graph: A graph node producing a Bounds2f.
45 def height(self) -> float.Float: 46 """Bounds2f Height 47 48 Gets the height of the bounds. 49 50 Returns: 51 Graph: A graph node producing a Float. 52 """ 53 bounds_parsed = input_parsers.parse_graph(self) 54 result = _internal.bounds2f_height_internal(bounds_parsed) 55 from .float import Float 56 return Float(result)
Bounds2f Height
Gets the height of the bounds.
Returns: Graph: A graph node producing a Float.
58 def min_x(self) -> float.Float: 59 """Bounds2f Min X 60 61 Gets the minimum X coordinate (left edge) of the bounds. 62 63 Returns: 64 Graph: A graph node producing a Float. 65 """ 66 bounds_parsed = input_parsers.parse_graph(self) 67 result = _internal.bounds2f_min_x_internal(bounds_parsed) 68 from .float import Float 69 return Float(result)
Bounds2f Min X
Gets the minimum X coordinate (left edge) of the bounds.
Returns: Graph: A graph node producing a Float.
71 def min_y(self) -> float.Float: 72 """Bounds2f Min Y 73 74 Gets the minimum Y coordinate (top edge) of the bounds. 75 76 Returns: 77 Graph: A graph node producing a Float. 78 """ 79 bounds_parsed = input_parsers.parse_graph(self) 80 result = _internal.bounds2f_min_y_internal(bounds_parsed) 81 from .float import Float 82 return Float(result)
Bounds2f Min Y
Gets the minimum Y coordinate (top edge) of the bounds.
Returns: Graph: A graph node producing a Float.
84 def width(self) -> float.Float: 85 """Bounds2f Width 86 87 Gets the width of the bounds. 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 bounds_parsed = input_parsers.parse_graph(self) 93 result = _internal.bounds2f_width_internal(bounds_parsed) 94 from .float import Float 95 return Float(result)
Bounds2f Width
Gets the width of the bounds.
Returns: Graph: A graph node producing a Float.
11class Bounds2fList(List): 12 """List of Bounds 2D Floats""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .bounds2f import Bounds2f 16 super().__init__(inner, Bounds2f if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Bounds 2D Floats
12class Bounds2i(Object): 13 """A 2D bounding box of Ints""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def from_x_y_width_height(x, y, width, height) -> Bounds2i: 20 """Bounds 2D Int from X, Y, Width & Height 21 22 Creates the bounds of a 2D array from its X, Y, Width and Height. 23 24 Args: 25 x: Graph of Int 26 y: Graph of Int 27 width: Graph of Int 28 height: Graph of Int 29 30 Returns: 31 Graph: A graph node producing a Bounds2i. 32 """ 33 x_parsed = input_parsers.parse_int_graph(x) 34 y_parsed = input_parsers.parse_int_graph(y) 35 width_parsed = input_parsers.parse_int_graph(width) 36 height_parsed = input_parsers.parse_int_graph(height) 37 result = _internal.bounds2i_from_x_y_width_height_internal(x_parsed, y_parsed, width_parsed, height_parsed) 38 return Bounds2i(result)
A 2D bounding box of Ints
18 @staticmethod 19 def from_x_y_width_height(x, y, width, height) -> Bounds2i: 20 """Bounds 2D Int from X, Y, Width & Height 21 22 Creates the bounds of a 2D array from its X, Y, Width and Height. 23 24 Args: 25 x: Graph of Int 26 y: Graph of Int 27 width: Graph of Int 28 height: Graph of Int 29 30 Returns: 31 Graph: A graph node producing a Bounds2i. 32 """ 33 x_parsed = input_parsers.parse_int_graph(x) 34 y_parsed = input_parsers.parse_int_graph(y) 35 width_parsed = input_parsers.parse_int_graph(width) 36 height_parsed = input_parsers.parse_int_graph(height) 37 result = _internal.bounds2i_from_x_y_width_height_internal(x_parsed, y_parsed, width_parsed, height_parsed) 38 return Bounds2i(result)
Bounds 2D Int from X, Y, Width & Height
Creates the bounds of a 2D array from its X, Y, Width and Height.
Args: x: Graph of Int y: Graph of Int width: Graph of Int height: Graph of Int
Returns: Graph: A graph node producing a Bounds2i.
11class Bounds2iList(List): 12 """List of Bounds 2D Ints""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .bounds2i import Bounds2i 16 super().__init__(inner, Bounds2i if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Bounds 2D Ints
12class Brush(Object): 13 """A brush to stroke on 2D objects""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def custom(function_body, helpers, inputs, radius) -> Brush: 20 """Brush Custom 21 22 Creates a brush with a custom shader. 23 24 Args: 25 function_body: Graph of String 26 helpers: Graph of String 27 inputs: Graph of Dictionary 28 radius: Graph of Float 29 30 Returns: 31 Graph: A graph node producing a Brush. 32 """ 33 function_body_parsed = input_parsers.parse_string_graph(function_body) 34 helpers_parsed = input_parsers.parse_string_graph(helpers) 35 inputs_parsed = input_parsers.parse_graph(inputs) 36 radius_parsed = input_parsers.parse_float_graph(radius) 37 result = _internal.brush_custom_internal(function_body_parsed, helpers_parsed, inputs_parsed, radius_parsed) 38 return Brush(result) 39 40 @staticmethod 41 def dashed(color_1, color_1_length, color_2, color_2_length, radius) -> Brush: 42 """Brush Dashed 43 44 Creates a brush that alternates between two colors along the length of the path, for dashed/dotted strokes. 45 46 Args: 47 color_1: Graph of ProfiledColor 48 color_1_length: Graph of Float 49 color_2: Graph of ProfiledColor 50 color_2_length: Graph of Float 51 radius: Graph of Float 52 53 Returns: 54 Graph: A graph node producing a Brush. 55 """ 56 color_1_parsed = input_parsers.parse_graph(color_1) 57 color_1_length_parsed = input_parsers.parse_float_graph(color_1_length) 58 color_2_parsed = input_parsers.parse_graph(color_2) 59 color_2_length_parsed = input_parsers.parse_float_graph(color_2_length) 60 radius_parsed = input_parsers.parse_float_graph(radius) 61 result = _internal.brush_dashed_internal(color_1_parsed, color_1_length_parsed, color_2_parsed, color_2_length_parsed, radius_parsed) 62 return Brush(result) 63 64 @staticmethod 65 def solid(color, radius) -> Brush: 66 """Brush Solid 67 68 Creates a brush with a color and radius. Will stroke with the solid color. 69 70 Args: 71 color: Graph of ProfiledColor 72 radius: Graph of Float 73 74 Returns: 75 Graph: A graph node producing a Brush. 76 """ 77 color_parsed = input_parsers.parse_graph(color) 78 radius_parsed = input_parsers.parse_float_graph(radius) 79 result = _internal.brush_solid_internal(color_parsed, radius_parsed) 80 return Brush(result)
A brush to stroke on 2D objects
18 @staticmethod 19 def custom(function_body, helpers, inputs, radius) -> Brush: 20 """Brush Custom 21 22 Creates a brush with a custom shader. 23 24 Args: 25 function_body: Graph of String 26 helpers: Graph of String 27 inputs: Graph of Dictionary 28 radius: Graph of Float 29 30 Returns: 31 Graph: A graph node producing a Brush. 32 """ 33 function_body_parsed = input_parsers.parse_string_graph(function_body) 34 helpers_parsed = input_parsers.parse_string_graph(helpers) 35 inputs_parsed = input_parsers.parse_graph(inputs) 36 radius_parsed = input_parsers.parse_float_graph(radius) 37 result = _internal.brush_custom_internal(function_body_parsed, helpers_parsed, inputs_parsed, radius_parsed) 38 return Brush(result)
Brush Custom
Creates a brush with a custom shader.
Args: function_body: Graph of String helpers: Graph of String inputs: Graph of Dictionary radius: Graph of Float
Returns: Graph: A graph node producing a Brush.
40 @staticmethod 41 def dashed(color_1, color_1_length, color_2, color_2_length, radius) -> Brush: 42 """Brush Dashed 43 44 Creates a brush that alternates between two colors along the length of the path, for dashed/dotted strokes. 45 46 Args: 47 color_1: Graph of ProfiledColor 48 color_1_length: Graph of Float 49 color_2: Graph of ProfiledColor 50 color_2_length: Graph of Float 51 radius: Graph of Float 52 53 Returns: 54 Graph: A graph node producing a Brush. 55 """ 56 color_1_parsed = input_parsers.parse_graph(color_1) 57 color_1_length_parsed = input_parsers.parse_float_graph(color_1_length) 58 color_2_parsed = input_parsers.parse_graph(color_2) 59 color_2_length_parsed = input_parsers.parse_float_graph(color_2_length) 60 radius_parsed = input_parsers.parse_float_graph(radius) 61 result = _internal.brush_dashed_internal(color_1_parsed, color_1_length_parsed, color_2_parsed, color_2_length_parsed, radius_parsed) 62 return Brush(result)
Brush Dashed
Creates a brush that alternates between two colors along the length of the path, for dashed/dotted strokes.
Args: color_1: Graph of ProfiledColor color_1_length: Graph of Float color_2: Graph of ProfiledColor color_2_length: Graph of Float radius: Graph of Float
Returns: Graph: A graph node producing a Brush.
64 @staticmethod 65 def solid(color, radius) -> Brush: 66 """Brush Solid 67 68 Creates a brush with a color and radius. Will stroke with the solid color. 69 70 Args: 71 color: Graph of ProfiledColor 72 radius: Graph of Float 73 74 Returns: 75 Graph: A graph node producing a Brush. 76 """ 77 color_parsed = input_parsers.parse_graph(color) 78 radius_parsed = input_parsers.parse_float_graph(radius) 79 result = _internal.brush_solid_internal(color_parsed, radius_parsed) 80 return Brush(result)
Brush Solid
Creates a brush with a color and radius. Will stroke with the solid color.
Args: color: Graph of ProfiledColor radius: Graph of Float
Returns: Graph: A graph node producing a Brush.
18class Bytes(Object): 19 """A list of bytes""" 20 21 def execute(self, context): 22 return self._inner.execute(context) 23 24 @staticmethod 25 def from_url(url) -> Bytes: 26 """Bytes from URL 27 28 Given a URL. Performs a GET request and downloads the result as bytes. 29 30 Args: 31 url: Graph of String 32 33 Returns: 34 Graph: A graph node producing a Bytes. 35 """ 36 url_parsed = input_parsers.parse_string_graph(url) 37 result = _internal.bytes_from_u_r_l_internal(url_parsed) 38 return Bytes(result) 39 40 def save_to_path(self, path) -> string.String: 41 """Bytes Save to Path 42 43 Writes a byte list to a specified file path on disk. Returns the path that was written to. 44 45 Args: 46 path: Graph of String 47 48 Returns: 49 Graph: A graph node producing a String. 50 """ 51 bytes_parsed = input_parsers.parse_graph(self) 52 path_parsed = input_parsers.parse_string_graph(path) 53 result = _internal.bytes_save_to_path_internal(bytes_parsed, path_parsed) 54 from .string import String 55 return String(result) 56 57 def file_convert_image_to_bmp(self) -> Bytes: 58 """File Convert Image to BMP 59 60 Converts any image format (JPEG, PNG, WebP, TIFF, HEIC, etc.) to BMP. Returns BMP bytes. 61 62 Returns: 63 Graph: A graph node producing a Bytes. 64 """ 65 image_bytes_parsed = input_parsers.parse_graph(self) 66 result = _internal.file_convert_image_to_bmp_internal(image_bytes_parsed) 67 return Bytes(result) 68 69 def file_convert_image_to_heic(self, quality) -> Bytes: 70 """File Convert Image to HEIC 71 72 Converts any image format (JPEG, PNG, WebP, TIFF, BMP, etc.) to HEIC. Returns HEIC bytes. 73 74 Args: 75 quality: Graph of Int 76 77 Returns: 78 Graph: A graph node producing a Bytes. 79 """ 80 image_bytes_parsed = input_parsers.parse_graph(self) 81 quality_parsed = input_parsers.parse_int_graph(quality) 82 result = _internal.file_convert_image_to_heic_internal(image_bytes_parsed, quality_parsed) 83 return Bytes(result) 84 85 def file_convert_image_to_jpeg(self, quality) -> Bytes: 86 """File Convert Image to JPEG 87 88 Converts any image format (PNG, WebP, TIFF, BMP, HEIC, etc.) to JPEG. Returns JPEG bytes. 89 90 Args: 91 quality: Graph of Int 92 93 Returns: 94 Graph: A graph node producing a Bytes. 95 """ 96 image_bytes_parsed = input_parsers.parse_graph(self) 97 quality_parsed = input_parsers.parse_int_graph(quality) 98 result = _internal.file_convert_image_to_jpeg_internal(image_bytes_parsed, quality_parsed) 99 return Bytes(result) 100 101 def file_convert_image_to_png(self) -> Bytes: 102 """File Convert Image to PNG 103 104 Converts any image format (JPEG, WebP, TIFF, BMP, HEIC, etc.) to PNG. Returns PNG bytes. 105 106 Returns: 107 Graph: A graph node producing a Bytes. 108 """ 109 image_bytes_parsed = input_parsers.parse_graph(self) 110 result = _internal.file_convert_image_to_png_internal(image_bytes_parsed) 111 return Bytes(result) 112 113 def file_convert_image_to_tiff(self) -> Bytes: 114 """File Convert Image to TIFF 115 116 Converts any image format (JPEG, PNG, WebP, BMP, HEIC, etc.) to TIFF. Returns TIFF bytes. 117 118 Returns: 119 Graph: A graph node producing a Bytes. 120 """ 121 image_bytes_parsed = input_parsers.parse_graph(self) 122 result = _internal.file_convert_image_to_tiff_internal(image_bytes_parsed) 123 return Bytes(result) 124 125 def file_convert_image_to_web_p(self, quality) -> Bytes: 126 """File Convert Image to WebP 127 128 Converts any image format (JPEG, PNG, TIFF, BMP, HEIC, etc.) to WebP. Returns WebP bytes. 129 130 Args: 131 quality: Graph of Int 132 133 Returns: 134 Graph: A graph node producing a Bytes. 135 """ 136 image_bytes_parsed = input_parsers.parse_graph(self) 137 quality_parsed = input_parsers.parse_int_graph(quality) 138 result = _internal.file_convert_image_to_web_p_internal(image_bytes_parsed, quality_parsed) 139 return Bytes(result) 140 141 def file_convert_video_to_gif(self, frame_rate) -> Bytes: 142 """File Convert Video to GIF 143 144 Converts any video format (MP4, MOV, WebM, AVI, MKV) to a GIF. Returns GIF bytes. 145 146 Args: 147 frame_rate: Graph of Int 148 149 Returns: 150 Graph: A graph node producing a Bytes. 151 """ 152 video_bytes_parsed = input_parsers.parse_graph(self) 153 frame_rate_parsed = input_parsers.parse_int_graph(frame_rate) 154 result = _internal.file_convert_video_to_gif_internal(video_bytes_parsed, frame_rate_parsed) 155 return Bytes(result) 156 157 def file_convert_video_to_mp4(self) -> Bytes: 158 """File Convert Video to MP4 159 160 Converts any video format (MOV, WebM, AVI, MKV) to MP4. Returns MP4 bytes. 161 162 Returns: 163 Graph: A graph node producing a Bytes. 164 """ 165 video_bytes_parsed = input_parsers.parse_graph(self) 166 result = _internal.file_convert_video_to_m_p4_internal(video_bytes_parsed) 167 return Bytes(result) 168 169 def file_convert_video_to_web_m(self) -> Bytes: 170 """File Convert Video to WebM 171 172 Converts any video format (MP4, MOV, AVI, MKV) to WebM. Returns WebM bytes. 173 174 Returns: 175 Graph: A graph node producing a Bytes. 176 """ 177 video_bytes_parsed = input_parsers.parse_graph(self) 178 result = _internal.file_convert_video_to_web_m_internal(video_bytes_parsed) 179 return Bytes(result) 180 181 def upload_bytes(self, url, content_type) -> void.Void: 182 """Upload Bytes 183 184 Given bytes and a URL. Performs a PUT request and uploads the bytes 185 186 Args: 187 url: Graph of String 188 content_type: Graph of String 189 190 Returns: 191 Graph: A graph node producing a Void. 192 """ 193 bytes_parsed = input_parsers.parse_graph(self) 194 url_parsed = input_parsers.parse_string_graph(url) 195 content_type_parsed = input_parsers.parse_string_graph(content_type) 196 result = _internal.upload_bytes_internal(bytes_parsed, url_parsed, content_type_parsed) 197 from .void import Void 198 return Void(result)
A list of bytes
24 @staticmethod 25 def from_url(url) -> Bytes: 26 """Bytes from URL 27 28 Given a URL. Performs a GET request and downloads the result as bytes. 29 30 Args: 31 url: Graph of String 32 33 Returns: 34 Graph: A graph node producing a Bytes. 35 """ 36 url_parsed = input_parsers.parse_string_graph(url) 37 result = _internal.bytes_from_u_r_l_internal(url_parsed) 38 return Bytes(result)
Bytes from URL
Given a URL. Performs a GET request and downloads the result as bytes.
Args: url: Graph of String
Returns: Graph: A graph node producing a Bytes.
40 def save_to_path(self, path) -> string.String: 41 """Bytes Save to Path 42 43 Writes a byte list to a specified file path on disk. Returns the path that was written to. 44 45 Args: 46 path: Graph of String 47 48 Returns: 49 Graph: A graph node producing a String. 50 """ 51 bytes_parsed = input_parsers.parse_graph(self) 52 path_parsed = input_parsers.parse_string_graph(path) 53 result = _internal.bytes_save_to_path_internal(bytes_parsed, path_parsed) 54 from .string import String 55 return String(result)
Bytes Save to Path
Writes a byte list to a specified file path on disk. Returns the path that was written to.
Args: path: Graph of String
Returns: Graph: A graph node producing a String.
57 def file_convert_image_to_bmp(self) -> Bytes: 58 """File Convert Image to BMP 59 60 Converts any image format (JPEG, PNG, WebP, TIFF, HEIC, etc.) to BMP. Returns BMP bytes. 61 62 Returns: 63 Graph: A graph node producing a Bytes. 64 """ 65 image_bytes_parsed = input_parsers.parse_graph(self) 66 result = _internal.file_convert_image_to_bmp_internal(image_bytes_parsed) 67 return Bytes(result)
File Convert Image to BMP
Converts any image format (JPEG, PNG, WebP, TIFF, HEIC, etc.) to BMP. Returns BMP bytes.
Returns: Graph: A graph node producing a Bytes.
69 def file_convert_image_to_heic(self, quality) -> Bytes: 70 """File Convert Image to HEIC 71 72 Converts any image format (JPEG, PNG, WebP, TIFF, BMP, etc.) to HEIC. Returns HEIC bytes. 73 74 Args: 75 quality: Graph of Int 76 77 Returns: 78 Graph: A graph node producing a Bytes. 79 """ 80 image_bytes_parsed = input_parsers.parse_graph(self) 81 quality_parsed = input_parsers.parse_int_graph(quality) 82 result = _internal.file_convert_image_to_heic_internal(image_bytes_parsed, quality_parsed) 83 return Bytes(result)
File Convert Image to HEIC
Converts any image format (JPEG, PNG, WebP, TIFF, BMP, etc.) to HEIC. Returns HEIC bytes.
Args: quality: Graph of Int
Returns: Graph: A graph node producing a Bytes.
85 def file_convert_image_to_jpeg(self, quality) -> Bytes: 86 """File Convert Image to JPEG 87 88 Converts any image format (PNG, WebP, TIFF, BMP, HEIC, etc.) to JPEG. Returns JPEG bytes. 89 90 Args: 91 quality: Graph of Int 92 93 Returns: 94 Graph: A graph node producing a Bytes. 95 """ 96 image_bytes_parsed = input_parsers.parse_graph(self) 97 quality_parsed = input_parsers.parse_int_graph(quality) 98 result = _internal.file_convert_image_to_jpeg_internal(image_bytes_parsed, quality_parsed) 99 return Bytes(result)
File Convert Image to JPEG
Converts any image format (PNG, WebP, TIFF, BMP, HEIC, etc.) to JPEG. Returns JPEG bytes.
Args: quality: Graph of Int
Returns: Graph: A graph node producing a Bytes.
101 def file_convert_image_to_png(self) -> Bytes: 102 """File Convert Image to PNG 103 104 Converts any image format (JPEG, WebP, TIFF, BMP, HEIC, etc.) to PNG. Returns PNG bytes. 105 106 Returns: 107 Graph: A graph node producing a Bytes. 108 """ 109 image_bytes_parsed = input_parsers.parse_graph(self) 110 result = _internal.file_convert_image_to_png_internal(image_bytes_parsed) 111 return Bytes(result)
File Convert Image to PNG
Converts any image format (JPEG, WebP, TIFF, BMP, HEIC, etc.) to PNG. Returns PNG bytes.
Returns: Graph: A graph node producing a Bytes.
113 def file_convert_image_to_tiff(self) -> Bytes: 114 """File Convert Image to TIFF 115 116 Converts any image format (JPEG, PNG, WebP, BMP, HEIC, etc.) to TIFF. Returns TIFF bytes. 117 118 Returns: 119 Graph: A graph node producing a Bytes. 120 """ 121 image_bytes_parsed = input_parsers.parse_graph(self) 122 result = _internal.file_convert_image_to_tiff_internal(image_bytes_parsed) 123 return Bytes(result)
File Convert Image to TIFF
Converts any image format (JPEG, PNG, WebP, BMP, HEIC, etc.) to TIFF. Returns TIFF bytes.
Returns: Graph: A graph node producing a Bytes.
125 def file_convert_image_to_web_p(self, quality) -> Bytes: 126 """File Convert Image to WebP 127 128 Converts any image format (JPEG, PNG, TIFF, BMP, HEIC, etc.) to WebP. Returns WebP bytes. 129 130 Args: 131 quality: Graph of Int 132 133 Returns: 134 Graph: A graph node producing a Bytes. 135 """ 136 image_bytes_parsed = input_parsers.parse_graph(self) 137 quality_parsed = input_parsers.parse_int_graph(quality) 138 result = _internal.file_convert_image_to_web_p_internal(image_bytes_parsed, quality_parsed) 139 return Bytes(result)
File Convert Image to WebP
Converts any image format (JPEG, PNG, TIFF, BMP, HEIC, etc.) to WebP. Returns WebP bytes.
Args: quality: Graph of Int
Returns: Graph: A graph node producing a Bytes.
141 def file_convert_video_to_gif(self, frame_rate) -> Bytes: 142 """File Convert Video to GIF 143 144 Converts any video format (MP4, MOV, WebM, AVI, MKV) to a GIF. Returns GIF bytes. 145 146 Args: 147 frame_rate: Graph of Int 148 149 Returns: 150 Graph: A graph node producing a Bytes. 151 """ 152 video_bytes_parsed = input_parsers.parse_graph(self) 153 frame_rate_parsed = input_parsers.parse_int_graph(frame_rate) 154 result = _internal.file_convert_video_to_gif_internal(video_bytes_parsed, frame_rate_parsed) 155 return Bytes(result)
File Convert Video to GIF
Converts any video format (MP4, MOV, WebM, AVI, MKV) to a GIF. Returns GIF bytes.
Args: frame_rate: Graph of Int
Returns: Graph: A graph node producing a Bytes.
157 def file_convert_video_to_mp4(self) -> Bytes: 158 """File Convert Video to MP4 159 160 Converts any video format (MOV, WebM, AVI, MKV) to MP4. Returns MP4 bytes. 161 162 Returns: 163 Graph: A graph node producing a Bytes. 164 """ 165 video_bytes_parsed = input_parsers.parse_graph(self) 166 result = _internal.file_convert_video_to_m_p4_internal(video_bytes_parsed) 167 return Bytes(result)
File Convert Video to MP4
Converts any video format (MOV, WebM, AVI, MKV) to MP4. Returns MP4 bytes.
Returns: Graph: A graph node producing a Bytes.
169 def file_convert_video_to_web_m(self) -> Bytes: 170 """File Convert Video to WebM 171 172 Converts any video format (MP4, MOV, AVI, MKV) to WebM. Returns WebM bytes. 173 174 Returns: 175 Graph: A graph node producing a Bytes. 176 """ 177 video_bytes_parsed = input_parsers.parse_graph(self) 178 result = _internal.file_convert_video_to_web_m_internal(video_bytes_parsed) 179 return Bytes(result)
File Convert Video to WebM
Converts any video format (MP4, MOV, AVI, MKV) to WebM. Returns WebM bytes.
Returns: Graph: A graph node producing a Bytes.
181 def upload_bytes(self, url, content_type) -> void.Void: 182 """Upload Bytes 183 184 Given bytes and a URL. Performs a PUT request and uploads the bytes 185 186 Args: 187 url: Graph of String 188 content_type: Graph of String 189 190 Returns: 191 Graph: A graph node producing a Void. 192 """ 193 bytes_parsed = input_parsers.parse_graph(self) 194 url_parsed = input_parsers.parse_string_graph(url) 195 content_type_parsed = input_parsers.parse_string_graph(content_type) 196 result = _internal.upload_bytes_internal(bytes_parsed, url_parsed, content_type_parsed) 197 from .void import Void 198 return Void(result)
Upload Bytes
Given bytes and a URL. Performs a PUT request and uploads the bytes
Args: url: Graph of String content_type: Graph of String
Returns: Graph: A graph node producing a Void.
12class ColorProfile(Object): 13 """A Color Profile""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def aces_cg() -> ColorProfile: 20 """Color Profile ACEScg 21 22 Creates an ACEScg Color Profile 23 24 Returns: 25 Graph: A graph node producing a ColorProfile. 26 """ 27 result = _internal.color_profile_a_c_e_scg_internal() 28 return ColorProfile(result) 29 30 @staticmethod 31 def bt709() -> ColorProfile: 32 """Color Profile BT.709 33 34 Creates a BT.709 Color Profile 35 36 Returns: 37 Graph: A graph node producing a ColorProfile. 38 """ 39 result = _internal.color_profile_b_t709_internal() 40 return ColorProfile(result) 41 42 @staticmethod 43 def ok_lab_a() -> ColorProfile: 44 """Color Profile OkLabA 45 46 Creates an OkLabA color-format profile. OkLab with also an alpha component. 47 48 Returns: 49 Graph: A graph node producing a ColorProfile. 50 """ 51 result = _internal.color_profile_ok_lab_a_internal() 52 return ColorProfile(result) 53 54 @staticmethod 55 def p3() -> ColorProfile: 56 """Color Profile P3 57 58 Creates a P3 Color Profile 59 60 Returns: 61 Graph: A graph node producing a ColorProfile. 62 """ 63 result = _internal.color_profile_p3_internal() 64 return ColorProfile(result) 65 66 @staticmethod 67 def png_srgb() -> ColorProfile: 68 """Color Profile PNG sRGB 69 70 Creates a color-format profile that is the same one as PNG sRGB. 71 72 Returns: 73 Graph: A graph node producing a ColorProfile. 74 """ 75 result = _internal.color_profile_p_n_g_s_r_g_b_internal() 76 return ColorProfile(result) 77 78 @staticmethod 79 def srgb() -> ColorProfile: 80 """Color Profile sRGB 81 82 Creates an sRGB Color Profile 83 84 Returns: 85 Graph: A graph node producing a ColorProfile. 86 """ 87 result = _internal.color_profile_s_r_g_b_internal() 88 return ColorProfile(result) 89 90 @staticmethod 91 def xyz() -> ColorProfile: 92 """Color Profile XYZ 93 94 Creates an XYZ Color Profile 95 96 Returns: 97 Graph: A graph node producing a ColorProfile. 98 """ 99 result = _internal.color_profile_x_y_z_internal() 100 return ColorProfile(result)
A Color Profile
18 @staticmethod 19 def aces_cg() -> ColorProfile: 20 """Color Profile ACEScg 21 22 Creates an ACEScg Color Profile 23 24 Returns: 25 Graph: A graph node producing a ColorProfile. 26 """ 27 result = _internal.color_profile_a_c_e_scg_internal() 28 return ColorProfile(result)
Color Profile ACEScg
Creates an ACEScg Color Profile
Returns: Graph: A graph node producing a ColorProfile.
30 @staticmethod 31 def bt709() -> ColorProfile: 32 """Color Profile BT.709 33 34 Creates a BT.709 Color Profile 35 36 Returns: 37 Graph: A graph node producing a ColorProfile. 38 """ 39 result = _internal.color_profile_b_t709_internal() 40 return ColorProfile(result)
Color Profile BT.709
Creates a BT.709 Color Profile
Returns: Graph: A graph node producing a ColorProfile.
42 @staticmethod 43 def ok_lab_a() -> ColorProfile: 44 """Color Profile OkLabA 45 46 Creates an OkLabA color-format profile. OkLab with also an alpha component. 47 48 Returns: 49 Graph: A graph node producing a ColorProfile. 50 """ 51 result = _internal.color_profile_ok_lab_a_internal() 52 return ColorProfile(result)
Color Profile OkLabA
Creates an OkLabA color-format profile. OkLab with also an alpha component.
Returns: Graph: A graph node producing a ColorProfile.
54 @staticmethod 55 def p3() -> ColorProfile: 56 """Color Profile P3 57 58 Creates a P3 Color Profile 59 60 Returns: 61 Graph: A graph node producing a ColorProfile. 62 """ 63 result = _internal.color_profile_p3_internal() 64 return ColorProfile(result)
Color Profile P3
Creates a P3 Color Profile
Returns: Graph: A graph node producing a ColorProfile.
66 @staticmethod 67 def png_srgb() -> ColorProfile: 68 """Color Profile PNG sRGB 69 70 Creates a color-format profile that is the same one as PNG sRGB. 71 72 Returns: 73 Graph: A graph node producing a ColorProfile. 74 """ 75 result = _internal.color_profile_p_n_g_s_r_g_b_internal() 76 return ColorProfile(result)
Color Profile PNG sRGB
Creates a color-format profile that is the same one as PNG sRGB.
Returns: Graph: A graph node producing a ColorProfile.
78 @staticmethod 79 def srgb() -> ColorProfile: 80 """Color Profile sRGB 81 82 Creates an sRGB Color Profile 83 84 Returns: 85 Graph: A graph node producing a ColorProfile. 86 """ 87 result = _internal.color_profile_s_r_g_b_internal() 88 return ColorProfile(result)
Color Profile sRGB
Creates an sRGB Color Profile
Returns: Graph: A graph node producing a ColorProfile.
90 @staticmethod 91 def xyz() -> ColorProfile: 92 """Color Profile XYZ 93 94 Creates an XYZ Color Profile 95 96 Returns: 97 Graph: A graph node producing a ColorProfile. 98 """ 99 result = _internal.color_profile_x_y_z_internal() 100 return ColorProfile(result)
Color Profile XYZ
Creates an XYZ Color Profile
Returns: Graph: A graph node producing a ColorProfile.
17class ColorRepresentation(Object): 18 """A color profile paired with a pixel encoding, describing how to interpret raw pixel values.""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 @staticmethod 24 def aces_cg() -> ColorRepresentation: 25 """Color Representation ACEScg 26 27 Creates a Color Representation using the ACEScg Color Profile with linear light, straight alpha pixel values. 28 29 Returns: 30 Graph: A graph node producing a ColorRepresentation. 31 """ 32 result = _internal.color_representation_a_c_e_scg_internal() 33 return ColorRepresentation(result) 34 35 @staticmethod 36 def from_color_profile_and_pixel_encoding(color_profile, pixel_encoding) -> ColorRepresentation: 37 """Color Representation From Color Profile And Pixel Encoding 38 39 Creates a Color Representation by pairing a Color Profile with a Pixel Encoding. 40 41 Args: 42 color_profile: Graph of ColorProfile 43 pixel_encoding: Graph of PixelEncoding 44 45 Returns: 46 Graph: A graph node producing a ColorRepresentation. 47 """ 48 color_profile_parsed = input_parsers.parse_graph(color_profile) 49 pixel_encoding_parsed = input_parsers.parse_graph(pixel_encoding) 50 result = _internal.color_representation_from_color_profile_and_pixel_encoding_internal(color_profile_parsed, pixel_encoding_parsed) 51 return ColorRepresentation(result) 52 53 @staticmethod 54 def oklab_a() -> ColorRepresentation: 55 """Color Representation OkLabA 56 57 Creates a Color Representation using the OkLabA Color Profile with encoded pixel values. 58 59 Returns: 60 Graph: A graph node producing a ColorRepresentation. 61 """ 62 result = _internal.color_representation_ok_lab_a_internal() 63 return ColorRepresentation(result) 64 65 def profile(self) -> color_profile.ColorProfile: 66 """Color Profile of a Color Representation 67 68 Given a color representation. Extracts the color profile of that color representation 69 70 Returns: 71 Graph: A graph node producing a ColorProfile. 72 """ 73 color_representation_parsed = input_parsers.parse_graph(self) 74 result = _internal.color_representation_profile_internal(color_representation_parsed) 75 from .color_profile import ColorProfile 76 return ColorProfile(result) 77 78 @staticmethod 79 def rgb_bt2020() -> ColorRepresentation: 80 """Color Representation BT.2020 81 82 Creates a Color Representation using the BT.2020 Color Profile with gamma-encoded pixel values. 83 84 Returns: 85 Graph: A graph node producing a ColorRepresentation. 86 """ 87 result = _internal.color_representation_r_g_b_b_t2020_internal() 88 return ColorRepresentation(result) 89 90 @staticmethod 91 def srgb() -> ColorRepresentation: 92 """Color Representation sRGB 93 94 Creates a Color Representation using the sRGB Color Profile with gamma-encoded pixel values. 95 96 Returns: 97 Graph: A graph node producing a ColorRepresentation. 98 """ 99 result = _internal.color_representation_s_r_g_b_internal() 100 return ColorRepresentation(result) 101 102 @staticmethod 103 def xyza() -> ColorRepresentation: 104 """Color Representation XYZA 105 106 Creates a Color Representation using the XYZA Color Profile with linear light, straight alpha pixel values. 107 108 Returns: 109 Graph: A graph node producing a ColorRepresentation. 110 """ 111 result = _internal.color_representation_x_y_z_a_internal() 112 return ColorRepresentation(result)
A color profile paired with a pixel encoding, describing how to interpret raw pixel values.
23 @staticmethod 24 def aces_cg() -> ColorRepresentation: 25 """Color Representation ACEScg 26 27 Creates a Color Representation using the ACEScg Color Profile with linear light, straight alpha pixel values. 28 29 Returns: 30 Graph: A graph node producing a ColorRepresentation. 31 """ 32 result = _internal.color_representation_a_c_e_scg_internal() 33 return ColorRepresentation(result)
Color Representation ACEScg
Creates a Color Representation using the ACEScg Color Profile with linear light, straight alpha pixel values.
Returns: Graph: A graph node producing a ColorRepresentation.
35 @staticmethod 36 def from_color_profile_and_pixel_encoding(color_profile, pixel_encoding) -> ColorRepresentation: 37 """Color Representation From Color Profile And Pixel Encoding 38 39 Creates a Color Representation by pairing a Color Profile with a Pixel Encoding. 40 41 Args: 42 color_profile: Graph of ColorProfile 43 pixel_encoding: Graph of PixelEncoding 44 45 Returns: 46 Graph: A graph node producing a ColorRepresentation. 47 """ 48 color_profile_parsed = input_parsers.parse_graph(color_profile) 49 pixel_encoding_parsed = input_parsers.parse_graph(pixel_encoding) 50 result = _internal.color_representation_from_color_profile_and_pixel_encoding_internal(color_profile_parsed, pixel_encoding_parsed) 51 return ColorRepresentation(result)
Color Representation From Color Profile And Pixel Encoding
Creates a Color Representation by pairing a Color Profile with a Pixel Encoding.
Args: color_profile: Graph of ColorProfile pixel_encoding: Graph of PixelEncoding
Returns: Graph: A graph node producing a ColorRepresentation.
53 @staticmethod 54 def oklab_a() -> ColorRepresentation: 55 """Color Representation OkLabA 56 57 Creates a Color Representation using the OkLabA Color Profile with encoded pixel values. 58 59 Returns: 60 Graph: A graph node producing a ColorRepresentation. 61 """ 62 result = _internal.color_representation_ok_lab_a_internal() 63 return ColorRepresentation(result)
Color Representation OkLabA
Creates a Color Representation using the OkLabA Color Profile with encoded pixel values.
Returns: Graph: A graph node producing a ColorRepresentation.
65 def profile(self) -> color_profile.ColorProfile: 66 """Color Profile of a Color Representation 67 68 Given a color representation. Extracts the color profile of that color representation 69 70 Returns: 71 Graph: A graph node producing a ColorProfile. 72 """ 73 color_representation_parsed = input_parsers.parse_graph(self) 74 result = _internal.color_representation_profile_internal(color_representation_parsed) 75 from .color_profile import ColorProfile 76 return ColorProfile(result)
Color Profile of a Color Representation
Given a color representation. Extracts the color profile of that color representation
Returns: Graph: A graph node producing a ColorProfile.
78 @staticmethod 79 def rgb_bt2020() -> ColorRepresentation: 80 """Color Representation BT.2020 81 82 Creates a Color Representation using the BT.2020 Color Profile with gamma-encoded pixel values. 83 84 Returns: 85 Graph: A graph node producing a ColorRepresentation. 86 """ 87 result = _internal.color_representation_r_g_b_b_t2020_internal() 88 return ColorRepresentation(result)
Color Representation BT.2020
Creates a Color Representation using the BT.2020 Color Profile with gamma-encoded pixel values.
Returns: Graph: A graph node producing a ColorRepresentation.
90 @staticmethod 91 def srgb() -> ColorRepresentation: 92 """Color Representation sRGB 93 94 Creates a Color Representation using the sRGB Color Profile with gamma-encoded pixel values. 95 96 Returns: 97 Graph: A graph node producing a ColorRepresentation. 98 """ 99 result = _internal.color_representation_s_r_g_b_internal() 100 return ColorRepresentation(result)
Color Representation sRGB
Creates a Color Representation using the sRGB Color Profile with gamma-encoded pixel values.
Returns: Graph: A graph node producing a ColorRepresentation.
102 @staticmethod 103 def xyza() -> ColorRepresentation: 104 """Color Representation XYZA 105 106 Creates a Color Representation using the XYZA Color Profile with linear light, straight alpha pixel values. 107 108 Returns: 109 Graph: A graph node producing a ColorRepresentation. 110 """ 111 result = _internal.color_representation_x_y_z_a_internal() 112 return ColorRepresentation(result)
Color Representation XYZA
Creates a Color Representation using the XYZA Color Profile with linear light, straight alpha pixel values.
Returns: Graph: A graph node producing a ColorRepresentation.
24class Composition(Object): 25 """A composition to create an image.""" 26 27 def execute(self, context): 28 return self._inner.execute(context).as_composition() 29 30 @staticmethod 31 def load(value) -> Composition: 32 return Composition(input_parsers.parse_composition_graph(value)) 33 34 def absolute_value(self) -> Composition: 35 """Composition Absolute Value 36 37 Takes the absolute value of all the pixels in the image. 38 39 Returns: 40 Graph: A graph node producing a Composition. 41 """ 42 image_parsed = input_parsers.parse_graph(self) 43 result = _internal.composition_absolute_value_internal(image_parsed) 44 return Composition(result) 45 46 def blend_add(self, background, foreground_transform) -> Composition: 47 """Composition Blend Add 48 49 Adds the foreground and background images together using additive blending. 50 51 Args: 52 background: Graph of Composition 53 foreground_transform: Graph of Transform2 54 55 Returns: 56 Graph: A graph node producing a Composition. 57 """ 58 foreground_parsed = input_parsers.parse_graph(self) 59 background_parsed = input_parsers.parse_graph(background) 60 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 61 result = _internal.composition_blend_add_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 62 return Composition(result) 63 64 def blend_alpha(self, background, foreground_transform) -> Composition: 65 """Composition Blend Alpha 66 67 Blends between the foreground and background using the alpha component of the foreground. 1 is foreground. 0 is background. 68 69 Args: 70 background: Graph of Composition 71 foreground_transform: Graph of Transform2 72 73 Returns: 74 Graph: A graph node producing a Composition. 75 """ 76 foreground_parsed = input_parsers.parse_graph(self) 77 background_parsed = input_parsers.parse_graph(background) 78 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 79 result = _internal.composition_blend_alpha_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 80 return Composition(result) 81 82 def blend_max(self, background, foreground_transform) -> Composition: 83 """Composition Blend Max 84 85 Blends the foreground and background images using maximum value blending. 86 87 Args: 88 background: Graph of Composition 89 foreground_transform: Graph of Transform2 90 91 Returns: 92 Graph: A graph node producing a Composition. 93 """ 94 foreground_parsed = input_parsers.parse_graph(self) 95 background_parsed = input_parsers.parse_graph(background) 96 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 97 result = _internal.composition_blend_max_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 98 return Composition(result) 99 100 def blend_min(self, background, foreground_transform) -> Composition: 101 """Composition Blend Min 102 103 Blends the foreground and background images using minimum blending, taking the minimum value for each pixel. 104 105 Args: 106 background: Graph of Composition 107 foreground_transform: Graph of Transform2 108 109 Returns: 110 Graph: A graph node producing a Composition. 111 """ 112 foreground_parsed = input_parsers.parse_graph(self) 113 background_parsed = input_parsers.parse_graph(background) 114 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 115 result = _internal.composition_blend_min_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 116 return Composition(result) 117 118 def blend_multiply(self, background, foreground_transform) -> Composition: 119 """Composition Blend Multiply 120 121 Multiplies the foreground and background images together using multiply blending. 122 123 Args: 124 background: Graph of Composition 125 foreground_transform: Graph of Transform2 126 127 Returns: 128 Graph: A graph node producing a Composition. 129 """ 130 foreground_parsed = input_parsers.parse_graph(self) 131 background_parsed = input_parsers.parse_graph(background) 132 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 133 result = _internal.composition_blend_multiply_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 134 return Composition(result) 135 136 def blend_stencil(self, background, foreground_transform) -> Composition: 137 """Composition Blend Stencil 138 139 Blends the foreground and background images using stencil blending. When the foreground is over the background, the foreground's alpha and the background's r, g and b are used. 140 141 Args: 142 background: Graph of Composition 143 foreground_transform: Graph of Transform2 144 145 Returns: 146 Graph: A graph node producing a Composition. 147 """ 148 foreground_parsed = input_parsers.parse_graph(self) 149 background_parsed = input_parsers.parse_graph(background) 150 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 151 result = _internal.composition_blend_stencil_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 152 return Composition(result) 153 154 def blend_subtract(self, background, foreground_transform) -> Composition: 155 """Composition Blend Subtract 156 157 Subtracts the foreground image from the background image using subtractive blending. 158 159 Args: 160 background: Graph of Composition 161 foreground_transform: Graph of Transform2 162 163 Returns: 164 Graph: A graph node producing a Composition. 165 """ 166 foreground_parsed = input_parsers.parse_graph(self) 167 background_parsed = input_parsers.parse_graph(background) 168 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 169 result = _internal.composition_blend_subtract_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 170 return Composition(result) 171 172 def bloom(self, threshold, sigma, intensity) -> Composition: 173 """Composition Bloom 174 175 Adds a soft bloom glow by blurring the image's bright areas and additively blending them back over the original. Threshold selects bright areas (OkLab lightness), sigma controls glow spread, intensity scales the glow strength. 176 177 Args: 178 threshold: Graph of Float 179 sigma: Graph of Float 180 intensity: Graph of Float 181 182 Returns: 183 Graph: A graph node producing a Composition. 184 """ 185 composition_parsed = input_parsers.parse_graph(self) 186 threshold_parsed = input_parsers.parse_float_graph(threshold) 187 sigma_parsed = input_parsers.parse_float_graph(sigma) 188 intensity_parsed = input_parsers.parse_float_graph(intensity) 189 result = _internal.composition_bloom_internal(composition_parsed, threshold_parsed, sigma_parsed, intensity_parsed) 190 return Composition(result) 191 192 def bounds(self) -> bounds2f.Bounds2f: 193 """Composition Bounds 194 195 Computes the bounding box of a composition. 196 197 Returns: 198 Graph: A graph node producing a Bounds2f. 199 """ 200 composition_parsed = input_parsers.parse_graph(self) 201 result = _internal.composition_bounds_internal(composition_parsed) 202 from .bounds2f import Bounds2f 203 return Bounds2f(result) 204 205 def box_blur(self, dimension) -> Composition: 206 """Composition Box Blur 207 208 Applies a box blur to an image. Dimension is the size. 1 corresponding to 3x3, 2 5x5 and so on. 209 210 Args: 211 dimension: Graph of Int 212 213 Returns: 214 Graph: A graph node producing a Composition. 215 """ 216 composition_parsed = input_parsers.parse_graph(self) 217 dimension_parsed = input_parsers.parse_int_graph(dimension) 218 result = _internal.composition_box_blur_internal(composition_parsed, dimension_parsed) 219 return Composition(result) 220 221 def brightness_adjust(self, scale) -> Composition: 222 """Composition Brightness Adjust 223 224 Adjusts an image's brightness by offsetting the L component in OkLab. A scale of 0 leaves brightness unchanged, positive values brighten, and negative values darken. 225 226 Args: 227 scale: Graph of Float 228 229 Returns: 230 Graph: A graph node producing a Composition. 231 """ 232 composition_parsed = input_parsers.parse_graph(self) 233 scale_parsed = input_parsers.parse_float_graph(scale) 234 result = _internal.composition_brightness_adjust_internal(composition_parsed, scale_parsed) 235 return Composition(result) 236 237 def chroma_offset(self, offset) -> Composition: 238 """Composition Chroma Offset 239 240 Applies a chroma offset to an image. This is done by modifying the a and b components of OkLab. For the vector, X applies to a, Y to to b. 241 242 Args: 243 offset: Graph of Vector2f 244 245 Returns: 246 Graph: A graph node producing a Composition. 247 """ 248 composition_parsed = input_parsers.parse_graph(self) 249 offset_parsed = input_parsers.parse_graph(offset) 250 result = _internal.composition_chroma_offset_internal(composition_parsed, offset_parsed) 251 return Composition(result) 252 253 def color_convert(self, color_profile) -> Composition: 254 """Composition Color Convert 255 256 Converts a Composition from one color space to another. 257 258 Args: 259 color_profile: Graph of ColorProfile 260 261 Returns: 262 Graph: A graph node producing a Composition. 263 """ 264 composition_parsed = input_parsers.parse_graph(self) 265 color_profile_parsed = input_parsers.parse_graph(color_profile) 266 result = _internal.composition_color_convert_internal(composition_parsed, color_profile_parsed) 267 return Composition(result) 268 269 def color_invert(self) -> Composition: 270 """Composition Color Invert 271 272 Applies a color invert operation to a composition. Taking 1 and subtracting each RGB operation against it. Works in linear color. 273 274 Returns: 275 Graph: A graph node producing a Composition. 276 """ 277 composition_parsed = input_parsers.parse_graph(self) 278 result = _internal.composition_color_invert_internal(composition_parsed) 279 return Composition(result) 280 281 def color_representation(self) -> color_representation.ColorRepresentation: 282 """Composition Color Representation 283 284 Gets the color representation associated with a Composition 285 286 Returns: 287 Graph: A graph node producing a ColorRepresentation. 288 """ 289 composition_parsed = input_parsers.parse_graph(self) 290 result = _internal.composition_color_representation_internal(composition_parsed) 291 from .color_representation import ColorRepresentation 292 return ColorRepresentation(result) 293 294 def color_threshold(self, threshold) -> Composition: 295 """Composition Color Threshold 296 297 Applies a color threshold to a Composition 298 299 Args: 300 threshold: Graph of Float 301 302 Returns: 303 Graph: A graph node producing a Composition. 304 """ 305 composition_parsed = input_parsers.parse_graph(self) 306 threshold_parsed = input_parsers.parse_float_graph(threshold) 307 result = _internal.composition_color_threshold_internal(composition_parsed, threshold_parsed) 308 return Composition(result) 309 310 def color_transformer_shader(self, function_body, helpers, input_color_representation, output_color_representation, inputs) -> Composition: 311 """Composition Color Transformer Shader 312 313 Defines a custom shader that takes an input color and then transforms that color to an output color. 314 315 Args: 316 function_body: Graph of String 317 helpers: Graph of String 318 input_color_representation: Graph of ColorRepresentation 319 output_color_representation: Graph of ColorRepresentation 320 inputs: Graph of Dictionary 321 322 Returns: 323 Graph: A graph node producing a Composition. 324 """ 325 composition_parsed = input_parsers.parse_graph(self) 326 function_body_parsed = input_parsers.parse_string_graph(function_body) 327 helpers_parsed = input_parsers.parse_string_graph(helpers) 328 input_color_representation_parsed = input_parsers.parse_graph(input_color_representation) 329 output_color_representation_parsed = input_parsers.parse_graph(output_color_representation) 330 inputs_parsed = input_parsers.parse_graph(inputs) 331 result = _internal.composition_color_transformer_shader_internal(composition_parsed, function_body_parsed, helpers_parsed, input_color_representation_parsed, output_color_representation_parsed, inputs_parsed) 332 return Composition(result) 333 334 def connected_component_boxes(self) -> bounds2i_list.Bounds2iList: 335 """Composition Connected Component Boxes 336 337 Finds boxes with a r alpha channel value greater than 0.5 in the image. Recommended to use a binary image for this. 338 339 Returns: 340 Graph: A graph node producing a Bounds2iList. 341 """ 342 composition_parsed = input_parsers.parse_graph(self) 343 result = _internal.composition_connected_component_boxes_internal(composition_parsed) 344 from .bounds2i_list import Bounds2iList 345 return Bounds2iList(result) 346 347 def contrast_adjustment(self, contrast) -> Composition: 348 """Composition Contrast Adjustment 349 350 Adjusts the contrast of a Composition 351 352 Args: 353 contrast: Graph of Float 354 355 Returns: 356 Graph: A graph node producing a Composition. 357 """ 358 composition_parsed = input_parsers.parse_graph(self) 359 contrast_parsed = input_parsers.parse_float_graph(contrast) 360 result = _internal.composition_contrast_adjustment_internal(composition_parsed, contrast_parsed) 361 return Composition(result) 362 363 def convolution(self, kernel, kernel_width, kernel_height) -> Composition: 364 """Composition Convolution 365 366 Performs a convolution on an composition 367 368 Args: 369 kernel: Graph of FloatList 370 kernel_width: Graph of Int 371 kernel_height: Graph of Int 372 373 Returns: 374 Graph: A graph node producing a Composition. 375 """ 376 composition_parsed = input_parsers.parse_graph(self) 377 kernel_parsed = input_parsers.parse_graph(kernel) 378 kernel_width_parsed = input_parsers.parse_int_graph(kernel_width) 379 kernel_height_parsed = input_parsers.parse_int_graph(kernel_height) 380 result = _internal.composition_convolution_internal(composition_parsed, kernel_parsed, kernel_width_parsed, kernel_height_parsed) 381 return Composition(result) 382 383 def crop(self, rect) -> Composition: 384 """Composition Crop 385 386 Applies a crop to a Composition 387 388 Args: 389 rect: Graph of Bounds2f 390 391 Returns: 392 Graph: A graph node producing a Composition. 393 """ 394 composition_parsed = input_parsers.parse_graph(self) 395 rect_parsed = input_parsers.parse_graph(rect) 396 result = _internal.composition_crop_internal(composition_parsed, rect_parsed) 397 return Composition(result) 398 399 def duotone(self, threshold, color_1, color_2) -> Composition: 400 """Composition Duotone 401 402 Creates a duotone effect. Colors below the threshold will be color 1, colors above will be color 2. 403 404 Args: 405 threshold: Graph of Float 406 color_1: Graph of ProfiledColor 407 color_2: Graph of ProfiledColor 408 409 Returns: 410 Graph: A graph node producing a Composition. 411 """ 412 composition_parsed = input_parsers.parse_graph(self) 413 threshold_parsed = input_parsers.parse_float_graph(threshold) 414 color_1_parsed = input_parsers.parse_graph(color_1) 415 color_2_parsed = input_parsers.parse_graph(color_2) 416 result = _internal.composition_duotone_internal(composition_parsed, threshold_parsed, color_1_parsed, color_2_parsed) 417 return Composition(result) 418 419 def emboss(self, angle, distance, amount) -> Composition: 420 """Composition Emboss 421 422 Applies an emboss effect, turning edges into a raised relief lit from the given angle. Flat areas become mid-gray; a negative amount debosses. 423 424 Args: 425 angle: Graph of Float 426 distance: Graph of Float 427 amount: Graph of Float 428 429 Returns: 430 Graph: A graph node producing a Composition. 431 """ 432 composition_parsed = input_parsers.parse_graph(self) 433 angle_parsed = input_parsers.parse_float_graph(angle) 434 distance_parsed = input_parsers.parse_float_graph(distance) 435 amount_parsed = input_parsers.parse_float_graph(amount) 436 result = _internal.composition_emboss_internal(composition_parsed, angle_parsed, distance_parsed, amount_parsed) 437 return Composition(result) 438 439 def exposure_adjust(self, steps) -> Composition: 440 """Composition Exposure Adjust 441 442 Updates the exposure of your image. Internally, will multiply the linear version of RGB values by a value that equals 2^step. 443 444 Args: 445 steps: Graph of Float 446 447 Returns: 448 Graph: A graph node producing a Composition. 449 """ 450 composition_parsed = input_parsers.parse_graph(self) 451 steps_parsed = input_parsers.parse_float_graph(steps) 452 result = _internal.composition_exposure_adjust_internal(composition_parsed, steps_parsed) 453 return Composition(result) 454 455 def film_grain(self, grain_strength, fine_grain_frequency, fine_weight, medium_grain_frequency, medium_weight, high_grain_frequency, high_weight) -> Composition: 456 """Composition Film Grain 457 458 adds multi-octave value-noise film grain in OkLabA - grain_strength controls the overall intensity, and the fine/medium/high frequency and weight pairs control the size and contribution of each grain octave. 459 460 Args: 461 grain_strength: Graph of Float 462 fine_grain_frequency: Graph of Float 463 fine_weight: Graph of Float 464 medium_grain_frequency: Graph of Float 465 medium_weight: Graph of Float 466 high_grain_frequency: Graph of Float 467 high_weight: Graph of Float 468 469 Returns: 470 Graph: A graph node producing a Composition. 471 """ 472 composition_parsed = input_parsers.parse_graph(self) 473 grain_strength_parsed = input_parsers.parse_float_graph(grain_strength) 474 fine_grain_frequency_parsed = input_parsers.parse_float_graph(fine_grain_frequency) 475 fine_weight_parsed = input_parsers.parse_float_graph(fine_weight) 476 medium_grain_frequency_parsed = input_parsers.parse_float_graph(medium_grain_frequency) 477 medium_weight_parsed = input_parsers.parse_float_graph(medium_weight) 478 high_grain_frequency_parsed = input_parsers.parse_float_graph(high_grain_frequency) 479 high_weight_parsed = input_parsers.parse_float_graph(high_weight) 480 result = _internal.composition_film_grain_internal(composition_parsed, grain_strength_parsed, fine_grain_frequency_parsed, fine_weight_parsed, medium_grain_frequency_parsed, medium_weight_parsed, high_grain_frequency_parsed, high_weight_parsed) 481 return Composition(result) 482 483 def fisheye(self, center, radius, strength) -> Composition: 484 """Composition Fisheye 485 486 Applies a fisheye lens distortion to this composition, magnifying the center and compressing the edges 487 488 Args: 489 center: Graph of Vector2f 490 radius: Graph of Float 491 strength: Graph of Float 492 493 Returns: 494 Graph: A graph node producing a Composition. 495 """ 496 composition_parsed = input_parsers.parse_graph(self) 497 center_parsed = input_parsers.parse_graph(center) 498 radius_parsed = input_parsers.parse_float_graph(radius) 499 strength_parsed = input_parsers.parse_float_graph(strength) 500 result = _internal.composition_fisheye_internal(composition_parsed, center_parsed, radius_parsed, strength_parsed) 501 return Composition(result) 502 503 def flip_horizontal(self) -> Composition: 504 """Composition Flip Horizontal 505 506 Flips the image along the horizontal axis 507 508 Returns: 509 Graph: A graph node producing a Composition. 510 """ 511 composition_parsed = input_parsers.parse_graph(self) 512 result = _internal.composition_flip_horizontal_internal(composition_parsed) 513 return Composition(result) 514 515 def flip_vertical(self) -> Composition: 516 """Composition Flip Vertical 517 518 Flips the image vertically 519 520 Returns: 521 Graph: A graph node producing a Composition. 522 """ 523 composition_parsed = input_parsers.parse_graph(self) 524 result = _internal.composition_flip_vertical_internal(composition_parsed) 525 return Composition(result) 526 527 @staticmethod 528 def freeform_shader(function_body, helpers, bounds, working_color_representation, inputs) -> Composition: 529 """Composition Freeform Shader 530 531 Given a bounds and a shader, allows you to generate an image. 532 533 Args: 534 function_body: Graph of String 535 helpers: Graph of String 536 bounds: Graph of Bounds2f 537 working_color_representation: Graph of ColorRepresentation 538 inputs: Graph of Dictionary 539 540 Returns: 541 Graph: A graph node producing a Composition. 542 """ 543 function_body_parsed = input_parsers.parse_string_graph(function_body) 544 helpers_parsed = input_parsers.parse_string_graph(helpers) 545 bounds_parsed = input_parsers.parse_graph(bounds) 546 working_color_representation_parsed = input_parsers.parse_graph(working_color_representation) 547 inputs_parsed = input_parsers.parse_graph(inputs) 548 result = _internal.composition_freeform_shader_internal(function_body_parsed, helpers_parsed, bounds_parsed, working_color_representation_parsed, inputs_parsed) 549 return Composition(result) 550 551 @staticmethod 552 def from_image(image) -> Composition: 553 """Composition from Image 554 555 Creates an composition out of an image 556 557 Args: 558 image: Graph of Image 559 560 Returns: 561 Graph: A graph node producing a Composition. 562 """ 563 image_parsed = input_parsers.parse_graph(image) 564 result = _internal.composition_from_image_internal(image_parsed) 565 return Composition(result) 566 567 @staticmethod 568 def from_path(path) -> Composition: 569 """Composition from Path 570 571 Loads an image from a file path or URL, decodes its bytes, and creates a Composition from it. 572 573 Args: 574 path: Graph of String 575 576 Returns: 577 Graph: A graph node producing a Composition. 578 """ 579 path_parsed = input_parsers.parse_string_graph(path) 580 result = _internal.composition_from_path_internal(path_parsed) 581 return Composition(result) 582 583 def gaussian_blur(self, sigma) -> Composition: 584 """Composition Gaussian Blur 585 586 Applies a gaussian blur to an image. Sigma controls the blur intensity. 587 588 Args: 589 sigma: Graph of Float 590 591 Returns: 592 Graph: A graph node producing a Composition. 593 """ 594 composition_parsed = input_parsers.parse_graph(self) 595 sigma_parsed = input_parsers.parse_float_graph(sigma) 596 result = _internal.composition_gaussian_blur_internal(composition_parsed, sigma_parsed) 597 return Composition(result) 598 599 def grayscale(self) -> Composition: 600 """Composition Grayscale 601 602 Applies grayscale to a Composition 603 604 Returns: 605 Graph: A graph node producing a Composition. 606 """ 607 composition_parsed = input_parsers.parse_graph(self) 608 result = _internal.composition_grayscale_internal(composition_parsed) 609 return Composition(result) 610 611 def halftone(self, pixel_size, foreground_color, background_color) -> Composition: 612 """Composition Halftone 613 614 Applies a halftone effect to a composition, tiling it into cells and painting a foreground-colored dot in each cell whose radius grows as the cell darkens, over a background color. 615 616 Args: 617 pixel_size: Graph of Int 618 foreground_color: Graph of ProfiledColor 619 background_color: Graph of ProfiledColor 620 621 Returns: 622 Graph: A graph node producing a Composition. 623 """ 624 composition_parsed = input_parsers.parse_graph(self) 625 pixel_size_parsed = input_parsers.parse_int_graph(pixel_size) 626 foreground_color_parsed = input_parsers.parse_graph(foreground_color) 627 background_color_parsed = input_parsers.parse_graph(background_color) 628 result = _internal.composition_halftone_internal(composition_parsed, pixel_size_parsed, foreground_color_parsed, background_color_parsed) 629 return Composition(result) 630 631 def kaleidoscope(self, segments, rotation, warp, warp_frequency) -> Composition: 632 """Composition Kaleidoscope 633 634 Applies a kaleidoscope effect, folding the image into mirrored wedges around the center. segments controls the number of wedges, rotation spins the pattern, and warp/warp_frequency add a radial glass-like distortion. 635 636 Args: 637 segments: Graph of Float 638 rotation: Graph of Float 639 warp: Graph of Float 640 warp_frequency: Graph of Float 641 642 Returns: 643 Graph: A graph node producing a Composition. 644 """ 645 composition_parsed = input_parsers.parse_graph(self) 646 segments_parsed = input_parsers.parse_float_graph(segments) 647 rotation_parsed = input_parsers.parse_float_graph(rotation) 648 warp_parsed = input_parsers.parse_float_graph(warp) 649 warp_frequency_parsed = input_parsers.parse_float_graph(warp_frequency) 650 result = _internal.composition_kaleidoscope_internal(composition_parsed, segments_parsed, rotation_parsed, warp_parsed, warp_frequency_parsed) 651 return Composition(result) 652 653 def l_curve(self, l_curve) -> Composition: 654 """Composition Lightness Curve 655 656 Applies a curve to the L component in an OkLab color. Adjusting the lightness of the image. 657 658 Args: 659 l_curve: Graph of Curve 660 661 Returns: 662 Graph: A graph node producing a Composition. 663 """ 664 composition_parsed = input_parsers.parse_graph(self) 665 l_curve_parsed = input_parsers.parse_graph(l_curve) 666 result = _internal.composition_l_curve_internal(composition_parsed, l_curve_parsed) 667 return Composition(result) 668 669 def lightness_threshold(self, threshold) -> Composition: 670 """Composition Lightness Threshold 671 672 Thresholds a Composition by OkLab lightness, producing an opaque white mask where lightness exceeds the threshold and transparent black elsewhere. 673 674 Args: 675 threshold: Graph of Float 676 677 Returns: 678 Graph: A graph node producing a Composition. 679 """ 680 composition_parsed = input_parsers.parse_graph(self) 681 threshold_parsed = input_parsers.parse_float_graph(threshold) 682 result = _internal.composition_lightness_threshold_internal(composition_parsed, threshold_parsed) 683 return Composition(result) 684 685 def linear_transform(self, entry_0_0, entry_0_1, entry_0_2, entry_0_3, entry_1_0, entry_1_1, entry_1_2, entry_1_3, entry_2_0, entry_2_1, entry_2_2, entry_2_3, entry_3_0, entry_3_1, entry_3_2, entry_3_3) -> Composition: 686 """Composition RGBA Linear Transform 687 688 Applies a linear transform to a Composition's RGBA values. Before application, will convert to a linear version of the color profile and will convert to an RGB profile if needed. 689 690 Args: 691 entry_0_0: Graph of Float 692 entry_0_1: Graph of Float 693 entry_0_2: Graph of Float 694 entry_0_3: Graph of Float 695 entry_1_0: Graph of Float 696 entry_1_1: Graph of Float 697 entry_1_2: Graph of Float 698 entry_1_3: Graph of Float 699 entry_2_0: Graph of Float 700 entry_2_1: Graph of Float 701 entry_2_2: Graph of Float 702 entry_2_3: Graph of Float 703 entry_3_0: Graph of Float 704 entry_3_1: Graph of Float 705 entry_3_2: Graph of Float 706 entry_3_3: Graph of Float 707 708 Returns: 709 Graph: A graph node producing a Composition. 710 """ 711 composition_parsed = input_parsers.parse_graph(self) 712 entry_0_0_parsed = input_parsers.parse_float_graph(entry_0_0) 713 entry_0_1_parsed = input_parsers.parse_float_graph(entry_0_1) 714 entry_0_2_parsed = input_parsers.parse_float_graph(entry_0_2) 715 entry_0_3_parsed = input_parsers.parse_float_graph(entry_0_3) 716 entry_1_0_parsed = input_parsers.parse_float_graph(entry_1_0) 717 entry_1_1_parsed = input_parsers.parse_float_graph(entry_1_1) 718 entry_1_2_parsed = input_parsers.parse_float_graph(entry_1_2) 719 entry_1_3_parsed = input_parsers.parse_float_graph(entry_1_3) 720 entry_2_0_parsed = input_parsers.parse_float_graph(entry_2_0) 721 entry_2_1_parsed = input_parsers.parse_float_graph(entry_2_1) 722 entry_2_2_parsed = input_parsers.parse_float_graph(entry_2_2) 723 entry_2_3_parsed = input_parsers.parse_float_graph(entry_2_3) 724 entry_3_0_parsed = input_parsers.parse_float_graph(entry_3_0) 725 entry_3_1_parsed = input_parsers.parse_float_graph(entry_3_1) 726 entry_3_2_parsed = input_parsers.parse_float_graph(entry_3_2) 727 entry_3_3_parsed = input_parsers.parse_float_graph(entry_3_3) 728 result = _internal.composition_linear_transform_internal(composition_parsed, entry_0_0_parsed, entry_0_1_parsed, entry_0_2_parsed, entry_0_3_parsed, entry_1_0_parsed, entry_1_1_parsed, entry_1_2_parsed, entry_1_3_parsed, entry_2_0_parsed, entry_2_1_parsed, entry_2_2_parsed, entry_2_3_parsed, entry_3_0_parsed, entry_3_1_parsed, entry_3_2_parsed, entry_3_3_parsed) 729 return Composition(result) 730 731 def liquify(self, amplitude, frequency) -> Composition: 732 """Composition Liquify 733 734 Applies a sinusoidal liquify distortion to this composition, displacing pixels by a wave whose size is controlled by amplitude and whose density is controlled by frequency. 735 736 Args: 737 amplitude: Graph of Float 738 frequency: Graph of Float 739 740 Returns: 741 Graph: A graph node producing a Composition. 742 """ 743 composition_parsed = input_parsers.parse_graph(self) 744 amplitude_parsed = input_parsers.parse_float_graph(amplitude) 745 frequency_parsed = input_parsers.parse_float_graph(frequency) 746 result = _internal.composition_liquify_internal(composition_parsed, amplitude_parsed, frequency_parsed) 747 return Composition(result) 748 749 def locate(self, prompt, positive_points, negative_points) -> bounds2f_list.Bounds2fList: 750 """Composition Locate 751 752 Finds the location of a prompt within the image. 753 754 Args: 755 prompt: Graph of String 756 positive_points: Graph of Point2iList 757 negative_points: Graph of Point2iList 758 759 Returns: 760 Graph: A graph node producing a Bounds2fList. 761 """ 762 composition_parsed = input_parsers.parse_graph(self) 763 prompt_parsed = input_parsers.parse_string_graph(prompt) 764 positive_points_parsed = input_parsers.parse_graph(positive_points) 765 negative_points_parsed = input_parsers.parse_graph(negative_points) 766 result = _internal.composition_locate_internal(composition_parsed, prompt_parsed, positive_points_parsed, negative_points_parsed) 767 from .bounds2f_list import Bounds2fList 768 return Bounds2fList(result) 769 770 def max_color(self) -> profiled_color.ProfiledColor: 771 """Composition Max Color 772 773 Computes the maximum color in a composition. Works by finding the maximum L, a and b and alpha components of an OkLabA color. 774 775 Returns: 776 Graph: A graph node producing a ProfiledColor. 777 """ 778 composition_parsed = input_parsers.parse_graph(self) 779 result = _internal.composition_max_color_internal(composition_parsed) 780 from .profiled_color import ProfiledColor 781 return ProfiledColor(result) 782 783 def median(self, kernel_size) -> Composition: 784 """Composition Median 785 786 Applies a per-channel median filter to a composition over a square window, reducing noise while preserving edges. kernel_size controls the window size (window width is 2*kernel_size-1). 787 788 Args: 789 kernel_size: Graph of Int 790 791 Returns: 792 Graph: A graph node producing a Composition. 793 """ 794 composition_parsed = input_parsers.parse_graph(self) 795 kernel_size_parsed = input_parsers.parse_int_graph(kernel_size) 796 result = _internal.composition_median_internal(composition_parsed, kernel_size_parsed) 797 return Composition(result) 798 799 def min_color(self) -> profiled_color.ProfiledColor: 800 """Composition Min Color 801 802 Computes the minimum color in a composition. Works by finding the minimum L, a and b and alpha components of an OkLabA color. 803 804 Returns: 805 Graph: A graph node producing a ProfiledColor. 806 """ 807 composition_parsed = input_parsers.parse_graph(self) 808 result = _internal.composition_min_color_internal(composition_parsed) 809 from .profiled_color import ProfiledColor 810 return ProfiledColor(result) 811 812 def min_max_colors(self) -> profiled_color_list.ProfiledColorList: 813 """Composition Min Max Colors 814 815 Computes the minimum and maximum colors in a composition. Works by finding the minimum and maximum L, a and b and alpha components of an OkLabA color. 816 817 Returns: 818 Graph: A graph node producing a ProfiledColorList. 819 """ 820 composition_parsed = input_parsers.parse_graph(self) 821 result = _internal.composition_min_max_colors_internal(composition_parsed) 822 from .profiled_color_list import ProfiledColorList 823 return ProfiledColorList(result) 824 825 @staticmethod 826 def monet_women_with_parasol() -> Composition: 827 """Monet's Women with a Parasol 828 829 Creates a composition from Monet's "Women with a Parasol" painting. Used frequently as a test asset. 830 831 Returns: 832 Graph: A graph node producing a Composition. 833 """ 834 result = _internal.composition_monet_women_with_parasol_internal() 835 return Composition(result) 836 837 def morphological_max(self, dimension) -> Composition: 838 """Composition Morphological Max 839 840 Apples a morphological max operation. 841 842 Args: 843 dimension: Graph of Int 844 845 Returns: 846 Graph: A graph node producing a Composition. 847 """ 848 composition_parsed = input_parsers.parse_graph(self) 849 dimension_parsed = input_parsers.parse_int_graph(dimension) 850 result = _internal.composition_morphological_max_internal(composition_parsed, dimension_parsed) 851 return Composition(result) 852 853 def morphological_min(self, dimension) -> Composition: 854 """Composition Morphological Min 855 856 Apples a morphological min operation. 857 858 Args: 859 dimension: Graph of Int 860 861 Returns: 862 Graph: A graph node producing a Composition. 863 """ 864 composition_parsed = input_parsers.parse_graph(self) 865 dimension_parsed = input_parsers.parse_int_graph(dimension) 866 result = _internal.composition_morphological_min_internal(composition_parsed, dimension_parsed) 867 return Composition(result) 868 869 def negative(self) -> Composition: 870 """Composition Negative 871 872 Creates the effect of a negative image by subracting from each component of the image. 873 874 Returns: 875 Graph: A graph node producing a Composition. 876 """ 877 composition_parsed = input_parsers.parse_graph(self) 878 result = _internal.composition_negative_internal(composition_parsed) 879 return Composition(result) 880 881 def nonlinear_rgb_blend_alpha(self, background, foreground_transform) -> Composition: 882 """Composition Nonlinear RGB Blend Alpha 883 884 A specialized version of CompositionBlendAlpha. Blends in a non-linear RGB. 885 886 Args: 887 background: Graph of Composition 888 foreground_transform: Graph of Transform2 889 890 Returns: 891 Graph: A graph node producing a Composition. 892 """ 893 foreground_parsed = input_parsers.parse_graph(self) 894 background_parsed = input_parsers.parse_graph(background) 895 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 896 result = _internal.composition_nonlinear_r_g_b_blend_alpha_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 897 return Composition(result) 898 899 def opacity_scales(self, scale) -> Composition: 900 """Composition Opacity Scale 901 902 Changes the opacity of an image by multiplying it by a scalar. 903 904 Args: 905 scale: Graph of Float 906 907 Returns: 908 Graph: A graph node producing a Composition. 909 """ 910 composition_parsed = input_parsers.parse_graph(self) 911 scale_parsed = input_parsers.parse_float_graph(scale) 912 result = _internal.composition_opacity_scale_internal(composition_parsed, scale_parsed) 913 return Composition(result) 914 915 @staticmethod 916 def painter(painter) -> Composition: 917 """Composition Painter 918 919 Creates a composition from a painter. 920 921 Args: 922 painter: Graph of Painter 923 924 Returns: 925 Graph: A graph node producing a Composition. 926 """ 927 painter_parsed = input_parsers.parse_graph(painter) 928 result = _internal.composition_painter_internal(painter_parsed) 929 return Composition(result) 930 931 def to_palette(self, size) -> profiled_color_list.ProfiledColorList: 932 """Composition Palette 933 934 Generates a palette of the most dominant colors of a composition. 935 936 Args: 937 size: Graph of Int 938 939 Returns: 940 Graph: A graph node producing a ProfiledColorList. 941 """ 942 composition_parsed = input_parsers.parse_graph(self) 943 size_parsed = input_parsers.parse_int_graph(size) 944 result = _internal.composition_palette_internal(composition_parsed, size_parsed) 945 from .profiled_color_list import ProfiledColorList 946 return ProfiledColorList(result) 947 948 def palette_reduction(self, palette) -> Composition: 949 """Composition Palette Reduction 950 951 Reduces the number of colors in a composition to a specified palette. 952 953 Args: 954 palette: Graph of ProfiledColorList 955 956 Returns: 957 Graph: A graph node producing a Composition. 958 """ 959 composition_parsed = input_parsers.parse_graph(self) 960 palette_parsed = input_parsers.parse_graph(palette) 961 result = _internal.composition_palette_reduction_internal(composition_parsed, palette_parsed) 962 return Composition(result) 963 964 def pixelate(self, pixel_size) -> Composition: 965 """Composition Pixelate 966 967 Applies a pixelation effect to a composition. 968 969 Args: 970 pixel_size: Graph of Int 971 972 Returns: 973 Graph: A graph node producing a Composition. 974 """ 975 composition_parsed = input_parsers.parse_graph(self) 976 pixel_size_parsed = input_parsers.parse_int_graph(pixel_size) 977 result = _internal.composition_pixelate_internal(composition_parsed, pixel_size_parsed) 978 return Composition(result) 979 980 def point_effect_shader(self, function_body, helpers, effect_center_point, effect_radius, inputs, working_color_representation) -> Composition: 981 """Composition Point Effect Shader 982 983 Runs a custom shader over a circular region around an effect center point. 984 985 Args: 986 function_body: Graph of String 987 helpers: Graph of String 988 effect_center_point: Graph of Point2f 989 effect_radius: Graph of Float 990 inputs: Graph of Dictionary 991 working_color_representation: Graph of ColorRepresentation 992 993 Returns: 994 Graph: A graph node producing a Composition. 995 """ 996 composition_parsed = input_parsers.parse_graph(self) 997 function_body_parsed = input_parsers.parse_string_graph(function_body) 998 helpers_parsed = input_parsers.parse_string_graph(helpers) 999 effect_center_point_parsed = input_parsers.parse_graph(effect_center_point) 1000 effect_radius_parsed = input_parsers.parse_float_graph(effect_radius) 1001 inputs_parsed = input_parsers.parse_graph(inputs) 1002 working_color_representation_parsed = input_parsers.parse_graph(working_color_representation) 1003 result = _internal.composition_point_effect_shader_internal(composition_parsed, function_body_parsed, helpers_parsed, effect_center_point_parsed, effect_radius_parsed, inputs_parsed, working_color_representation_parsed) 1004 return Composition(result) 1005 1006 def r_g_b_curve(self, r_curve, g_curve, b_curve) -> Composition: 1007 """Composition RGB Curve 1008 1009 Applies a curve to the R, G, and B components 1010 1011 Args: 1012 r_curve: Graph of Curve 1013 g_curve: Graph of Curve 1014 b_curve: Graph of Curve 1015 1016 Returns: 1017 Graph: A graph node producing a Composition. 1018 """ 1019 composition_parsed = input_parsers.parse_graph(self) 1020 r_curve_parsed = input_parsers.parse_graph(r_curve) 1021 g_curve_parsed = input_parsers.parse_graph(g_curve) 1022 b_curve_parsed = input_parsers.parse_graph(b_curve) 1023 result = _internal.composition_r_g_b_curve_internal(composition_parsed, r_curve_parsed, g_curve_parsed, b_curve_parsed) 1024 return Composition(result) 1025 1026 def render_to_image(self) -> image.Image: 1027 """Composition Render to Image 1028 1029 Renders a Composition to an Image 1030 1031 Returns: 1032 Graph: A graph node producing a Image. 1033 """ 1034 composition_parsed = input_parsers.parse_graph(self) 1035 result = _internal.composition_render_to_image_internal(composition_parsed) 1036 from .image import Image 1037 return Image(result) 1038 1039 def rotate_180(self) -> Composition: 1040 """Composition Rotate 180 1041 1042 Rotates the image 180 degrees 1043 1044 Returns: 1045 Graph: A graph node producing a Composition. 1046 """ 1047 composition_parsed = input_parsers.parse_graph(self) 1048 result = _internal.composition_rotate180_internal(composition_parsed) 1049 return Composition(result) 1050 1051 def rotate_90_clockwise(self) -> Composition: 1052 """Composition Rotate 90 Clockwise 1053 1054 Rotates the image 90 degrees clockwise 1055 1056 Returns: 1057 Graph: A graph node producing a Composition. 1058 """ 1059 composition_parsed = input_parsers.parse_graph(self) 1060 result = _internal.composition_rotate90_clockwise_internal(composition_parsed) 1061 return Composition(result) 1062 1063 def rotate_90_counter_clockwise(self) -> Composition: 1064 """Composition Rotate 90 Counter Clockwise 1065 1066 Rotates the image 90 degrees counter-clockwise 1067 1068 Returns: 1069 Graph: A graph node producing a Composition. 1070 """ 1071 composition_parsed = input_parsers.parse_graph(self) 1072 result = _internal.composition_rotate90_counter_clockwise_internal(composition_parsed) 1073 return Composition(result) 1074 1075 def saturation_adjust(self, scale) -> Composition: 1076 """Composition Saturation Adjust 1077 1078 Adjusts the saturation of an image by a given factor. Internally, scales the chroma components in OkLab color space. 1079 1080 Args: 1081 scale: Graph of Float 1082 1083 Returns: 1084 Graph: A graph node producing a Composition. 1085 """ 1086 composition_parsed = input_parsers.parse_graph(self) 1087 scale_parsed = input_parsers.parse_float_graph(scale) 1088 result = _internal.composition_saturation_adjust_internal(composition_parsed, scale_parsed) 1089 return Composition(result) 1090 1091 def scanlines(self, size, beam_power, line_offset, intensity) -> Composition: 1092 """Composition Scanlines 1093 1094 Applies a CRT-style scanline effect, darkening the composition in horizontal bands whose spacing is set by size, sharpness by beam power, vertical phase by line offset, and overall strength by intensity. 1095 1096 Args: 1097 size: Graph of Float 1098 beam_power: Graph of Float 1099 line_offset: Graph of Float 1100 intensity: Graph of Float 1101 1102 Returns: 1103 Graph: A graph node producing a Composition. 1104 """ 1105 composition_parsed = input_parsers.parse_graph(self) 1106 size_parsed = input_parsers.parse_float_graph(size) 1107 beam_power_parsed = input_parsers.parse_float_graph(beam_power) 1108 line_offset_parsed = input_parsers.parse_float_graph(line_offset) 1109 intensity_parsed = input_parsers.parse_float_graph(intensity) 1110 result = _internal.composition_scanlines_internal(composition_parsed, size_parsed, beam_power_parsed, line_offset_parsed, intensity_parsed) 1111 return Composition(result) 1112 1113 def segment(self, prompt, positive_points, negative_points) -> Composition: 1114 """Composition Segment 1115 1116 Segments objects in a composition using SAM3. Accepts a text prompt and lists of positive/negative click points. 1117 1118 Args: 1119 prompt: Graph of String 1120 positive_points: Graph of Point2iList 1121 negative_points: Graph of Point2iList 1122 1123 Returns: 1124 Graph: A graph node producing a Composition. 1125 """ 1126 composition_parsed = input_parsers.parse_graph(self) 1127 prompt_parsed = input_parsers.parse_string_graph(prompt) 1128 positive_points_parsed = input_parsers.parse_graph(positive_points) 1129 negative_points_parsed = input_parsers.parse_graph(negative_points) 1130 result = _internal.composition_segment_internal(composition_parsed, prompt_parsed, positive_points_parsed, negative_points_parsed) 1131 return Composition(result) 1132 1133 def sharpen(self, radius, strength) -> Composition: 1134 """Composition Sharpen 1135 1136 Applies a sharpen filter to the composition. 1137 1138 Args: 1139 radius: Graph of Float 1140 strength: Graph of Float 1141 1142 Returns: 1143 Graph: A graph node producing a Composition. 1144 """ 1145 composition_parsed = input_parsers.parse_graph(self) 1146 radius_parsed = input_parsers.parse_float_graph(radius) 1147 strength_parsed = input_parsers.parse_float_graph(strength) 1148 result = _internal.composition_sharpen_internal(composition_parsed, radius_parsed, strength_parsed) 1149 return Composition(result) 1150 1151 def sobel_edge_detection(self) -> Composition: 1152 """Composition Sobel Edge Detection 1153 1154 Applies Sobel edge detection to an image. 1155 1156 Returns: 1157 Graph: A graph node producing a Composition. 1158 """ 1159 composition_parsed = input_parsers.parse_graph(self) 1160 result = _internal.composition_sobel_edge_detection_internal(composition_parsed) 1161 return Composition(result) 1162 1163 def spacial_effect_shader(self, function_body, helpers, max_displacement, inputs, working_color_representation) -> Composition: 1164 """Composition Spacial Effect Shader 1165 1166 Runs a custom shader over an input that can spatially displace pixels by up to a maximum displacement. 1167 1168 Args: 1169 function_body: Graph of String 1170 helpers: Graph of String 1171 max_displacement: Graph of Float 1172 inputs: Graph of Dictionary 1173 working_color_representation: Graph of ColorRepresentation 1174 1175 Returns: 1176 Graph: A graph node producing a Composition. 1177 """ 1178 composition_parsed = input_parsers.parse_graph(self) 1179 function_body_parsed = input_parsers.parse_string_graph(function_body) 1180 helpers_parsed = input_parsers.parse_string_graph(helpers) 1181 max_displacement_parsed = input_parsers.parse_float_graph(max_displacement) 1182 inputs_parsed = input_parsers.parse_graph(inputs) 1183 working_color_representation_parsed = input_parsers.parse_graph(working_color_representation) 1184 result = _internal.composition_spacial_effect_shader_internal(composition_parsed, function_body_parsed, helpers_parsed, max_displacement_parsed, inputs_parsed, working_color_representation_parsed) 1185 return Composition(result) 1186 1187 def swirl(self, center, radius, amount) -> Composition: 1188 """Composition Swirl 1189 1190 Applies a swirl distortion to this composition 1191 1192 Args: 1193 center: Graph of Vector2f 1194 radius: Graph of Float 1195 amount: Graph of Float 1196 1197 Returns: 1198 Graph: A graph node producing a Composition. 1199 """ 1200 composition_parsed = input_parsers.parse_graph(self) 1201 center_parsed = input_parsers.parse_graph(center) 1202 radius_parsed = input_parsers.parse_float_graph(radius) 1203 amount_parsed = input_parsers.parse_float_graph(amount) 1204 result = _internal.composition_swirl_internal(composition_parsed, center_parsed, radius_parsed, amount_parsed) 1205 return Composition(result) 1206 1207 def target_white_kelvin(self, kelvin) -> Composition: 1208 """Composition Target White Kelvin 1209 1210 Sets the image white point to the value specified in Kelvin. The profile connection white point is D50, so you will only see changes as you move away from that. 1211 1212 Args: 1213 kelvin: Graph of Float 1214 1215 Returns: 1216 Graph: A graph node producing a Composition. 1217 """ 1218 composition_parsed = input_parsers.parse_graph(self) 1219 kelvin_parsed = input_parsers.parse_float_graph(kelvin) 1220 result = _internal.composition_target_white_kelvin_internal(composition_parsed, kelvin_parsed) 1221 return Composition(result) 1222 1223 def to_ok_lab_hist(self) -> ok_lab_hist.OkLabHist: 1224 """Composition to OkLab Histogram 1225 1226 Creates an OkLab Histogram from the colors in a Composition. 1227 1228 Returns: 1229 Graph: A graph node producing a OkLabHist. 1230 """ 1231 composition_parsed = input_parsers.parse_graph(self) 1232 result = _internal.composition_to_ok_lab_hist_internal(composition_parsed) 1233 from .ok_lab_hist import OkLabHist 1234 return OkLabHist(result) 1235 1236 def transform(self, transform) -> Composition: 1237 """Composition Transform 1238 1239 Applies a 2D transform to a Composition. 1240 1241 Args: 1242 transform: Graph of Transform2 1243 1244 Returns: 1245 Graph: A graph node producing a Composition. 1246 """ 1247 composition_parsed = input_parsers.parse_graph(self) 1248 transform_parsed = input_parsers.parse_graph(transform) 1249 result = _internal.composition_transform_internal(composition_parsed, transform_parsed) 1250 return Composition(result) 1251 1252 def vibrance_adjustment(self, strength) -> Composition: 1253 """Composition Vibrance Adjustment 1254 1255 Adjusts the vibrance of an image by a given strength. Internally, boosts chroma in OkLab color space adaptively, applying more boost to less saturated colors. 1256 1257 Args: 1258 strength: Graph of Float 1259 1260 Returns: 1261 Graph: A graph node producing a Composition. 1262 """ 1263 composition_parsed = input_parsers.parse_graph(self) 1264 strength_parsed = input_parsers.parse_float_graph(strength) 1265 result = _internal.composition_vibrance_adjustment_internal(composition_parsed, strength_parsed) 1266 return Composition(result) 1267 1268 def vignette(self, center, radius_x, radius_y, softness, strength) -> Composition: 1269 """Composition Vignette 1270 1271 darkens the area outside an ellipse - center is the bright spot in pixel coordinates, radius_x and radius_y are the ellipse semi-axes in pixels where the falloff starts, softness is the width of the fade-out band in pixels, and strength (0-1) defines how dark the edges become at maximum. 1272 1273 Args: 1274 center: Graph of Vector2f 1275 radius_x: Graph of Float 1276 radius_y: Graph of Float 1277 softness: Graph of Float 1278 strength: Graph of Float 1279 1280 Returns: 1281 Graph: A graph node producing a Composition. 1282 """ 1283 composition_parsed = input_parsers.parse_graph(self) 1284 center_parsed = input_parsers.parse_graph(center) 1285 radius_x_parsed = input_parsers.parse_float_graph(radius_x) 1286 radius_y_parsed = input_parsers.parse_float_graph(radius_y) 1287 softness_parsed = input_parsers.parse_float_graph(softness) 1288 strength_parsed = input_parsers.parse_float_graph(strength) 1289 result = _internal.composition_vignette_internal(composition_parsed, center_parsed, radius_x_parsed, radius_y_parsed, softness_parsed, strength_parsed) 1290 return Composition(result) 1291 1292 def zoom_blur(self, center, strength, falloff, effect_radius) -> Composition: 1293 """Composition Zoom Blur 1294 1295 Performs a zoom blur on this composition 1296 1297 Args: 1298 center: Graph of Vector2f 1299 strength: Graph of Float 1300 falloff: Graph of Float 1301 effect_radius: Graph of Float 1302 1303 Returns: 1304 Graph: A graph node producing a Composition. 1305 """ 1306 composition_parsed = input_parsers.parse_graph(self) 1307 center_parsed = input_parsers.parse_graph(center) 1308 strength_parsed = input_parsers.parse_float_graph(strength) 1309 falloff_parsed = input_parsers.parse_float_graph(falloff) 1310 effect_radius_parsed = input_parsers.parse_float_graph(effect_radius) 1311 result = _internal.composition_zoom_blur_internal(composition_parsed, center_parsed, strength_parsed, falloff_parsed, effect_radius_parsed) 1312 return Composition(result)
A composition to create an image.
34 def absolute_value(self) -> Composition: 35 """Composition Absolute Value 36 37 Takes the absolute value of all the pixels in the image. 38 39 Returns: 40 Graph: A graph node producing a Composition. 41 """ 42 image_parsed = input_parsers.parse_graph(self) 43 result = _internal.composition_absolute_value_internal(image_parsed) 44 return Composition(result)
Composition Absolute Value
Takes the absolute value of all the pixels in the image.
Returns: Graph: A graph node producing a Composition.
46 def blend_add(self, background, foreground_transform) -> Composition: 47 """Composition Blend Add 48 49 Adds the foreground and background images together using additive blending. 50 51 Args: 52 background: Graph of Composition 53 foreground_transform: Graph of Transform2 54 55 Returns: 56 Graph: A graph node producing a Composition. 57 """ 58 foreground_parsed = input_parsers.parse_graph(self) 59 background_parsed = input_parsers.parse_graph(background) 60 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 61 result = _internal.composition_blend_add_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 62 return Composition(result)
Composition Blend Add
Adds the foreground and background images together using additive blending.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
64 def blend_alpha(self, background, foreground_transform) -> Composition: 65 """Composition Blend Alpha 66 67 Blends between the foreground and background using the alpha component of the foreground. 1 is foreground. 0 is background. 68 69 Args: 70 background: Graph of Composition 71 foreground_transform: Graph of Transform2 72 73 Returns: 74 Graph: A graph node producing a Composition. 75 """ 76 foreground_parsed = input_parsers.parse_graph(self) 77 background_parsed = input_parsers.parse_graph(background) 78 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 79 result = _internal.composition_blend_alpha_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 80 return Composition(result)
Composition Blend Alpha
Blends between the foreground and background using the alpha component of the foreground. 1 is foreground. 0 is background.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
82 def blend_max(self, background, foreground_transform) -> Composition: 83 """Composition Blend Max 84 85 Blends the foreground and background images using maximum value blending. 86 87 Args: 88 background: Graph of Composition 89 foreground_transform: Graph of Transform2 90 91 Returns: 92 Graph: A graph node producing a Composition. 93 """ 94 foreground_parsed = input_parsers.parse_graph(self) 95 background_parsed = input_parsers.parse_graph(background) 96 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 97 result = _internal.composition_blend_max_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 98 return Composition(result)
Composition Blend Max
Blends the foreground and background images using maximum value blending.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
100 def blend_min(self, background, foreground_transform) -> Composition: 101 """Composition Blend Min 102 103 Blends the foreground and background images using minimum blending, taking the minimum value for each pixel. 104 105 Args: 106 background: Graph of Composition 107 foreground_transform: Graph of Transform2 108 109 Returns: 110 Graph: A graph node producing a Composition. 111 """ 112 foreground_parsed = input_parsers.parse_graph(self) 113 background_parsed = input_parsers.parse_graph(background) 114 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 115 result = _internal.composition_blend_min_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 116 return Composition(result)
Composition Blend Min
Blends the foreground and background images using minimum blending, taking the minimum value for each pixel.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
118 def blend_multiply(self, background, foreground_transform) -> Composition: 119 """Composition Blend Multiply 120 121 Multiplies the foreground and background images together using multiply blending. 122 123 Args: 124 background: Graph of Composition 125 foreground_transform: Graph of Transform2 126 127 Returns: 128 Graph: A graph node producing a Composition. 129 """ 130 foreground_parsed = input_parsers.parse_graph(self) 131 background_parsed = input_parsers.parse_graph(background) 132 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 133 result = _internal.composition_blend_multiply_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 134 return Composition(result)
Composition Blend Multiply
Multiplies the foreground and background images together using multiply blending.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
136 def blend_stencil(self, background, foreground_transform) -> Composition: 137 """Composition Blend Stencil 138 139 Blends the foreground and background images using stencil blending. When the foreground is over the background, the foreground's alpha and the background's r, g and b are used. 140 141 Args: 142 background: Graph of Composition 143 foreground_transform: Graph of Transform2 144 145 Returns: 146 Graph: A graph node producing a Composition. 147 """ 148 foreground_parsed = input_parsers.parse_graph(self) 149 background_parsed = input_parsers.parse_graph(background) 150 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 151 result = _internal.composition_blend_stencil_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 152 return Composition(result)
Composition Blend Stencil
Blends the foreground and background images using stencil blending. When the foreground is over the background, the foreground's alpha and the background's r, g and b are used.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
154 def blend_subtract(self, background, foreground_transform) -> Composition: 155 """Composition Blend Subtract 156 157 Subtracts the foreground image from the background image using subtractive blending. 158 159 Args: 160 background: Graph of Composition 161 foreground_transform: Graph of Transform2 162 163 Returns: 164 Graph: A graph node producing a Composition. 165 """ 166 foreground_parsed = input_parsers.parse_graph(self) 167 background_parsed = input_parsers.parse_graph(background) 168 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 169 result = _internal.composition_blend_subtract_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 170 return Composition(result)
Composition Blend Subtract
Subtracts the foreground image from the background image using subtractive blending.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
172 def bloom(self, threshold, sigma, intensity) -> Composition: 173 """Composition Bloom 174 175 Adds a soft bloom glow by blurring the image's bright areas and additively blending them back over the original. Threshold selects bright areas (OkLab lightness), sigma controls glow spread, intensity scales the glow strength. 176 177 Args: 178 threshold: Graph of Float 179 sigma: Graph of Float 180 intensity: Graph of Float 181 182 Returns: 183 Graph: A graph node producing a Composition. 184 """ 185 composition_parsed = input_parsers.parse_graph(self) 186 threshold_parsed = input_parsers.parse_float_graph(threshold) 187 sigma_parsed = input_parsers.parse_float_graph(sigma) 188 intensity_parsed = input_parsers.parse_float_graph(intensity) 189 result = _internal.composition_bloom_internal(composition_parsed, threshold_parsed, sigma_parsed, intensity_parsed) 190 return Composition(result)
Composition Bloom
Adds a soft bloom glow by blurring the image's bright areas and additively blending them back over the original. Threshold selects bright areas (OkLab lightness), sigma controls glow spread, intensity scales the glow strength.
Args: threshold: Graph of Float sigma: Graph of Float intensity: Graph of Float
Returns: Graph: A graph node producing a Composition.
192 def bounds(self) -> bounds2f.Bounds2f: 193 """Composition Bounds 194 195 Computes the bounding box of a composition. 196 197 Returns: 198 Graph: A graph node producing a Bounds2f. 199 """ 200 composition_parsed = input_parsers.parse_graph(self) 201 result = _internal.composition_bounds_internal(composition_parsed) 202 from .bounds2f import Bounds2f 203 return Bounds2f(result)
Composition Bounds
Computes the bounding box of a composition.
Returns: Graph: A graph node producing a Bounds2f.
205 def box_blur(self, dimension) -> Composition: 206 """Composition Box Blur 207 208 Applies a box blur to an image. Dimension is the size. 1 corresponding to 3x3, 2 5x5 and so on. 209 210 Args: 211 dimension: Graph of Int 212 213 Returns: 214 Graph: A graph node producing a Composition. 215 """ 216 composition_parsed = input_parsers.parse_graph(self) 217 dimension_parsed = input_parsers.parse_int_graph(dimension) 218 result = _internal.composition_box_blur_internal(composition_parsed, dimension_parsed) 219 return Composition(result)
Composition Box Blur
Applies a box blur to an image. Dimension is the size. 1 corresponding to 3x3, 2 5x5 and so on.
Args: dimension: Graph of Int
Returns: Graph: A graph node producing a Composition.
221 def brightness_adjust(self, scale) -> Composition: 222 """Composition Brightness Adjust 223 224 Adjusts an image's brightness by offsetting the L component in OkLab. A scale of 0 leaves brightness unchanged, positive values brighten, and negative values darken. 225 226 Args: 227 scale: Graph of Float 228 229 Returns: 230 Graph: A graph node producing a Composition. 231 """ 232 composition_parsed = input_parsers.parse_graph(self) 233 scale_parsed = input_parsers.parse_float_graph(scale) 234 result = _internal.composition_brightness_adjust_internal(composition_parsed, scale_parsed) 235 return Composition(result)
Composition Brightness Adjust
Adjusts an image's brightness by offsetting the L component in OkLab. A scale of 0 leaves brightness unchanged, positive values brighten, and negative values darken.
Args: scale: Graph of Float
Returns: Graph: A graph node producing a Composition.
237 def chroma_offset(self, offset) -> Composition: 238 """Composition Chroma Offset 239 240 Applies a chroma offset to an image. This is done by modifying the a and b components of OkLab. For the vector, X applies to a, Y to to b. 241 242 Args: 243 offset: Graph of Vector2f 244 245 Returns: 246 Graph: A graph node producing a Composition. 247 """ 248 composition_parsed = input_parsers.parse_graph(self) 249 offset_parsed = input_parsers.parse_graph(offset) 250 result = _internal.composition_chroma_offset_internal(composition_parsed, offset_parsed) 251 return Composition(result)
Composition Chroma Offset
Applies a chroma offset to an image. This is done by modifying the a and b components of OkLab. For the vector, X applies to a, Y to to b.
Args: offset: Graph of Vector2f
Returns: Graph: A graph node producing a Composition.
253 def color_convert(self, color_profile) -> Composition: 254 """Composition Color Convert 255 256 Converts a Composition from one color space to another. 257 258 Args: 259 color_profile: Graph of ColorProfile 260 261 Returns: 262 Graph: A graph node producing a Composition. 263 """ 264 composition_parsed = input_parsers.parse_graph(self) 265 color_profile_parsed = input_parsers.parse_graph(color_profile) 266 result = _internal.composition_color_convert_internal(composition_parsed, color_profile_parsed) 267 return Composition(result)
Composition Color Convert
Converts a Composition from one color space to another.
Args: color_profile: Graph of ColorProfile
Returns: Graph: A graph node producing a Composition.
269 def color_invert(self) -> Composition: 270 """Composition Color Invert 271 272 Applies a color invert operation to a composition. Taking 1 and subtracting each RGB operation against it. Works in linear color. 273 274 Returns: 275 Graph: A graph node producing a Composition. 276 """ 277 composition_parsed = input_parsers.parse_graph(self) 278 result = _internal.composition_color_invert_internal(composition_parsed) 279 return Composition(result)
Composition Color Invert
Applies a color invert operation to a composition. Taking 1 and subtracting each RGB operation against it. Works in linear color.
Returns: Graph: A graph node producing a Composition.
281 def color_representation(self) -> color_representation.ColorRepresentation: 282 """Composition Color Representation 283 284 Gets the color representation associated with a Composition 285 286 Returns: 287 Graph: A graph node producing a ColorRepresentation. 288 """ 289 composition_parsed = input_parsers.parse_graph(self) 290 result = _internal.composition_color_representation_internal(composition_parsed) 291 from .color_representation import ColorRepresentation 292 return ColorRepresentation(result)
Composition Color Representation
Gets the color representation associated with a Composition
Returns: Graph: A graph node producing a ColorRepresentation.
294 def color_threshold(self, threshold) -> Composition: 295 """Composition Color Threshold 296 297 Applies a color threshold to a Composition 298 299 Args: 300 threshold: Graph of Float 301 302 Returns: 303 Graph: A graph node producing a Composition. 304 """ 305 composition_parsed = input_parsers.parse_graph(self) 306 threshold_parsed = input_parsers.parse_float_graph(threshold) 307 result = _internal.composition_color_threshold_internal(composition_parsed, threshold_parsed) 308 return Composition(result)
Composition Color Threshold
Applies a color threshold to a Composition
Args: threshold: Graph of Float
Returns: Graph: A graph node producing a Composition.
310 def color_transformer_shader(self, function_body, helpers, input_color_representation, output_color_representation, inputs) -> Composition: 311 """Composition Color Transformer Shader 312 313 Defines a custom shader that takes an input color and then transforms that color to an output color. 314 315 Args: 316 function_body: Graph of String 317 helpers: Graph of String 318 input_color_representation: Graph of ColorRepresentation 319 output_color_representation: Graph of ColorRepresentation 320 inputs: Graph of Dictionary 321 322 Returns: 323 Graph: A graph node producing a Composition. 324 """ 325 composition_parsed = input_parsers.parse_graph(self) 326 function_body_parsed = input_parsers.parse_string_graph(function_body) 327 helpers_parsed = input_parsers.parse_string_graph(helpers) 328 input_color_representation_parsed = input_parsers.parse_graph(input_color_representation) 329 output_color_representation_parsed = input_parsers.parse_graph(output_color_representation) 330 inputs_parsed = input_parsers.parse_graph(inputs) 331 result = _internal.composition_color_transformer_shader_internal(composition_parsed, function_body_parsed, helpers_parsed, input_color_representation_parsed, output_color_representation_parsed, inputs_parsed) 332 return Composition(result)
Composition Color Transformer Shader
Defines a custom shader that takes an input color and then transforms that color to an output color.
Args: function_body: Graph of String helpers: Graph of String input_color_representation: Graph of ColorRepresentation output_color_representation: Graph of ColorRepresentation inputs: Graph of Dictionary
Returns: Graph: A graph node producing a Composition.
334 def connected_component_boxes(self) -> bounds2i_list.Bounds2iList: 335 """Composition Connected Component Boxes 336 337 Finds boxes with a r alpha channel value greater than 0.5 in the image. Recommended to use a binary image for this. 338 339 Returns: 340 Graph: A graph node producing a Bounds2iList. 341 """ 342 composition_parsed = input_parsers.parse_graph(self) 343 result = _internal.composition_connected_component_boxes_internal(composition_parsed) 344 from .bounds2i_list import Bounds2iList 345 return Bounds2iList(result)
Composition Connected Component Boxes
Finds boxes with a r alpha channel value greater than 0.5 in the image. Recommended to use a binary image for this.
Returns: Graph: A graph node producing a Bounds2iList.
347 def contrast_adjustment(self, contrast) -> Composition: 348 """Composition Contrast Adjustment 349 350 Adjusts the contrast of a Composition 351 352 Args: 353 contrast: Graph of Float 354 355 Returns: 356 Graph: A graph node producing a Composition. 357 """ 358 composition_parsed = input_parsers.parse_graph(self) 359 contrast_parsed = input_parsers.parse_float_graph(contrast) 360 result = _internal.composition_contrast_adjustment_internal(composition_parsed, contrast_parsed) 361 return Composition(result)
Composition Contrast Adjustment
Adjusts the contrast of a Composition
Args: contrast: Graph of Float
Returns: Graph: A graph node producing a Composition.
363 def convolution(self, kernel, kernel_width, kernel_height) -> Composition: 364 """Composition Convolution 365 366 Performs a convolution on an composition 367 368 Args: 369 kernel: Graph of FloatList 370 kernel_width: Graph of Int 371 kernel_height: Graph of Int 372 373 Returns: 374 Graph: A graph node producing a Composition. 375 """ 376 composition_parsed = input_parsers.parse_graph(self) 377 kernel_parsed = input_parsers.parse_graph(kernel) 378 kernel_width_parsed = input_parsers.parse_int_graph(kernel_width) 379 kernel_height_parsed = input_parsers.parse_int_graph(kernel_height) 380 result = _internal.composition_convolution_internal(composition_parsed, kernel_parsed, kernel_width_parsed, kernel_height_parsed) 381 return Composition(result)
Composition Convolution
Performs a convolution on an composition
Args: kernel: Graph of FloatList kernel_width: Graph of Int kernel_height: Graph of Int
Returns: Graph: A graph node producing a Composition.
383 def crop(self, rect) -> Composition: 384 """Composition Crop 385 386 Applies a crop to a Composition 387 388 Args: 389 rect: Graph of Bounds2f 390 391 Returns: 392 Graph: A graph node producing a Composition. 393 """ 394 composition_parsed = input_parsers.parse_graph(self) 395 rect_parsed = input_parsers.parse_graph(rect) 396 result = _internal.composition_crop_internal(composition_parsed, rect_parsed) 397 return Composition(result)
Composition Crop
Applies a crop to a Composition
Args: rect: Graph of Bounds2f
Returns: Graph: A graph node producing a Composition.
399 def duotone(self, threshold, color_1, color_2) -> Composition: 400 """Composition Duotone 401 402 Creates a duotone effect. Colors below the threshold will be color 1, colors above will be color 2. 403 404 Args: 405 threshold: Graph of Float 406 color_1: Graph of ProfiledColor 407 color_2: Graph of ProfiledColor 408 409 Returns: 410 Graph: A graph node producing a Composition. 411 """ 412 composition_parsed = input_parsers.parse_graph(self) 413 threshold_parsed = input_parsers.parse_float_graph(threshold) 414 color_1_parsed = input_parsers.parse_graph(color_1) 415 color_2_parsed = input_parsers.parse_graph(color_2) 416 result = _internal.composition_duotone_internal(composition_parsed, threshold_parsed, color_1_parsed, color_2_parsed) 417 return Composition(result)
Composition Duotone
Creates a duotone effect. Colors below the threshold will be color 1, colors above will be color 2.
Args: threshold: Graph of Float color_1: Graph of ProfiledColor color_2: Graph of ProfiledColor
Returns: Graph: A graph node producing a Composition.
419 def emboss(self, angle, distance, amount) -> Composition: 420 """Composition Emboss 421 422 Applies an emboss effect, turning edges into a raised relief lit from the given angle. Flat areas become mid-gray; a negative amount debosses. 423 424 Args: 425 angle: Graph of Float 426 distance: Graph of Float 427 amount: Graph of Float 428 429 Returns: 430 Graph: A graph node producing a Composition. 431 """ 432 composition_parsed = input_parsers.parse_graph(self) 433 angle_parsed = input_parsers.parse_float_graph(angle) 434 distance_parsed = input_parsers.parse_float_graph(distance) 435 amount_parsed = input_parsers.parse_float_graph(amount) 436 result = _internal.composition_emboss_internal(composition_parsed, angle_parsed, distance_parsed, amount_parsed) 437 return Composition(result)
Composition Emboss
Applies an emboss effect, turning edges into a raised relief lit from the given angle. Flat areas become mid-gray; a negative amount debosses.
Args: angle: Graph of Float distance: Graph of Float amount: Graph of Float
Returns: Graph: A graph node producing a Composition.
439 def exposure_adjust(self, steps) -> Composition: 440 """Composition Exposure Adjust 441 442 Updates the exposure of your image. Internally, will multiply the linear version of RGB values by a value that equals 2^step. 443 444 Args: 445 steps: Graph of Float 446 447 Returns: 448 Graph: A graph node producing a Composition. 449 """ 450 composition_parsed = input_parsers.parse_graph(self) 451 steps_parsed = input_parsers.parse_float_graph(steps) 452 result = _internal.composition_exposure_adjust_internal(composition_parsed, steps_parsed) 453 return Composition(result)
Composition Exposure Adjust
Updates the exposure of your image. Internally, will multiply the linear version of RGB values by a value that equals 2^step.
Args: steps: Graph of Float
Returns: Graph: A graph node producing a Composition.
455 def film_grain(self, grain_strength, fine_grain_frequency, fine_weight, medium_grain_frequency, medium_weight, high_grain_frequency, high_weight) -> Composition: 456 """Composition Film Grain 457 458 adds multi-octave value-noise film grain in OkLabA - grain_strength controls the overall intensity, and the fine/medium/high frequency and weight pairs control the size and contribution of each grain octave. 459 460 Args: 461 grain_strength: Graph of Float 462 fine_grain_frequency: Graph of Float 463 fine_weight: Graph of Float 464 medium_grain_frequency: Graph of Float 465 medium_weight: Graph of Float 466 high_grain_frequency: Graph of Float 467 high_weight: Graph of Float 468 469 Returns: 470 Graph: A graph node producing a Composition. 471 """ 472 composition_parsed = input_parsers.parse_graph(self) 473 grain_strength_parsed = input_parsers.parse_float_graph(grain_strength) 474 fine_grain_frequency_parsed = input_parsers.parse_float_graph(fine_grain_frequency) 475 fine_weight_parsed = input_parsers.parse_float_graph(fine_weight) 476 medium_grain_frequency_parsed = input_parsers.parse_float_graph(medium_grain_frequency) 477 medium_weight_parsed = input_parsers.parse_float_graph(medium_weight) 478 high_grain_frequency_parsed = input_parsers.parse_float_graph(high_grain_frequency) 479 high_weight_parsed = input_parsers.parse_float_graph(high_weight) 480 result = _internal.composition_film_grain_internal(composition_parsed, grain_strength_parsed, fine_grain_frequency_parsed, fine_weight_parsed, medium_grain_frequency_parsed, medium_weight_parsed, high_grain_frequency_parsed, high_weight_parsed) 481 return Composition(result)
Composition Film Grain
adds multi-octave value-noise film grain in OkLabA - grain_strength controls the overall intensity, and the fine/medium/high frequency and weight pairs control the size and contribution of each grain octave.
Args: grain_strength: Graph of Float fine_grain_frequency: Graph of Float fine_weight: Graph of Float medium_grain_frequency: Graph of Float medium_weight: Graph of Float high_grain_frequency: Graph of Float high_weight: Graph of Float
Returns: Graph: A graph node producing a Composition.
483 def fisheye(self, center, radius, strength) -> Composition: 484 """Composition Fisheye 485 486 Applies a fisheye lens distortion to this composition, magnifying the center and compressing the edges 487 488 Args: 489 center: Graph of Vector2f 490 radius: Graph of Float 491 strength: Graph of Float 492 493 Returns: 494 Graph: A graph node producing a Composition. 495 """ 496 composition_parsed = input_parsers.parse_graph(self) 497 center_parsed = input_parsers.parse_graph(center) 498 radius_parsed = input_parsers.parse_float_graph(radius) 499 strength_parsed = input_parsers.parse_float_graph(strength) 500 result = _internal.composition_fisheye_internal(composition_parsed, center_parsed, radius_parsed, strength_parsed) 501 return Composition(result)
Composition Fisheye
Applies a fisheye lens distortion to this composition, magnifying the center and compressing the edges
Args: center: Graph of Vector2f radius: Graph of Float strength: Graph of Float
Returns: Graph: A graph node producing a Composition.
503 def flip_horizontal(self) -> Composition: 504 """Composition Flip Horizontal 505 506 Flips the image along the horizontal axis 507 508 Returns: 509 Graph: A graph node producing a Composition. 510 """ 511 composition_parsed = input_parsers.parse_graph(self) 512 result = _internal.composition_flip_horizontal_internal(composition_parsed) 513 return Composition(result)
Composition Flip Horizontal
Flips the image along the horizontal axis
Returns: Graph: A graph node producing a Composition.
515 def flip_vertical(self) -> Composition: 516 """Composition Flip Vertical 517 518 Flips the image vertically 519 520 Returns: 521 Graph: A graph node producing a Composition. 522 """ 523 composition_parsed = input_parsers.parse_graph(self) 524 result = _internal.composition_flip_vertical_internal(composition_parsed) 525 return Composition(result)
Composition Flip Vertical
Flips the image vertically
Returns: Graph: A graph node producing a Composition.
527 @staticmethod 528 def freeform_shader(function_body, helpers, bounds, working_color_representation, inputs) -> Composition: 529 """Composition Freeform Shader 530 531 Given a bounds and a shader, allows you to generate an image. 532 533 Args: 534 function_body: Graph of String 535 helpers: Graph of String 536 bounds: Graph of Bounds2f 537 working_color_representation: Graph of ColorRepresentation 538 inputs: Graph of Dictionary 539 540 Returns: 541 Graph: A graph node producing a Composition. 542 """ 543 function_body_parsed = input_parsers.parse_string_graph(function_body) 544 helpers_parsed = input_parsers.parse_string_graph(helpers) 545 bounds_parsed = input_parsers.parse_graph(bounds) 546 working_color_representation_parsed = input_parsers.parse_graph(working_color_representation) 547 inputs_parsed = input_parsers.parse_graph(inputs) 548 result = _internal.composition_freeform_shader_internal(function_body_parsed, helpers_parsed, bounds_parsed, working_color_representation_parsed, inputs_parsed) 549 return Composition(result)
Composition Freeform Shader
Given a bounds and a shader, allows you to generate an image.
Args: function_body: Graph of String helpers: Graph of String bounds: Graph of Bounds2f working_color_representation: Graph of ColorRepresentation inputs: Graph of Dictionary
Returns: Graph: A graph node producing a Composition.
551 @staticmethod 552 def from_image(image) -> Composition: 553 """Composition from Image 554 555 Creates an composition out of an image 556 557 Args: 558 image: Graph of Image 559 560 Returns: 561 Graph: A graph node producing a Composition. 562 """ 563 image_parsed = input_parsers.parse_graph(image) 564 result = _internal.composition_from_image_internal(image_parsed) 565 return Composition(result)
Composition from Image
Creates an composition out of an image
Args: image: Graph of Image
Returns: Graph: A graph node producing a Composition.
567 @staticmethod 568 def from_path(path) -> Composition: 569 """Composition from Path 570 571 Loads an image from a file path or URL, decodes its bytes, and creates a Composition from it. 572 573 Args: 574 path: Graph of String 575 576 Returns: 577 Graph: A graph node producing a Composition. 578 """ 579 path_parsed = input_parsers.parse_string_graph(path) 580 result = _internal.composition_from_path_internal(path_parsed) 581 return Composition(result)
Composition from Path
Loads an image from a file path or URL, decodes its bytes, and creates a Composition from it.
Args: path: Graph of String
Returns: Graph: A graph node producing a Composition.
583 def gaussian_blur(self, sigma) -> Composition: 584 """Composition Gaussian Blur 585 586 Applies a gaussian blur to an image. Sigma controls the blur intensity. 587 588 Args: 589 sigma: Graph of Float 590 591 Returns: 592 Graph: A graph node producing a Composition. 593 """ 594 composition_parsed = input_parsers.parse_graph(self) 595 sigma_parsed = input_parsers.parse_float_graph(sigma) 596 result = _internal.composition_gaussian_blur_internal(composition_parsed, sigma_parsed) 597 return Composition(result)
Composition Gaussian Blur
Applies a gaussian blur to an image. Sigma controls the blur intensity.
Args: sigma: Graph of Float
Returns: Graph: A graph node producing a Composition.
599 def grayscale(self) -> Composition: 600 """Composition Grayscale 601 602 Applies grayscale to a Composition 603 604 Returns: 605 Graph: A graph node producing a Composition. 606 """ 607 composition_parsed = input_parsers.parse_graph(self) 608 result = _internal.composition_grayscale_internal(composition_parsed) 609 return Composition(result)
Composition Grayscale
Applies grayscale to a Composition
Returns: Graph: A graph node producing a Composition.
611 def halftone(self, pixel_size, foreground_color, background_color) -> Composition: 612 """Composition Halftone 613 614 Applies a halftone effect to a composition, tiling it into cells and painting a foreground-colored dot in each cell whose radius grows as the cell darkens, over a background color. 615 616 Args: 617 pixel_size: Graph of Int 618 foreground_color: Graph of ProfiledColor 619 background_color: Graph of ProfiledColor 620 621 Returns: 622 Graph: A graph node producing a Composition. 623 """ 624 composition_parsed = input_parsers.parse_graph(self) 625 pixel_size_parsed = input_parsers.parse_int_graph(pixel_size) 626 foreground_color_parsed = input_parsers.parse_graph(foreground_color) 627 background_color_parsed = input_parsers.parse_graph(background_color) 628 result = _internal.composition_halftone_internal(composition_parsed, pixel_size_parsed, foreground_color_parsed, background_color_parsed) 629 return Composition(result)
Composition Halftone
Applies a halftone effect to a composition, tiling it into cells and painting a foreground-colored dot in each cell whose radius grows as the cell darkens, over a background color.
Args: pixel_size: Graph of Int foreground_color: Graph of ProfiledColor background_color: Graph of ProfiledColor
Returns: Graph: A graph node producing a Composition.
631 def kaleidoscope(self, segments, rotation, warp, warp_frequency) -> Composition: 632 """Composition Kaleidoscope 633 634 Applies a kaleidoscope effect, folding the image into mirrored wedges around the center. segments controls the number of wedges, rotation spins the pattern, and warp/warp_frequency add a radial glass-like distortion. 635 636 Args: 637 segments: Graph of Float 638 rotation: Graph of Float 639 warp: Graph of Float 640 warp_frequency: Graph of Float 641 642 Returns: 643 Graph: A graph node producing a Composition. 644 """ 645 composition_parsed = input_parsers.parse_graph(self) 646 segments_parsed = input_parsers.parse_float_graph(segments) 647 rotation_parsed = input_parsers.parse_float_graph(rotation) 648 warp_parsed = input_parsers.parse_float_graph(warp) 649 warp_frequency_parsed = input_parsers.parse_float_graph(warp_frequency) 650 result = _internal.composition_kaleidoscope_internal(composition_parsed, segments_parsed, rotation_parsed, warp_parsed, warp_frequency_parsed) 651 return Composition(result)
Composition Kaleidoscope
Applies a kaleidoscope effect, folding the image into mirrored wedges around the center. segments controls the number of wedges, rotation spins the pattern, and warp/warp_frequency add a radial glass-like distortion.
Args: segments: Graph of Float rotation: Graph of Float warp: Graph of Float warp_frequency: Graph of Float
Returns: Graph: A graph node producing a Composition.
653 def l_curve(self, l_curve) -> Composition: 654 """Composition Lightness Curve 655 656 Applies a curve to the L component in an OkLab color. Adjusting the lightness of the image. 657 658 Args: 659 l_curve: Graph of Curve 660 661 Returns: 662 Graph: A graph node producing a Composition. 663 """ 664 composition_parsed = input_parsers.parse_graph(self) 665 l_curve_parsed = input_parsers.parse_graph(l_curve) 666 result = _internal.composition_l_curve_internal(composition_parsed, l_curve_parsed) 667 return Composition(result)
Composition Lightness Curve
Applies a curve to the L component in an OkLab color. Adjusting the lightness of the image.
Args: l_curve: Graph of Curve
Returns: Graph: A graph node producing a Composition.
669 def lightness_threshold(self, threshold) -> Composition: 670 """Composition Lightness Threshold 671 672 Thresholds a Composition by OkLab lightness, producing an opaque white mask where lightness exceeds the threshold and transparent black elsewhere. 673 674 Args: 675 threshold: Graph of Float 676 677 Returns: 678 Graph: A graph node producing a Composition. 679 """ 680 composition_parsed = input_parsers.parse_graph(self) 681 threshold_parsed = input_parsers.parse_float_graph(threshold) 682 result = _internal.composition_lightness_threshold_internal(composition_parsed, threshold_parsed) 683 return Composition(result)
Composition Lightness Threshold
Thresholds a Composition by OkLab lightness, producing an opaque white mask where lightness exceeds the threshold and transparent black elsewhere.
Args: threshold: Graph of Float
Returns: Graph: A graph node producing a Composition.
685 def linear_transform(self, entry_0_0, entry_0_1, entry_0_2, entry_0_3, entry_1_0, entry_1_1, entry_1_2, entry_1_3, entry_2_0, entry_2_1, entry_2_2, entry_2_3, entry_3_0, entry_3_1, entry_3_2, entry_3_3) -> Composition: 686 """Composition RGBA Linear Transform 687 688 Applies a linear transform to a Composition's RGBA values. Before application, will convert to a linear version of the color profile and will convert to an RGB profile if needed. 689 690 Args: 691 entry_0_0: Graph of Float 692 entry_0_1: Graph of Float 693 entry_0_2: Graph of Float 694 entry_0_3: Graph of Float 695 entry_1_0: Graph of Float 696 entry_1_1: Graph of Float 697 entry_1_2: Graph of Float 698 entry_1_3: Graph of Float 699 entry_2_0: Graph of Float 700 entry_2_1: Graph of Float 701 entry_2_2: Graph of Float 702 entry_2_3: Graph of Float 703 entry_3_0: Graph of Float 704 entry_3_1: Graph of Float 705 entry_3_2: Graph of Float 706 entry_3_3: Graph of Float 707 708 Returns: 709 Graph: A graph node producing a Composition. 710 """ 711 composition_parsed = input_parsers.parse_graph(self) 712 entry_0_0_parsed = input_parsers.parse_float_graph(entry_0_0) 713 entry_0_1_parsed = input_parsers.parse_float_graph(entry_0_1) 714 entry_0_2_parsed = input_parsers.parse_float_graph(entry_0_2) 715 entry_0_3_parsed = input_parsers.parse_float_graph(entry_0_3) 716 entry_1_0_parsed = input_parsers.parse_float_graph(entry_1_0) 717 entry_1_1_parsed = input_parsers.parse_float_graph(entry_1_1) 718 entry_1_2_parsed = input_parsers.parse_float_graph(entry_1_2) 719 entry_1_3_parsed = input_parsers.parse_float_graph(entry_1_3) 720 entry_2_0_parsed = input_parsers.parse_float_graph(entry_2_0) 721 entry_2_1_parsed = input_parsers.parse_float_graph(entry_2_1) 722 entry_2_2_parsed = input_parsers.parse_float_graph(entry_2_2) 723 entry_2_3_parsed = input_parsers.parse_float_graph(entry_2_3) 724 entry_3_0_parsed = input_parsers.parse_float_graph(entry_3_0) 725 entry_3_1_parsed = input_parsers.parse_float_graph(entry_3_1) 726 entry_3_2_parsed = input_parsers.parse_float_graph(entry_3_2) 727 entry_3_3_parsed = input_parsers.parse_float_graph(entry_3_3) 728 result = _internal.composition_linear_transform_internal(composition_parsed, entry_0_0_parsed, entry_0_1_parsed, entry_0_2_parsed, entry_0_3_parsed, entry_1_0_parsed, entry_1_1_parsed, entry_1_2_parsed, entry_1_3_parsed, entry_2_0_parsed, entry_2_1_parsed, entry_2_2_parsed, entry_2_3_parsed, entry_3_0_parsed, entry_3_1_parsed, entry_3_2_parsed, entry_3_3_parsed) 729 return Composition(result)
Composition RGBA Linear Transform
Applies a linear transform to a Composition's RGBA values. Before application, will convert to a linear version of the color profile and will convert to an RGB profile if needed.
Args: entry_0_0: Graph of Float entry_0_1: Graph of Float entry_0_2: Graph of Float entry_0_3: Graph of Float entry_1_0: Graph of Float entry_1_1: Graph of Float entry_1_2: Graph of Float entry_1_3: Graph of Float entry_2_0: Graph of Float entry_2_1: Graph of Float entry_2_2: Graph of Float entry_2_3: Graph of Float entry_3_0: Graph of Float entry_3_1: Graph of Float entry_3_2: Graph of Float entry_3_3: Graph of Float
Returns: Graph: A graph node producing a Composition.
731 def liquify(self, amplitude, frequency) -> Composition: 732 """Composition Liquify 733 734 Applies a sinusoidal liquify distortion to this composition, displacing pixels by a wave whose size is controlled by amplitude and whose density is controlled by frequency. 735 736 Args: 737 amplitude: Graph of Float 738 frequency: Graph of Float 739 740 Returns: 741 Graph: A graph node producing a Composition. 742 """ 743 composition_parsed = input_parsers.parse_graph(self) 744 amplitude_parsed = input_parsers.parse_float_graph(amplitude) 745 frequency_parsed = input_parsers.parse_float_graph(frequency) 746 result = _internal.composition_liquify_internal(composition_parsed, amplitude_parsed, frequency_parsed) 747 return Composition(result)
Composition Liquify
Applies a sinusoidal liquify distortion to this composition, displacing pixels by a wave whose size is controlled by amplitude and whose density is controlled by frequency.
Args: amplitude: Graph of Float frequency: Graph of Float
Returns: Graph: A graph node producing a Composition.
749 def locate(self, prompt, positive_points, negative_points) -> bounds2f_list.Bounds2fList: 750 """Composition Locate 751 752 Finds the location of a prompt within the image. 753 754 Args: 755 prompt: Graph of String 756 positive_points: Graph of Point2iList 757 negative_points: Graph of Point2iList 758 759 Returns: 760 Graph: A graph node producing a Bounds2fList. 761 """ 762 composition_parsed = input_parsers.parse_graph(self) 763 prompt_parsed = input_parsers.parse_string_graph(prompt) 764 positive_points_parsed = input_parsers.parse_graph(positive_points) 765 negative_points_parsed = input_parsers.parse_graph(negative_points) 766 result = _internal.composition_locate_internal(composition_parsed, prompt_parsed, positive_points_parsed, negative_points_parsed) 767 from .bounds2f_list import Bounds2fList 768 return Bounds2fList(result)
Composition Locate
Finds the location of a prompt within the image.
Args: prompt: Graph of String positive_points: Graph of Point2iList negative_points: Graph of Point2iList
Returns: Graph: A graph node producing a Bounds2fList.
770 def max_color(self) -> profiled_color.ProfiledColor: 771 """Composition Max Color 772 773 Computes the maximum color in a composition. Works by finding the maximum L, a and b and alpha components of an OkLabA color. 774 775 Returns: 776 Graph: A graph node producing a ProfiledColor. 777 """ 778 composition_parsed = input_parsers.parse_graph(self) 779 result = _internal.composition_max_color_internal(composition_parsed) 780 from .profiled_color import ProfiledColor 781 return ProfiledColor(result)
Composition Max Color
Computes the maximum color in a composition. Works by finding the maximum L, a and b and alpha components of an OkLabA color.
Returns: Graph: A graph node producing a ProfiledColor.
783 def median(self, kernel_size) -> Composition: 784 """Composition Median 785 786 Applies a per-channel median filter to a composition over a square window, reducing noise while preserving edges. kernel_size controls the window size (window width is 2*kernel_size-1). 787 788 Args: 789 kernel_size: Graph of Int 790 791 Returns: 792 Graph: A graph node producing a Composition. 793 """ 794 composition_parsed = input_parsers.parse_graph(self) 795 kernel_size_parsed = input_parsers.parse_int_graph(kernel_size) 796 result = _internal.composition_median_internal(composition_parsed, kernel_size_parsed) 797 return Composition(result)
Composition Median
Applies a per-channel median filter to a composition over a square window, reducing noise while preserving edges. kernel_size controls the window size (window width is 2*kernel_size-1).
Args: kernel_size: Graph of Int
Returns: Graph: A graph node producing a Composition.
799 def min_color(self) -> profiled_color.ProfiledColor: 800 """Composition Min Color 801 802 Computes the minimum color in a composition. Works by finding the minimum L, a and b and alpha components of an OkLabA color. 803 804 Returns: 805 Graph: A graph node producing a ProfiledColor. 806 """ 807 composition_parsed = input_parsers.parse_graph(self) 808 result = _internal.composition_min_color_internal(composition_parsed) 809 from .profiled_color import ProfiledColor 810 return ProfiledColor(result)
Composition Min Color
Computes the minimum color in a composition. Works by finding the minimum L, a and b and alpha components of an OkLabA color.
Returns: Graph: A graph node producing a ProfiledColor.
812 def min_max_colors(self) -> profiled_color_list.ProfiledColorList: 813 """Composition Min Max Colors 814 815 Computes the minimum and maximum colors in a composition. Works by finding the minimum and maximum L, a and b and alpha components of an OkLabA color. 816 817 Returns: 818 Graph: A graph node producing a ProfiledColorList. 819 """ 820 composition_parsed = input_parsers.parse_graph(self) 821 result = _internal.composition_min_max_colors_internal(composition_parsed) 822 from .profiled_color_list import ProfiledColorList 823 return ProfiledColorList(result)
Composition Min Max Colors
Computes the minimum and maximum colors in a composition. Works by finding the minimum and maximum L, a and b and alpha components of an OkLabA color.
Returns: Graph: A graph node producing a ProfiledColorList.
825 @staticmethod 826 def monet_women_with_parasol() -> Composition: 827 """Monet's Women with a Parasol 828 829 Creates a composition from Monet's "Women with a Parasol" painting. Used frequently as a test asset. 830 831 Returns: 832 Graph: A graph node producing a Composition. 833 """ 834 result = _internal.composition_monet_women_with_parasol_internal() 835 return Composition(result)
Monet's Women with a Parasol
Creates a composition from Monet's "Women with a Parasol" painting. Used frequently as a test asset.
Returns: Graph: A graph node producing a Composition.
837 def morphological_max(self, dimension) -> Composition: 838 """Composition Morphological Max 839 840 Apples a morphological max operation. 841 842 Args: 843 dimension: Graph of Int 844 845 Returns: 846 Graph: A graph node producing a Composition. 847 """ 848 composition_parsed = input_parsers.parse_graph(self) 849 dimension_parsed = input_parsers.parse_int_graph(dimension) 850 result = _internal.composition_morphological_max_internal(composition_parsed, dimension_parsed) 851 return Composition(result)
Composition Morphological Max
Apples a morphological max operation.
Args: dimension: Graph of Int
Returns: Graph: A graph node producing a Composition.
853 def morphological_min(self, dimension) -> Composition: 854 """Composition Morphological Min 855 856 Apples a morphological min operation. 857 858 Args: 859 dimension: Graph of Int 860 861 Returns: 862 Graph: A graph node producing a Composition. 863 """ 864 composition_parsed = input_parsers.parse_graph(self) 865 dimension_parsed = input_parsers.parse_int_graph(dimension) 866 result = _internal.composition_morphological_min_internal(composition_parsed, dimension_parsed) 867 return Composition(result)
Composition Morphological Min
Apples a morphological min operation.
Args: dimension: Graph of Int
Returns: Graph: A graph node producing a Composition.
869 def negative(self) -> Composition: 870 """Composition Negative 871 872 Creates the effect of a negative image by subracting from each component of the image. 873 874 Returns: 875 Graph: A graph node producing a Composition. 876 """ 877 composition_parsed = input_parsers.parse_graph(self) 878 result = _internal.composition_negative_internal(composition_parsed) 879 return Composition(result)
Composition Negative
Creates the effect of a negative image by subracting from each component of the image.
Returns: Graph: A graph node producing a Composition.
881 def nonlinear_rgb_blend_alpha(self, background, foreground_transform) -> Composition: 882 """Composition Nonlinear RGB Blend Alpha 883 884 A specialized version of CompositionBlendAlpha. Blends in a non-linear RGB. 885 886 Args: 887 background: Graph of Composition 888 foreground_transform: Graph of Transform2 889 890 Returns: 891 Graph: A graph node producing a Composition. 892 """ 893 foreground_parsed = input_parsers.parse_graph(self) 894 background_parsed = input_parsers.parse_graph(background) 895 foreground_transform_parsed = input_parsers.parse_graph(foreground_transform) 896 result = _internal.composition_nonlinear_r_g_b_blend_alpha_internal(foreground_parsed, background_parsed, foreground_transform_parsed) 897 return Composition(result)
Composition Nonlinear RGB Blend Alpha
A specialized version of CompositionBlendAlpha. Blends in a non-linear RGB.
Args: background: Graph of Composition foreground_transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
899 def opacity_scales(self, scale) -> Composition: 900 """Composition Opacity Scale 901 902 Changes the opacity of an image by multiplying it by a scalar. 903 904 Args: 905 scale: Graph of Float 906 907 Returns: 908 Graph: A graph node producing a Composition. 909 """ 910 composition_parsed = input_parsers.parse_graph(self) 911 scale_parsed = input_parsers.parse_float_graph(scale) 912 result = _internal.composition_opacity_scale_internal(composition_parsed, scale_parsed) 913 return Composition(result)
Composition Opacity Scale
Changes the opacity of an image by multiplying it by a scalar.
Args: scale: Graph of Float
Returns: Graph: A graph node producing a Composition.
915 @staticmethod 916 def painter(painter) -> Composition: 917 """Composition Painter 918 919 Creates a composition from a painter. 920 921 Args: 922 painter: Graph of Painter 923 924 Returns: 925 Graph: A graph node producing a Composition. 926 """ 927 painter_parsed = input_parsers.parse_graph(painter) 928 result = _internal.composition_painter_internal(painter_parsed) 929 return Composition(result)
Composition Painter
Creates a composition from a painter.
Args: painter: Graph of Painter
Returns: Graph: A graph node producing a Composition.
931 def to_palette(self, size) -> profiled_color_list.ProfiledColorList: 932 """Composition Palette 933 934 Generates a palette of the most dominant colors of a composition. 935 936 Args: 937 size: Graph of Int 938 939 Returns: 940 Graph: A graph node producing a ProfiledColorList. 941 """ 942 composition_parsed = input_parsers.parse_graph(self) 943 size_parsed = input_parsers.parse_int_graph(size) 944 result = _internal.composition_palette_internal(composition_parsed, size_parsed) 945 from .profiled_color_list import ProfiledColorList 946 return ProfiledColorList(result)
Composition Palette
Generates a palette of the most dominant colors of a composition.
Args: size: Graph of Int
Returns: Graph: A graph node producing a ProfiledColorList.
948 def palette_reduction(self, palette) -> Composition: 949 """Composition Palette Reduction 950 951 Reduces the number of colors in a composition to a specified palette. 952 953 Args: 954 palette: Graph of ProfiledColorList 955 956 Returns: 957 Graph: A graph node producing a Composition. 958 """ 959 composition_parsed = input_parsers.parse_graph(self) 960 palette_parsed = input_parsers.parse_graph(palette) 961 result = _internal.composition_palette_reduction_internal(composition_parsed, palette_parsed) 962 return Composition(result)
Composition Palette Reduction
Reduces the number of colors in a composition to a specified palette.
Args: palette: Graph of ProfiledColorList
Returns: Graph: A graph node producing a Composition.
964 def pixelate(self, pixel_size) -> Composition: 965 """Composition Pixelate 966 967 Applies a pixelation effect to a composition. 968 969 Args: 970 pixel_size: Graph of Int 971 972 Returns: 973 Graph: A graph node producing a Composition. 974 """ 975 composition_parsed = input_parsers.parse_graph(self) 976 pixel_size_parsed = input_parsers.parse_int_graph(pixel_size) 977 result = _internal.composition_pixelate_internal(composition_parsed, pixel_size_parsed) 978 return Composition(result)
Composition Pixelate
Applies a pixelation effect to a composition.
Args: pixel_size: Graph of Int
Returns: Graph: A graph node producing a Composition.
980 def point_effect_shader(self, function_body, helpers, effect_center_point, effect_radius, inputs, working_color_representation) -> Composition: 981 """Composition Point Effect Shader 982 983 Runs a custom shader over a circular region around an effect center point. 984 985 Args: 986 function_body: Graph of String 987 helpers: Graph of String 988 effect_center_point: Graph of Point2f 989 effect_radius: Graph of Float 990 inputs: Graph of Dictionary 991 working_color_representation: Graph of ColorRepresentation 992 993 Returns: 994 Graph: A graph node producing a Composition. 995 """ 996 composition_parsed = input_parsers.parse_graph(self) 997 function_body_parsed = input_parsers.parse_string_graph(function_body) 998 helpers_parsed = input_parsers.parse_string_graph(helpers) 999 effect_center_point_parsed = input_parsers.parse_graph(effect_center_point) 1000 effect_radius_parsed = input_parsers.parse_float_graph(effect_radius) 1001 inputs_parsed = input_parsers.parse_graph(inputs) 1002 working_color_representation_parsed = input_parsers.parse_graph(working_color_representation) 1003 result = _internal.composition_point_effect_shader_internal(composition_parsed, function_body_parsed, helpers_parsed, effect_center_point_parsed, effect_radius_parsed, inputs_parsed, working_color_representation_parsed) 1004 return Composition(result)
Composition Point Effect Shader
Runs a custom shader over a circular region around an effect center point.
Args: function_body: Graph of String helpers: Graph of String effect_center_point: Graph of Point2f effect_radius: Graph of Float inputs: Graph of Dictionary working_color_representation: Graph of ColorRepresentation
Returns: Graph: A graph node producing a Composition.
1006 def r_g_b_curve(self, r_curve, g_curve, b_curve) -> Composition: 1007 """Composition RGB Curve 1008 1009 Applies a curve to the R, G, and B components 1010 1011 Args: 1012 r_curve: Graph of Curve 1013 g_curve: Graph of Curve 1014 b_curve: Graph of Curve 1015 1016 Returns: 1017 Graph: A graph node producing a Composition. 1018 """ 1019 composition_parsed = input_parsers.parse_graph(self) 1020 r_curve_parsed = input_parsers.parse_graph(r_curve) 1021 g_curve_parsed = input_parsers.parse_graph(g_curve) 1022 b_curve_parsed = input_parsers.parse_graph(b_curve) 1023 result = _internal.composition_r_g_b_curve_internal(composition_parsed, r_curve_parsed, g_curve_parsed, b_curve_parsed) 1024 return Composition(result)
Composition RGB Curve
Applies a curve to the R, G, and B components
Args: r_curve: Graph of Curve g_curve: Graph of Curve b_curve: Graph of Curve
Returns: Graph: A graph node producing a Composition.
1026 def render_to_image(self) -> image.Image: 1027 """Composition Render to Image 1028 1029 Renders a Composition to an Image 1030 1031 Returns: 1032 Graph: A graph node producing a Image. 1033 """ 1034 composition_parsed = input_parsers.parse_graph(self) 1035 result = _internal.composition_render_to_image_internal(composition_parsed) 1036 from .image import Image 1037 return Image(result)
Composition Render to Image
Renders a Composition to an Image
Returns: Graph: A graph node producing a Image.
1039 def rotate_180(self) -> Composition: 1040 """Composition Rotate 180 1041 1042 Rotates the image 180 degrees 1043 1044 Returns: 1045 Graph: A graph node producing a Composition. 1046 """ 1047 composition_parsed = input_parsers.parse_graph(self) 1048 result = _internal.composition_rotate180_internal(composition_parsed) 1049 return Composition(result)
Composition Rotate 180
Rotates the image 180 degrees
Returns: Graph: A graph node producing a Composition.
1051 def rotate_90_clockwise(self) -> Composition: 1052 """Composition Rotate 90 Clockwise 1053 1054 Rotates the image 90 degrees clockwise 1055 1056 Returns: 1057 Graph: A graph node producing a Composition. 1058 """ 1059 composition_parsed = input_parsers.parse_graph(self) 1060 result = _internal.composition_rotate90_clockwise_internal(composition_parsed) 1061 return Composition(result)
Composition Rotate 90 Clockwise
Rotates the image 90 degrees clockwise
Returns: Graph: A graph node producing a Composition.
1063 def rotate_90_counter_clockwise(self) -> Composition: 1064 """Composition Rotate 90 Counter Clockwise 1065 1066 Rotates the image 90 degrees counter-clockwise 1067 1068 Returns: 1069 Graph: A graph node producing a Composition. 1070 """ 1071 composition_parsed = input_parsers.parse_graph(self) 1072 result = _internal.composition_rotate90_counter_clockwise_internal(composition_parsed) 1073 return Composition(result)
Composition Rotate 90 Counter Clockwise
Rotates the image 90 degrees counter-clockwise
Returns: Graph: A graph node producing a Composition.
1075 def saturation_adjust(self, scale) -> Composition: 1076 """Composition Saturation Adjust 1077 1078 Adjusts the saturation of an image by a given factor. Internally, scales the chroma components in OkLab color space. 1079 1080 Args: 1081 scale: Graph of Float 1082 1083 Returns: 1084 Graph: A graph node producing a Composition. 1085 """ 1086 composition_parsed = input_parsers.parse_graph(self) 1087 scale_parsed = input_parsers.parse_float_graph(scale) 1088 result = _internal.composition_saturation_adjust_internal(composition_parsed, scale_parsed) 1089 return Composition(result)
Composition Saturation Adjust
Adjusts the saturation of an image by a given factor. Internally, scales the chroma components in OkLab color space.
Args: scale: Graph of Float
Returns: Graph: A graph node producing a Composition.
1091 def scanlines(self, size, beam_power, line_offset, intensity) -> Composition: 1092 """Composition Scanlines 1093 1094 Applies a CRT-style scanline effect, darkening the composition in horizontal bands whose spacing is set by size, sharpness by beam power, vertical phase by line offset, and overall strength by intensity. 1095 1096 Args: 1097 size: Graph of Float 1098 beam_power: Graph of Float 1099 line_offset: Graph of Float 1100 intensity: Graph of Float 1101 1102 Returns: 1103 Graph: A graph node producing a Composition. 1104 """ 1105 composition_parsed = input_parsers.parse_graph(self) 1106 size_parsed = input_parsers.parse_float_graph(size) 1107 beam_power_parsed = input_parsers.parse_float_graph(beam_power) 1108 line_offset_parsed = input_parsers.parse_float_graph(line_offset) 1109 intensity_parsed = input_parsers.parse_float_graph(intensity) 1110 result = _internal.composition_scanlines_internal(composition_parsed, size_parsed, beam_power_parsed, line_offset_parsed, intensity_parsed) 1111 return Composition(result)
Composition Scanlines
Applies a CRT-style scanline effect, darkening the composition in horizontal bands whose spacing is set by size, sharpness by beam power, vertical phase by line offset, and overall strength by intensity.
Args: size: Graph of Float beam_power: Graph of Float line_offset: Graph of Float intensity: Graph of Float
Returns: Graph: A graph node producing a Composition.
1113 def segment(self, prompt, positive_points, negative_points) -> Composition: 1114 """Composition Segment 1115 1116 Segments objects in a composition using SAM3. Accepts a text prompt and lists of positive/negative click points. 1117 1118 Args: 1119 prompt: Graph of String 1120 positive_points: Graph of Point2iList 1121 negative_points: Graph of Point2iList 1122 1123 Returns: 1124 Graph: A graph node producing a Composition. 1125 """ 1126 composition_parsed = input_parsers.parse_graph(self) 1127 prompt_parsed = input_parsers.parse_string_graph(prompt) 1128 positive_points_parsed = input_parsers.parse_graph(positive_points) 1129 negative_points_parsed = input_parsers.parse_graph(negative_points) 1130 result = _internal.composition_segment_internal(composition_parsed, prompt_parsed, positive_points_parsed, negative_points_parsed) 1131 return Composition(result)
Composition Segment
Segments objects in a composition using SAM3. Accepts a text prompt and lists of positive/negative click points.
Args: prompt: Graph of String positive_points: Graph of Point2iList negative_points: Graph of Point2iList
Returns: Graph: A graph node producing a Composition.
1133 def sharpen(self, radius, strength) -> Composition: 1134 """Composition Sharpen 1135 1136 Applies a sharpen filter to the composition. 1137 1138 Args: 1139 radius: Graph of Float 1140 strength: Graph of Float 1141 1142 Returns: 1143 Graph: A graph node producing a Composition. 1144 """ 1145 composition_parsed = input_parsers.parse_graph(self) 1146 radius_parsed = input_parsers.parse_float_graph(radius) 1147 strength_parsed = input_parsers.parse_float_graph(strength) 1148 result = _internal.composition_sharpen_internal(composition_parsed, radius_parsed, strength_parsed) 1149 return Composition(result)
Composition Sharpen
Applies a sharpen filter to the composition.
Args: radius: Graph of Float strength: Graph of Float
Returns: Graph: A graph node producing a Composition.
1151 def sobel_edge_detection(self) -> Composition: 1152 """Composition Sobel Edge Detection 1153 1154 Applies Sobel edge detection to an image. 1155 1156 Returns: 1157 Graph: A graph node producing a Composition. 1158 """ 1159 composition_parsed = input_parsers.parse_graph(self) 1160 result = _internal.composition_sobel_edge_detection_internal(composition_parsed) 1161 return Composition(result)
Composition Sobel Edge Detection
Applies Sobel edge detection to an image.
Returns: Graph: A graph node producing a Composition.
1163 def spacial_effect_shader(self, function_body, helpers, max_displacement, inputs, working_color_representation) -> Composition: 1164 """Composition Spacial Effect Shader 1165 1166 Runs a custom shader over an input that can spatially displace pixels by up to a maximum displacement. 1167 1168 Args: 1169 function_body: Graph of String 1170 helpers: Graph of String 1171 max_displacement: Graph of Float 1172 inputs: Graph of Dictionary 1173 working_color_representation: Graph of ColorRepresentation 1174 1175 Returns: 1176 Graph: A graph node producing a Composition. 1177 """ 1178 composition_parsed = input_parsers.parse_graph(self) 1179 function_body_parsed = input_parsers.parse_string_graph(function_body) 1180 helpers_parsed = input_parsers.parse_string_graph(helpers) 1181 max_displacement_parsed = input_parsers.parse_float_graph(max_displacement) 1182 inputs_parsed = input_parsers.parse_graph(inputs) 1183 working_color_representation_parsed = input_parsers.parse_graph(working_color_representation) 1184 result = _internal.composition_spacial_effect_shader_internal(composition_parsed, function_body_parsed, helpers_parsed, max_displacement_parsed, inputs_parsed, working_color_representation_parsed) 1185 return Composition(result)
Composition Spacial Effect Shader
Runs a custom shader over an input that can spatially displace pixels by up to a maximum displacement.
Args: function_body: Graph of String helpers: Graph of String max_displacement: Graph of Float inputs: Graph of Dictionary working_color_representation: Graph of ColorRepresentation
Returns: Graph: A graph node producing a Composition.
1187 def swirl(self, center, radius, amount) -> Composition: 1188 """Composition Swirl 1189 1190 Applies a swirl distortion to this composition 1191 1192 Args: 1193 center: Graph of Vector2f 1194 radius: Graph of Float 1195 amount: Graph of Float 1196 1197 Returns: 1198 Graph: A graph node producing a Composition. 1199 """ 1200 composition_parsed = input_parsers.parse_graph(self) 1201 center_parsed = input_parsers.parse_graph(center) 1202 radius_parsed = input_parsers.parse_float_graph(radius) 1203 amount_parsed = input_parsers.parse_float_graph(amount) 1204 result = _internal.composition_swirl_internal(composition_parsed, center_parsed, radius_parsed, amount_parsed) 1205 return Composition(result)
Composition Swirl
Applies a swirl distortion to this composition
Args: center: Graph of Vector2f radius: Graph of Float amount: Graph of Float
Returns: Graph: A graph node producing a Composition.
1207 def target_white_kelvin(self, kelvin) -> Composition: 1208 """Composition Target White Kelvin 1209 1210 Sets the image white point to the value specified in Kelvin. The profile connection white point is D50, so you will only see changes as you move away from that. 1211 1212 Args: 1213 kelvin: Graph of Float 1214 1215 Returns: 1216 Graph: A graph node producing a Composition. 1217 """ 1218 composition_parsed = input_parsers.parse_graph(self) 1219 kelvin_parsed = input_parsers.parse_float_graph(kelvin) 1220 result = _internal.composition_target_white_kelvin_internal(composition_parsed, kelvin_parsed) 1221 return Composition(result)
Composition Target White Kelvin
Sets the image white point to the value specified in Kelvin. The profile connection white point is D50, so you will only see changes as you move away from that.
Args: kelvin: Graph of Float
Returns: Graph: A graph node producing a Composition.
1223 def to_ok_lab_hist(self) -> ok_lab_hist.OkLabHist: 1224 """Composition to OkLab Histogram 1225 1226 Creates an OkLab Histogram from the colors in a Composition. 1227 1228 Returns: 1229 Graph: A graph node producing a OkLabHist. 1230 """ 1231 composition_parsed = input_parsers.parse_graph(self) 1232 result = _internal.composition_to_ok_lab_hist_internal(composition_parsed) 1233 from .ok_lab_hist import OkLabHist 1234 return OkLabHist(result)
Composition to OkLab Histogram
Creates an OkLab Histogram from the colors in a Composition.
Returns: Graph: A graph node producing a OkLabHist.
1236 def transform(self, transform) -> Composition: 1237 """Composition Transform 1238 1239 Applies a 2D transform to a Composition. 1240 1241 Args: 1242 transform: Graph of Transform2 1243 1244 Returns: 1245 Graph: A graph node producing a Composition. 1246 """ 1247 composition_parsed = input_parsers.parse_graph(self) 1248 transform_parsed = input_parsers.parse_graph(transform) 1249 result = _internal.composition_transform_internal(composition_parsed, transform_parsed) 1250 return Composition(result)
Composition Transform
Applies a 2D transform to a Composition.
Args: transform: Graph of Transform2
Returns: Graph: A graph node producing a Composition.
1252 def vibrance_adjustment(self, strength) -> Composition: 1253 """Composition Vibrance Adjustment 1254 1255 Adjusts the vibrance of an image by a given strength. Internally, boosts chroma in OkLab color space adaptively, applying more boost to less saturated colors. 1256 1257 Args: 1258 strength: Graph of Float 1259 1260 Returns: 1261 Graph: A graph node producing a Composition. 1262 """ 1263 composition_parsed = input_parsers.parse_graph(self) 1264 strength_parsed = input_parsers.parse_float_graph(strength) 1265 result = _internal.composition_vibrance_adjustment_internal(composition_parsed, strength_parsed) 1266 return Composition(result)
Composition Vibrance Adjustment
Adjusts the vibrance of an image by a given strength. Internally, boosts chroma in OkLab color space adaptively, applying more boost to less saturated colors.
Args: strength: Graph of Float
Returns: Graph: A graph node producing a Composition.
1268 def vignette(self, center, radius_x, radius_y, softness, strength) -> Composition: 1269 """Composition Vignette 1270 1271 darkens the area outside an ellipse - center is the bright spot in pixel coordinates, radius_x and radius_y are the ellipse semi-axes in pixels where the falloff starts, softness is the width of the fade-out band in pixels, and strength (0-1) defines how dark the edges become at maximum. 1272 1273 Args: 1274 center: Graph of Vector2f 1275 radius_x: Graph of Float 1276 radius_y: Graph of Float 1277 softness: Graph of Float 1278 strength: Graph of Float 1279 1280 Returns: 1281 Graph: A graph node producing a Composition. 1282 """ 1283 composition_parsed = input_parsers.parse_graph(self) 1284 center_parsed = input_parsers.parse_graph(center) 1285 radius_x_parsed = input_parsers.parse_float_graph(radius_x) 1286 radius_y_parsed = input_parsers.parse_float_graph(radius_y) 1287 softness_parsed = input_parsers.parse_float_graph(softness) 1288 strength_parsed = input_parsers.parse_float_graph(strength) 1289 result = _internal.composition_vignette_internal(composition_parsed, center_parsed, radius_x_parsed, radius_y_parsed, softness_parsed, strength_parsed) 1290 return Composition(result)
Composition Vignette
darkens the area outside an ellipse - center is the bright spot in pixel coordinates, radius_x and radius_y are the ellipse semi-axes in pixels where the falloff starts, softness is the width of the fade-out band in pixels, and strength (0-1) defines how dark the edges become at maximum.
Args: center: Graph of Vector2f radius_x: Graph of Float radius_y: Graph of Float softness: Graph of Float strength: Graph of Float
Returns: Graph: A graph node producing a Composition.
1292 def zoom_blur(self, center, strength, falloff, effect_radius) -> Composition: 1293 """Composition Zoom Blur 1294 1295 Performs a zoom blur on this composition 1296 1297 Args: 1298 center: Graph of Vector2f 1299 strength: Graph of Float 1300 falloff: Graph of Float 1301 effect_radius: Graph of Float 1302 1303 Returns: 1304 Graph: A graph node producing a Composition. 1305 """ 1306 composition_parsed = input_parsers.parse_graph(self) 1307 center_parsed = input_parsers.parse_graph(center) 1308 strength_parsed = input_parsers.parse_float_graph(strength) 1309 falloff_parsed = input_parsers.parse_float_graph(falloff) 1310 effect_radius_parsed = input_parsers.parse_float_graph(effect_radius) 1311 result = _internal.composition_zoom_blur_internal(composition_parsed, center_parsed, strength_parsed, falloff_parsed, effect_radius_parsed) 1312 return Composition(result)
Composition Zoom Blur
Performs a zoom blur on this composition
Args: center: Graph of Vector2f strength: Graph of Float falloff: Graph of Float effect_radius: Graph of Float
Returns: Graph: A graph node producing a Composition.
17class Curve(Object): 18 """A curve that represents a mathematical function in 2D that takes and input and maps to an output.""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 def evaluate(self, input) -> float.Float: 24 """Curve Evaluate 25 26 Evaluates a curve at a given input value. 27 28 Args: 29 input: Graph of Float 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 curve_parsed = input_parsers.parse_graph(self) 35 input_parsed = input_parsers.parse_float_graph(input) 36 result = _internal.curve_evaluate_internal(curve_parsed, input_parsed) 37 from .float import Float 38 return Float(result) 39 40 @staticmethod 41 def gamma(gamma) -> Curve: 42 """Curve Gamma 43 44 A gamma curve. The gamma parameter corresponding to y=x^gamma. 45 46 Args: 47 gamma: Graph of Float 48 49 Returns: 50 Graph: A graph node producing a Curve. 51 """ 52 gamma_parsed = input_parsers.parse_float_graph(gamma) 53 result = _internal.curve_gamma_internal(gamma_parsed) 54 return Curve(result) 55 56 @staticmethod 57 def identity() -> Curve: 58 """Curve Identity 59 60 An identity curve, y=x 61 62 Returns: 63 Graph: A graph node producing a Curve. 64 """ 65 result = _internal.curve_identity_internal() 66 return Curve(result) 67 68 @staticmethod 69 def pivoted_sigmoid(pivot, slope) -> Curve: 70 """Curve Pivoted Sigmoid 71 72 A pivoted sigmoid contrast curve that anchors at the pivot and smoothly compresses shadows and highlights, with a slope parameter controlling midtone contrast. 73 74 Args: 75 pivot: Graph of Float 76 slope: Graph of Float 77 78 Returns: 79 Graph: A graph node producing a Curve. 80 """ 81 pivot_parsed = input_parsers.parse_float_graph(pivot) 82 slope_parsed = input_parsers.parse_float_graph(slope) 83 result = _internal.curve_pivoted_sigmoid_internal(pivot_parsed, slope_parsed) 84 return Curve(result) 85 86 @staticmethod 87 def s_curve(pivot, slope, toe, shoulder) -> Curve: 88 """Curve S 89 90 An S-curve remaps values by anchoring contrast at a chosen pivot, increasing or decreasing midtone separation via slope, gently flattening the curve near black with toe to compress or lift shadows, and softly flattening near white with shoulder to roll off highlights, while keeping black and white fixed. 91 92 Args: 93 pivot: Graph of Float 94 slope: Graph of Float 95 toe: Graph of Float 96 shoulder: Graph of Float 97 98 Returns: 99 Graph: A graph node producing a Curve. 100 """ 101 pivot_parsed = input_parsers.parse_float_graph(pivot) 102 slope_parsed = input_parsers.parse_float_graph(slope) 103 toe_parsed = input_parsers.parse_float_graph(toe) 104 shoulder_parsed = input_parsers.parse_float_graph(shoulder) 105 result = _internal.curve_s_curve_internal(pivot_parsed, slope_parsed, toe_parsed, shoulder_parsed) 106 return Curve(result)
A curve that represents a mathematical function in 2D that takes and input and maps to an output.
23 def evaluate(self, input) -> float.Float: 24 """Curve Evaluate 25 26 Evaluates a curve at a given input value. 27 28 Args: 29 input: Graph of Float 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 curve_parsed = input_parsers.parse_graph(self) 35 input_parsed = input_parsers.parse_float_graph(input) 36 result = _internal.curve_evaluate_internal(curve_parsed, input_parsed) 37 from .float import Float 38 return Float(result)
Curve Evaluate
Evaluates a curve at a given input value.
Args: input: Graph of Float
Returns: Graph: A graph node producing a Float.
40 @staticmethod 41 def gamma(gamma) -> Curve: 42 """Curve Gamma 43 44 A gamma curve. The gamma parameter corresponding to y=x^gamma. 45 46 Args: 47 gamma: Graph of Float 48 49 Returns: 50 Graph: A graph node producing a Curve. 51 """ 52 gamma_parsed = input_parsers.parse_float_graph(gamma) 53 result = _internal.curve_gamma_internal(gamma_parsed) 54 return Curve(result)
Curve Gamma
A gamma curve. The gamma parameter corresponding to y=x^gamma.
Args: gamma: Graph of Float
Returns: Graph: A graph node producing a Curve.
56 @staticmethod 57 def identity() -> Curve: 58 """Curve Identity 59 60 An identity curve, y=x 61 62 Returns: 63 Graph: A graph node producing a Curve. 64 """ 65 result = _internal.curve_identity_internal() 66 return Curve(result)
Curve Identity
An identity curve, y=x
Returns: Graph: A graph node producing a Curve.
68 @staticmethod 69 def pivoted_sigmoid(pivot, slope) -> Curve: 70 """Curve Pivoted Sigmoid 71 72 A pivoted sigmoid contrast curve that anchors at the pivot and smoothly compresses shadows and highlights, with a slope parameter controlling midtone contrast. 73 74 Args: 75 pivot: Graph of Float 76 slope: Graph of Float 77 78 Returns: 79 Graph: A graph node producing a Curve. 80 """ 81 pivot_parsed = input_parsers.parse_float_graph(pivot) 82 slope_parsed = input_parsers.parse_float_graph(slope) 83 result = _internal.curve_pivoted_sigmoid_internal(pivot_parsed, slope_parsed) 84 return Curve(result)
Curve Pivoted Sigmoid
A pivoted sigmoid contrast curve that anchors at the pivot and smoothly compresses shadows and highlights, with a slope parameter controlling midtone contrast.
Args: pivot: Graph of Float slope: Graph of Float
Returns: Graph: A graph node producing a Curve.
86 @staticmethod 87 def s_curve(pivot, slope, toe, shoulder) -> Curve: 88 """Curve S 89 90 An S-curve remaps values by anchoring contrast at a chosen pivot, increasing or decreasing midtone separation via slope, gently flattening the curve near black with toe to compress or lift shadows, and softly flattening near white with shoulder to roll off highlights, while keeping black and white fixed. 91 92 Args: 93 pivot: Graph of Float 94 slope: Graph of Float 95 toe: Graph of Float 96 shoulder: Graph of Float 97 98 Returns: 99 Graph: A graph node producing a Curve. 100 """ 101 pivot_parsed = input_parsers.parse_float_graph(pivot) 102 slope_parsed = input_parsers.parse_float_graph(slope) 103 toe_parsed = input_parsers.parse_float_graph(toe) 104 shoulder_parsed = input_parsers.parse_float_graph(shoulder) 105 result = _internal.curve_s_curve_internal(pivot_parsed, slope_parsed, toe_parsed, shoulder_parsed) 106 return Curve(result)
Curve S
An S-curve remaps values by anchoring contrast at a chosen pivot, increasing or decreasing midtone separation via slope, gently flattening the curve near black with toe to compress or lift shadows, and softly flattening near white with shoulder to roll off highlights, while keeping black and white fixed.
Args: pivot: Graph of Float slope: Graph of Float toe: Graph of Float shoulder: Graph of Float
Returns: Graph: A graph node producing a Curve.
12class Dictionary(Object): 13 """A key value lookup between a name and a type in the graph""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 def add(self, key, value) -> Dictionary: 19 """Dictionary Add 20 21 Adds a key-value pair to a dictionary 22 23 Args: 24 key: Graph of String 25 value: Graph of Any 26 27 Returns: 28 Graph: A graph node producing a Dictionary. 29 """ 30 dictionary_parsed = input_parsers.parse_graph(self) 31 key_parsed = input_parsers.parse_string_graph(key) 32 value_parsed = input_parsers.parse_graph(value) 33 result = _internal.dictionary_add_internal(dictionary_parsed, key_parsed, value_parsed) 34 return Dictionary(result) 35 36 @staticmethod 37 def create() -> Dictionary: 38 """Dictionary Create 39 40 Creates a new dictionary 41 42 Returns: 43 Graph: A graph node producing a Dictionary. 44 """ 45 result = _internal.dictionary_create_internal() 46 return Dictionary(result)
A key value lookup between a name and a type in the graph
18 def add(self, key, value) -> Dictionary: 19 """Dictionary Add 20 21 Adds a key-value pair to a dictionary 22 23 Args: 24 key: Graph of String 25 value: Graph of Any 26 27 Returns: 28 Graph: A graph node producing a Dictionary. 29 """ 30 dictionary_parsed = input_parsers.parse_graph(self) 31 key_parsed = input_parsers.parse_string_graph(key) 32 value_parsed = input_parsers.parse_graph(value) 33 result = _internal.dictionary_add_internal(dictionary_parsed, key_parsed, value_parsed) 34 return Dictionary(result)
Dictionary Add
Adds a key-value pair to a dictionary
Args: key: Graph of String value: Graph of Any
Returns: Graph: A graph node producing a Dictionary.
36 @staticmethod 37 def create() -> Dictionary: 38 """Dictionary Create 39 40 Creates a new dictionary 41 42 Returns: 43 Graph: A graph node producing a Dictionary. 44 """ 45 result = _internal.dictionary_create_internal() 46 return Dictionary(result)
Dictionary Create
Creates a new dictionary
Returns: Graph: A graph node producing a Dictionary.
12class Fill(Object): 13 """The fill for when drawing in a 2d object.""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def custom(function_body, helpers, inputs) -> Fill: 20 """Fill Custom 21 22 Creates a fill with a custom shader. 23 24 Args: 25 function_body: Graph of String 26 helpers: Graph of String 27 inputs: Graph of Dictionary 28 29 Returns: 30 Graph: A graph node producing a Fill. 31 """ 32 function_body_parsed = input_parsers.parse_string_graph(function_body) 33 helpers_parsed = input_parsers.parse_string_graph(helpers) 34 inputs_parsed = input_parsers.parse_graph(inputs) 35 result = _internal.fill_custom_internal(function_body_parsed, helpers_parsed, inputs_parsed) 36 return Fill(result) 37 38 @staticmethod 39 def solid(color) -> Fill: 40 """Fill Solid 41 42 Creates a fill with a solid color. 43 44 Args: 45 color: Graph of ProfiledColor 46 47 Returns: 48 Graph: A graph node producing a Fill. 49 """ 50 color_parsed = input_parsers.parse_graph(color) 51 result = _internal.fill_solid_internal(color_parsed) 52 return Fill(result)
The fill for when drawing in a 2d object.
18 @staticmethod 19 def custom(function_body, helpers, inputs) -> Fill: 20 """Fill Custom 21 22 Creates a fill with a custom shader. 23 24 Args: 25 function_body: Graph of String 26 helpers: Graph of String 27 inputs: Graph of Dictionary 28 29 Returns: 30 Graph: A graph node producing a Fill. 31 """ 32 function_body_parsed = input_parsers.parse_string_graph(function_body) 33 helpers_parsed = input_parsers.parse_string_graph(helpers) 34 inputs_parsed = input_parsers.parse_graph(inputs) 35 result = _internal.fill_custom_internal(function_body_parsed, helpers_parsed, inputs_parsed) 36 return Fill(result)
Fill Custom
Creates a fill with a custom shader.
Args: function_body: Graph of String helpers: Graph of String inputs: Graph of Dictionary
Returns: Graph: A graph node producing a Fill.
38 @staticmethod 39 def solid(color) -> Fill: 40 """Fill Solid 41 42 Creates a fill with a solid color. 43 44 Args: 45 color: Graph of ProfiledColor 46 47 Returns: 48 Graph: A graph node producing a Fill. 49 """ 50 color_parsed = input_parsers.parse_graph(color) 51 result = _internal.fill_solid_internal(color_parsed) 52 return Fill(result)
Fill Solid
Creates a fill with a solid color.
Args: color: Graph of ProfiledColor
Returns: Graph: A graph node producing a Fill.
19class Float(Object): 20 """A float""" 21 22 def execute(self, context): 23 return self._inner.execute(context).as_float() 24 25 if TYPE_CHECKING: 26 # Implemented at runtime via monkeypatching in `_operators.py`; declared 27 # here only so static type checkers recognize these operators. 28 def __add__(self, other: Float | builtins.float | builtins.int) -> Float: ... 29 def __radd__(self, other: Float | builtins.float | builtins.int) -> Float: ... 30 def __sub__(self, other: Float | builtins.float | builtins.int) -> Float: ... 31 def __rsub__(self, other: Float | builtins.float | builtins.int) -> Float: ... 32 def __mul__(self, other: Float | builtins.float | builtins.int) -> Float: ... 33 def __rmul__(self, other: Float | builtins.float | builtins.int) -> Float: ... 34 def __truediv__(self, other: Float | builtins.float | builtins.int) -> Float: ... 35 def __rtruediv__(self, other: Float | builtins.float | builtins.int) -> Float: ... 36 def __gt__(self, other: Float | builtins.float | builtins.int) -> bool.Bool: ... 37 def __ge__(self, other: Float | builtins.float | builtins.int) -> bool.Bool: ... 38 def __lt__(self, other: Float | builtins.float | builtins.int) -> bool.Bool: ... 39 def __le__(self, other: Float | builtins.float | builtins.int) -> bool.Bool: ... 40 def __eq__(self, other: builtins.object) -> bool.Bool: ... # type: ignore[override] 41 42 def abs(self) -> Float: 43 """Absolute Value 44 45 Returns the absolute value of a float 46 47 Returns: 48 Graph: A graph node producing a Float. 49 """ 50 number_parsed = input_parsers.parse_float_graph(self) 51 result = _internal.abs_internal(number_parsed) 52 return Float(result) 53 54 def add(self, float2) -> Float: 55 """Float Add 56 57 Adds two floats together. 58 59 Args: 60 float2: Graph of Float 61 62 Returns: 63 Graph: A graph node producing a Float. 64 """ 65 float1_parsed = input_parsers.parse_float_graph(self) 66 float2_parsed = input_parsers.parse_float_graph(float2) 67 result = _internal.float_add_internal(float1_parsed, float2_parsed) 68 return Float(result) 69 70 def cos(self) -> Float: 71 """Float Cosine 72 73 Computes the cosine of a float (in radians). 74 75 Returns: 76 Graph: A graph node producing a Float. 77 """ 78 angle_parsed = input_parsers.parse_float_graph(self) 79 result = _internal.float_cos_internal(angle_parsed) 80 return Float(result) 81 82 def divide(self, float2) -> Float: 83 """Float Divide 84 85 Adds two floats together. 86 87 Args: 88 float2: Graph of Float 89 90 Returns: 91 Graph: A graph node producing a Float. 92 """ 93 float1_parsed = input_parsers.parse_float_graph(self) 94 float2_parsed = input_parsers.parse_float_graph(float2) 95 result = _internal.float_divide_internal(float1_parsed, float2_parsed) 96 return Float(result) 97 98 def equals(self, float_2) -> bool.Bool: 99 """Float Equals 100 101 Checks if two floats are equal 102 103 Args: 104 float_2: Graph of Float 105 106 Returns: 107 Graph: A graph node producing a Bool. 108 """ 109 float_1_parsed = input_parsers.parse_float_graph(self) 110 float_2_parsed = input_parsers.parse_float_graph(float_2) 111 result = _internal.float_equals_internal(float_1_parsed, float_2_parsed) 112 from .bool import Bool 113 return Bool(result) 114 115 def greater_than(self, float_2) -> bool.Bool: 116 """Float Greater Than 117 118 Checks if the first float is greater than the second float 119 120 Args: 121 float_2: Graph of Float 122 123 Returns: 124 Graph: A graph node producing a Bool. 125 """ 126 float_1_parsed = input_parsers.parse_float_graph(self) 127 float_2_parsed = input_parsers.parse_float_graph(float_2) 128 result = _internal.float_greater_than_internal(float_1_parsed, float_2_parsed) 129 from .bool import Bool 130 return Bool(result) 131 132 def greater_than_or_equal(self, float_2) -> bool.Bool: 133 """Float Greater Than Or Equal 134 135 Checks if the first float is greater than or equal to the second float 136 137 Args: 138 float_2: Graph of Float 139 140 Returns: 141 Graph: A graph node producing a Bool. 142 """ 143 float_1_parsed = input_parsers.parse_float_graph(self) 144 float_2_parsed = input_parsers.parse_float_graph(float_2) 145 result = _internal.float_greater_than_or_equal_internal(float_1_parsed, float_2_parsed) 146 from .bool import Bool 147 return Bool(result) 148 149 def lerp(self, float1, float2) -> Float: 150 """Float Lerp 151 152 Lerps between two floats using the x parameter 153 154 Args: 155 float1: Graph of Float 156 float2: Graph of Float 157 158 Returns: 159 Graph: A graph node producing a Float. 160 """ 161 x_parsed = input_parsers.parse_float_graph(self) 162 float1_parsed = input_parsers.parse_float_graph(float1) 163 float2_parsed = input_parsers.parse_float_graph(float2) 164 result = _internal.float_lerp_internal(x_parsed, float1_parsed, float2_parsed) 165 return Float(result) 166 167 def less_than(self, float_2) -> bool.Bool: 168 """Float Less Than 169 170 Checks if the first float is less than the second float 171 172 Args: 173 float_2: Graph of Float 174 175 Returns: 176 Graph: A graph node producing a Bool. 177 """ 178 float_1_parsed = input_parsers.parse_float_graph(self) 179 float_2_parsed = input_parsers.parse_float_graph(float_2) 180 result = _internal.float_less_than_internal(float_1_parsed, float_2_parsed) 181 from .bool import Bool 182 return Bool(result) 183 184 def less_than_or_equal(self, float_2) -> bool.Bool: 185 """Float Less Than Or Equal 186 187 Checks if the first float is less than or equal to the second float 188 189 Args: 190 float_2: Graph of Float 191 192 Returns: 193 Graph: A graph node producing a Bool. 194 """ 195 float_1_parsed = input_parsers.parse_float_graph(self) 196 float_2_parsed = input_parsers.parse_float_graph(float_2) 197 result = _internal.float_less_than_or_equal_internal(float_1_parsed, float_2_parsed) 198 from .bool import Bool 199 return Bool(result) 200 201 def max(self, float2) -> Float: 202 """Float Max 203 204 Returns the maximum float. 205 206 Args: 207 float2: Graph of Float 208 209 Returns: 210 Graph: A graph node producing a Float. 211 """ 212 float1_parsed = input_parsers.parse_float_graph(self) 213 float2_parsed = input_parsers.parse_float_graph(float2) 214 result = _internal.float_max_internal(float1_parsed, float2_parsed) 215 return Float(result) 216 217 def min(self, float2) -> Float: 218 """Float Min 219 220 Returns the minimum float. 221 222 Args: 223 float2: Graph of Float 224 225 Returns: 226 Graph: A graph node producing a Float. 227 """ 228 float1_parsed = input_parsers.parse_float_graph(self) 229 float2_parsed = input_parsers.parse_float_graph(float2) 230 result = _internal.float_min_internal(float1_parsed, float2_parsed) 231 return Float(result) 232 233 def multiply(self, float2) -> Float: 234 """Float Multiply 235 236 Multiplies two floats together. 237 238 Args: 239 float2: Graph of Float 240 241 Returns: 242 Graph: A graph node producing a Float. 243 """ 244 float1_parsed = input_parsers.parse_float_graph(self) 245 float2_parsed = input_parsers.parse_float_graph(float2) 246 result = _internal.float_multiply_internal(float1_parsed, float2_parsed) 247 return Float(result) 248 249 def pow(self, float2) -> Float: 250 """Float Power 251 252 Raises float 1 to the power of float 2 253 254 Args: 255 float2: Graph of Float 256 257 Returns: 258 Graph: A graph node producing a Float. 259 """ 260 float1_parsed = input_parsers.parse_float_graph(self) 261 float2_parsed = input_parsers.parse_float_graph(float2) 262 result = _internal.float_pow_internal(float1_parsed, float2_parsed) 263 return Float(result) 264 265 def round_to_int(self) -> int.Int: 266 """Float Round to Int 267 268 Rounds the float to the nearest int 269 270 Returns: 271 Graph: A graph node producing a Int. 272 """ 273 float_parsed = input_parsers.parse_float_graph(self) 274 result = _internal.float_round_to_int_internal(float_parsed) 275 from .int import Int 276 return Int(result) 277 278 def sin(self) -> Float: 279 """Float Sine 280 281 Computes the sine of a float (in radians). 282 283 Returns: 284 Graph: A graph node producing a Float. 285 """ 286 angle_parsed = input_parsers.parse_float_graph(self) 287 result = _internal.float_sin_internal(angle_parsed) 288 return Float(result) 289 290 def square_root(self) -> Float: 291 """Float Square Root 292 293 Compares the square root of a number 294 295 Returns: 296 Graph: A graph node producing a Float. 297 """ 298 number_parsed = input_parsers.parse_float_graph(self) 299 result = _internal.float_square_root_internal(number_parsed) 300 return Float(result) 301 302 def squared(self) -> Float: 303 """Float Squared 304 305 Raises a float to the power of 2. 306 307 Returns: 308 Graph: A graph node producing a Float. 309 """ 310 number_parsed = input_parsers.parse_float_graph(self) 311 result = _internal.float_squared_internal(number_parsed) 312 return Float(result) 313 314 def subtract(self, float2) -> Float: 315 """Float Subtract 316 317 Adds two floats together. 318 319 Args: 320 float2: Graph of Float 321 322 Returns: 323 Graph: A graph node producing a Float. 324 """ 325 float1_parsed = input_parsers.parse_float_graph(self) 326 float2_parsed = input_parsers.parse_float_graph(float2) 327 result = _internal.float_subtract_internal(float1_parsed, float2_parsed) 328 return Float(result) 329 330 @staticmethod 331 def pi() -> Float: 332 """Pi 333 334 Returns π as a float 335 336 Returns: 337 Graph: A graph node producing a Float. 338 """ 339 result = _internal.pi_internal() 340 return Float(result)
A float
42 def abs(self) -> Float: 43 """Absolute Value 44 45 Returns the absolute value of a float 46 47 Returns: 48 Graph: A graph node producing a Float. 49 """ 50 number_parsed = input_parsers.parse_float_graph(self) 51 result = _internal.abs_internal(number_parsed) 52 return Float(result)
Absolute Value
Returns the absolute value of a float
Returns: Graph: A graph node producing a Float.
54 def add(self, float2) -> Float: 55 """Float Add 56 57 Adds two floats together. 58 59 Args: 60 float2: Graph of Float 61 62 Returns: 63 Graph: A graph node producing a Float. 64 """ 65 float1_parsed = input_parsers.parse_float_graph(self) 66 float2_parsed = input_parsers.parse_float_graph(float2) 67 result = _internal.float_add_internal(float1_parsed, float2_parsed) 68 return Float(result)
Float Add
Adds two floats together.
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
70 def cos(self) -> Float: 71 """Float Cosine 72 73 Computes the cosine of a float (in radians). 74 75 Returns: 76 Graph: A graph node producing a Float. 77 """ 78 angle_parsed = input_parsers.parse_float_graph(self) 79 result = _internal.float_cos_internal(angle_parsed) 80 return Float(result)
Float Cosine
Computes the cosine of a float (in radians).
Returns: Graph: A graph node producing a Float.
82 def divide(self, float2) -> Float: 83 """Float Divide 84 85 Adds two floats together. 86 87 Args: 88 float2: Graph of Float 89 90 Returns: 91 Graph: A graph node producing a Float. 92 """ 93 float1_parsed = input_parsers.parse_float_graph(self) 94 float2_parsed = input_parsers.parse_float_graph(float2) 95 result = _internal.float_divide_internal(float1_parsed, float2_parsed) 96 return Float(result)
Float Divide
Adds two floats together.
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
98 def equals(self, float_2) -> bool.Bool: 99 """Float Equals 100 101 Checks if two floats are equal 102 103 Args: 104 float_2: Graph of Float 105 106 Returns: 107 Graph: A graph node producing a Bool. 108 """ 109 float_1_parsed = input_parsers.parse_float_graph(self) 110 float_2_parsed = input_parsers.parse_float_graph(float_2) 111 result = _internal.float_equals_internal(float_1_parsed, float_2_parsed) 112 from .bool import Bool 113 return Bool(result)
Float Equals
Checks if two floats are equal
Args: float_2: Graph of Float
Returns: Graph: A graph node producing a Bool.
115 def greater_than(self, float_2) -> bool.Bool: 116 """Float Greater Than 117 118 Checks if the first float is greater than the second float 119 120 Args: 121 float_2: Graph of Float 122 123 Returns: 124 Graph: A graph node producing a Bool. 125 """ 126 float_1_parsed = input_parsers.parse_float_graph(self) 127 float_2_parsed = input_parsers.parse_float_graph(float_2) 128 result = _internal.float_greater_than_internal(float_1_parsed, float_2_parsed) 129 from .bool import Bool 130 return Bool(result)
Float Greater Than
Checks if the first float is greater than the second float
Args: float_2: Graph of Float
Returns: Graph: A graph node producing a Bool.
132 def greater_than_or_equal(self, float_2) -> bool.Bool: 133 """Float Greater Than Or Equal 134 135 Checks if the first float is greater than or equal to the second float 136 137 Args: 138 float_2: Graph of Float 139 140 Returns: 141 Graph: A graph node producing a Bool. 142 """ 143 float_1_parsed = input_parsers.parse_float_graph(self) 144 float_2_parsed = input_parsers.parse_float_graph(float_2) 145 result = _internal.float_greater_than_or_equal_internal(float_1_parsed, float_2_parsed) 146 from .bool import Bool 147 return Bool(result)
Float Greater Than Or Equal
Checks if the first float is greater than or equal to the second float
Args: float_2: Graph of Float
Returns: Graph: A graph node producing a Bool.
149 def lerp(self, float1, float2) -> Float: 150 """Float Lerp 151 152 Lerps between two floats using the x parameter 153 154 Args: 155 float1: Graph of Float 156 float2: Graph of Float 157 158 Returns: 159 Graph: A graph node producing a Float. 160 """ 161 x_parsed = input_parsers.parse_float_graph(self) 162 float1_parsed = input_parsers.parse_float_graph(float1) 163 float2_parsed = input_parsers.parse_float_graph(float2) 164 result = _internal.float_lerp_internal(x_parsed, float1_parsed, float2_parsed) 165 return Float(result)
Float Lerp
Lerps between two floats using the x parameter
Args: float1: Graph of Float float2: Graph of Float
Returns: Graph: A graph node producing a Float.
167 def less_than(self, float_2) -> bool.Bool: 168 """Float Less Than 169 170 Checks if the first float is less than the second float 171 172 Args: 173 float_2: Graph of Float 174 175 Returns: 176 Graph: A graph node producing a Bool. 177 """ 178 float_1_parsed = input_parsers.parse_float_graph(self) 179 float_2_parsed = input_parsers.parse_float_graph(float_2) 180 result = _internal.float_less_than_internal(float_1_parsed, float_2_parsed) 181 from .bool import Bool 182 return Bool(result)
Float Less Than
Checks if the first float is less than the second float
Args: float_2: Graph of Float
Returns: Graph: A graph node producing a Bool.
184 def less_than_or_equal(self, float_2) -> bool.Bool: 185 """Float Less Than Or Equal 186 187 Checks if the first float is less than or equal to the second float 188 189 Args: 190 float_2: Graph of Float 191 192 Returns: 193 Graph: A graph node producing a Bool. 194 """ 195 float_1_parsed = input_parsers.parse_float_graph(self) 196 float_2_parsed = input_parsers.parse_float_graph(float_2) 197 result = _internal.float_less_than_or_equal_internal(float_1_parsed, float_2_parsed) 198 from .bool import Bool 199 return Bool(result)
Float Less Than Or Equal
Checks if the first float is less than or equal to the second float
Args: float_2: Graph of Float
Returns: Graph: A graph node producing a Bool.
201 def max(self, float2) -> Float: 202 """Float Max 203 204 Returns the maximum float. 205 206 Args: 207 float2: Graph of Float 208 209 Returns: 210 Graph: A graph node producing a Float. 211 """ 212 float1_parsed = input_parsers.parse_float_graph(self) 213 float2_parsed = input_parsers.parse_float_graph(float2) 214 result = _internal.float_max_internal(float1_parsed, float2_parsed) 215 return Float(result)
Float Max
Returns the maximum float.
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
217 def min(self, float2) -> Float: 218 """Float Min 219 220 Returns the minimum float. 221 222 Args: 223 float2: Graph of Float 224 225 Returns: 226 Graph: A graph node producing a Float. 227 """ 228 float1_parsed = input_parsers.parse_float_graph(self) 229 float2_parsed = input_parsers.parse_float_graph(float2) 230 result = _internal.float_min_internal(float1_parsed, float2_parsed) 231 return Float(result)
Float Min
Returns the minimum float.
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
233 def multiply(self, float2) -> Float: 234 """Float Multiply 235 236 Multiplies two floats together. 237 238 Args: 239 float2: Graph of Float 240 241 Returns: 242 Graph: A graph node producing a Float. 243 """ 244 float1_parsed = input_parsers.parse_float_graph(self) 245 float2_parsed = input_parsers.parse_float_graph(float2) 246 result = _internal.float_multiply_internal(float1_parsed, float2_parsed) 247 return Float(result)
Float Multiply
Multiplies two floats together.
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
249 def pow(self, float2) -> Float: 250 """Float Power 251 252 Raises float 1 to the power of float 2 253 254 Args: 255 float2: Graph of Float 256 257 Returns: 258 Graph: A graph node producing a Float. 259 """ 260 float1_parsed = input_parsers.parse_float_graph(self) 261 float2_parsed = input_parsers.parse_float_graph(float2) 262 result = _internal.float_pow_internal(float1_parsed, float2_parsed) 263 return Float(result)
Float Power
Raises float 1 to the power of float 2
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
265 def round_to_int(self) -> int.Int: 266 """Float Round to Int 267 268 Rounds the float to the nearest int 269 270 Returns: 271 Graph: A graph node producing a Int. 272 """ 273 float_parsed = input_parsers.parse_float_graph(self) 274 result = _internal.float_round_to_int_internal(float_parsed) 275 from .int import Int 276 return Int(result)
Float Round to Int
Rounds the float to the nearest int
Returns: Graph: A graph node producing a Int.
278 def sin(self) -> Float: 279 """Float Sine 280 281 Computes the sine of a float (in radians). 282 283 Returns: 284 Graph: A graph node producing a Float. 285 """ 286 angle_parsed = input_parsers.parse_float_graph(self) 287 result = _internal.float_sin_internal(angle_parsed) 288 return Float(result)
Float Sine
Computes the sine of a float (in radians).
Returns: Graph: A graph node producing a Float.
290 def square_root(self) -> Float: 291 """Float Square Root 292 293 Compares the square root of a number 294 295 Returns: 296 Graph: A graph node producing a Float. 297 """ 298 number_parsed = input_parsers.parse_float_graph(self) 299 result = _internal.float_square_root_internal(number_parsed) 300 return Float(result)
Float Square Root
Compares the square root of a number
Returns: Graph: A graph node producing a Float.
302 def squared(self) -> Float: 303 """Float Squared 304 305 Raises a float to the power of 2. 306 307 Returns: 308 Graph: A graph node producing a Float. 309 """ 310 number_parsed = input_parsers.parse_float_graph(self) 311 result = _internal.float_squared_internal(number_parsed) 312 return Float(result)
Float Squared
Raises a float to the power of 2.
Returns: Graph: A graph node producing a Float.
314 def subtract(self, float2) -> Float: 315 """Float Subtract 316 317 Adds two floats together. 318 319 Args: 320 float2: Graph of Float 321 322 Returns: 323 Graph: A graph node producing a Float. 324 """ 325 float1_parsed = input_parsers.parse_float_graph(self) 326 float2_parsed = input_parsers.parse_float_graph(float2) 327 result = _internal.float_subtract_internal(float1_parsed, float2_parsed) 328 return Float(result)
Float Subtract
Adds two floats together.
Args: float2: Graph of Float
Returns: Graph: A graph node producing a Float.
11class FloatList(List): 12 """List of Floats""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .float import Float 16 super().__init__(inner, Float if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context).as_float_list()
List of Floats
17class Image(Object): 18 """An Image""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 @staticmethod 24 def from_bytes(bytes) -> Image: 25 """Image from Bytes 26 27 Given some bytes, parses an image 28 29 Args: 30 bytes: Graph of Bytes 31 32 Returns: 33 Graph: A graph node producing a Image. 34 """ 35 bytes_parsed = input_parsers.parse_graph(bytes) 36 result = _internal.image_from_bytes_internal(bytes_parsed) 37 return Image(result) 38 39 def to_bytes(self) -> bytes.Bytes: 40 """Image to Bytes 41 42 Given an image, converts it to bytes 43 44 Returns: 45 Graph: A graph node producing a Bytes. 46 """ 47 image_parsed = input_parsers.parse_graph(self) 48 result = _internal.image_to_bytes_internal(image_parsed) 49 from .bytes import Bytes 50 return Bytes(result)
An Image
23 @staticmethod 24 def from_bytes(bytes) -> Image: 25 """Image from Bytes 26 27 Given some bytes, parses an image 28 29 Args: 30 bytes: Graph of Bytes 31 32 Returns: 33 Graph: A graph node producing a Image. 34 """ 35 bytes_parsed = input_parsers.parse_graph(bytes) 36 result = _internal.image_from_bytes_internal(bytes_parsed) 37 return Image(result)
Image from Bytes
Given some bytes, parses an image
Args: bytes: Graph of Bytes
Returns: Graph: A graph node producing a Image.
39 def to_bytes(self) -> bytes.Bytes: 40 """Image to Bytes 41 42 Given an image, converts it to bytes 43 44 Returns: 45 Graph: A graph node producing a Bytes. 46 """ 47 image_parsed = input_parsers.parse_graph(self) 48 result = _internal.image_to_bytes_internal(image_parsed) 49 from .bytes import Bytes 50 return Bytes(result)
Image to Bytes
Given an image, converts it to bytes
Returns: Graph: A graph node producing a Bytes.
20class Int(Object): 21 """An integer""" 22 23 def execute(self, context): 24 return self._inner.execute(context).as_int() 25 26 if TYPE_CHECKING: 27 # Implemented at runtime via monkeypatching in `_operators.py`; declared 28 # here only so static type checkers recognize these operators. 29 def __add__(self, other: Int | builtins.int) -> Int: ... 30 def __radd__(self, other: Int | builtins.int) -> Int: ... 31 def __sub__(self, other: Int | builtins.int) -> Int: ... 32 def __rsub__(self, other: Int | builtins.int) -> Int: ... 33 def __mul__(self, other: Int | builtins.int) -> Int: ... 34 def __rmul__(self, other: Int | builtins.int) -> Int: ... 35 def __gt__(self, other: Int | builtins.int) -> bool.Bool: ... 36 def __ge__(self, other: Int | builtins.int) -> bool.Bool: ... 37 def __lt__(self, other: Int | builtins.int) -> bool.Bool: ... 38 def __le__(self, other: Int | builtins.int) -> bool.Bool: ... 39 def __eq__(self, other: builtins.object) -> bool.Bool: ... # type: ignore[override] 40 41 def abs(self) -> Int: 42 """Int Absolute Value 43 44 Returns the absolute value of an int 45 46 Returns: 47 Graph: A graph node producing a Int. 48 """ 49 number_parsed = input_parsers.parse_int_graph(self) 50 result = _internal.int_abs_internal(number_parsed) 51 return Int(result) 52 53 def add(self, int_2) -> Int: 54 """Int Add 55 56 Adds to ints together 57 58 Args: 59 int_2: Graph of Int 60 61 Returns: 62 Graph: A graph node producing a Int. 63 """ 64 int_1_parsed = input_parsers.parse_int_graph(self) 65 int_2_parsed = input_parsers.parse_int_graph(int_2) 66 result = _internal.int_add_internal(int_1_parsed, int_2_parsed) 67 return Int(result) 68 69 def equals(self, int_2) -> bool.Bool: 70 """Int Equals 71 72 Checks if two ints are equal 73 74 Args: 75 int_2: Graph of Int 76 77 Returns: 78 Graph: A graph node producing a Bool. 79 """ 80 int_1_parsed = input_parsers.parse_int_graph(self) 81 int_2_parsed = input_parsers.parse_int_graph(int_2) 82 result = _internal.int_equals_internal(int_1_parsed, int_2_parsed) 83 from .bool import Bool 84 return Bool(result) 85 86 def greater_than(self, int_2) -> bool.Bool: 87 """Int Greater Than 88 89 Checks if the first int is greater than the second int 90 91 Args: 92 int_2: Graph of Int 93 94 Returns: 95 Graph: A graph node producing a Bool. 96 """ 97 int_1_parsed = input_parsers.parse_int_graph(self) 98 int_2_parsed = input_parsers.parse_int_graph(int_2) 99 result = _internal.int_greater_than_internal(int_1_parsed, int_2_parsed) 100 from .bool import Bool 101 return Bool(result) 102 103 def greater_than_or_equal(self, int_2) -> bool.Bool: 104 """Int Greater Than Or Equal 105 106 Checks if the first int is greater than or equal to the second int 107 108 Args: 109 int_2: Graph of Int 110 111 Returns: 112 Graph: A graph node producing a Bool. 113 """ 114 int_1_parsed = input_parsers.parse_int_graph(self) 115 int_2_parsed = input_parsers.parse_int_graph(int_2) 116 result = _internal.int_greater_than_or_equal_internal(int_1_parsed, int_2_parsed) 117 from .bool import Bool 118 return Bool(result) 119 120 def less_than(self, int_2) -> bool.Bool: 121 """Int Less Than 122 123 Checks if the first int is less than the second int 124 125 Args: 126 int_2: Graph of Int 127 128 Returns: 129 Graph: A graph node producing a Bool. 130 """ 131 int_1_parsed = input_parsers.parse_int_graph(self) 132 int_2_parsed = input_parsers.parse_int_graph(int_2) 133 result = _internal.int_less_than_internal(int_1_parsed, int_2_parsed) 134 from .bool import Bool 135 return Bool(result) 136 137 def less_than_or_equal(self, int_2) -> bool.Bool: 138 """Int Less Than Or Equal 139 140 Checks if the first int is less than or equal to the second int 141 142 Args: 143 int_2: Graph of Int 144 145 Returns: 146 Graph: A graph node producing a Bool. 147 """ 148 int_1_parsed = input_parsers.parse_int_graph(self) 149 int_2_parsed = input_parsers.parse_int_graph(int_2) 150 result = _internal.int_less_than_or_equal_internal(int_1_parsed, int_2_parsed) 151 from .bool import Bool 152 return Bool(result) 153 154 def max(self, int2) -> Int: 155 """Int Max 156 157 Returns the maximum int. 158 159 Args: 160 int2: Graph of Int 161 162 Returns: 163 Graph: A graph node producing a Int. 164 """ 165 int1_parsed = input_parsers.parse_int_graph(self) 166 int2_parsed = input_parsers.parse_int_graph(int2) 167 result = _internal.int_max_internal(int1_parsed, int2_parsed) 168 return Int(result) 169 170 def min(self, int2) -> Int: 171 """Int Min 172 173 Returns the minimum int. 174 175 Args: 176 int2: Graph of Int 177 178 Returns: 179 Graph: A graph node producing a Int. 180 """ 181 int1_parsed = input_parsers.parse_int_graph(self) 182 int2_parsed = input_parsers.parse_int_graph(int2) 183 result = _internal.int_min_internal(int1_parsed, int2_parsed) 184 return Int(result) 185 186 def multiply(self, int_2) -> Int: 187 """Int Multiply 188 189 Multiplies two integers together 190 191 Args: 192 int_2: Graph of Int 193 194 Returns: 195 Graph: A graph node producing a Int. 196 """ 197 int_1_parsed = input_parsers.parse_int_graph(self) 198 int_2_parsed = input_parsers.parse_int_graph(int_2) 199 result = _internal.int_multiply_internal(int_1_parsed, int_2_parsed) 200 return Int(result) 201 202 def range(self, max) -> int_list.IntList: 203 """Int Range 204 205 Generates a list from the minimum to the maximum inclusive 206 207 Args: 208 max: Graph of Int 209 210 Returns: 211 Graph: A graph node producing a IntList. 212 """ 213 min_parsed = input_parsers.parse_int_graph(self) 214 max_parsed = input_parsers.parse_int_graph(max) 215 result = _internal.int_range_internal(min_parsed, max_parsed) 216 from .int_list import IntList 217 return IntList(result) 218 219 def subtract(self, int_2) -> Int: 220 """Int Subtract 221 222 Subtracts one int from another 223 224 Args: 225 int_2: Graph of Int 226 227 Returns: 228 Graph: A graph node producing a Int. 229 """ 230 int_1_parsed = input_parsers.parse_int_graph(self) 231 int_2_parsed = input_parsers.parse_int_graph(int_2) 232 result = _internal.int_subtract_internal(int_1_parsed, int_2_parsed) 233 return Int(result) 234 235 def to_float(self) -> float.Float: 236 """Int To Float 237 238 Converts an Int to a Float 239 240 Returns: 241 Graph: A graph node producing a Float. 242 """ 243 int_parsed = input_parsers.parse_int_graph(self) 244 result = _internal.int_to_float_internal(int_parsed) 245 from .float import Float 246 return Float(result)
An integer
41 def abs(self) -> Int: 42 """Int Absolute Value 43 44 Returns the absolute value of an int 45 46 Returns: 47 Graph: A graph node producing a Int. 48 """ 49 number_parsed = input_parsers.parse_int_graph(self) 50 result = _internal.int_abs_internal(number_parsed) 51 return Int(result)
Int Absolute Value
Returns the absolute value of an int
Returns: Graph: A graph node producing a Int.
53 def add(self, int_2) -> Int: 54 """Int Add 55 56 Adds to ints together 57 58 Args: 59 int_2: Graph of Int 60 61 Returns: 62 Graph: A graph node producing a Int. 63 """ 64 int_1_parsed = input_parsers.parse_int_graph(self) 65 int_2_parsed = input_parsers.parse_int_graph(int_2) 66 result = _internal.int_add_internal(int_1_parsed, int_2_parsed) 67 return Int(result)
Int Add
Adds to ints together
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Int.
69 def equals(self, int_2) -> bool.Bool: 70 """Int Equals 71 72 Checks if two ints are equal 73 74 Args: 75 int_2: Graph of Int 76 77 Returns: 78 Graph: A graph node producing a Bool. 79 """ 80 int_1_parsed = input_parsers.parse_int_graph(self) 81 int_2_parsed = input_parsers.parse_int_graph(int_2) 82 result = _internal.int_equals_internal(int_1_parsed, int_2_parsed) 83 from .bool import Bool 84 return Bool(result)
Int Equals
Checks if two ints are equal
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Bool.
86 def greater_than(self, int_2) -> bool.Bool: 87 """Int Greater Than 88 89 Checks if the first int is greater than the second int 90 91 Args: 92 int_2: Graph of Int 93 94 Returns: 95 Graph: A graph node producing a Bool. 96 """ 97 int_1_parsed = input_parsers.parse_int_graph(self) 98 int_2_parsed = input_parsers.parse_int_graph(int_2) 99 result = _internal.int_greater_than_internal(int_1_parsed, int_2_parsed) 100 from .bool import Bool 101 return Bool(result)
Int Greater Than
Checks if the first int is greater than the second int
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Bool.
103 def greater_than_or_equal(self, int_2) -> bool.Bool: 104 """Int Greater Than Or Equal 105 106 Checks if the first int is greater than or equal to the second int 107 108 Args: 109 int_2: Graph of Int 110 111 Returns: 112 Graph: A graph node producing a Bool. 113 """ 114 int_1_parsed = input_parsers.parse_int_graph(self) 115 int_2_parsed = input_parsers.parse_int_graph(int_2) 116 result = _internal.int_greater_than_or_equal_internal(int_1_parsed, int_2_parsed) 117 from .bool import Bool 118 return Bool(result)
Int Greater Than Or Equal
Checks if the first int is greater than or equal to the second int
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Bool.
120 def less_than(self, int_2) -> bool.Bool: 121 """Int Less Than 122 123 Checks if the first int is less than the second int 124 125 Args: 126 int_2: Graph of Int 127 128 Returns: 129 Graph: A graph node producing a Bool. 130 """ 131 int_1_parsed = input_parsers.parse_int_graph(self) 132 int_2_parsed = input_parsers.parse_int_graph(int_2) 133 result = _internal.int_less_than_internal(int_1_parsed, int_2_parsed) 134 from .bool import Bool 135 return Bool(result)
Int Less Than
Checks if the first int is less than the second int
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Bool.
137 def less_than_or_equal(self, int_2) -> bool.Bool: 138 """Int Less Than Or Equal 139 140 Checks if the first int is less than or equal to the second int 141 142 Args: 143 int_2: Graph of Int 144 145 Returns: 146 Graph: A graph node producing a Bool. 147 """ 148 int_1_parsed = input_parsers.parse_int_graph(self) 149 int_2_parsed = input_parsers.parse_int_graph(int_2) 150 result = _internal.int_less_than_or_equal_internal(int_1_parsed, int_2_parsed) 151 from .bool import Bool 152 return Bool(result)
Int Less Than Or Equal
Checks if the first int is less than or equal to the second int
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Bool.
154 def max(self, int2) -> Int: 155 """Int Max 156 157 Returns the maximum int. 158 159 Args: 160 int2: Graph of Int 161 162 Returns: 163 Graph: A graph node producing a Int. 164 """ 165 int1_parsed = input_parsers.parse_int_graph(self) 166 int2_parsed = input_parsers.parse_int_graph(int2) 167 result = _internal.int_max_internal(int1_parsed, int2_parsed) 168 return Int(result)
Int Max
Returns the maximum int.
Args: int2: Graph of Int
Returns: Graph: A graph node producing a Int.
170 def min(self, int2) -> Int: 171 """Int Min 172 173 Returns the minimum int. 174 175 Args: 176 int2: Graph of Int 177 178 Returns: 179 Graph: A graph node producing a Int. 180 """ 181 int1_parsed = input_parsers.parse_int_graph(self) 182 int2_parsed = input_parsers.parse_int_graph(int2) 183 result = _internal.int_min_internal(int1_parsed, int2_parsed) 184 return Int(result)
Int Min
Returns the minimum int.
Args: int2: Graph of Int
Returns: Graph: A graph node producing a Int.
186 def multiply(self, int_2) -> Int: 187 """Int Multiply 188 189 Multiplies two integers together 190 191 Args: 192 int_2: Graph of Int 193 194 Returns: 195 Graph: A graph node producing a Int. 196 """ 197 int_1_parsed = input_parsers.parse_int_graph(self) 198 int_2_parsed = input_parsers.parse_int_graph(int_2) 199 result = _internal.int_multiply_internal(int_1_parsed, int_2_parsed) 200 return Int(result)
Int Multiply
Multiplies two integers together
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Int.
202 def range(self, max) -> int_list.IntList: 203 """Int Range 204 205 Generates a list from the minimum to the maximum inclusive 206 207 Args: 208 max: Graph of Int 209 210 Returns: 211 Graph: A graph node producing a IntList. 212 """ 213 min_parsed = input_parsers.parse_int_graph(self) 214 max_parsed = input_parsers.parse_int_graph(max) 215 result = _internal.int_range_internal(min_parsed, max_parsed) 216 from .int_list import IntList 217 return IntList(result)
Int Range
Generates a list from the minimum to the maximum inclusive
Args: max: Graph of Int
Returns: Graph: A graph node producing a IntList.
219 def subtract(self, int_2) -> Int: 220 """Int Subtract 221 222 Subtracts one int from another 223 224 Args: 225 int_2: Graph of Int 226 227 Returns: 228 Graph: A graph node producing a Int. 229 """ 230 int_1_parsed = input_parsers.parse_int_graph(self) 231 int_2_parsed = input_parsers.parse_int_graph(int_2) 232 result = _internal.int_subtract_internal(int_1_parsed, int_2_parsed) 233 return Int(result)
Int Subtract
Subtracts one int from another
Args: int_2: Graph of Int
Returns: Graph: A graph node producing a Int.
235 def to_float(self) -> float.Float: 236 """Int To Float 237 238 Converts an Int to a Float 239 240 Returns: 241 Graph: A graph node producing a Float. 242 """ 243 int_parsed = input_parsers.parse_int_graph(self) 244 result = _internal.int_to_float_internal(int_parsed) 245 from .float import Float 246 return Float(result)
Int To Float
Converts an Int to a Float
Returns: Graph: A graph node producing a Float.
11class IntList(List): 12 """List of Ints""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .int import Int 16 super().__init__(inner, Int if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context).as_int_list()
List of Ints
17class LMSA(Object): 18 """An LMS color with an alpha component.""" 19 20 def execute(self, context): 21 return self._inner.execute(context).as_lmsa_color() 22 23 def alpha(self) -> float.Float: 24 """LMS Color Alpha 25 26 Gets the alpha component of an LMS color with alpha. 27 28 Returns: 29 Graph: A graph node producing a Float. 30 """ 31 lmsa_parsed = input_parsers.parse_graph(self) 32 result = _internal.l_m_s_a_alpha_internal(lmsa_parsed) 33 from .float import Float 34 return Float(result) 35 36 def l(self) -> float.Float: 37 """LMS Color L 38 39 Gets the L component of an LMS color with alpha. 40 41 Returns: 42 Graph: A graph node producing a Float. 43 """ 44 lmsa_parsed = input_parsers.parse_graph(self) 45 result = _internal.l_m_s_a_l_internal(lmsa_parsed) 46 from .float import Float 47 return Float(result) 48 49 def m(self) -> float.Float: 50 """LMS Color M 51 52 Gets the M component of an LMS color with alpha. 53 54 Returns: 55 Graph: A graph node producing a Float. 56 """ 57 lmsa_parsed = input_parsers.parse_graph(self) 58 result = _internal.l_m_s_a_m_internal(lmsa_parsed) 59 from .float import Float 60 return Float(result) 61 62 def s(self) -> float.Float: 63 """LMS Color S 64 65 Gets the S component of an LMS color with alpha. 66 67 Returns: 68 Graph: A graph node producing a Float. 69 """ 70 lmsa_parsed = input_parsers.parse_graph(self) 71 result = _internal.l_m_s_a_s_internal(lmsa_parsed) 72 from .float import Float 73 return Float(result)
An LMS color with an alpha component.
23 def alpha(self) -> float.Float: 24 """LMS Color Alpha 25 26 Gets the alpha component of an LMS color with alpha. 27 28 Returns: 29 Graph: A graph node producing a Float. 30 """ 31 lmsa_parsed = input_parsers.parse_graph(self) 32 result = _internal.l_m_s_a_alpha_internal(lmsa_parsed) 33 from .float import Float 34 return Float(result)
LMS Color Alpha
Gets the alpha component of an LMS color with alpha.
Returns: Graph: A graph node producing a Float.
36 def l(self) -> float.Float: 37 """LMS Color L 38 39 Gets the L component of an LMS color with alpha. 40 41 Returns: 42 Graph: A graph node producing a Float. 43 """ 44 lmsa_parsed = input_parsers.parse_graph(self) 45 result = _internal.l_m_s_a_l_internal(lmsa_parsed) 46 from .float import Float 47 return Float(result)
LMS Color L
Gets the L component of an LMS color with alpha.
Returns: Graph: A graph node producing a Float.
49 def m(self) -> float.Float: 50 """LMS Color M 51 52 Gets the M component of an LMS color with alpha. 53 54 Returns: 55 Graph: A graph node producing a Float. 56 """ 57 lmsa_parsed = input_parsers.parse_graph(self) 58 result = _internal.l_m_s_a_m_internal(lmsa_parsed) 59 from .float import Float 60 return Float(result)
LMS Color M
Gets the M component of an LMS color with alpha.
Returns: Graph: A graph node producing a Float.
62 def s(self) -> float.Float: 63 """LMS Color S 64 65 Gets the S component of an LMS color with alpha. 66 67 Returns: 68 Graph: A graph node producing a Float. 69 """ 70 lmsa_parsed = input_parsers.parse_graph(self) 71 result = _internal.l_m_s_a_s_internal(lmsa_parsed) 72 from .float import Float 73 return Float(result)
LMS Color S
Gets the S component of an LMS color with alpha.
Returns: Graph: A graph node producing a Float.
11class Null(Object): 12 """An unconnected input""" 13 14 def execute(self, context): 15 return self._inner.execute(context)
An unconnected input
17class OkLabA(Object): 18 """An OkLab color with an alpha component.""" 19 20 def execute(self, context): 21 return self._inner.execute(context).as_ok_lab_a() 22 23 def a(self) -> float.Float: 24 """OkLab Color a 25 26 Gets the a component of an OkLab color with alpha. 27 28 Returns: 29 Graph: A graph node producing a Float. 30 """ 31 ok_lab_a_parsed = input_parsers.parse_graph(self) 32 result = _internal.ok_lab_a_a_internal(ok_lab_a_parsed) 33 from .float import Float 34 return Float(result) 35 36 def alpha(self) -> float.Float: 37 """OkLab Color Alpha 38 39 Gets the alpha component of an OkLab color with alpha. 40 41 Returns: 42 Graph: A graph node producing a Float. 43 """ 44 ok_lab_a_parsed = input_parsers.parse_graph(self) 45 result = _internal.ok_lab_a_alpha_internal(ok_lab_a_parsed) 46 from .float import Float 47 return Float(result) 48 49 def b(self) -> float.Float: 50 """OkLab Color b 51 52 Gets the b component of an OkLab color with alpha. 53 54 Returns: 55 Graph: A graph node producing a Float. 56 """ 57 ok_lab_a_parsed = input_parsers.parse_graph(self) 58 result = _internal.ok_lab_a_b_internal(ok_lab_a_parsed) 59 from .float import Float 60 return Float(result) 61 62 @staticmethod 63 def from_components(l, a, b, alpha) -> OkLabA: 64 """OkLab Color with Alpha from Components 65 66 Given the L, a, b and alpha creates the color 67 68 Args: 69 l: Graph of Float 70 a: Graph of Float 71 b: Graph of Float 72 alpha: Graph of Float 73 74 Returns: 75 Graph: A graph node producing a OkLabA. 76 """ 77 l_parsed = input_parsers.parse_float_graph(l) 78 a_parsed = input_parsers.parse_float_graph(a) 79 b_parsed = input_parsers.parse_float_graph(b) 80 alpha_parsed = input_parsers.parse_float_graph(alpha) 81 result = _internal.ok_lab_a_from_components_internal(l_parsed, a_parsed, b_parsed, alpha_parsed) 82 return OkLabA(result) 83 84 def l(self) -> float.Float: 85 """OkLab Color L 86 87 Gets the L component of an OkLab color with alpha. 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 ok_lab_a_parsed = input_parsers.parse_graph(self) 93 result = _internal.ok_lab_a_l_internal(ok_lab_a_parsed) 94 from .float import Float 95 return Float(result)
An OkLab color with an alpha component.
23 def a(self) -> float.Float: 24 """OkLab Color a 25 26 Gets the a component of an OkLab color with alpha. 27 28 Returns: 29 Graph: A graph node producing a Float. 30 """ 31 ok_lab_a_parsed = input_parsers.parse_graph(self) 32 result = _internal.ok_lab_a_a_internal(ok_lab_a_parsed) 33 from .float import Float 34 return Float(result)
OkLab Color a
Gets the a component of an OkLab color with alpha.
Returns: Graph: A graph node producing a Float.
36 def alpha(self) -> float.Float: 37 """OkLab Color Alpha 38 39 Gets the alpha component of an OkLab color with alpha. 40 41 Returns: 42 Graph: A graph node producing a Float. 43 """ 44 ok_lab_a_parsed = input_parsers.parse_graph(self) 45 result = _internal.ok_lab_a_alpha_internal(ok_lab_a_parsed) 46 from .float import Float 47 return Float(result)
OkLab Color Alpha
Gets the alpha component of an OkLab color with alpha.
Returns: Graph: A graph node producing a Float.
49 def b(self) -> float.Float: 50 """OkLab Color b 51 52 Gets the b component of an OkLab color with alpha. 53 54 Returns: 55 Graph: A graph node producing a Float. 56 """ 57 ok_lab_a_parsed = input_parsers.parse_graph(self) 58 result = _internal.ok_lab_a_b_internal(ok_lab_a_parsed) 59 from .float import Float 60 return Float(result)
OkLab Color b
Gets the b component of an OkLab color with alpha.
Returns: Graph: A graph node producing a Float.
62 @staticmethod 63 def from_components(l, a, b, alpha) -> OkLabA: 64 """OkLab Color with Alpha from Components 65 66 Given the L, a, b and alpha creates the color 67 68 Args: 69 l: Graph of Float 70 a: Graph of Float 71 b: Graph of Float 72 alpha: Graph of Float 73 74 Returns: 75 Graph: A graph node producing a OkLabA. 76 """ 77 l_parsed = input_parsers.parse_float_graph(l) 78 a_parsed = input_parsers.parse_float_graph(a) 79 b_parsed = input_parsers.parse_float_graph(b) 80 alpha_parsed = input_parsers.parse_float_graph(alpha) 81 result = _internal.ok_lab_a_from_components_internal(l_parsed, a_parsed, b_parsed, alpha_parsed) 82 return OkLabA(result)
OkLab Color with Alpha from Components
Given the L, a, b and alpha creates the color
Args: l: Graph of Float a: Graph of Float b: Graph of Float alpha: Graph of Float
Returns: Graph: A graph node producing a OkLabA.
84 def l(self) -> float.Float: 85 """OkLab Color L 86 87 Gets the L component of an OkLab color with alpha. 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 ok_lab_a_parsed = input_parsers.parse_graph(self) 93 result = _internal.ok_lab_a_l_internal(ok_lab_a_parsed) 94 from .float import Float 95 return Float(result)
OkLab Color L
Gets the L component of an OkLab color with alpha.
Returns: Graph: A graph node producing a Float.
12class OkLabColor(Object): 13 """A color in the OkLab color space, which is designed to be perceptually uniform. L represents lightness. Negative "a" for green. Positive "a" for red. Negative "b" for blue. Positive "b" for yellow.""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def from_components(l, a, b) -> OkLabColor: 20 """OkLab Color from Components 21 22 Given the L, a and b creates the color 23 24 Args: 25 l: Graph of Float 26 a: Graph of Float 27 b: Graph of Float 28 29 Returns: 30 Graph: A graph node producing a OkLabColor. 31 """ 32 l_parsed = input_parsers.parse_float_graph(l) 33 a_parsed = input_parsers.parse_float_graph(a) 34 b_parsed = input_parsers.parse_float_graph(b) 35 result = _internal.ok_lab_color_from_components_internal(l_parsed, a_parsed, b_parsed) 36 return OkLabColor(result)
A color in the OkLab color space, which is designed to be perceptually uniform. L represents lightness. Negative "a" for green. Positive "a" for red. Negative "b" for blue. Positive "b" for yellow.
18 @staticmethod 19 def from_components(l, a, b) -> OkLabColor: 20 """OkLab Color from Components 21 22 Given the L, a and b creates the color 23 24 Args: 25 l: Graph of Float 26 a: Graph of Float 27 b: Graph of Float 28 29 Returns: 30 Graph: A graph node producing a OkLabColor. 31 """ 32 l_parsed = input_parsers.parse_float_graph(l) 33 a_parsed = input_parsers.parse_float_graph(a) 34 b_parsed = input_parsers.parse_float_graph(b) 35 result = _internal.ok_lab_color_from_components_internal(l_parsed, a_parsed, b_parsed) 36 return OkLabColor(result)
OkLab Color from Components
Given the L, a and b creates the color
Args: l: Graph of Float a: Graph of Float b: Graph of Float
Returns: Graph: A graph node producing a OkLabColor.
17class OkLabHist(Object): 18 """A histogram in various dimensions over the OkLab color space.""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 def lightness_percentile(self, quantile) -> float.Float: 24 """OkLab Histogram Lightness Quantile 25 26 Given an OkLab histogram and a quantile, returns the lightness value that corresponds to the quantile. 27 28 Args: 29 quantile: Graph of Float 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 hist_parsed = input_parsers.parse_graph(self) 35 quantile_parsed = input_parsers.parse_float_graph(quantile) 36 result = _internal.ok_lab_hist_lightness_quantile_internal(hist_parsed, quantile_parsed) 37 from .float import Float 38 return Float(result)
A histogram in various dimensions over the OkLab color space.
23 def lightness_percentile(self, quantile) -> float.Float: 24 """OkLab Histogram Lightness Quantile 25 26 Given an OkLab histogram and a quantile, returns the lightness value that corresponds to the quantile. 27 28 Args: 29 quantile: Graph of Float 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 hist_parsed = input_parsers.parse_graph(self) 35 quantile_parsed = input_parsers.parse_float_graph(quantile) 36 result = _internal.ok_lab_hist_lightness_quantile_internal(hist_parsed, quantile_parsed) 37 from .float import Float 38 return Float(result)
OkLab Histogram Lightness Quantile
Given an OkLab histogram and a quantile, returns the lightness value that corresponds to the quantile.
Args: quantile: Graph of Float
Returns: Graph: A graph node producing a Float.
12class Painter(Object): 13 """Can draw in 2D. Using paths, brushes, fills and transforms to create your artwork.""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 def add_ellipse_with_render_style(self, center, dimensions, rotation, render_style, instances) -> Painter: 19 """Painter Add Ellipse with Render Style 20 21 Adds an ellipse to the painter and draws it with the render style. Set some transforms on the ellipse as well. 22 23 Args: 24 center: Graph of Point2f 25 dimensions: Graph of Vector2f 26 rotation: Graph of Float 27 render_style: Graph of RenderStyle 28 instances: Graph of Transform2List 29 30 Returns: 31 Graph: A graph node producing a Painter. 32 """ 33 painter_parsed = input_parsers.parse_graph(self) 34 center_parsed = input_parsers.parse_graph(center) 35 dimensions_parsed = input_parsers.parse_graph(dimensions) 36 rotation_parsed = input_parsers.parse_float_graph(rotation) 37 render_style_parsed = input_parsers.parse_graph(render_style) 38 instances_parsed = input_parsers.parse_graph(instances) 39 result = _internal.painter_add_ellipse_with_render_style_internal(painter_parsed, center_parsed, dimensions_parsed, rotation_parsed, render_style_parsed, instances_parsed) 40 return Painter(result) 41 42 def add_path_with_render_style(self, path, render_style, instances) -> Painter: 43 """Painter Add Path with Render Style 44 45 Adds a path to the painter and draws it with the render style. Set some transforms on the path as well. 46 47 Args: 48 path: Graph of Path 49 render_style: Graph of RenderStyle 50 instances: Graph of Transform2List 51 52 Returns: 53 Graph: A graph node producing a Painter. 54 """ 55 painter_parsed = input_parsers.parse_graph(self) 56 path_parsed = input_parsers.parse_graph(path) 57 render_style_parsed = input_parsers.parse_graph(render_style) 58 instances_parsed = input_parsers.parse_graph(instances) 59 result = _internal.painter_add_path_with_render_style_internal(painter_parsed, path_parsed, render_style_parsed, instances_parsed) 60 return Painter(result) 61 62 def add_rectangle_with_render_style(self, center, dimensions, rotation, render_style, instances) -> Painter: 63 """Painter Add Rectangle with Render Style 64 65 Adds a rectangle to the painter and draws it with the render style. Set some transforms on the rectangle as well. 66 67 Args: 68 center: Graph of Point2f 69 dimensions: Graph of Vector2f 70 rotation: Graph of Float 71 render_style: Graph of RenderStyle 72 instances: Graph of Transform2List 73 74 Returns: 75 Graph: A graph node producing a Painter. 76 """ 77 painter_parsed = input_parsers.parse_graph(self) 78 center_parsed = input_parsers.parse_graph(center) 79 dimensions_parsed = input_parsers.parse_graph(dimensions) 80 rotation_parsed = input_parsers.parse_float_graph(rotation) 81 render_style_parsed = input_parsers.parse_graph(render_style) 82 instances_parsed = input_parsers.parse_graph(instances) 83 result = _internal.painter_add_rectangle_with_render_style_internal(painter_parsed, center_parsed, dimensions_parsed, rotation_parsed, render_style_parsed, instances_parsed) 84 return Painter(result) 85 86 @staticmethod 87 def new() -> Painter: 88 """Painter New 89 90 Creates a new painter. 91 92 Returns: 93 Graph: A graph node producing a Painter. 94 """ 95 result = _internal.painter_new_internal() 96 return Painter(result)
Can draw in 2D. Using paths, brushes, fills and transforms to create your artwork.
18 def add_ellipse_with_render_style(self, center, dimensions, rotation, render_style, instances) -> Painter: 19 """Painter Add Ellipse with Render Style 20 21 Adds an ellipse to the painter and draws it with the render style. Set some transforms on the ellipse as well. 22 23 Args: 24 center: Graph of Point2f 25 dimensions: Graph of Vector2f 26 rotation: Graph of Float 27 render_style: Graph of RenderStyle 28 instances: Graph of Transform2List 29 30 Returns: 31 Graph: A graph node producing a Painter. 32 """ 33 painter_parsed = input_parsers.parse_graph(self) 34 center_parsed = input_parsers.parse_graph(center) 35 dimensions_parsed = input_parsers.parse_graph(dimensions) 36 rotation_parsed = input_parsers.parse_float_graph(rotation) 37 render_style_parsed = input_parsers.parse_graph(render_style) 38 instances_parsed = input_parsers.parse_graph(instances) 39 result = _internal.painter_add_ellipse_with_render_style_internal(painter_parsed, center_parsed, dimensions_parsed, rotation_parsed, render_style_parsed, instances_parsed) 40 return Painter(result)
Painter Add Ellipse with Render Style
Adds an ellipse to the painter and draws it with the render style. Set some transforms on the ellipse as well.
Args: center: Graph of Point2f dimensions: Graph of Vector2f rotation: Graph of Float render_style: Graph of RenderStyle instances: Graph of Transform2List
Returns: Graph: A graph node producing a Painter.
42 def add_path_with_render_style(self, path, render_style, instances) -> Painter: 43 """Painter Add Path with Render Style 44 45 Adds a path to the painter and draws it with the render style. Set some transforms on the path as well. 46 47 Args: 48 path: Graph of Path 49 render_style: Graph of RenderStyle 50 instances: Graph of Transform2List 51 52 Returns: 53 Graph: A graph node producing a Painter. 54 """ 55 painter_parsed = input_parsers.parse_graph(self) 56 path_parsed = input_parsers.parse_graph(path) 57 render_style_parsed = input_parsers.parse_graph(render_style) 58 instances_parsed = input_parsers.parse_graph(instances) 59 result = _internal.painter_add_path_with_render_style_internal(painter_parsed, path_parsed, render_style_parsed, instances_parsed) 60 return Painter(result)
Painter Add Path with Render Style
Adds a path to the painter and draws it with the render style. Set some transforms on the path as well.
Args: path: Graph of Path render_style: Graph of RenderStyle instances: Graph of Transform2List
Returns: Graph: A graph node producing a Painter.
62 def add_rectangle_with_render_style(self, center, dimensions, rotation, render_style, instances) -> Painter: 63 """Painter Add Rectangle with Render Style 64 65 Adds a rectangle to the painter and draws it with the render style. Set some transforms on the rectangle as well. 66 67 Args: 68 center: Graph of Point2f 69 dimensions: Graph of Vector2f 70 rotation: Graph of Float 71 render_style: Graph of RenderStyle 72 instances: Graph of Transform2List 73 74 Returns: 75 Graph: A graph node producing a Painter. 76 """ 77 painter_parsed = input_parsers.parse_graph(self) 78 center_parsed = input_parsers.parse_graph(center) 79 dimensions_parsed = input_parsers.parse_graph(dimensions) 80 rotation_parsed = input_parsers.parse_float_graph(rotation) 81 render_style_parsed = input_parsers.parse_graph(render_style) 82 instances_parsed = input_parsers.parse_graph(instances) 83 result = _internal.painter_add_rectangle_with_render_style_internal(painter_parsed, center_parsed, dimensions_parsed, rotation_parsed, render_style_parsed, instances_parsed) 84 return Painter(result)
Painter Add Rectangle with Render Style
Adds a rectangle to the painter and draws it with the render style. Set some transforms on the rectangle as well.
Args: center: Graph of Point2f dimensions: Graph of Vector2f rotation: Graph of Float render_style: Graph of RenderStyle instances: Graph of Transform2List
Returns: Graph: A graph node producing a Painter.
86 @staticmethod 87 def new() -> Painter: 88 """Painter New 89 90 Creates a new painter. 91 92 Returns: 93 Graph: A graph node producing a Painter. 94 """ 95 result = _internal.painter_new_internal() 96 return Painter(result)
Painter New
Creates a new painter.
Returns: Graph: A graph node producing a Painter.
12class Path(Object): 13 """A 2D path that can be used to be rendered.""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 def cardinal_cubic_to_point(self, point, tension) -> Path: 19 """Path Cardinal Cubic to Point 20 21 Moves the path from it's current point to another with a Cardinal Cubic spline. 22 23 Args: 24 point: Graph of Point2f 25 tension: Graph of Float 26 27 Returns: 28 Graph: A graph node producing a Path. 29 """ 30 path_parsed = input_parsers.parse_graph(self) 31 point_parsed = input_parsers.parse_graph(point) 32 tension_parsed = input_parsers.parse_float_graph(tension) 33 result = _internal.path_cardinal_cubic_to_point_internal(path_parsed, point_parsed, tension_parsed) 34 return Path(result) 35 36 def catmull_rom_to_point(self, point) -> Path: 37 """Path Catmull-Rom to Point 38 39 Moves the path from it's current point to another with a Catmull-Rom spline. 40 41 Args: 42 point: Graph of Point2f 43 44 Returns: 45 Graph: A graph node producing a Path. 46 """ 47 path_parsed = input_parsers.parse_graph(self) 48 point_parsed = input_parsers.parse_graph(point) 49 result = _internal.path_catmull_rom_to_point_internal(path_parsed, point_parsed) 50 return Path(result) 51 52 def drawing_move(self, point, time, pressure, azimuth_angle, altitude_angle, tension) -> Path: 53 """Path Drawing Move 54 55 Represents a move in a freehand drawing. 56 57 Args: 58 point: Graph of Point2f 59 time: Graph of Float 60 pressure: Graph of Float 61 azimuth_angle: Graph of Float 62 altitude_angle: Graph of Float 63 tension: Graph of Float 64 65 Returns: 66 Graph: A graph node producing a Path. 67 """ 68 path_parsed = input_parsers.parse_graph(self) 69 point_parsed = input_parsers.parse_graph(point) 70 time_parsed = input_parsers.parse_float_graph(time) 71 pressure_parsed = input_parsers.parse_float_graph(pressure) 72 azimuth_angle_parsed = input_parsers.parse_float_graph(azimuth_angle) 73 altitude_angle_parsed = input_parsers.parse_float_graph(altitude_angle) 74 tension_parsed = input_parsers.parse_float_graph(tension) 75 result = _internal.path_drawing_move_internal(path_parsed, point_parsed, time_parsed, pressure_parsed, azimuth_angle_parsed, altitude_angle_parsed, tension_parsed) 76 return Path(result) 77 78 def drawing_start(self, time, point, pressure, azimuth_angle, altitude_angle) -> Path: 79 """Path Drawing Start 80 81 Represents the start of a freehand drawing. 82 83 Args: 84 time: Graph of Float 85 point: Graph of Point2f 86 pressure: Graph of Float 87 azimuth_angle: Graph of Float 88 altitude_angle: Graph of Float 89 90 Returns: 91 Graph: A graph node producing a Path. 92 """ 93 path_parsed = input_parsers.parse_graph(self) 94 time_parsed = input_parsers.parse_float_graph(time) 95 point_parsed = input_parsers.parse_graph(point) 96 pressure_parsed = input_parsers.parse_float_graph(pressure) 97 azimuth_angle_parsed = input_parsers.parse_float_graph(azimuth_angle) 98 altitude_angle_parsed = input_parsers.parse_float_graph(altitude_angle) 99 result = _internal.path_drawing_start_internal(path_parsed, time_parsed, point_parsed, pressure_parsed, azimuth_angle_parsed, altitude_angle_parsed) 100 return Path(result) 101 102 def line_to_point(self, point) -> Path: 103 """Path Line to Point 104 105 Moves the path from it's current point to another at another point with a line. 106 107 Args: 108 point: Graph of Point2f 109 110 Returns: 111 Graph: A graph node producing a Path. 112 """ 113 path_parsed = input_parsers.parse_graph(self) 114 point_parsed = input_parsers.parse_graph(point) 115 result = _internal.path_line_to_point_internal(path_parsed, point_parsed) 116 return Path(result) 117 118 def move_to_point(self, point) -> Path: 119 """Path Move to Point 120 121 Moves the path to a specified point without drawing anything. 122 123 Args: 124 point: Graph of Point2f 125 126 Returns: 127 Graph: A graph node producing a Path. 128 """ 129 path_parsed = input_parsers.parse_graph(self) 130 point_parsed = input_parsers.parse_graph(point) 131 result = _internal.path_move_to_point_internal(path_parsed, point_parsed) 132 return Path(result) 133 134 @staticmethod 135 def new() -> Path: 136 """Path New 137 138 Creates a new empty path. 139 140 Returns: 141 Graph: A graph node producing a Path. 142 """ 143 result = _internal.path_new_internal() 144 return Path(result)
A 2D path that can be used to be rendered.
18 def cardinal_cubic_to_point(self, point, tension) -> Path: 19 """Path Cardinal Cubic to Point 20 21 Moves the path from it's current point to another with a Cardinal Cubic spline. 22 23 Args: 24 point: Graph of Point2f 25 tension: Graph of Float 26 27 Returns: 28 Graph: A graph node producing a Path. 29 """ 30 path_parsed = input_parsers.parse_graph(self) 31 point_parsed = input_parsers.parse_graph(point) 32 tension_parsed = input_parsers.parse_float_graph(tension) 33 result = _internal.path_cardinal_cubic_to_point_internal(path_parsed, point_parsed, tension_parsed) 34 return Path(result)
Path Cardinal Cubic to Point
Moves the path from it's current point to another with a Cardinal Cubic spline.
Args: point: Graph of Point2f tension: Graph of Float
Returns: Graph: A graph node producing a Path.
36 def catmull_rom_to_point(self, point) -> Path: 37 """Path Catmull-Rom to Point 38 39 Moves the path from it's current point to another with a Catmull-Rom spline. 40 41 Args: 42 point: Graph of Point2f 43 44 Returns: 45 Graph: A graph node producing a Path. 46 """ 47 path_parsed = input_parsers.parse_graph(self) 48 point_parsed = input_parsers.parse_graph(point) 49 result = _internal.path_catmull_rom_to_point_internal(path_parsed, point_parsed) 50 return Path(result)
Path Catmull-Rom to Point
Moves the path from it's current point to another with a Catmull-Rom spline.
Args: point: Graph of Point2f
Returns: Graph: A graph node producing a Path.
52 def drawing_move(self, point, time, pressure, azimuth_angle, altitude_angle, tension) -> Path: 53 """Path Drawing Move 54 55 Represents a move in a freehand drawing. 56 57 Args: 58 point: Graph of Point2f 59 time: Graph of Float 60 pressure: Graph of Float 61 azimuth_angle: Graph of Float 62 altitude_angle: Graph of Float 63 tension: Graph of Float 64 65 Returns: 66 Graph: A graph node producing a Path. 67 """ 68 path_parsed = input_parsers.parse_graph(self) 69 point_parsed = input_parsers.parse_graph(point) 70 time_parsed = input_parsers.parse_float_graph(time) 71 pressure_parsed = input_parsers.parse_float_graph(pressure) 72 azimuth_angle_parsed = input_parsers.parse_float_graph(azimuth_angle) 73 altitude_angle_parsed = input_parsers.parse_float_graph(altitude_angle) 74 tension_parsed = input_parsers.parse_float_graph(tension) 75 result = _internal.path_drawing_move_internal(path_parsed, point_parsed, time_parsed, pressure_parsed, azimuth_angle_parsed, altitude_angle_parsed, tension_parsed) 76 return Path(result)
Path Drawing Move
Represents a move in a freehand drawing.
Args: point: Graph of Point2f time: Graph of Float pressure: Graph of Float azimuth_angle: Graph of Float altitude_angle: Graph of Float tension: Graph of Float
Returns: Graph: A graph node producing a Path.
78 def drawing_start(self, time, point, pressure, azimuth_angle, altitude_angle) -> Path: 79 """Path Drawing Start 80 81 Represents the start of a freehand drawing. 82 83 Args: 84 time: Graph of Float 85 point: Graph of Point2f 86 pressure: Graph of Float 87 azimuth_angle: Graph of Float 88 altitude_angle: Graph of Float 89 90 Returns: 91 Graph: A graph node producing a Path. 92 """ 93 path_parsed = input_parsers.parse_graph(self) 94 time_parsed = input_parsers.parse_float_graph(time) 95 point_parsed = input_parsers.parse_graph(point) 96 pressure_parsed = input_parsers.parse_float_graph(pressure) 97 azimuth_angle_parsed = input_parsers.parse_float_graph(azimuth_angle) 98 altitude_angle_parsed = input_parsers.parse_float_graph(altitude_angle) 99 result = _internal.path_drawing_start_internal(path_parsed, time_parsed, point_parsed, pressure_parsed, azimuth_angle_parsed, altitude_angle_parsed) 100 return Path(result)
Path Drawing Start
Represents the start of a freehand drawing.
Args: time: Graph of Float point: Graph of Point2f pressure: Graph of Float azimuth_angle: Graph of Float altitude_angle: Graph of Float
Returns: Graph: A graph node producing a Path.
102 def line_to_point(self, point) -> Path: 103 """Path Line to Point 104 105 Moves the path from it's current point to another at another point with a line. 106 107 Args: 108 point: Graph of Point2f 109 110 Returns: 111 Graph: A graph node producing a Path. 112 """ 113 path_parsed = input_parsers.parse_graph(self) 114 point_parsed = input_parsers.parse_graph(point) 115 result = _internal.path_line_to_point_internal(path_parsed, point_parsed) 116 return Path(result)
Path Line to Point
Moves the path from it's current point to another at another point with a line.
Args: point: Graph of Point2f
Returns: Graph: A graph node producing a Path.
118 def move_to_point(self, point) -> Path: 119 """Path Move to Point 120 121 Moves the path to a specified point without drawing anything. 122 123 Args: 124 point: Graph of Point2f 125 126 Returns: 127 Graph: A graph node producing a Path. 128 """ 129 path_parsed = input_parsers.parse_graph(self) 130 point_parsed = input_parsers.parse_graph(point) 131 result = _internal.path_move_to_point_internal(path_parsed, point_parsed) 132 return Path(result)
Path Move to Point
Moves the path to a specified point without drawing anything.
Args: point: Graph of Point2f
Returns: Graph: A graph node producing a Path.
134 @staticmethod 135 def new() -> Path: 136 """Path New 137 138 Creates a new empty path. 139 140 Returns: 141 Graph: A graph node producing a Path. 142 """ 143 result = _internal.path_new_internal() 144 return Path(result)
Path New
Creates a new empty path.
Returns: Graph: A graph node producing a Path.
12class PixelEncoding(Object): 13 """How pixel values are encoded (gamma/other encoded, linear straight alpha, or linear premultiplied alpha).""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def encoded() -> PixelEncoding: 20 """Pixel Encoding Encoded 21 22 Creates a Pixel Encoding representing gamma or other non-linear encoded values. 23 24 Returns: 25 Graph: A graph node producing a PixelEncoding. 26 """ 27 result = _internal.pixel_encoding_encoded_internal() 28 return PixelEncoding(result) 29 30 @staticmethod 31 def linear() -> PixelEncoding: 32 """Pixel Encoding Linear 33 34 Creates a Pixel Encoding representing linear light, straight alpha values. 35 36 Returns: 37 Graph: A graph node producing a PixelEncoding. 38 """ 39 result = _internal.pixel_encoding_linear_internal() 40 return PixelEncoding(result) 41 42 @staticmethod 43 def premultiplied_alpha() -> PixelEncoding: 44 """Pixel Encoding Premultiplied Alpha 45 46 Creates a Pixel Encoding representing linear light, premultiplied alpha values. 47 48 Returns: 49 Graph: A graph node producing a PixelEncoding. 50 """ 51 result = _internal.pixel_encoding_premultiplied_alpha_internal() 52 return PixelEncoding(result)
How pixel values are encoded (gamma/other encoded, linear straight alpha, or linear premultiplied alpha).
18 @staticmethod 19 def encoded() -> PixelEncoding: 20 """Pixel Encoding Encoded 21 22 Creates a Pixel Encoding representing gamma or other non-linear encoded values. 23 24 Returns: 25 Graph: A graph node producing a PixelEncoding. 26 """ 27 result = _internal.pixel_encoding_encoded_internal() 28 return PixelEncoding(result)
Pixel Encoding Encoded
Creates a Pixel Encoding representing gamma or other non-linear encoded values.
Returns: Graph: A graph node producing a PixelEncoding.
30 @staticmethod 31 def linear() -> PixelEncoding: 32 """Pixel Encoding Linear 33 34 Creates a Pixel Encoding representing linear light, straight alpha values. 35 36 Returns: 37 Graph: A graph node producing a PixelEncoding. 38 """ 39 result = _internal.pixel_encoding_linear_internal() 40 return PixelEncoding(result)
Pixel Encoding Linear
Creates a Pixel Encoding representing linear light, straight alpha values.
Returns: Graph: A graph node producing a PixelEncoding.
42 @staticmethod 43 def premultiplied_alpha() -> PixelEncoding: 44 """Pixel Encoding Premultiplied Alpha 45 46 Creates a Pixel Encoding representing linear light, premultiplied alpha values. 47 48 Returns: 49 Graph: A graph node producing a PixelEncoding. 50 """ 51 result = _internal.pixel_encoding_premultiplied_alpha_internal() 52 return PixelEncoding(result)
Pixel Encoding Premultiplied Alpha
Creates a Pixel Encoding representing linear light, premultiplied alpha values.
Returns: Graph: A graph node producing a PixelEncoding.
17class Point2f(Object): 18 """A point with an x and y as floats""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 def distance(self, rhs) -> float.Float: 24 """Point 2 Float Distance 25 26 The Euclidean distance between two Point 2 Floats. 27 28 Args: 29 rhs: Graph of Point2f 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.point2f_distance_internal(lhs_parsed, rhs_parsed) 37 from .float import Float 38 return Float(result) 39 40 @staticmethod 41 def from_components(x, y) -> Point2f: 42 """Point 2 Float from Components 43 44 Given an x and y creates a point 45 46 Args: 47 x: Graph of Float 48 y: Graph of Float 49 50 Returns: 51 Graph: A graph node producing a Point2f. 52 """ 53 x_parsed = input_parsers.parse_float_graph(x) 54 y_parsed = input_parsers.parse_float_graph(y) 55 result = _internal.point2f_from_components_internal(x_parsed, y_parsed) 56 return Point2f(result)
A point with an x and y as floats
23 def distance(self, rhs) -> float.Float: 24 """Point 2 Float Distance 25 26 The Euclidean distance between two Point 2 Floats. 27 28 Args: 29 rhs: Graph of Point2f 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.point2f_distance_internal(lhs_parsed, rhs_parsed) 37 from .float import Float 38 return Float(result)
Point 2 Float Distance
The Euclidean distance between two Point 2 Floats.
Args: rhs: Graph of Point2f
Returns: Graph: A graph node producing a Float.
40 @staticmethod 41 def from_components(x, y) -> Point2f: 42 """Point 2 Float from Components 43 44 Given an x and y creates a point 45 46 Args: 47 x: Graph of Float 48 y: Graph of Float 49 50 Returns: 51 Graph: A graph node producing a Point2f. 52 """ 53 x_parsed = input_parsers.parse_float_graph(x) 54 y_parsed = input_parsers.parse_float_graph(y) 55 result = _internal.point2f_from_components_internal(x_parsed, y_parsed) 56 return Point2f(result)
Point 2 Float from Components
Given an x and y creates a point
Args: x: Graph of Float y: Graph of Float
Returns: Graph: A graph node producing a Point2f.
11class Point2fList(List): 12 """List of Point 2 Floats""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .point2f import Point2f 16 super().__init__(inner, Point2f if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Point 2 Floats
17class Point2i(Object): 18 """A point with an x and y as ints""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 def distance(self, rhs) -> float.Float: 24 """Point 2 Int Distance 25 26 The Euclidean distance between two Point 2 Ints, returned as a Float. 27 28 Args: 29 rhs: Graph of Point2i 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.point2i_distance_internal(lhs_parsed, rhs_parsed) 37 from .float import Float 38 return Float(result) 39 40 @staticmethod 41 def from_components(x, y) -> Point2i: 42 """Point 2 Int from Components 43 44 Given an x and y creates a point 45 46 Args: 47 x: Graph of Int 48 y: Graph of Int 49 50 Returns: 51 Graph: A graph node producing a Point2i. 52 """ 53 x_parsed = input_parsers.parse_int_graph(x) 54 y_parsed = input_parsers.parse_int_graph(y) 55 result = _internal.point2i_from_components_internal(x_parsed, y_parsed) 56 return Point2i(result)
A point with an x and y as ints
23 def distance(self, rhs) -> float.Float: 24 """Point 2 Int Distance 25 26 The Euclidean distance between two Point 2 Ints, returned as a Float. 27 28 Args: 29 rhs: Graph of Point2i 30 31 Returns: 32 Graph: A graph node producing a Float. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.point2i_distance_internal(lhs_parsed, rhs_parsed) 37 from .float import Float 38 return Float(result)
Point 2 Int Distance
The Euclidean distance between two Point 2 Ints, returned as a Float.
Args: rhs: Graph of Point2i
Returns: Graph: A graph node producing a Float.
40 @staticmethod 41 def from_components(x, y) -> Point2i: 42 """Point 2 Int from Components 43 44 Given an x and y creates a point 45 46 Args: 47 x: Graph of Int 48 y: Graph of Int 49 50 Returns: 51 Graph: A graph node producing a Point2i. 52 """ 53 x_parsed = input_parsers.parse_int_graph(x) 54 y_parsed = input_parsers.parse_int_graph(y) 55 result = _internal.point2i_from_components_internal(x_parsed, y_parsed) 56 return Point2i(result)
Point 2 Int from Components
Given an x and y creates a point
Args: x: Graph of Int y: Graph of Int
Returns: Graph: A graph node producing a Point2i.
11class Point2iList(List): 12 """List of Point 2 Ints""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .point2i import Point2i 16 super().__init__(inner, Point2i if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Point 2 Ints
20class ProfiledColor(Object): 21 """A color with an associated color representation.""" 22 23 def execute(self, context): 24 return self._inner.execute(context) 25 26 @staticmethod 27 def blackbody(kelvin) -> ProfiledColor: 28 """Profiled Color Blackbody 29 30 Creates a profiled color that is the color of a blackbody emitter at a given kelvin. 31 32 Args: 33 kelvin: Graph of Float 34 35 Returns: 36 Graph: A graph node producing a ProfiledColor. 37 """ 38 kelvin_parsed = input_parsers.parse_float_graph(kelvin) 39 result = _internal.profiled_color_blackbody_internal(kelvin_parsed) 40 return ProfiledColor(result) 41 42 def brightness_adjust(self, offset) -> ProfiledColor: 43 """Profiled Color Brightness Adjust 44 45 Adjusts a profiled color's lightness in OkLab. 46 47 Args: 48 offset: Graph of Float 49 50 Returns: 51 Graph: A graph node producing a ProfiledColor. 52 """ 53 profiled_color_parsed = input_parsers.parse_graph(self) 54 offset_parsed = input_parsers.parse_float_graph(offset) 55 result = _internal.profiled_color_brightness_adjust_internal(profiled_color_parsed, offset_parsed) 56 return ProfiledColor(result) 57 58 def chroma_offset(self, offset) -> ProfiledColor: 59 """Profiled Color Chroma Offset 60 61 Applies an offset to the a and b chroma components of a profiled color in OkLab. 62 63 Args: 64 offset: Graph of Vector2f 65 66 Returns: 67 Graph: A graph node producing a ProfiledColor. 68 """ 69 profiled_color_parsed = input_parsers.parse_graph(self) 70 offset_parsed = input_parsers.parse_graph(offset) 71 result = _internal.profiled_color_chroma_offset_internal(profiled_color_parsed, offset_parsed) 72 return ProfiledColor(result) 73 74 def exposure_adjust(self, steps) -> ProfiledColor: 75 """Profiled Color Exposure Adjust 76 77 Updates a profiled color's exposure by multiplying linear RGB values by 2^steps. 78 79 Args: 80 steps: Graph of Float 81 82 Returns: 83 Graph: A graph node producing a ProfiledColor. 84 """ 85 profiled_color_parsed = input_parsers.parse_graph(self) 86 steps_parsed = input_parsers.parse_float_graph(steps) 87 result = _internal.profiled_color_exposure_adjust_internal(profiled_color_parsed, steps_parsed) 88 return ProfiledColor(result) 89 90 @staticmethod 91 def new_lmsa(lmsa) -> ProfiledColor: 92 """Profiled Color from LMS with Alpha 93 94 Creates a profiled color from LMS channels and alpha. 95 96 Args: 97 lmsa: Graph of LMSA 98 99 Returns: 100 Graph: A graph node producing a ProfiledColor. 101 """ 102 lmsa_parsed = input_parsers.parse_graph(lmsa) 103 result = _internal.profiled_color_from_l_m_s_a_internal(lmsa_parsed) 104 return ProfiledColor(result) 105 106 @staticmethod 107 def from_ok_lab_a(ok_lab_a) -> ProfiledColor: 108 """Profiled Color from OkLab with Alpha 109 110 Creates a profiled color from OkLab channels and alpha. 111 112 Args: 113 ok_lab_a: Graph of OkLabA 114 115 Returns: 116 Graph: A graph node producing a ProfiledColor. 117 """ 118 ok_lab_a_parsed = input_parsers.parse_graph(ok_lab_a) 119 result = _internal.profiled_color_from_ok_lab_a_internal(ok_lab_a_parsed) 120 return ProfiledColor(result) 121 122 @staticmethod 123 def from_rgba_aces_cg(rgba) -> ProfiledColor: 124 """Profiled Color from RGBA ACEScg 125 126 Creates a profiled color from linear ACEScg RGBA channels. 127 128 Args: 129 rgba: Graph of RGBAColor 130 131 Returns: 132 Graph: A graph node producing a ProfiledColor. 133 """ 134 rgba_parsed = input_parsers.parse_graph(rgba) 135 result = _internal.profiled_color_from_rgba_aces_cg_internal(rgba_parsed) 136 return ProfiledColor(result) 137 138 @staticmethod 139 def from_rgba_p3(rgba) -> ProfiledColor: 140 """Profiled Color from RGBA P3 141 142 Creates a profiled color from encoded Display P3 RGBA channels. 143 144 Args: 145 rgba: Graph of RGBAColor 146 147 Returns: 148 Graph: A graph node producing a ProfiledColor. 149 """ 150 rgba_parsed = input_parsers.parse_graph(rgba) 151 result = _internal.profiled_color_from_rgba_p3_internal(rgba_parsed) 152 return ProfiledColor(result) 153 154 @staticmethod 155 def from_rgba_srgb(rgba) -> ProfiledColor: 156 """Profiled Color from RGBA sRGB 157 158 Creates a profiled color from encoded sRGB RGBA channels. 159 160 Args: 161 rgba: Graph of RGBAColor 162 163 Returns: 164 Graph: A graph node producing a ProfiledColor. 165 """ 166 rgba_parsed = input_parsers.parse_graph(rgba) 167 result = _internal.profiled_color_from_rgba_srgb_internal(rgba_parsed) 168 return ProfiledColor(result) 169 170 @staticmethod 171 def from_rgba_srgb_linear(rgba) -> ProfiledColor: 172 """Profiled Color from RGBA linear sRGB 173 174 Creates a profiled color from linear sRGB RGBA channels. 175 176 Args: 177 rgba: Graph of RGBAColor 178 179 Returns: 180 Graph: A graph node producing a ProfiledColor. 181 """ 182 rgba_parsed = input_parsers.parse_graph(rgba) 183 result = _internal.profiled_color_from_rgba_srgb_linear_internal(rgba_parsed) 184 return ProfiledColor(result) 185 186 @staticmethod 187 def from_srgb_hex(hex) -> ProfiledColor: 188 """Profiled Color from sRGB Hex 189 190 Creates a profiled color from an encoded sRGB hex string (#RGB, #RGBA, #RRGGBB, or #RRGGBBAA). 191 192 Args: 193 hex: Graph of String 194 195 Returns: 196 Graph: A graph node producing a ProfiledColor. 197 """ 198 hex_parsed = input_parsers.parse_string_graph(hex) 199 result = _internal.profiled_color_from_srgb_hex_internal(hex_parsed) 200 return ProfiledColor(result) 201 202 @staticmethod 203 def from_wavelength_nm(wavelength_nm) -> ProfiledColor: 204 """Profiled Color From Wavelength (nm) 205 206 Creates a profiled color from a monochromatic wavelength in nanometres. 207 208 Args: 209 wavelength_nm: Graph of Float 210 211 Returns: 212 Graph: A graph node producing a ProfiledColor. 213 """ 214 wavelength_nm_parsed = input_parsers.parse_float_graph(wavelength_nm) 215 result = _internal.profiled_color_from_wavelength_nm_internal(wavelength_nm_parsed) 216 return ProfiledColor(result) 217 218 @staticmethod 219 def from_xyz_a(xyza) -> ProfiledColor: 220 """Profiled Color from XYZ with Alpha 221 222 Creates a profiled color from XYZ channels and alpha. 223 224 Args: 225 xyza: Graph of XYZA 226 227 Returns: 228 Graph: A graph node producing a ProfiledColor. 229 """ 230 xyza_parsed = input_parsers.parse_graph(xyza) 231 result = _internal.profiled_color_from_xyz_a_internal(xyza_parsed) 232 return ProfiledColor(result) 233 234 def grayscale(self) -> ProfiledColor: 235 """Profiled Color Grayscale 236 237 Removes chroma from a profiled color. 238 239 Returns: 240 Graph: A graph node producing a ProfiledColor. 241 """ 242 profiled_color_parsed = input_parsers.parse_graph(self) 243 result = _internal.profiled_color_grayscale_internal(profiled_color_parsed) 244 return ProfiledColor(result) 245 246 def lightness_curve(self, l_curve) -> ProfiledColor: 247 """Profiled Color Lightness Curve 248 249 Applies a curve to the L component of a profiled color in OkLab. 250 251 Args: 252 l_curve: Graph of Curve 253 254 Returns: 255 Graph: A graph node producing a ProfiledColor. 256 """ 257 profiled_color_parsed = input_parsers.parse_graph(self) 258 l_curve_parsed = input_parsers.parse_graph(l_curve) 259 result = _internal.profiled_color_lightness_curve_internal(profiled_color_parsed, l_curve_parsed) 260 return ProfiledColor(result) 261 262 def saturation_adjust(self, scale) -> ProfiledColor: 263 """Profiled Color Saturation Adjust 264 265 Scales the chroma components of a profiled color in OkLab. 266 267 Args: 268 scale: Graph of Float 269 270 Returns: 271 Graph: A graph node producing a ProfiledColor. 272 """ 273 profiled_color_parsed = input_parsers.parse_graph(self) 274 scale_parsed = input_parsers.parse_float_graph(scale) 275 result = _internal.profiled_color_saturation_adjust_internal(profiled_color_parsed, scale_parsed) 276 return ProfiledColor(result) 277 278 def target_white(self, target_white) -> ProfiledColor: 279 """Profiled Color Target White 280 281 Adapts a profiled color to the specified XYZ white point. 282 283 Args: 284 target_white: Graph of XYZ 285 286 Returns: 287 Graph: A graph node producing a ProfiledColor. 288 """ 289 profiled_color_parsed = input_parsers.parse_graph(self) 290 target_white_parsed = input_parsers.parse_graph(target_white) 291 result = _internal.profiled_color_target_white_internal(profiled_color_parsed, target_white_parsed) 292 return ProfiledColor(result) 293 294 def to_lmsa(self) -> l_m_s_a.LMSA: 295 """Profiled Color to LMS with Alpha 296 297 Converts a profiled color to LMS channels with alpha. 298 299 Returns: 300 Graph: A graph node producing a LMSA. 301 """ 302 profiled_color_parsed = input_parsers.parse_graph(self) 303 result = _internal.profiled_color_to_l_m_s_a_internal(profiled_color_parsed) 304 from .l_m_s_a import LMSA 305 return LMSA(result) 306 307 def to_ok_lab_a(self) -> ok_lab_a.OkLabA: 308 """Profiled Color to OkLab with Alpha 309 310 Converts a profiled color to OkLab channels with alpha. 311 312 Returns: 313 Graph: A graph node producing a OkLabA. 314 """ 315 profiled_color_parsed = input_parsers.parse_graph(self) 316 result = _internal.profiled_color_to_ok_lab_a_internal(profiled_color_parsed) 317 from .ok_lab_a import OkLabA 318 return OkLabA(result) 319 320 def to_rgb_encoded_with_color_profile(self, color_profile) -> r_g_b_a_color.RGBAColor: 321 """Profiled Color to Encoded RGB with Color Profile 322 323 Converts a profiled color to encoded RGB channels using the specified RGB color profile. 324 325 Args: 326 color_profile: Graph of ColorProfile 327 328 Returns: 329 Graph: A graph node producing a RGBAColor. 330 """ 331 profiled_color_parsed = input_parsers.parse_graph(self) 332 color_profile_parsed = input_parsers.parse_graph(color_profile) 333 result = _internal.profiled_color_to_rgb_encoded_with_color_profile_internal(profiled_color_parsed, color_profile_parsed) 334 from .r_g_b_a_color import RGBAColor 335 return RGBAColor(result) 336 337 def to_rgb_linear_with_color_profile(self, color_profile) -> r_g_b_a_color.RGBAColor: 338 """Profiled Color to Linear RGB with Color Profile 339 340 Converts a profiled color to linear RGB channels using the specified RGB color profile. 341 342 Args: 343 color_profile: Graph of ColorProfile 344 345 Returns: 346 Graph: A graph node producing a RGBAColor. 347 """ 348 profiled_color_parsed = input_parsers.parse_graph(self) 349 color_profile_parsed = input_parsers.parse_graph(color_profile) 350 result = _internal.profiled_color_to_rgb_linear_with_color_profile_internal(profiled_color_parsed, color_profile_parsed) 351 from .r_g_b_a_color import RGBAColor 352 return RGBAColor(result) 353 354 def to_xyz_a(self) -> x_y_z_a.XYZA: 355 """Profiled Color to XYZ with Alpha 356 357 Converts a profiled color to XYZ channels with alpha. 358 359 Returns: 360 Graph: A graph node producing a XYZA. 361 """ 362 profiled_color_parsed = input_parsers.parse_graph(self) 363 result = _internal.profiled_color_to_xyz_a_internal(profiled_color_parsed) 364 from .x_y_z_a import XYZA 365 return XYZA(result)
A color with an associated color representation.
26 @staticmethod 27 def blackbody(kelvin) -> ProfiledColor: 28 """Profiled Color Blackbody 29 30 Creates a profiled color that is the color of a blackbody emitter at a given kelvin. 31 32 Args: 33 kelvin: Graph of Float 34 35 Returns: 36 Graph: A graph node producing a ProfiledColor. 37 """ 38 kelvin_parsed = input_parsers.parse_float_graph(kelvin) 39 result = _internal.profiled_color_blackbody_internal(kelvin_parsed) 40 return ProfiledColor(result)
Profiled Color Blackbody
Creates a profiled color that is the color of a blackbody emitter at a given kelvin.
Args: kelvin: Graph of Float
Returns: Graph: A graph node producing a ProfiledColor.
42 def brightness_adjust(self, offset) -> ProfiledColor: 43 """Profiled Color Brightness Adjust 44 45 Adjusts a profiled color's lightness in OkLab. 46 47 Args: 48 offset: Graph of Float 49 50 Returns: 51 Graph: A graph node producing a ProfiledColor. 52 """ 53 profiled_color_parsed = input_parsers.parse_graph(self) 54 offset_parsed = input_parsers.parse_float_graph(offset) 55 result = _internal.profiled_color_brightness_adjust_internal(profiled_color_parsed, offset_parsed) 56 return ProfiledColor(result)
Profiled Color Brightness Adjust
Adjusts a profiled color's lightness in OkLab.
Args: offset: Graph of Float
Returns: Graph: A graph node producing a ProfiledColor.
58 def chroma_offset(self, offset) -> ProfiledColor: 59 """Profiled Color Chroma Offset 60 61 Applies an offset to the a and b chroma components of a profiled color in OkLab. 62 63 Args: 64 offset: Graph of Vector2f 65 66 Returns: 67 Graph: A graph node producing a ProfiledColor. 68 """ 69 profiled_color_parsed = input_parsers.parse_graph(self) 70 offset_parsed = input_parsers.parse_graph(offset) 71 result = _internal.profiled_color_chroma_offset_internal(profiled_color_parsed, offset_parsed) 72 return ProfiledColor(result)
Profiled Color Chroma Offset
Applies an offset to the a and b chroma components of a profiled color in OkLab.
Args: offset: Graph of Vector2f
Returns: Graph: A graph node producing a ProfiledColor.
74 def exposure_adjust(self, steps) -> ProfiledColor: 75 """Profiled Color Exposure Adjust 76 77 Updates a profiled color's exposure by multiplying linear RGB values by 2^steps. 78 79 Args: 80 steps: Graph of Float 81 82 Returns: 83 Graph: A graph node producing a ProfiledColor. 84 """ 85 profiled_color_parsed = input_parsers.parse_graph(self) 86 steps_parsed = input_parsers.parse_float_graph(steps) 87 result = _internal.profiled_color_exposure_adjust_internal(profiled_color_parsed, steps_parsed) 88 return ProfiledColor(result)
Profiled Color Exposure Adjust
Updates a profiled color's exposure by multiplying linear RGB values by 2^steps.
Args: steps: Graph of Float
Returns: Graph: A graph node producing a ProfiledColor.
90 @staticmethod 91 def new_lmsa(lmsa) -> ProfiledColor: 92 """Profiled Color from LMS with Alpha 93 94 Creates a profiled color from LMS channels and alpha. 95 96 Args: 97 lmsa: Graph of LMSA 98 99 Returns: 100 Graph: A graph node producing a ProfiledColor. 101 """ 102 lmsa_parsed = input_parsers.parse_graph(lmsa) 103 result = _internal.profiled_color_from_l_m_s_a_internal(lmsa_parsed) 104 return ProfiledColor(result)
Profiled Color from LMS with Alpha
Creates a profiled color from LMS channels and alpha.
Args: lmsa: Graph of LMSA
Returns: Graph: A graph node producing a ProfiledColor.
106 @staticmethod 107 def from_ok_lab_a(ok_lab_a) -> ProfiledColor: 108 """Profiled Color from OkLab with Alpha 109 110 Creates a profiled color from OkLab channels and alpha. 111 112 Args: 113 ok_lab_a: Graph of OkLabA 114 115 Returns: 116 Graph: A graph node producing a ProfiledColor. 117 """ 118 ok_lab_a_parsed = input_parsers.parse_graph(ok_lab_a) 119 result = _internal.profiled_color_from_ok_lab_a_internal(ok_lab_a_parsed) 120 return ProfiledColor(result)
Profiled Color from OkLab with Alpha
Creates a profiled color from OkLab channels and alpha.
Args: ok_lab_a: Graph of OkLabA
Returns: Graph: A graph node producing a ProfiledColor.
122 @staticmethod 123 def from_rgba_aces_cg(rgba) -> ProfiledColor: 124 """Profiled Color from RGBA ACEScg 125 126 Creates a profiled color from linear ACEScg RGBA channels. 127 128 Args: 129 rgba: Graph of RGBAColor 130 131 Returns: 132 Graph: A graph node producing a ProfiledColor. 133 """ 134 rgba_parsed = input_parsers.parse_graph(rgba) 135 result = _internal.profiled_color_from_rgba_aces_cg_internal(rgba_parsed) 136 return ProfiledColor(result)
Profiled Color from RGBA ACEScg
Creates a profiled color from linear ACEScg RGBA channels.
Args: rgba: Graph of RGBAColor
Returns: Graph: A graph node producing a ProfiledColor.
138 @staticmethod 139 def from_rgba_p3(rgba) -> ProfiledColor: 140 """Profiled Color from RGBA P3 141 142 Creates a profiled color from encoded Display P3 RGBA channels. 143 144 Args: 145 rgba: Graph of RGBAColor 146 147 Returns: 148 Graph: A graph node producing a ProfiledColor. 149 """ 150 rgba_parsed = input_parsers.parse_graph(rgba) 151 result = _internal.profiled_color_from_rgba_p3_internal(rgba_parsed) 152 return ProfiledColor(result)
Profiled Color from RGBA P3
Creates a profiled color from encoded Display P3 RGBA channels.
Args: rgba: Graph of RGBAColor
Returns: Graph: A graph node producing a ProfiledColor.
154 @staticmethod 155 def from_rgba_srgb(rgba) -> ProfiledColor: 156 """Profiled Color from RGBA sRGB 157 158 Creates a profiled color from encoded sRGB RGBA channels. 159 160 Args: 161 rgba: Graph of RGBAColor 162 163 Returns: 164 Graph: A graph node producing a ProfiledColor. 165 """ 166 rgba_parsed = input_parsers.parse_graph(rgba) 167 result = _internal.profiled_color_from_rgba_srgb_internal(rgba_parsed) 168 return ProfiledColor(result)
Profiled Color from RGBA sRGB
Creates a profiled color from encoded sRGB RGBA channels.
Args: rgba: Graph of RGBAColor
Returns: Graph: A graph node producing a ProfiledColor.
170 @staticmethod 171 def from_rgba_srgb_linear(rgba) -> ProfiledColor: 172 """Profiled Color from RGBA linear sRGB 173 174 Creates a profiled color from linear sRGB RGBA channels. 175 176 Args: 177 rgba: Graph of RGBAColor 178 179 Returns: 180 Graph: A graph node producing a ProfiledColor. 181 """ 182 rgba_parsed = input_parsers.parse_graph(rgba) 183 result = _internal.profiled_color_from_rgba_srgb_linear_internal(rgba_parsed) 184 return ProfiledColor(result)
Profiled Color from RGBA linear sRGB
Creates a profiled color from linear sRGB RGBA channels.
Args: rgba: Graph of RGBAColor
Returns: Graph: A graph node producing a ProfiledColor.
186 @staticmethod 187 def from_srgb_hex(hex) -> ProfiledColor: 188 """Profiled Color from sRGB Hex 189 190 Creates a profiled color from an encoded sRGB hex string (#RGB, #RGBA, #RRGGBB, or #RRGGBBAA). 191 192 Args: 193 hex: Graph of String 194 195 Returns: 196 Graph: A graph node producing a ProfiledColor. 197 """ 198 hex_parsed = input_parsers.parse_string_graph(hex) 199 result = _internal.profiled_color_from_srgb_hex_internal(hex_parsed) 200 return ProfiledColor(result)
Profiled Color from sRGB Hex
Creates a profiled color from an encoded sRGB hex string (#RGB, #RGBA, #RRGGBB, or #RRGGBBAA).
Args: hex: Graph of String
Returns: Graph: A graph node producing a ProfiledColor.
202 @staticmethod 203 def from_wavelength_nm(wavelength_nm) -> ProfiledColor: 204 """Profiled Color From Wavelength (nm) 205 206 Creates a profiled color from a monochromatic wavelength in nanometres. 207 208 Args: 209 wavelength_nm: Graph of Float 210 211 Returns: 212 Graph: A graph node producing a ProfiledColor. 213 """ 214 wavelength_nm_parsed = input_parsers.parse_float_graph(wavelength_nm) 215 result = _internal.profiled_color_from_wavelength_nm_internal(wavelength_nm_parsed) 216 return ProfiledColor(result)
Profiled Color From Wavelength (nm)
Creates a profiled color from a monochromatic wavelength in nanometres.
Args: wavelength_nm: Graph of Float
Returns: Graph: A graph node producing a ProfiledColor.
218 @staticmethod 219 def from_xyz_a(xyza) -> ProfiledColor: 220 """Profiled Color from XYZ with Alpha 221 222 Creates a profiled color from XYZ channels and alpha. 223 224 Args: 225 xyza: Graph of XYZA 226 227 Returns: 228 Graph: A graph node producing a ProfiledColor. 229 """ 230 xyza_parsed = input_parsers.parse_graph(xyza) 231 result = _internal.profiled_color_from_xyz_a_internal(xyza_parsed) 232 return ProfiledColor(result)
Profiled Color from XYZ with Alpha
Creates a profiled color from XYZ channels and alpha.
Args: xyza: Graph of XYZA
Returns: Graph: A graph node producing a ProfiledColor.
234 def grayscale(self) -> ProfiledColor: 235 """Profiled Color Grayscale 236 237 Removes chroma from a profiled color. 238 239 Returns: 240 Graph: A graph node producing a ProfiledColor. 241 """ 242 profiled_color_parsed = input_parsers.parse_graph(self) 243 result = _internal.profiled_color_grayscale_internal(profiled_color_parsed) 244 return ProfiledColor(result)
Profiled Color Grayscale
Removes chroma from a profiled color.
Returns: Graph: A graph node producing a ProfiledColor.
246 def lightness_curve(self, l_curve) -> ProfiledColor: 247 """Profiled Color Lightness Curve 248 249 Applies a curve to the L component of a profiled color in OkLab. 250 251 Args: 252 l_curve: Graph of Curve 253 254 Returns: 255 Graph: A graph node producing a ProfiledColor. 256 """ 257 profiled_color_parsed = input_parsers.parse_graph(self) 258 l_curve_parsed = input_parsers.parse_graph(l_curve) 259 result = _internal.profiled_color_lightness_curve_internal(profiled_color_parsed, l_curve_parsed) 260 return ProfiledColor(result)
Profiled Color Lightness Curve
Applies a curve to the L component of a profiled color in OkLab.
Args: l_curve: Graph of Curve
Returns: Graph: A graph node producing a ProfiledColor.
262 def saturation_adjust(self, scale) -> ProfiledColor: 263 """Profiled Color Saturation Adjust 264 265 Scales the chroma components of a profiled color in OkLab. 266 267 Args: 268 scale: Graph of Float 269 270 Returns: 271 Graph: A graph node producing a ProfiledColor. 272 """ 273 profiled_color_parsed = input_parsers.parse_graph(self) 274 scale_parsed = input_parsers.parse_float_graph(scale) 275 result = _internal.profiled_color_saturation_adjust_internal(profiled_color_parsed, scale_parsed) 276 return ProfiledColor(result)
Profiled Color Saturation Adjust
Scales the chroma components of a profiled color in OkLab.
Args: scale: Graph of Float
Returns: Graph: A graph node producing a ProfiledColor.
278 def target_white(self, target_white) -> ProfiledColor: 279 """Profiled Color Target White 280 281 Adapts a profiled color to the specified XYZ white point. 282 283 Args: 284 target_white: Graph of XYZ 285 286 Returns: 287 Graph: A graph node producing a ProfiledColor. 288 """ 289 profiled_color_parsed = input_parsers.parse_graph(self) 290 target_white_parsed = input_parsers.parse_graph(target_white) 291 result = _internal.profiled_color_target_white_internal(profiled_color_parsed, target_white_parsed) 292 return ProfiledColor(result)
Profiled Color Target White
Adapts a profiled color to the specified XYZ white point.
Args: target_white: Graph of XYZ
Returns: Graph: A graph node producing a ProfiledColor.
294 def to_lmsa(self) -> l_m_s_a.LMSA: 295 """Profiled Color to LMS with Alpha 296 297 Converts a profiled color to LMS channels with alpha. 298 299 Returns: 300 Graph: A graph node producing a LMSA. 301 """ 302 profiled_color_parsed = input_parsers.parse_graph(self) 303 result = _internal.profiled_color_to_l_m_s_a_internal(profiled_color_parsed) 304 from .l_m_s_a import LMSA 305 return LMSA(result)
Profiled Color to LMS with Alpha
Converts a profiled color to LMS channels with alpha.
Returns: Graph: A graph node producing a LMSA.
307 def to_ok_lab_a(self) -> ok_lab_a.OkLabA: 308 """Profiled Color to OkLab with Alpha 309 310 Converts a profiled color to OkLab channels with alpha. 311 312 Returns: 313 Graph: A graph node producing a OkLabA. 314 """ 315 profiled_color_parsed = input_parsers.parse_graph(self) 316 result = _internal.profiled_color_to_ok_lab_a_internal(profiled_color_parsed) 317 from .ok_lab_a import OkLabA 318 return OkLabA(result)
Profiled Color to OkLab with Alpha
Converts a profiled color to OkLab channels with alpha.
Returns: Graph: A graph node producing a OkLabA.
320 def to_rgb_encoded_with_color_profile(self, color_profile) -> r_g_b_a_color.RGBAColor: 321 """Profiled Color to Encoded RGB with Color Profile 322 323 Converts a profiled color to encoded RGB channels using the specified RGB color profile. 324 325 Args: 326 color_profile: Graph of ColorProfile 327 328 Returns: 329 Graph: A graph node producing a RGBAColor. 330 """ 331 profiled_color_parsed = input_parsers.parse_graph(self) 332 color_profile_parsed = input_parsers.parse_graph(color_profile) 333 result = _internal.profiled_color_to_rgb_encoded_with_color_profile_internal(profiled_color_parsed, color_profile_parsed) 334 from .r_g_b_a_color import RGBAColor 335 return RGBAColor(result)
Profiled Color to Encoded RGB with Color Profile
Converts a profiled color to encoded RGB channels using the specified RGB color profile.
Args: color_profile: Graph of ColorProfile
Returns: Graph: A graph node producing a RGBAColor.
337 def to_rgb_linear_with_color_profile(self, color_profile) -> r_g_b_a_color.RGBAColor: 338 """Profiled Color to Linear RGB with Color Profile 339 340 Converts a profiled color to linear RGB channels using the specified RGB color profile. 341 342 Args: 343 color_profile: Graph of ColorProfile 344 345 Returns: 346 Graph: A graph node producing a RGBAColor. 347 """ 348 profiled_color_parsed = input_parsers.parse_graph(self) 349 color_profile_parsed = input_parsers.parse_graph(color_profile) 350 result = _internal.profiled_color_to_rgb_linear_with_color_profile_internal(profiled_color_parsed, color_profile_parsed) 351 from .r_g_b_a_color import RGBAColor 352 return RGBAColor(result)
Profiled Color to Linear RGB with Color Profile
Converts a profiled color to linear RGB channels using the specified RGB color profile.
Args: color_profile: Graph of ColorProfile
Returns: Graph: A graph node producing a RGBAColor.
354 def to_xyz_a(self) -> x_y_z_a.XYZA: 355 """Profiled Color to XYZ with Alpha 356 357 Converts a profiled color to XYZ channels with alpha. 358 359 Returns: 360 Graph: A graph node producing a XYZA. 361 """ 362 profiled_color_parsed = input_parsers.parse_graph(self) 363 result = _internal.profiled_color_to_xyz_a_internal(profiled_color_parsed) 364 from .x_y_z_a import XYZA 365 return XYZA(result)
Profiled Color to XYZ with Alpha
Converts a profiled color to XYZ channels with alpha.
Returns: Graph: A graph node producing a XYZA.
11class ProfiledColorList(List): 12 """List of Profiled Colors""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .profiled_color import ProfiledColor 16 super().__init__(inner, ProfiledColor if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Profiled Colors
12class RGBAColor(Object): 13 """A color with a red, green, blue, and alpha component""" 14 15 def execute(self, context): 16 return self._inner.execute(context).as_rgba_color() 17 18 @staticmethod 19 def from_components(r, g, b, a) -> RGBAColor: 20 """RGBA Color from Components 21 22 Given the r, g, b and a creates the color 23 24 Args: 25 r: Graph of Float 26 g: Graph of Float 27 b: Graph of Float 28 a: Graph of Float 29 30 Returns: 31 Graph: A graph node producing a RGBAColor. 32 """ 33 r_parsed = input_parsers.parse_float_graph(r) 34 g_parsed = input_parsers.parse_float_graph(g) 35 b_parsed = input_parsers.parse_float_graph(b) 36 a_parsed = input_parsers.parse_float_graph(a) 37 result = _internal.r_g_b_a_color_from_components_internal(r_parsed, g_parsed, b_parsed, a_parsed) 38 return RGBAColor(result)
A color with a red, green, blue, and alpha component
18 @staticmethod 19 def from_components(r, g, b, a) -> RGBAColor: 20 """RGBA Color from Components 21 22 Given the r, g, b and a creates the color 23 24 Args: 25 r: Graph of Float 26 g: Graph of Float 27 b: Graph of Float 28 a: Graph of Float 29 30 Returns: 31 Graph: A graph node producing a RGBAColor. 32 """ 33 r_parsed = input_parsers.parse_float_graph(r) 34 g_parsed = input_parsers.parse_float_graph(g) 35 b_parsed = input_parsers.parse_float_graph(b) 36 a_parsed = input_parsers.parse_float_graph(a) 37 result = _internal.r_g_b_a_color_from_components_internal(r_parsed, g_parsed, b_parsed, a_parsed) 38 return RGBAColor(result)
RGBA Color from Components
Given the r, g, b and a creates the color
Args: r: Graph of Float g: Graph of Float b: Graph of Float a: Graph of Float
Returns: Graph: A graph node producing a RGBAColor.
12class RGBColor(Object): 13 """A color with a red, green and blue component""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def from_components(r, g, b) -> RGBColor: 20 """RGB Color from Components 21 22 Given the r, g and b creates the color 23 24 Args: 25 r: Graph of Float 26 g: Graph of Float 27 b: Graph of Float 28 29 Returns: 30 Graph: A graph node producing a RGBColor. 31 """ 32 r_parsed = input_parsers.parse_float_graph(r) 33 g_parsed = input_parsers.parse_float_graph(g) 34 b_parsed = input_parsers.parse_float_graph(b) 35 result = _internal.r_g_b_color_from_components_internal(r_parsed, g_parsed, b_parsed) 36 return RGBColor(result)
A color with a red, green and blue component
18 @staticmethod 19 def from_components(r, g, b) -> RGBColor: 20 """RGB Color from Components 21 22 Given the r, g and b creates the color 23 24 Args: 25 r: Graph of Float 26 g: Graph of Float 27 b: Graph of Float 28 29 Returns: 30 Graph: A graph node producing a RGBColor. 31 """ 32 r_parsed = input_parsers.parse_float_graph(r) 33 g_parsed = input_parsers.parse_float_graph(g) 34 b_parsed = input_parsers.parse_float_graph(b) 35 result = _internal.r_g_b_color_from_components_internal(r_parsed, g_parsed, b_parsed) 36 return RGBColor(result)
RGB Color from Components
Given the r, g and b creates the color
Args: r: Graph of Float g: Graph of Float b: Graph of Float
Returns: Graph: A graph node producing a RGBColor.
12class RenderStyle(Object): 13 """Combining a fill and brush into a render style to create a 2D object.""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def brush_and_fill(brush, fill) -> RenderStyle: 20 """Render Style Brush and Fill 21 22 Creates a render style that will have a brush and a fill. 23 24 Args: 25 brush: Graph of Brush 26 fill: Graph of Fill 27 28 Returns: 29 Graph: A graph node producing a RenderStyle. 30 """ 31 brush_parsed = input_parsers.parse_graph(brush) 32 fill_parsed = input_parsers.parse_graph(fill) 33 result = _internal.render_style_brush_and_fill_internal(brush_parsed, fill_parsed) 34 return RenderStyle(result) 35 36 @staticmethod 37 def brush_only(brush) -> RenderStyle: 38 """Render Style Brush Only 39 40 Creates a render style that will only have a brush. 41 42 Args: 43 brush: Graph of Brush 44 45 Returns: 46 Graph: A graph node producing a RenderStyle. 47 """ 48 brush_parsed = input_parsers.parse_graph(brush) 49 result = _internal.render_style_brush_only_internal(brush_parsed) 50 return RenderStyle(result) 51 52 @staticmethod 53 def fill_only(fill) -> RenderStyle: 54 """Render Style Fill Only 55 56 Creates a render style that will only have a fill. 57 58 Args: 59 fill: Graph of Fill 60 61 Returns: 62 Graph: A graph node producing a RenderStyle. 63 """ 64 fill_parsed = input_parsers.parse_graph(fill) 65 result = _internal.render_style_fill_only_internal(fill_parsed) 66 return RenderStyle(result)
Combining a fill and brush into a render style to create a 2D object.
18 @staticmethod 19 def brush_and_fill(brush, fill) -> RenderStyle: 20 """Render Style Brush and Fill 21 22 Creates a render style that will have a brush and a fill. 23 24 Args: 25 brush: Graph of Brush 26 fill: Graph of Fill 27 28 Returns: 29 Graph: A graph node producing a RenderStyle. 30 """ 31 brush_parsed = input_parsers.parse_graph(brush) 32 fill_parsed = input_parsers.parse_graph(fill) 33 result = _internal.render_style_brush_and_fill_internal(brush_parsed, fill_parsed) 34 return RenderStyle(result)
Render Style Brush and Fill
Creates a render style that will have a brush and a fill.
Args: brush: Graph of Brush fill: Graph of Fill
Returns: Graph: A graph node producing a RenderStyle.
36 @staticmethod 37 def brush_only(brush) -> RenderStyle: 38 """Render Style Brush Only 39 40 Creates a render style that will only have a brush. 41 42 Args: 43 brush: Graph of Brush 44 45 Returns: 46 Graph: A graph node producing a RenderStyle. 47 """ 48 brush_parsed = input_parsers.parse_graph(brush) 49 result = _internal.render_style_brush_only_internal(brush_parsed) 50 return RenderStyle(result)
Render Style Brush Only
Creates a render style that will only have a brush.
Args: brush: Graph of Brush
Returns: Graph: A graph node producing a RenderStyle.
52 @staticmethod 53 def fill_only(fill) -> RenderStyle: 54 """Render Style Fill Only 55 56 Creates a render style that will only have a fill. 57 58 Args: 59 fill: Graph of Fill 60 61 Returns: 62 Graph: A graph node producing a RenderStyle. 63 """ 64 fill_parsed = input_parsers.parse_graph(fill) 65 result = _internal.render_style_fill_only_internal(fill_parsed) 66 return RenderStyle(result)
Render Style Fill Only
Creates a render style that will only have a fill.
Args: fill: Graph of Fill
Returns: Graph: A graph node producing a RenderStyle.
19class Sequence(Object): 20 """A sequence with a bunch of operations to render a movie""" 21 22 def execute(self, context): 23 return self._inner.execute(context).as_sequence() 24 25 def adjust_speed(self, factor) -> Sequence: 26 """Sequence Adjust Speed 27 28 Adjusts the speed of a sequence by a speed factor. 29 30 Args: 31 factor: Graph of Float 32 33 Returns: 34 Graph: A graph node producing a Sequence. 35 """ 36 sequence_parsed = input_parsers.parse_graph(self) 37 factor_parsed = input_parsers.parse_float_graph(factor) 38 result = _internal.sequence_adjust_speed_internal(sequence_parsed, factor_parsed) 39 return Sequence(result) 40 41 def composition_at_time(self, time) -> composition.Composition: 42 """Sequence Composition at Time 43 44 Extracts an composition from a sequence at a particular time 45 46 Args: 47 time: Graph of Float 48 49 Returns: 50 Graph: A graph node producing a Composition. 51 """ 52 sequence_parsed = input_parsers.parse_graph(self) 53 time_parsed = input_parsers.parse_float_graph(time) 54 result = _internal.sequence_composition_at_time_internal(sequence_parsed, time_parsed) 55 from .composition import Composition 56 return Composition(result) 57 58 def concatenate(self, sequence_2) -> Sequence: 59 """Sequence Concatenate 60 61 Given two sequences, combines them into one by playing the first one and then the second one. 62 63 Args: 64 sequence_2: Graph of Sequence 65 66 Returns: 67 Graph: A graph node producing a Sequence. 68 """ 69 sequence_1_parsed = input_parsers.parse_graph(self) 70 sequence_2_parsed = input_parsers.parse_graph(sequence_2) 71 result = _internal.sequence_concatenate_internal(sequence_1_parsed, sequence_2_parsed) 72 return Sequence(result) 73 74 def duration(self) -> float.Float: 75 """Sequence Duration 76 77 Gets the duration from a sequence 78 79 Returns: 80 Graph: A graph node producing a Float. 81 """ 82 sequence_parsed = input_parsers.parse_graph(self) 83 result = _internal.sequence_duration_internal(sequence_parsed) 84 from .float import Float 85 return Float(result) 86 87 @staticmethod 88 def from_composition_and_duration(composition, duration) -> Sequence: 89 """Sequence from Composition and Duration 90 91 Give a Composition and a Duration. Returns a Sequence. 92 93 Args: 94 composition: Graph of Composition 95 duration: Graph of Float 96 97 Returns: 98 Graph: A graph node producing a Sequence. 99 """ 100 composition_parsed = input_parsers.parse_graph(composition) 101 duration_parsed = input_parsers.parse_float_graph(duration) 102 result = _internal.sequence_from_composition_and_duration_internal(composition_parsed, duration_parsed) 103 return Sequence(result) 104 105 @staticmethod 106 def from_url(url) -> Sequence: 107 """Sequence from URL 108 109 Creates a sequence from URL 110 111 Args: 112 url: Graph of String 113 114 Returns: 115 Graph: A graph node producing a Sequence. 116 """ 117 url_parsed = input_parsers.parse_string_graph(url) 118 result = _internal.sequence_from_u_r_l_internal(url_parsed) 119 return Sequence(result) 120 121 @staticmethod 122 def graph(duration, fn) -> Sequence: 123 """Sequence Graph 124 125 Creates a sequence that runs the graph to get the duration and the frame for each time. 126 127 Args: 128 duration: Graph of Float 129 fn: The function associated with this node. 130 131 Returns: 132 Graph: A graph node producing a Sequence. 133 """ 134 duration_parsed = input_parsers.parse_float_graph(duration) 135 if not hasattr(fn, "__brushcue_make_graph__"): 136 raise TypeError("fn must be annotated with @brushcue_fn") 137 dispatched_graphs = fn.__brushcue_make_graph__([ 138 _internal.TypeDefinition.from_name("Float") 139 ]) 140 result = _internal.sequence_graph_internal(duration_parsed, *dispatched_graphs 141 ) 142 143 return Sequence(result) 144 145 def reverse(self) -> Sequence: 146 """Sequence Reverse 147 148 Given a sequence. Reverses it. 149 150 Returns: 151 Graph: A graph node producing a Sequence. 152 """ 153 sequence_parsed = input_parsers.parse_graph(self) 154 result = _internal.sequence_reverse_internal(sequence_parsed) 155 return Sequence(result) 156 157 def to_mp4(self, frame_rate) -> bytes.Bytes: 158 """Sequence To MP4 159 160 Given a sequence. Converts it to MP4 return a local file to where that MP4 is stored. 161 162 Args: 163 frame_rate: Graph of Int 164 165 Returns: 166 Graph: A graph node producing a Bytes. 167 """ 168 sequence_parsed = input_parsers.parse_graph(self) 169 frame_rate_parsed = input_parsers.parse_int_graph(frame_rate) 170 result = _internal.sequence_to_mp4_internal(sequence_parsed, frame_rate_parsed) 171 from .bytes import Bytes 172 return Bytes(result) 173 174 def trim_back(self, amount) -> Sequence: 175 """Sequence Trim Back 176 177 Given a sequence. Trims from the back. 178 179 Args: 180 amount: Graph of Float 181 182 Returns: 183 Graph: A graph node producing a Sequence. 184 """ 185 sequence_parsed = input_parsers.parse_graph(self) 186 amount_parsed = input_parsers.parse_float_graph(amount) 187 result = _internal.sequence_trim_back_internal(sequence_parsed, amount_parsed) 188 return Sequence(result) 189 190 def trim_front(self, amount) -> Sequence: 191 """Sequence Trim Front 192 193 Given a sequence. Trims from the front. 194 195 Args: 196 amount: Graph of Float 197 198 Returns: 199 Graph: A graph node producing a Sequence. 200 """ 201 sequence_parsed = input_parsers.parse_graph(self) 202 amount_parsed = input_parsers.parse_float_graph(amount) 203 result = _internal.sequence_trim_front_internal(sequence_parsed, amount_parsed) 204 return Sequence(result)
A sequence with a bunch of operations to render a movie
25 def adjust_speed(self, factor) -> Sequence: 26 """Sequence Adjust Speed 27 28 Adjusts the speed of a sequence by a speed factor. 29 30 Args: 31 factor: Graph of Float 32 33 Returns: 34 Graph: A graph node producing a Sequence. 35 """ 36 sequence_parsed = input_parsers.parse_graph(self) 37 factor_parsed = input_parsers.parse_float_graph(factor) 38 result = _internal.sequence_adjust_speed_internal(sequence_parsed, factor_parsed) 39 return Sequence(result)
Sequence Adjust Speed
Adjusts the speed of a sequence by a speed factor.
Args: factor: Graph of Float
Returns: Graph: A graph node producing a Sequence.
41 def composition_at_time(self, time) -> composition.Composition: 42 """Sequence Composition at Time 43 44 Extracts an composition from a sequence at a particular time 45 46 Args: 47 time: Graph of Float 48 49 Returns: 50 Graph: A graph node producing a Composition. 51 """ 52 sequence_parsed = input_parsers.parse_graph(self) 53 time_parsed = input_parsers.parse_float_graph(time) 54 result = _internal.sequence_composition_at_time_internal(sequence_parsed, time_parsed) 55 from .composition import Composition 56 return Composition(result)
Sequence Composition at Time
Extracts an composition from a sequence at a particular time
Args: time: Graph of Float
Returns: Graph: A graph node producing a Composition.
58 def concatenate(self, sequence_2) -> Sequence: 59 """Sequence Concatenate 60 61 Given two sequences, combines them into one by playing the first one and then the second one. 62 63 Args: 64 sequence_2: Graph of Sequence 65 66 Returns: 67 Graph: A graph node producing a Sequence. 68 """ 69 sequence_1_parsed = input_parsers.parse_graph(self) 70 sequence_2_parsed = input_parsers.parse_graph(sequence_2) 71 result = _internal.sequence_concatenate_internal(sequence_1_parsed, sequence_2_parsed) 72 return Sequence(result)
Sequence Concatenate
Given two sequences, combines them into one by playing the first one and then the second one.
Args: sequence_2: Graph of Sequence
Returns: Graph: A graph node producing a Sequence.
74 def duration(self) -> float.Float: 75 """Sequence Duration 76 77 Gets the duration from a sequence 78 79 Returns: 80 Graph: A graph node producing a Float. 81 """ 82 sequence_parsed = input_parsers.parse_graph(self) 83 result = _internal.sequence_duration_internal(sequence_parsed) 84 from .float import Float 85 return Float(result)
Sequence Duration
Gets the duration from a sequence
Returns: Graph: A graph node producing a Float.
87 @staticmethod 88 def from_composition_and_duration(composition, duration) -> Sequence: 89 """Sequence from Composition and Duration 90 91 Give a Composition and a Duration. Returns a Sequence. 92 93 Args: 94 composition: Graph of Composition 95 duration: Graph of Float 96 97 Returns: 98 Graph: A graph node producing a Sequence. 99 """ 100 composition_parsed = input_parsers.parse_graph(composition) 101 duration_parsed = input_parsers.parse_float_graph(duration) 102 result = _internal.sequence_from_composition_and_duration_internal(composition_parsed, duration_parsed) 103 return Sequence(result)
Sequence from Composition and Duration
Give a Composition and a Duration. Returns a Sequence.
Args: composition: Graph of Composition duration: Graph of Float
Returns: Graph: A graph node producing a Sequence.
105 @staticmethod 106 def from_url(url) -> Sequence: 107 """Sequence from URL 108 109 Creates a sequence from URL 110 111 Args: 112 url: Graph of String 113 114 Returns: 115 Graph: A graph node producing a Sequence. 116 """ 117 url_parsed = input_parsers.parse_string_graph(url) 118 result = _internal.sequence_from_u_r_l_internal(url_parsed) 119 return Sequence(result)
Sequence from URL
Creates a sequence from URL
Args: url: Graph of String
Returns: Graph: A graph node producing a Sequence.
121 @staticmethod 122 def graph(duration, fn) -> Sequence: 123 """Sequence Graph 124 125 Creates a sequence that runs the graph to get the duration and the frame for each time. 126 127 Args: 128 duration: Graph of Float 129 fn: The function associated with this node. 130 131 Returns: 132 Graph: A graph node producing a Sequence. 133 """ 134 duration_parsed = input_parsers.parse_float_graph(duration) 135 if not hasattr(fn, "__brushcue_make_graph__"): 136 raise TypeError("fn must be annotated with @brushcue_fn") 137 dispatched_graphs = fn.__brushcue_make_graph__([ 138 _internal.TypeDefinition.from_name("Float") 139 ]) 140 result = _internal.sequence_graph_internal(duration_parsed, *dispatched_graphs 141 ) 142 143 return Sequence(result)
Sequence Graph
Creates a sequence that runs the graph to get the duration and the frame for each time.
Args: duration: Graph of Float fn: The function associated with this node.
Returns: Graph: A graph node producing a Sequence.
145 def reverse(self) -> Sequence: 146 """Sequence Reverse 147 148 Given a sequence. Reverses it. 149 150 Returns: 151 Graph: A graph node producing a Sequence. 152 """ 153 sequence_parsed = input_parsers.parse_graph(self) 154 result = _internal.sequence_reverse_internal(sequence_parsed) 155 return Sequence(result)
Sequence Reverse
Given a sequence. Reverses it.
Returns: Graph: A graph node producing a Sequence.
157 def to_mp4(self, frame_rate) -> bytes.Bytes: 158 """Sequence To MP4 159 160 Given a sequence. Converts it to MP4 return a local file to where that MP4 is stored. 161 162 Args: 163 frame_rate: Graph of Int 164 165 Returns: 166 Graph: A graph node producing a Bytes. 167 """ 168 sequence_parsed = input_parsers.parse_graph(self) 169 frame_rate_parsed = input_parsers.parse_int_graph(frame_rate) 170 result = _internal.sequence_to_mp4_internal(sequence_parsed, frame_rate_parsed) 171 from .bytes import Bytes 172 return Bytes(result)
Sequence To MP4
Given a sequence. Converts it to MP4 return a local file to where that MP4 is stored.
Args: frame_rate: Graph of Int
Returns: Graph: A graph node producing a Bytes.
174 def trim_back(self, amount) -> Sequence: 175 """Sequence Trim Back 176 177 Given a sequence. Trims from the back. 178 179 Args: 180 amount: Graph of Float 181 182 Returns: 183 Graph: A graph node producing a Sequence. 184 """ 185 sequence_parsed = input_parsers.parse_graph(self) 186 amount_parsed = input_parsers.parse_float_graph(amount) 187 result = _internal.sequence_trim_back_internal(sequence_parsed, amount_parsed) 188 return Sequence(result)
Sequence Trim Back
Given a sequence. Trims from the back.
Args: amount: Graph of Float
Returns: Graph: A graph node producing a Sequence.
190 def trim_front(self, amount) -> Sequence: 191 """Sequence Trim Front 192 193 Given a sequence. Trims from the front. 194 195 Args: 196 amount: Graph of Float 197 198 Returns: 199 Graph: A graph node producing a Sequence. 200 """ 201 sequence_parsed = input_parsers.parse_graph(self) 202 amount_parsed = input_parsers.parse_float_graph(amount) 203 result = _internal.sequence_trim_front_internal(sequence_parsed, amount_parsed) 204 return Sequence(result)
Sequence Trim Front
Given a sequence. Trims from the front.
Args: amount: Graph of Float
Returns: Graph: A graph node producing a Sequence.
11class String(Object): 12 """a string""" 13 14 def execute(self, context): 15 return self._inner.execute(context).as_string()
a string
11class StringList(List): 12 """List of Strings""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .string import String 16 super().__init__(inner, String if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Strings
12class Transform2(Object): 13 """A 2D Transformation""" 14 15 def execute(self, context): 16 return self._inner.execute(context) 17 18 @staticmethod 19 def identity() -> Transform2: 20 """Transform 2D Identity 21 22 Creates a 2D transform that is the identity transform. 23 24 Returns: 25 Graph: A graph node producing a Transform2. 26 """ 27 result = _internal.transform2_identity_internal() 28 return Transform2(result) 29 30 def rotate(self, angle) -> Transform2: 31 """Transform 2D Rotate 32 33 Applies a rotation to a 2D transform. Rotation is in radians. 34 35 Args: 36 angle: Graph of Float 37 38 Returns: 39 Graph: A graph node producing a Transform2. 40 """ 41 transform_parsed = input_parsers.parse_graph(self) 42 angle_parsed = input_parsers.parse_float_graph(angle) 43 result = _internal.transform2_rotate_internal(transform_parsed, angle_parsed) 44 return Transform2(result) 45 46 def scale(self, scale) -> Transform2: 47 """Transform 2D Scale 48 49 Applies a scale to a 2D transform. 50 51 Args: 52 scale: Graph of Vector2f 53 54 Returns: 55 Graph: A graph node producing a Transform2. 56 """ 57 transform_parsed = input_parsers.parse_graph(self) 58 scale_parsed = input_parsers.parse_graph(scale) 59 result = _internal.transform2_scale_internal(transform_parsed, scale_parsed) 60 return Transform2(result) 61 62 def translation(self, translation) -> Transform2: 63 """Transform 2D Translation 64 65 Applies a translation to a 2D transform. 66 67 Args: 68 translation: Graph of Vector2f 69 70 Returns: 71 Graph: A graph node producing a Transform2. 72 """ 73 transform_parsed = input_parsers.parse_graph(self) 74 translation_parsed = input_parsers.parse_graph(translation) 75 result = _internal.transform2_translation_internal(transform_parsed, translation_parsed) 76 return Transform2(result)
A 2D Transformation
18 @staticmethod 19 def identity() -> Transform2: 20 """Transform 2D Identity 21 22 Creates a 2D transform that is the identity transform. 23 24 Returns: 25 Graph: A graph node producing a Transform2. 26 """ 27 result = _internal.transform2_identity_internal() 28 return Transform2(result)
Transform 2D Identity
Creates a 2D transform that is the identity transform.
Returns: Graph: A graph node producing a Transform2.
30 def rotate(self, angle) -> Transform2: 31 """Transform 2D Rotate 32 33 Applies a rotation to a 2D transform. Rotation is in radians. 34 35 Args: 36 angle: Graph of Float 37 38 Returns: 39 Graph: A graph node producing a Transform2. 40 """ 41 transform_parsed = input_parsers.parse_graph(self) 42 angle_parsed = input_parsers.parse_float_graph(angle) 43 result = _internal.transform2_rotate_internal(transform_parsed, angle_parsed) 44 return Transform2(result)
Transform 2D Rotate
Applies a rotation to a 2D transform. Rotation is in radians.
Args: angle: Graph of Float
Returns: Graph: A graph node producing a Transform2.
46 def scale(self, scale) -> Transform2: 47 """Transform 2D Scale 48 49 Applies a scale to a 2D transform. 50 51 Args: 52 scale: Graph of Vector2f 53 54 Returns: 55 Graph: A graph node producing a Transform2. 56 """ 57 transform_parsed = input_parsers.parse_graph(self) 58 scale_parsed = input_parsers.parse_graph(scale) 59 result = _internal.transform2_scale_internal(transform_parsed, scale_parsed) 60 return Transform2(result)
Transform 2D Scale
Applies a scale to a 2D transform.
Args: scale: Graph of Vector2f
Returns: Graph: A graph node producing a Transform2.
62 def translation(self, translation) -> Transform2: 63 """Transform 2D Translation 64 65 Applies a translation to a 2D transform. 66 67 Args: 68 translation: Graph of Vector2f 69 70 Returns: 71 Graph: A graph node producing a Transform2. 72 """ 73 transform_parsed = input_parsers.parse_graph(self) 74 translation_parsed = input_parsers.parse_graph(translation) 75 result = _internal.transform2_translation_internal(transform_parsed, translation_parsed) 76 return Transform2(result)
Transform 2D Translation
Applies a translation to a 2D transform.
Args: translation: Graph of Vector2f
Returns: Graph: A graph node producing a Transform2.
11class Transform2List(List): 12 """List of Transform 2Ds""" 13 14 def __init__(self, inner, resolved_type=None): 15 from .transform2 import Transform2 16 super().__init__(inner, Transform2 if resolved_type is None else resolved_type) 17 18 def execute(self, context): 19 return self._inner.execute(context)
List of Transform 2Ds
17class Vector2f(Object): 18 """A vector with two elements of Floats""" 19 20 def execute(self, context): 21 return self._inner.execute(context).as_vector2f() 22 23 def add(self, rhs) -> Vector2f: 24 """Vector 2 Float Add 25 26 Add two Vector 2s of Floats 27 28 Args: 29 rhs: Graph of Vector2f 30 31 Returns: 32 Graph: A graph node producing a Vector2f. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.vector2f_add_internal(lhs_parsed, rhs_parsed) 37 return Vector2f(result) 38 39 @staticmethod 40 def from_components(x, y) -> Vector2f: 41 """Vector 2 Float from Components 42 43 Given an x and y creates a vector. 44 45 Args: 46 x: Graph of Float 47 y: Graph of Float 48 49 Returns: 50 Graph: A graph node producing a Vector2f. 51 """ 52 x_parsed = input_parsers.parse_float_graph(x) 53 y_parsed = input_parsers.parse_float_graph(y) 54 result = _internal.vector2f_from_components_internal(x_parsed, y_parsed) 55 return Vector2f(result) 56 57 def normalize(self) -> Vector2f: 58 """Vector 2 Float Normalize 59 60 Normalizes a Vector. Converting it's length to 1. 61 62 Returns: 63 Graph: A graph node producing a Vector2f. 64 """ 65 vector_parsed = input_parsers.parse_graph(self) 66 result = _internal.vector2f_normalize_internal(vector_parsed) 67 return Vector2f(result) 68 69 def scalar_multiply(self, scalar) -> Vector2f: 70 """Vector 2 Float Scalar Multiply 71 72 Multiplies each element of the Vector as a scalar 73 74 Args: 75 scalar: Graph of Float 76 77 Returns: 78 Graph: A graph node producing a Vector2f. 79 """ 80 vector_parsed = input_parsers.parse_graph(self) 81 scalar_parsed = input_parsers.parse_float_graph(scalar) 82 result = _internal.vector2f_scalar_multiply_internal(vector_parsed, scalar_parsed) 83 return Vector2f(result) 84 85 def x(self) -> float.Float: 86 """Vector 2 Float get X 87 88 Retrieves the X component of a Vector 2 Float. 89 90 Returns: 91 Graph: A graph node producing a Float. 92 """ 93 vector_parsed = input_parsers.parse_graph(self) 94 result = _internal.vector2f_x_internal(vector_parsed) 95 from .float import Float 96 return Float(result) 97 98 def y(self) -> float.Float: 99 """Vector 2 Float get Y 100 101 Retrieves the Y component of a Vector 2 Float. 102 103 Returns: 104 Graph: A graph node producing a Float. 105 """ 106 vector_parsed = input_parsers.parse_graph(self) 107 result = _internal.vector2f_y_internal(vector_parsed) 108 from .float import Float 109 return Float(result)
A vector with two elements of Floats
23 def add(self, rhs) -> Vector2f: 24 """Vector 2 Float Add 25 26 Add two Vector 2s of Floats 27 28 Args: 29 rhs: Graph of Vector2f 30 31 Returns: 32 Graph: A graph node producing a Vector2f. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.vector2f_add_internal(lhs_parsed, rhs_parsed) 37 return Vector2f(result)
Vector 2 Float Add
Add two Vector 2s of Floats
Args: rhs: Graph of Vector2f
Returns: Graph: A graph node producing a Vector2f.
39 @staticmethod 40 def from_components(x, y) -> Vector2f: 41 """Vector 2 Float from Components 42 43 Given an x and y creates a vector. 44 45 Args: 46 x: Graph of Float 47 y: Graph of Float 48 49 Returns: 50 Graph: A graph node producing a Vector2f. 51 """ 52 x_parsed = input_parsers.parse_float_graph(x) 53 y_parsed = input_parsers.parse_float_graph(y) 54 result = _internal.vector2f_from_components_internal(x_parsed, y_parsed) 55 return Vector2f(result)
Vector 2 Float from Components
Given an x and y creates a vector.
Args: x: Graph of Float y: Graph of Float
Returns: Graph: A graph node producing a Vector2f.
57 def normalize(self) -> Vector2f: 58 """Vector 2 Float Normalize 59 60 Normalizes a Vector. Converting it's length to 1. 61 62 Returns: 63 Graph: A graph node producing a Vector2f. 64 """ 65 vector_parsed = input_parsers.parse_graph(self) 66 result = _internal.vector2f_normalize_internal(vector_parsed) 67 return Vector2f(result)
Vector 2 Float Normalize
Normalizes a Vector. Converting it's length to 1.
Returns: Graph: A graph node producing a Vector2f.
69 def scalar_multiply(self, scalar) -> Vector2f: 70 """Vector 2 Float Scalar Multiply 71 72 Multiplies each element of the Vector as a scalar 73 74 Args: 75 scalar: Graph of Float 76 77 Returns: 78 Graph: A graph node producing a Vector2f. 79 """ 80 vector_parsed = input_parsers.parse_graph(self) 81 scalar_parsed = input_parsers.parse_float_graph(scalar) 82 result = _internal.vector2f_scalar_multiply_internal(vector_parsed, scalar_parsed) 83 return Vector2f(result)
Vector 2 Float Scalar Multiply
Multiplies each element of the Vector as a scalar
Args: scalar: Graph of Float
Returns: Graph: A graph node producing a Vector2f.
85 def x(self) -> float.Float: 86 """Vector 2 Float get X 87 88 Retrieves the X component of a Vector 2 Float. 89 90 Returns: 91 Graph: A graph node producing a Float. 92 """ 93 vector_parsed = input_parsers.parse_graph(self) 94 result = _internal.vector2f_x_internal(vector_parsed) 95 from .float import Float 96 return Float(result)
Vector 2 Float get X
Retrieves the X component of a Vector 2 Float.
Returns: Graph: A graph node producing a Float.
98 def y(self) -> float.Float: 99 """Vector 2 Float get Y 100 101 Retrieves the Y component of a Vector 2 Float. 102 103 Returns: 104 Graph: A graph node producing a Float. 105 """ 106 vector_parsed = input_parsers.parse_graph(self) 107 result = _internal.vector2f_y_internal(vector_parsed) 108 from .float import Float 109 return Float(result)
Vector 2 Float get Y
Retrieves the Y component of a Vector 2 Float.
Returns: Graph: A graph node producing a Float.
18class Vector2i(Object): 19 """A vector with two elements of Ints""" 20 21 def execute(self, context): 22 return self._inner.execute(context).as_vector2i() 23 24 def vector2int_to_vector2float(self) -> vector2f.Vector2f: 25 """Vector 2 Int to Vector 2 Float 26 27 Given a Vector 2 Int. Creates a Vector 2 Float. 28 29 Returns: 30 Graph: A graph node producing a Vector2f. 31 """ 32 vector_parsed = input_parsers.parse_graph(self) 33 result = _internal.vector2_int_to_vector2_float_internal(vector_parsed) 34 from .vector2f import Vector2f 35 return Vector2f(result) 36 37 def add(self, rhs) -> Vector2i: 38 """Vector 2 Int Add 39 40 Add two Vector 2s of Ints 41 42 Args: 43 rhs: Graph of Vector2i 44 45 Returns: 46 Graph: A graph node producing a Vector2i. 47 """ 48 lhs_parsed = input_parsers.parse_graph(self) 49 rhs_parsed = input_parsers.parse_graph(rhs) 50 result = _internal.vector2i_add_internal(lhs_parsed, rhs_parsed) 51 return Vector2i(result) 52 53 @staticmethod 54 def from_components(x, y) -> Vector2i: 55 """Vector 2 Int from Components 56 57 Given an x and y creates a vector. 58 59 Args: 60 x: Graph of Int 61 y: Graph of Int 62 63 Returns: 64 Graph: A graph node producing a Vector2i. 65 """ 66 x_parsed = input_parsers.parse_int_graph(x) 67 y_parsed = input_parsers.parse_int_graph(y) 68 result = _internal.vector2i_from_components_internal(x_parsed, y_parsed) 69 return Vector2i(result) 70 71 def to_vector2f(self) -> vector2f.Vector2f: 72 """Vector 2 Int to Vector 2 Float 73 74 Given a Vector 2 Int. Creates a Vector 2 Float. 75 76 Returns: 77 Graph: A graph node producing a Vector2f. 78 """ 79 vector_parsed = input_parsers.parse_graph(self) 80 result = _internal.vector2i_to_vector2f_internal(vector_parsed) 81 from .vector2f import Vector2f 82 return Vector2f(result) 83 84 def x(self) -> int.Int: 85 """Vector 2 Int get X 86 87 Retrieves the X component of a Vector 2 Int. 88 89 Returns: 90 Graph: A graph node producing a Int. 91 """ 92 vector_parsed = input_parsers.parse_graph(self) 93 result = _internal.vector2i_x_internal(vector_parsed) 94 from .int import Int 95 return Int(result) 96 97 def y(self) -> int.Int: 98 """Vector 2 Int get Y 99 100 Retrieves the Y component of a Vector 2 Int. 101 102 Returns: 103 Graph: A graph node producing a Int. 104 """ 105 vector_parsed = input_parsers.parse_graph(self) 106 result = _internal.vector2i_y_internal(vector_parsed) 107 from .int import Int 108 return Int(result)
A vector with two elements of Ints
24 def vector2int_to_vector2float(self) -> vector2f.Vector2f: 25 """Vector 2 Int to Vector 2 Float 26 27 Given a Vector 2 Int. Creates a Vector 2 Float. 28 29 Returns: 30 Graph: A graph node producing a Vector2f. 31 """ 32 vector_parsed = input_parsers.parse_graph(self) 33 result = _internal.vector2_int_to_vector2_float_internal(vector_parsed) 34 from .vector2f import Vector2f 35 return Vector2f(result)
Vector 2 Int to Vector 2 Float
Given a Vector 2 Int. Creates a Vector 2 Float.
Returns: Graph: A graph node producing a Vector2f.
37 def add(self, rhs) -> Vector2i: 38 """Vector 2 Int Add 39 40 Add two Vector 2s of Ints 41 42 Args: 43 rhs: Graph of Vector2i 44 45 Returns: 46 Graph: A graph node producing a Vector2i. 47 """ 48 lhs_parsed = input_parsers.parse_graph(self) 49 rhs_parsed = input_parsers.parse_graph(rhs) 50 result = _internal.vector2i_add_internal(lhs_parsed, rhs_parsed) 51 return Vector2i(result)
Vector 2 Int Add
Add two Vector 2s of Ints
Args: rhs: Graph of Vector2i
Returns: Graph: A graph node producing a Vector2i.
53 @staticmethod 54 def from_components(x, y) -> Vector2i: 55 """Vector 2 Int from Components 56 57 Given an x and y creates a vector. 58 59 Args: 60 x: Graph of Int 61 y: Graph of Int 62 63 Returns: 64 Graph: A graph node producing a Vector2i. 65 """ 66 x_parsed = input_parsers.parse_int_graph(x) 67 y_parsed = input_parsers.parse_int_graph(y) 68 result = _internal.vector2i_from_components_internal(x_parsed, y_parsed) 69 return Vector2i(result)
Vector 2 Int from Components
Given an x and y creates a vector.
Args: x: Graph of Int y: Graph of Int
Returns: Graph: A graph node producing a Vector2i.
71 def to_vector2f(self) -> vector2f.Vector2f: 72 """Vector 2 Int to Vector 2 Float 73 74 Given a Vector 2 Int. Creates a Vector 2 Float. 75 76 Returns: 77 Graph: A graph node producing a Vector2f. 78 """ 79 vector_parsed = input_parsers.parse_graph(self) 80 result = _internal.vector2i_to_vector2f_internal(vector_parsed) 81 from .vector2f import Vector2f 82 return Vector2f(result)
Vector 2 Int to Vector 2 Float
Given a Vector 2 Int. Creates a Vector 2 Float.
Returns: Graph: A graph node producing a Vector2f.
84 def x(self) -> int.Int: 85 """Vector 2 Int get X 86 87 Retrieves the X component of a Vector 2 Int. 88 89 Returns: 90 Graph: A graph node producing a Int. 91 """ 92 vector_parsed = input_parsers.parse_graph(self) 93 result = _internal.vector2i_x_internal(vector_parsed) 94 from .int import Int 95 return Int(result)
Vector 2 Int get X
Retrieves the X component of a Vector 2 Int.
Returns: Graph: A graph node producing a Int.
97 def y(self) -> int.Int: 98 """Vector 2 Int get Y 99 100 Retrieves the Y component of a Vector 2 Int. 101 102 Returns: 103 Graph: A graph node producing a Int. 104 """ 105 vector_parsed = input_parsers.parse_graph(self) 106 result = _internal.vector2i_y_internal(vector_parsed) 107 from .int import Int 108 return Int(result)
Vector 2 Int get Y
Retrieves the Y component of a Vector 2 Int.
Returns: Graph: A graph node producing a Int.
17class Vector3f(Object): 18 """A vector with three elements of Float""" 19 20 def execute(self, context): 21 return self._inner.execute(context).as_vector3f() 22 23 def add(self, rhs) -> Vector3f: 24 """Vector 3 Float Add 25 26 Add two Vector 3s of Floats 27 28 Args: 29 rhs: Graph of Vector3f 30 31 Returns: 32 Graph: A graph node producing a Vector3f. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.vector3f_add_internal(lhs_parsed, rhs_parsed) 37 return Vector3f(result) 38 39 @staticmethod 40 def from_components(x, y, z) -> Vector3f: 41 """Vector 3 Float from Components 42 43 Given an x, y and z creates a vector floats. 44 45 Args: 46 x: Graph of Float 47 y: Graph of Float 48 z: Graph of Float 49 50 Returns: 51 Graph: A graph node producing a Vector3f. 52 """ 53 x_parsed = input_parsers.parse_float_graph(x) 54 y_parsed = input_parsers.parse_float_graph(y) 55 z_parsed = input_parsers.parse_float_graph(z) 56 result = _internal.vector3f_from_components_internal(x_parsed, y_parsed, z_parsed) 57 return Vector3f(result) 58 59 def normalize(self) -> Vector3f: 60 """Vector 3 Normalize 61 62 Normalizes a Vector 3 Float. Converting it's length to 1. 63 64 Returns: 65 Graph: A graph node producing a Vector3f. 66 """ 67 vector_parsed = input_parsers.parse_graph(self) 68 result = _internal.vector3f_normalize_internal(vector_parsed) 69 return Vector3f(result) 70 71 def x(self) -> float.Float: 72 """Vector 3D Float X 73 74 Gets the value in the x component for the provided vector 75 76 Returns: 77 Graph: A graph node producing a Float. 78 """ 79 vector_parsed = input_parsers.parse_graph(self) 80 result = _internal.vector3f_x_internal(vector_parsed) 81 from .float import Float 82 return Float(result) 83 84 def y(self) -> float.Float: 85 """Vector 3D Y Float 86 87 Gets the value in the y component for the provided vector 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 vector_parsed = input_parsers.parse_graph(self) 93 result = _internal.vector3f_y_internal(vector_parsed) 94 from .float import Float 95 return Float(result) 96 97 def z(self) -> float.Float: 98 """Vector 3D Float Z 99 100 Gets the value in the z component for the provided vector 101 102 Returns: 103 Graph: A graph node producing a Float. 104 """ 105 vector_parsed = input_parsers.parse_graph(self) 106 result = _internal.vector3f_z_internal(vector_parsed) 107 from .float import Float 108 return Float(result)
A vector with three elements of Float
23 def add(self, rhs) -> Vector3f: 24 """Vector 3 Float Add 25 26 Add two Vector 3s of Floats 27 28 Args: 29 rhs: Graph of Vector3f 30 31 Returns: 32 Graph: A graph node producing a Vector3f. 33 """ 34 lhs_parsed = input_parsers.parse_graph(self) 35 rhs_parsed = input_parsers.parse_graph(rhs) 36 result = _internal.vector3f_add_internal(lhs_parsed, rhs_parsed) 37 return Vector3f(result)
Vector 3 Float Add
Add two Vector 3s of Floats
Args: rhs: Graph of Vector3f
Returns: Graph: A graph node producing a Vector3f.
39 @staticmethod 40 def from_components(x, y, z) -> Vector3f: 41 """Vector 3 Float from Components 42 43 Given an x, y and z creates a vector floats. 44 45 Args: 46 x: Graph of Float 47 y: Graph of Float 48 z: Graph of Float 49 50 Returns: 51 Graph: A graph node producing a Vector3f. 52 """ 53 x_parsed = input_parsers.parse_float_graph(x) 54 y_parsed = input_parsers.parse_float_graph(y) 55 z_parsed = input_parsers.parse_float_graph(z) 56 result = _internal.vector3f_from_components_internal(x_parsed, y_parsed, z_parsed) 57 return Vector3f(result)
Vector 3 Float from Components
Given an x, y and z creates a vector floats.
Args: x: Graph of Float y: Graph of Float z: Graph of Float
Returns: Graph: A graph node producing a Vector3f.
59 def normalize(self) -> Vector3f: 60 """Vector 3 Normalize 61 62 Normalizes a Vector 3 Float. Converting it's length to 1. 63 64 Returns: 65 Graph: A graph node producing a Vector3f. 66 """ 67 vector_parsed = input_parsers.parse_graph(self) 68 result = _internal.vector3f_normalize_internal(vector_parsed) 69 return Vector3f(result)
Vector 3 Normalize
Normalizes a Vector 3 Float. Converting it's length to 1.
Returns: Graph: A graph node producing a Vector3f.
71 def x(self) -> float.Float: 72 """Vector 3D Float X 73 74 Gets the value in the x component for the provided vector 75 76 Returns: 77 Graph: A graph node producing a Float. 78 """ 79 vector_parsed = input_parsers.parse_graph(self) 80 result = _internal.vector3f_x_internal(vector_parsed) 81 from .float import Float 82 return Float(result)
Vector 3D Float X
Gets the value in the x component for the provided vector
Returns: Graph: A graph node producing a Float.
84 def y(self) -> float.Float: 85 """Vector 3D Y Float 86 87 Gets the value in the y component for the provided vector 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 vector_parsed = input_parsers.parse_graph(self) 93 result = _internal.vector3f_y_internal(vector_parsed) 94 from .float import Float 95 return Float(result)
Vector 3D Y Float
Gets the value in the y component for the provided vector
Returns: Graph: A graph node producing a Float.
97 def z(self) -> float.Float: 98 """Vector 3D Float Z 99 100 Gets the value in the z component for the provided vector 101 102 Returns: 103 Graph: A graph node producing a Float. 104 """ 105 vector_parsed = input_parsers.parse_graph(self) 106 result = _internal.vector3f_z_internal(vector_parsed) 107 from .float import Float 108 return Float(result)
Vector 3D Float Z
Gets the value in the z component for the provided vector
Returns: Graph: A graph node producing a Float.
11class Void(Object): 12 """The absence of a value""" 13 14 def execute(self, context): 15 return self._inner.execute(context)
The absence of a value
11class XYZ(Object): 12 """A color-format in the CIE XYZ color-format space.""" 13 14 def execute(self, context): 15 return self._inner.execute(context)
A color-format in the CIE XYZ color-format space.
17class XYZA(Object): 18 """A CIE XYZ color with an alpha component.""" 19 20 def execute(self, context): 21 return self._inner.execute(context) 22 23 def alpha(self) -> float.Float: 24 """XYZ Color Alpha 25 26 Gets the alpha component of an XYZ color with alpha. 27 28 Returns: 29 Graph: A graph node producing a Float. 30 """ 31 xyza_parsed = input_parsers.parse_graph(self) 32 result = _internal.x_y_z_a_alpha_internal(xyza_parsed) 33 from .float import Float 34 return Float(result) 35 36 @staticmethod 37 def from_components(x, y, z, alpha) -> XYZA: 38 """XYZ Color with Alpha from Components 39 40 Creates an XYZ color with alpha from its components. 41 42 Args: 43 x: Graph of Float 44 y: Graph of Float 45 z: Graph of Float 46 alpha: Graph of Float 47 48 Returns: 49 Graph: A graph node producing a XYZA. 50 """ 51 x_parsed = input_parsers.parse_float_graph(x) 52 y_parsed = input_parsers.parse_float_graph(y) 53 z_parsed = input_parsers.parse_float_graph(z) 54 alpha_parsed = input_parsers.parse_float_graph(alpha) 55 result = _internal.x_y_z_a_from_components_internal(x_parsed, y_parsed, z_parsed, alpha_parsed) 56 return XYZA(result) 57 58 def x(self) -> float.Float: 59 """XYZ Color X 60 61 Gets the X tristimulus value of an XYZ color with alpha. 62 63 Returns: 64 Graph: A graph node producing a Float. 65 """ 66 xyza_parsed = input_parsers.parse_graph(self) 67 result = _internal.x_y_z_a_x_internal(xyza_parsed) 68 from .float import Float 69 return Float(result) 70 71 def y(self) -> float.Float: 72 """XYZ Color Y 73 74 Gets the Y tristimulus value of an XYZ color with alpha. 75 76 Returns: 77 Graph: A graph node producing a Float. 78 """ 79 xyza_parsed = input_parsers.parse_graph(self) 80 result = _internal.x_y_z_a_y_internal(xyza_parsed) 81 from .float import Float 82 return Float(result) 83 84 def z(self) -> float.Float: 85 """XYZ Color Z 86 87 Gets the Z tristimulus value of an XYZ color with alpha. 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 xyza_parsed = input_parsers.parse_graph(self) 93 result = _internal.x_y_z_a_z_internal(xyza_parsed) 94 from .float import Float 95 return Float(result)
A CIE XYZ color with an alpha component.
23 def alpha(self) -> float.Float: 24 """XYZ Color Alpha 25 26 Gets the alpha component of an XYZ color with alpha. 27 28 Returns: 29 Graph: A graph node producing a Float. 30 """ 31 xyza_parsed = input_parsers.parse_graph(self) 32 result = _internal.x_y_z_a_alpha_internal(xyza_parsed) 33 from .float import Float 34 return Float(result)
XYZ Color Alpha
Gets the alpha component of an XYZ color with alpha.
Returns: Graph: A graph node producing a Float.
36 @staticmethod 37 def from_components(x, y, z, alpha) -> XYZA: 38 """XYZ Color with Alpha from Components 39 40 Creates an XYZ color with alpha from its components. 41 42 Args: 43 x: Graph of Float 44 y: Graph of Float 45 z: Graph of Float 46 alpha: Graph of Float 47 48 Returns: 49 Graph: A graph node producing a XYZA. 50 """ 51 x_parsed = input_parsers.parse_float_graph(x) 52 y_parsed = input_parsers.parse_float_graph(y) 53 z_parsed = input_parsers.parse_float_graph(z) 54 alpha_parsed = input_parsers.parse_float_graph(alpha) 55 result = _internal.x_y_z_a_from_components_internal(x_parsed, y_parsed, z_parsed, alpha_parsed) 56 return XYZA(result)
XYZ Color with Alpha from Components
Creates an XYZ color with alpha from its components.
Args: x: Graph of Float y: Graph of Float z: Graph of Float alpha: Graph of Float
Returns: Graph: A graph node producing a XYZA.
58 def x(self) -> float.Float: 59 """XYZ Color X 60 61 Gets the X tristimulus value of an XYZ color with alpha. 62 63 Returns: 64 Graph: A graph node producing a Float. 65 """ 66 xyza_parsed = input_parsers.parse_graph(self) 67 result = _internal.x_y_z_a_x_internal(xyza_parsed) 68 from .float import Float 69 return Float(result)
XYZ Color X
Gets the X tristimulus value of an XYZ color with alpha.
Returns: Graph: A graph node producing a Float.
71 def y(self) -> float.Float: 72 """XYZ Color Y 73 74 Gets the Y tristimulus value of an XYZ color with alpha. 75 76 Returns: 77 Graph: A graph node producing a Float. 78 """ 79 xyza_parsed = input_parsers.parse_graph(self) 80 result = _internal.x_y_z_a_y_internal(xyza_parsed) 81 from .float import Float 82 return Float(result)
XYZ Color Y
Gets the Y tristimulus value of an XYZ color with alpha.
Returns: Graph: A graph node producing a Float.
84 def z(self) -> float.Float: 85 """XYZ Color Z 86 87 Gets the Z tristimulus value of an XYZ color with alpha. 88 89 Returns: 90 Graph: A graph node producing a Float. 91 """ 92 xyza_parsed = input_parsers.parse_graph(self) 93 result = _internal.x_y_z_a_z_internal(xyza_parsed) 94 from .float import Float 95 return Float(result)
XYZ Color Z
Gets the Z tristimulus value of an XYZ color with alpha.
Returns: Graph: A graph node producing a Float.
19class AnyGraph(_GraphWrapper): 20 """The common base for every typed graph value""" 21 22 def execute(self, context): 23 return self._inner.execute(context) 24 25 @staticmethod 26 def if_(condition, fn) -> _IfOutputT: 27 """If 28 29 Selects one of two equally typed graph branches. 30 31 Args: 32 condition: Graph of Bool 33 fn: The function associated with this node. 34 35 Returns: 36 Graph: A graph node producing a Any. 37 """ 38 condition_parsed = input_parsers.parse_bool_graph(condition) 39 if not hasattr(fn, "__brushcue_make_graph__"): 40 raise TypeError("fn must be annotated with @brushcue_fn") 41 dispatched_graphs = fn.__brushcue_make_graph__([ 42 _internal.TypeDefinition.from_name("Any") 43 ]) 44 input_parsers.ensure_same_graph_type( 45 then, 46 otherwise 47 ) 48 result = _internal.if_internal(condition_parsed, *dispatched_graphs 49 ) 50 51 return input_parsers.resolve_output_graph( 52 result, 53 fn.__brushcue_output_graph__, 54 "Any", 55 )
The common base for every typed graph value
25 @staticmethod 26 def if_(condition, fn) -> _IfOutputT: 27 """If 28 29 Selects one of two equally typed graph branches. 30 31 Args: 32 condition: Graph of Bool 33 fn: The function associated with this node. 34 35 Returns: 36 Graph: A graph node producing a Any. 37 """ 38 condition_parsed = input_parsers.parse_bool_graph(condition) 39 if not hasattr(fn, "__brushcue_make_graph__"): 40 raise TypeError("fn must be annotated with @brushcue_fn") 41 dispatched_graphs = fn.__brushcue_make_graph__([ 42 _internal.TypeDefinition.from_name("Any") 43 ]) 44 input_parsers.ensure_same_graph_type( 45 then, 46 otherwise 47 ) 48 result = _internal.if_internal(condition_parsed, *dispatched_graphs 49 ) 50 51 return input_parsers.resolve_output_graph( 52 result, 53 fn.__brushcue_output_graph__, 54 "Any", 55 )
If
Selects one of two equally typed graph branches.
Args: condition: Graph of Bool fn: The function associated with this node.
Returns: Graph: A graph node producing a Any.
22class Stream(AnyGraph, Generic[_StreamItemT]): 23 """A generic stream in the graph""" 24 25 def execute(self, context): 26 return self._inner.execute(context) 27 28 def collect(self) -> list.List: 29 """Stream Collect 30 31 Collects a stream into a list 32 33 Returns: 34 Graph: A graph node producing a List. 35 """ 36 stream_parsed = input_parsers.parse_graph(self) 37 result = _internal.stream_collect_internal(stream_parsed) 38 return input_parsers.resolve_output_graph( 39 result, 40 self, 41 "List", 42 ) 43 44 def filter(self, fn) -> Stream[_StreamItemT]: 45 """Stream Filter 46 47 Performs a filter operation over a stream 48 49 Args: 50 fn: The function associated with this node. 51 52 Returns: 53 Graph: A graph node producing a Stream. 54 """ 55 stream_parsed = input_parsers.parse_graph(self) 56 if not hasattr(fn, "__brushcue_make_graph__"): 57 raise TypeError("fn must be annotated with @brushcue_fn") 58 dispatched_graphs = fn.__brushcue_make_graph__([ 59 _internal.TypeDefinition.from_name(self._resolved_type.__name__) 60 ]) 61 result = _internal.stream_filter_internal(stream_parsed, *dispatched_graphs 62 ) 63 64 return input_parsers.resolve_output_graph( 65 result, 66 self, 67 "Stream", 68 ) 69 70 def first(self) -> _StreamItemT: 71 """Stream First 72 73 Returns the first element of a stream 74 75 Returns: 76 Graph: A graph node producing a Object. 77 """ 78 stream_parsed = input_parsers.parse_graph(self) 79 result = _internal.stream_first_internal(stream_parsed) 80 return input_parsers.resolve_output_graph( 81 result, 82 self, 83 "Object", 84 ) 85 86 def fold(self, initial_accumulator: _StreamFoldOutputT, fn) -> _StreamFoldOutputT: 87 """Stream Fold 88 89 Folds the elements of a stream into an accumulator 90 91 Args: 92 initial_accumulator: Graph of Object 93 fn: The function associated with this node. 94 95 Returns: 96 Graph: A graph node producing a Object. 97 """ 98 stream_parsed = input_parsers.parse_graph(self) 99 initial_accumulator_parsed = input_parsers.parse_graph(initial_accumulator) 100 if not hasattr(fn, "__brushcue_make_graph__"): 101 raise TypeError("fn must be annotated with @brushcue_fn") 102 dispatched_graphs = fn.__brushcue_make_graph__([ 103 _internal.TypeDefinition.from_name("Object"), 104 _internal.TypeDefinition.from_name(self._resolved_type.__name__) 105 ]) 106 result = _internal.stream_fold_internal(stream_parsed, initial_accumulator_parsed, *dispatched_graphs 107 ) 108 109 return input_parsers.resolve_output_graph( 110 result, 111 initial_accumulator, 112 "Object", 113 ) 114 115 def map(self, fn) -> Stream[_StreamMapOutputT]: 116 """Stream Map 117 118 Performs a map operation over a stream 119 120 Args: 121 fn: The function associated with this node. 122 123 Returns: 124 Graph: A graph node producing a Stream. 125 """ 126 stream_parsed = input_parsers.parse_graph(self) 127 if not hasattr(fn, "__brushcue_make_graph__"): 128 raise TypeError("fn must be annotated with @brushcue_fn") 129 dispatched_graphs = fn.__brushcue_make_graph__([ 130 _internal.TypeDefinition.from_name(self._resolved_type.__name__) 131 ]) 132 result = _internal.stream_map_internal(stream_parsed, *dispatched_graphs 133 ) 134 135 return input_parsers.resolve_output_graph( 136 result, 137 fn.__brushcue_output_graph__, 138 "Stream", 139 )
A generic stream in the graph
28 def collect(self) -> list.List: 29 """Stream Collect 30 31 Collects a stream into a list 32 33 Returns: 34 Graph: A graph node producing a List. 35 """ 36 stream_parsed = input_parsers.parse_graph(self) 37 result = _internal.stream_collect_internal(stream_parsed) 38 return input_parsers.resolve_output_graph( 39 result, 40 self, 41 "List", 42 )
Stream Collect
Collects a stream into a list
Returns: Graph: A graph node producing a List.
44 def filter(self, fn) -> Stream[_StreamItemT]: 45 """Stream Filter 46 47 Performs a filter operation over a stream 48 49 Args: 50 fn: The function associated with this node. 51 52 Returns: 53 Graph: A graph node producing a Stream. 54 """ 55 stream_parsed = input_parsers.parse_graph(self) 56 if not hasattr(fn, "__brushcue_make_graph__"): 57 raise TypeError("fn must be annotated with @brushcue_fn") 58 dispatched_graphs = fn.__brushcue_make_graph__([ 59 _internal.TypeDefinition.from_name(self._resolved_type.__name__) 60 ]) 61 result = _internal.stream_filter_internal(stream_parsed, *dispatched_graphs 62 ) 63 64 return input_parsers.resolve_output_graph( 65 result, 66 self, 67 "Stream", 68 )
Stream Filter
Performs a filter operation over a stream
Args: fn: The function associated with this node.
Returns: Graph: A graph node producing a Stream.
70 def first(self) -> _StreamItemT: 71 """Stream First 72 73 Returns the first element of a stream 74 75 Returns: 76 Graph: A graph node producing a Object. 77 """ 78 stream_parsed = input_parsers.parse_graph(self) 79 result = _internal.stream_first_internal(stream_parsed) 80 return input_parsers.resolve_output_graph( 81 result, 82 self, 83 "Object", 84 )
Stream First
Returns the first element of a stream
Returns: Graph: A graph node producing a Object.
86 def fold(self, initial_accumulator: _StreamFoldOutputT, fn) -> _StreamFoldOutputT: 87 """Stream Fold 88 89 Folds the elements of a stream into an accumulator 90 91 Args: 92 initial_accumulator: Graph of Object 93 fn: The function associated with this node. 94 95 Returns: 96 Graph: A graph node producing a Object. 97 """ 98 stream_parsed = input_parsers.parse_graph(self) 99 initial_accumulator_parsed = input_parsers.parse_graph(initial_accumulator) 100 if not hasattr(fn, "__brushcue_make_graph__"): 101 raise TypeError("fn must be annotated with @brushcue_fn") 102 dispatched_graphs = fn.__brushcue_make_graph__([ 103 _internal.TypeDefinition.from_name("Object"), 104 _internal.TypeDefinition.from_name(self._resolved_type.__name__) 105 ]) 106 result = _internal.stream_fold_internal(stream_parsed, initial_accumulator_parsed, *dispatched_graphs 107 ) 108 109 return input_parsers.resolve_output_graph( 110 result, 111 initial_accumulator, 112 "Object", 113 )
Stream Fold
Folds the elements of a stream into an accumulator
Args: initial_accumulator: Graph of Object fn: The function associated with this node.
Returns: Graph: A graph node producing a Object.
115 def map(self, fn) -> Stream[_StreamMapOutputT]: 116 """Stream Map 117 118 Performs a map operation over a stream 119 120 Args: 121 fn: The function associated with this node. 122 123 Returns: 124 Graph: A graph node producing a Stream. 125 """ 126 stream_parsed = input_parsers.parse_graph(self) 127 if not hasattr(fn, "__brushcue_make_graph__"): 128 raise TypeError("fn must be annotated with @brushcue_fn") 129 dispatched_graphs = fn.__brushcue_make_graph__([ 130 _internal.TypeDefinition.from_name(self._resolved_type.__name__) 131 ]) 132 result = _internal.stream_map_internal(stream_parsed, *dispatched_graphs 133 ) 134 135 return input_parsers.resolve_output_graph( 136 result, 137 fn.__brushcue_output_graph__, 138 "Stream", 139 )
Stream Map
Performs a map operation over a stream
Args: fn: The function associated with this node.
Returns: Graph: A graph node producing a Stream.
21class List(AnyGraph, Generic[_ListItemT]): 22 """A generic list in the graph""" 23 24 def execute(self, context): 25 return self._inner.execute(context) 26 27 def append(self, element) -> List[_ListItemT]: 28 """List Append 29 30 Appends an element to a list 31 32 Args: 33 element: Graph of Object 34 35 Returns: 36 Graph: A graph node producing a List. 37 """ 38 list_parsed = input_parsers.parse_graph(self) 39 element_parsed = input_parsers.parse_graph(element) 40 result = _internal.list_append_internal(list_parsed, element_parsed) 41 return input_parsers.resolve_output_graph( 42 result, 43 self, 44 "List", 45 ) 46 47 def first(self) -> _ListItemT: 48 """List First 49 50 Returns the first element of a list 51 52 Returns: 53 Graph: A graph node producing a Object. 54 """ 55 list_parsed = input_parsers.parse_graph(self) 56 result = _internal.list_first_internal(list_parsed) 57 return input_parsers.resolve_output_graph( 58 result, 59 self, 60 "Object", 61 ) 62 63 def get(self, index) -> _ListItemT: 64 """List Get 65 66 Fetches the element of the list at a given index. 67 68 Args: 69 index: Graph of Int 70 71 Returns: 72 Graph: A graph node producing a Object. 73 """ 74 list_parsed = input_parsers.parse_graph(self) 75 index_parsed = input_parsers.parse_int_graph(index) 76 result = _internal.list_get_internal(list_parsed, index_parsed) 77 return input_parsers.resolve_output_graph( 78 result, 79 self, 80 "Object", 81 ) 82 83 def length(self) -> int.Int: 84 """List Length 85 86 Returns the number of elements in a list. 87 88 Returns: 89 Graph: A graph node producing a Int. 90 """ 91 list_parsed = input_parsers.parse_graph(self) 92 result = _internal.list_length_internal(list_parsed) 93 from .int import Int 94 return Int(result) 95 96 def to_stream(self) -> stream.Stream: 97 """List to Stream 98 99 Converts a list to a stream 100 101 Returns: 102 Graph: A graph node producing a Stream. 103 """ 104 list_parsed = input_parsers.parse_graph(self) 105 result = _internal.list_to_stream_internal(list_parsed) 106 return input_parsers.resolve_output_graph( 107 result, 108 self, 109 "Stream", 110 )
A generic list in the graph
27 def append(self, element) -> List[_ListItemT]: 28 """List Append 29 30 Appends an element to a list 31 32 Args: 33 element: Graph of Object 34 35 Returns: 36 Graph: A graph node producing a List. 37 """ 38 list_parsed = input_parsers.parse_graph(self) 39 element_parsed = input_parsers.parse_graph(element) 40 result = _internal.list_append_internal(list_parsed, element_parsed) 41 return input_parsers.resolve_output_graph( 42 result, 43 self, 44 "List", 45 )
List Append
Appends an element to a list
Args: element: Graph of Object
Returns: Graph: A graph node producing a List.
47 def first(self) -> _ListItemT: 48 """List First 49 50 Returns the first element of a list 51 52 Returns: 53 Graph: A graph node producing a Object. 54 """ 55 list_parsed = input_parsers.parse_graph(self) 56 result = _internal.list_first_internal(list_parsed) 57 return input_parsers.resolve_output_graph( 58 result, 59 self, 60 "Object", 61 )
List First
Returns the first element of a list
Returns: Graph: A graph node producing a Object.
63 def get(self, index) -> _ListItemT: 64 """List Get 65 66 Fetches the element of the list at a given index. 67 68 Args: 69 index: Graph of Int 70 71 Returns: 72 Graph: A graph node producing a Object. 73 """ 74 list_parsed = input_parsers.parse_graph(self) 75 index_parsed = input_parsers.parse_int_graph(index) 76 result = _internal.list_get_internal(list_parsed, index_parsed) 77 return input_parsers.resolve_output_graph( 78 result, 79 self, 80 "Object", 81 )
List Get
Fetches the element of the list at a given index.
Args: index: Graph of Int
Returns: Graph: A graph node producing a Object.
83 def length(self) -> int.Int: 84 """List Length 85 86 Returns the number of elements in a list. 87 88 Returns: 89 Graph: A graph node producing a Int. 90 """ 91 list_parsed = input_parsers.parse_graph(self) 92 result = _internal.list_length_internal(list_parsed) 93 from .int import Int 94 return Int(result)
List Length
Returns the number of elements in a list.
Returns: Graph: A graph node producing a Int.
96 def to_stream(self) -> stream.Stream: 97 """List to Stream 98 99 Converts a list to a stream 100 101 Returns: 102 Graph: A graph node producing a Stream. 103 """ 104 list_parsed = input_parsers.parse_graph(self) 105 result = _internal.list_to_stream_internal(list_parsed) 106 return input_parsers.resolve_output_graph( 107 result, 108 self, 109 "Stream", 110 )
List to Stream
Converts a list to a stream
Returns: Graph: A graph node producing a Stream.
18class Object(AnyGraph): 19 """An object whose concrete graph type is determined by context""" 20 21 def execute(self, context): 22 return self._inner.execute(context) 23 24 @staticmethod 25 def input(output_type: _internal.TypeDefinition) -> AnyGraph: 26 """Create a dispatched input with an explicit graph output type.""" 27 result = _internal.input_internal(output_type) 28 return input_parsers.wrap_graph_for_type_definition(result, output_type) 29 30 def to_list(self) -> list.List: 31 """Object to List 32 33 Converts an object to a list 34 35 Returns: 36 Graph: A graph node producing a List. 37 """ 38 object_parsed = input_parsers.parse_graph(self) 39 result = _internal.object_to_list_internal(object_parsed) 40 return input_parsers.resolve_output_graph( 41 result, 42 self, 43 "List", 44 ) 45 46 def to_stream(self) -> stream.Stream: 47 """Object to Stream 48 49 Converts an object to a stream 50 51 Returns: 52 Graph: A graph node producing a Stream. 53 """ 54 object_parsed = input_parsers.parse_graph(self) 55 result = _internal.object_to_stream_internal(object_parsed) 56 return input_parsers.resolve_output_graph( 57 result, 58 self, 59 "Stream", 60 )
An object whose concrete graph type is determined by context
24 @staticmethod 25 def input(output_type: _internal.TypeDefinition) -> AnyGraph: 26 """Create a dispatched input with an explicit graph output type.""" 27 result = _internal.input_internal(output_type) 28 return input_parsers.wrap_graph_for_type_definition(result, output_type)
Create a dispatched input with an explicit graph output type.
30 def to_list(self) -> list.List: 31 """Object to List 32 33 Converts an object to a list 34 35 Returns: 36 Graph: A graph node producing a List. 37 """ 38 object_parsed = input_parsers.parse_graph(self) 39 result = _internal.object_to_list_internal(object_parsed) 40 return input_parsers.resolve_output_graph( 41 result, 42 self, 43 "List", 44 )
Object to List
Converts an object to a list
Returns: Graph: A graph node producing a List.
46 def to_stream(self) -> stream.Stream: 47 """Object to Stream 48 49 Converts an object to a stream 50 51 Returns: 52 Graph: A graph node producing a Stream. 53 """ 54 object_parsed = input_parsers.parse_graph(self) 55 result = _internal.object_to_stream_internal(object_parsed) 56 return input_parsers.resolve_output_graph( 57 result, 58 self, 59 "Stream", 60 )
Object to Stream
Converts an object to a stream
Returns: Graph: A graph node producing a Stream.