TileAssembler¶

class Draft.TileAssembler((object)arg1) → None

The Draft.TileAssembler class provides the ability to assemble images or portions of images, called tiles, into a single final image that will be written to a file on disk. Each tile is represented by a Draft.Image created from a filename and corresponds to an image file on disk. The image files on disk associated with the tiles must not be modified during the assembly process; doing so might lead to unexpected behavior.

New in version 1.3.

__init__( (object)arg1) -> None

AddTile((TileAssembler)self, (Image)image, (int)left, (int)bottom) → None :

Adds an image to be included in the assembled final image.

Arguments:

image
A Draft.Image created from a filename.
left
An integer number of pixels that denotes how far from the left the image should be offset.
bottom
An integer number of pixels that denotes how far from the bottom the image should be offset.

Usage:

tileAssembler = Draft.TileAssembler()

AssembleToFile((TileAssembler)self, (unicode)filename[, (ImageInfo)imageInfo=<Draft.ImageInfo object at 0x0000000005A333B8>]) → None :

Assembles the images added with the function Draft.TileAssembler.AddTile() to one single image which is written to a file on disk.

Arguments:

filename
A string value indicating where to save the file to.
imageInfo
Optional. A Draft.ImageInfo that determines saving properties. (Default is ‘None’.)

Usage:

tileAssembler = Draft.TileAssembler()
tileAssembler.AssembleToFile( "//path/to/final/image.exr" )

SetChannels((TileAssembler)self, (object)channels) → None :

Sets the channels of the final image.

Arguments:

channels
A list of (string) channel names to be included in the final image.

Usage:

tileAssembler = Draft.TileAssembler()
tileAssembler.SetChannels( ['R', 'G', 'B', 'A'] )

SetSize((TileAssembler)self, (int)width, (int)height) → None :

Sets the size of the final image.

Arguments:

width
An integer value indicating the width of the final image.
height
An integer value indicating the height of the final image.

Usage:

tileAssembler = Draft.TileAssembler()
tileAssembler.SetSize( 640, 480 )