OperatorsΒΆ
Operators for color and reposition effects.
- class lablib.operators.BaseOperator[source]ΒΆ
Base class for all operators.
Currently this is only used for type checking.
- class lablib.operators.ColorOperator[source]ΒΆ
Base class for color operators.
Currently this is only used for type checking.
- abstract classmethod from_node_data(data)[source]ΒΆ
An abstract classmethod for returning a
ColorOperatorfrom node data.- Parameters:
data (dict) β The node data.
- Returns:
The color operator object.
- Return type:
- 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
CornerPin2Dfrom 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 -> Mirror2Dlooking atCornerPin2D.- flopΒΆ
Mirror vertically.
- Type:
bool
- flipΒΆ
Mirror horizontally.
- Type:
bool
- class lablib.operators.OCIOCDLTransform(file=None, cccid='', direction=0, interpolation='linear', offset=<factory>, power=<factory>, slope=<factory>, saturation=1.0)[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
- file = NoneΒΆ
- classmethod from_node_data(data)[source]ΒΆ
Create
OCIOCDLTransformfrom 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
OCIOColorSpacefrom 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
OCIOFileTransformfrom 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.RepositionOperator[source]ΒΆ
Base class for reposition operators.
Currently this is only used for type checking.
- 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_orderparameter 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
Transformobject 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.libto work with transformation matrices.- Returns:
Arguments for OIIO.
- Return type:
List[str]