Update ".gitignore" file.
[OpenColorIO-Configs.git] / aces_1.0.0 / python / util.py
1 import PyOpenColorIO as OCIO
2
3 #
4 # Utility classes and functions
5 #
6 class ColorSpace:
7     "A container for data needed to define an OCIO 'Color Space' "
8
9     def __init__(self, 
10         name, 
11         description=None, 
12         bitDepth=OCIO.Constants.BIT_DEPTH_F32,
13         equalityGroup=None,
14         family=None,
15         isData=False,
16         toReferenceTransforms=[],
17         fromReferenceTransforms=[],
18         allocationType=OCIO.Constants.ALLOCATION_UNIFORM,
19         allocationVars=[0.0, 1.0]):
20         "Initialize the standard class variables"
21         self.name = name
22         self.bitDepth=bitDepth
23         self.description = description
24         self.equalityGroup=equalityGroup
25         self.family=family 
26         self.isData=isData
27         self.toReferenceTransforms=toReferenceTransforms
28         self.fromReferenceTransforms=fromReferenceTransforms
29         self.allocationType=allocationType
30         self.allocationVars=allocationVars
31
32 # Create a 4x4 matrix (list) based on a 3x3 matrix (list) input
33 def mat44FromMat33(mat33):
34     return [mat33[0], mat33[1], mat33[2], 0.0, 
35             mat33[3], mat33[4], mat33[5], 0.0, 
36             mat33[6], mat33[7], mat33[8], 0.0, 
37             0,0,0,1.0]