This method expects the image data to be in linear color space. It will not do any color space conversions for you; the data must be converted beforehand.
Usage ¶
createCOPImage(session: hapi.Session, parent_node_id: int, width: int, height: int, packing: hapi.imagePacking, flip_x: bool, flip_y: bool, data_array: list of float, start: int, length: int) → bool
Loads some raw image data into a COP node.
session
The session of Houdini you are interacting with. See hapi.Session for more on sessions. Pass None to just use the default in-process session.
parent_node_id
The node that the copnet containing the texture will be created in, or -1 if the parent is the image manager.
width
The width of the image in pixels. width height
channel count (implied by packing) should equal the size
of data_array.
height
The height of the image in pixels. width height
channel count (implied by packing) should equal the size
of data_array.
packing
How the image data is packed (single-channel, RBGA, etc).
flip_x
Whether to flip the image horizontally.
flip_y
Whether to flip the image vertically.
data_array
A float array representing the image’s pixel data. Values
should be between 0.0 and 1.0. The data should be packed
according to packing.
start
The index of the first value of data_array to use.
Must be at least 0 and at most (size of data_array - 1).
length
How much of data_array to use. Must be at least 0
and at most (size of data_array - start).