collada.material.CImage¶
- class collada.material.CImage(id, path, collada=None, xmlnode=None)¶
Class containing data coming from a <image> tag.
Basically is just the path to the file, but we give an extended functionality if PIL is available. You can in that case get the image object or numpy arrays in both int and float format. We named it CImage to avoid confusion with PIL’s Image class.
- __init__(id, path, collada=None, xmlnode=None)¶
Create an image object.
- Parameters:
id (str) – A unique string identifier for the image
path (str) – Path relative to the collada document where the image is located
collada (collada.Collada) – The collada object this image belongs to
xmlnode – If loaded from xml, the node this data comes from
Methods
__init__(id, path[, collada, xmlnode])Create an image object.
getData()getFloatArray()getImage()getUintArray()load(collada, localspace, node)Load and return a class instance from an XML node.
save()Saves the image back to
xmlnode.setData(data)Attributes
dataRaw binary image file data if the file is readable.
floatarrayNumpy float array (height, width, nchannels) with the image data normalized to 1.0.
pilimagePIL Image object if PIL is available and the file is readable.
uintarrayNumpy array (height, width, nchannels) in integer format.
xmlnodeElementTree representation of the image.
idThe unique string identifier for the image
pathPath relative to the collada document where the image is located