OperatorsΒΆ
Operators for color and reposition effects.
- class lablib.operators.AYONOCIOLookProduct(ocioLookItems=<factory>, ocioLookWorkingSpace=<factory>)[source]ΒΆ
AYON ocioLook product dataclass
This class will hold all the necessary data for the ocioLook product, so it can be covered into FileTransform and ColorSpaceTransform during
AYONOCIOLookProduct.to_ocio_obj()
method.Example of input data
{ "ocioLookItems": [ { "name": "LUTfile", "file: "path/to/lut.cube", # currently created via processor "ext": "cube", "input_colorspace": { "colorspace": "Output - sRGB", "name": "color_picking", "type": "roles" }, "output_colorspace": { "colorspace": "ACES - ACEScc", "name": "color_timing", "type": "roles" }, "direction": "forward", "interpolation": "tetrahedral", "config_data": { "path": "path/to/config.ocio", "template": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio", "colorspace": "compositing_linear" }, }, ], "ocioLookWorkingSpace": { "colorspace": "ACES - ACEScg", "name": "compositing_linear", "type": "roles" }, },
- ocioLookItemsΒΆ
List of ocioLook items.
- Type:
List[dict]
- ocioLookWorkingSpaceΒΆ
The working space.
- Type:
dict
- classmethod from_node_data(data)[source]ΒΆ
Create
AYONOCIOLookProduct
from node data.- Parameters:
data (dict) β The node data.
- Returns:
The AYONOCIOLookProduct object.
- Return type:
- to_ocio_obj()[source]ΒΆ
Converts to list of native OCIO objects.
- Returns:
- The OCIO
ColorSpaceTransform and FileTransform objects in a list. The order of the objects is based on the order of the items in
ocioLookItems
.
- Return type:
List[Union[OCIO.ColorSpaceTransform, OCIO.FileTransform]]
- class lablib.operators.CornerPin2D(from1=<factory>, from2=<factory>, from3=<factory>, from4=<factory>, to1=<factory>, to2=<factory>, to3=<factory>, to4=<factory>)[source]ΒΆ
Operator for corner pinning images.
Danger
This operator is not yet tested or used in the codebase.
- from1ΒΆ
The first corner of the source image.
- Type:
List[float]
- from2ΒΆ
The second corner of the source image.
- Type:
List[float]
- from3ΒΆ
The third corner of the source image.
- Type:
List[float]
- from4ΒΆ
The fourth corner of the source image.
- Type:
List[float]
- to1ΒΆ
The first corner of the destination image.
- Type:
List[float]
- to2ΒΆ
The second corner of the destination image.
- Type:
List[float]
- to3ΒΆ
The third corner of the destination image.
- Type:
List[float]
- to4ΒΆ
The fourth corner of the destination image.
- Type:
List[float]
- classmethod from_node_data(data)[source]ΒΆ
Create
CornerPin2D
from node data.- dataΒΆ
The node data.
- Type:
dict
- Returns:
The corner pin object.
- Return type:
- class lablib.operators.Crop(box=<factory>)[source]ΒΆ
Operator for cropping images.
- boxΒΆ
The crop box.
- Type:
List[int]
- class lablib.operators.Mirror2(flop=False, flip=False)[source]ΒΆ
Operator for mirroring images.
Todo
This should be
Mirror2 -> Mirror2D
looking atCornerPin2D
.- flopΒΆ
Mirror vertically.
- Type:
bool
- flipΒΆ
Mirror horizontally.
- Type:
bool
- class lablib.operators.OCIOCDLTransform(file=None, direction=0, cccid='', offset=<factory>, power=<factory>, slope=<factory>, saturation=1.0, interpolation='linear')[source]ΒΆ
Foundry Hiero Timeline soft effect node class.
Note
Since this node class combines two of OCIO classes (FileTransform and CDLTransform), we will separate them here within
OCIOCDLTransform.to_ocio_obj()
.- fileΒΆ
Path to the LUT file.
- Type:
Optional[str]
- directionΒΆ
The direction. Defaults to 0.
- Type:
int
- cccidΒΆ
The cccid. Defaults to ββ.
- Type:
str
- offsetΒΆ
The offset. Defaults to [0.0, 0.0, 0.0].
- Type:
List[float]
- powerΒΆ
The power. Defaults to [1.0, 1.0, 1.0].
- Type:
List[float]
- slopeΒΆ
The slope. Defaults to [0.0, 0.0, 0.0].
- Type:
List[float]
- saturationΒΆ
The saturation. Defaults to 1.0.
- Type:
float
- interpolationΒΆ
The interpolation. Defaults to βlinearβ.
- Type:
str
- classmethod from_node_data(data)[source]ΒΆ
Create
OCIOCDLTransform
from node data.- Parameters:
data (dict) β
The node data. List of expected but not required keys: - file (str): Path to the LUT file. - direction (int): The direction.
Defaults to 0.
- cccid (str): The cccid.
Defaults to ββ.
- offset (List[float]): The offset.
Defaults to [0.0, 0.0, 0.0].
- power (List[float]): The power.
Defaults to [1.0, 1.0, 1.0].
- slope (List[float]): The slope.
Defaults to [0.0, 0.0, 0.0].
- saturation (float): The saturation.
Defaults to 1.0.
- interpolation (str): The interpolation.
Defaults to βlinearβ.
- Returns:
The OCIOCDLTransform object.
- Return type:
- class lablib.operators.OCIOColorSpace(in_colorspace='ACES - ACEScg', out_colorspace='ACES - ACEScg')[source]ΒΆ
Foundry Hiero Timeline soft effect node class.
- in_colorspaceΒΆ
The input colorspace. Defaults to βACES - ACEScgβ.
- Type:
str
- out_colorspaceΒΆ
The output colorspace. Defaults to βACES - ACEScgβ.
- Type:
str
- classmethod from_node_data(data)[source]ΒΆ
Create
OCIOColorSpace
from node data.- Parameters:
data (dict) β The node data.
- Return type:
- class lablib.operators.OCIOFileTransform(file='', cccid='', direction=0, interpolation='linear')[source]ΒΆ
Class for handling OCIO FileTransform effects.
Note
Reads Foundry Hiero Timeline soft effect node class.
- fileΒΆ
Path to the LUT file.
- Type:
str
- cccidΒΆ
Path to the cccid file.
- Type:
str
- directionΒΆ
The direction. Defaults to 0.
- Type:
int
- interpolationΒΆ
The interpolation. Defaults to βlinearβ.
- Type:
str
- classmethod from_node_data(data)[source]ΒΆ
Create
OCIOFileTransform
from node data.Note
Reads Foundry Hiero Timeline soft effect node data.
Would it be cool if weβd had a way to interface other DCC node data? Would they even be so much different?
- Parameters:
data (dict) β The node data. List of expected but not required keys: - file (str): Path to the LUT file. - cccid (str): Path to the cccid file. - direction (int): The direction. Defaults to 0. - interpolation (str): The interpolation. Defaults to βlinearβ.
- Returns:
The OCIOFileTransform object.
- Return type:
- class lablib.operators.Transform(translate=<factory>, rotate=0.0, scale=<factory>, center=<factory>, invert=False, skewX=0.0, skewY=0.0, skew_order='XY')[source]ΒΆ
Transform operator for repositioning images.
Note
The transformations are applied in the following order:
translate, rotate, scale, center, invert, skewX, skewY
.The
Transform.skew_order
parameter determines the order in which the skewX and skewY transformations are applied.- translateΒΆ
The translation vector.
- Type:
List[float]
- rotateΒΆ
The rotation angle in degrees.
- Type:
float
- scaleΒΆ
The scaling vector.
- Type:
List[float]
- centerΒΆ
The center of the transformation.
- Type:
List[float]
- invertΒΆ
Invert the transformation.
- Type:
bool
- skewXΒΆ
The skew in the X direction.
- Type:
float
- skewYΒΆ
The skew in the Y direction.
- Type:
float
- skew_orderΒΆ
The order in which the skewX and skewY transformations are applied.
- Type:
str
- classmethod from_node_data(data)[source]ΒΆ
Create a
Transform
object from node data.- dataΒΆ
The node data.
- Type:
dict
- Returns:
The transform object.
- Return type:
- to_oiio_args()[source]ΒΆ
Gets the arguments for
oiiotool
.Uses
lablib.lib
to work with transformation matrices.- Returns:
Arguments for OIIO.
- Return type:
List[str]