Imath — Support types for OpenEXR library

class Imath.Box(min=None, max=None)
Box is a 2D box, specified by its two corners min and max, both of which are point
class Imath.Box2f(min=None, max=None)
Box2f is a 2D box, specified by its two corners min and max.
class Imath.Box2i(min=None, max=None)
Box2i is a 2D box, specified by its two corners min and max.
class Imath.Channel(type=HALF, xSampling=1, ySampling=1)

Channel defines the type and spatial layout of a channel. type is a PixelType. xSampling is the number of X-axis pixels between samples. ySampling is the number of Y-axis pixels between samples.

>>> import Imath
>>> print Imath.Channel(Imath.PixelType(Imath.PixelType.FLOAT), 4, 4)
FLOAT (4, 4)
class Imath.Compression(v)

Compression can have possible values: NO_COMPRESSION, RLE_COMPRESSION, ZIPS_COMPRESSION, ZIP_COMPRESSION, PIZ_COMPRESSION, PXR24_COMPRESSION.

>>> import Imath
>>> print Imath.Compression(Imath.Compression.RLE_COMPRESSION)
RLE_COMPRESSION
class Imath.LineOrder(v)

LineOrder can have three possible values: INCREASING_Y, DECREASING_Y, RANDOM_Y.

>>> import Imath
>>> print Imath.LineOrder(Imath.LineOrder.DECREASING_Y)
DECREASING_Y
class Imath.PixelType(v)

PixelType can have possible values UINT, HALF, FLOAT.

>>> import Imath
>>> print Imath.PixelType(Imath.PixelType.HALF)
HALF
class Imath.PreviewImage(width, height, pixels)

PreviewImage is a small preview image, intended as a thumbnail version of the full image. The image has size (width, height) and 8-bit pixel values are given by string pixels in RGBA order from top-left to bottom-right.

For example, to create a preview image from a JPEG file using the popular Python Imaging Library:

>>> import Image
>>> import Imath
>>> im = Image.open("lena.jpg").resize((100, 100)).convert("RGBA")
>>> print Imath.PreviewImage(im.size[0], im.size[1], im.tostring())
<Imath.PreviewImage instance 100x100>
class Imath.V2f(x, y)
V2f is a 2D point, with members x and y.
class Imath.V2i(x, y)
V2i is a 2D point, with members x and y.
class Imath.point(x, y)
Point is a 2D point, with members x and y.

Previous topic

OpenEXR — Read and write EXR format images

This Page