Cel Class Reference

The Cel JavaScript class. Adds file storage capabilities to cels. More...

Files

File imageFile ()
 Get a permanent copy of cel image file. This function without parameters is valid only for ports that point to a physically valid file on disk. More...
 
File imageFile (const String &name)
 Get a permanent copy of cel image file of specific format. More...
 
File imageFileAs (const String &name, const String &formatstring, const String &optionstring)
 Get a permanent copy of cel image file of specific format. More...
 
File workingCopy ()
 Get a temporary copy of cel image file. More...
 
File workingCopyAs (const String &ext, const String &formatstring=String(), const String &optionstring=String())
 Get a temporary copy of cel image file of specific format. More...
 
void setEmpty ()
 Set wrapped cel as empty. More...
 
QList< int > allocatedRect ()
 Retrieve allocated area of sparse image. Is equal to full area for non-sparse images. More...
 
QList< int > rect ()
 Retrieve full area of image. More...
 
bool isCel3D () const
 
bool convertColorSpace (const String &fromColorSpace, const String &toColorSpace)
 Convert cel colour space. More...
 

Detailed Description

The Cel JavaScript class. Adds file storage capabilities to cels.

A cel JavaScript object can be obtained by calling InputPort::getCel()

Member Function Documentation

◆ allocatedRect

QList<int> Cel::allocatedRect ( )
slot

Retrieve allocated area of sparse image. Is equal to full area for non-sparse images.

Returns
Allocated rect. 4-tuple (x1, y1, width, height).

◆ convertColorSpace

bool Cel::convertColorSpace ( const String &  fromColorSpace,
const String &  toColorSpace 
)
slot

Convert cel colour space.

Parameters
fromColorSpacethe name of the colour space to convert from.
toColorSpacethe name of the colour space to convert to.
Returns
True if success, false if specified colour space names are not supported.
inputport = Context.input();
cel = inputport.getCel();
// Apply colour space conversion
cel.convertColorSpace("Linear", "Rec.709");
// Save cel image as a file
cel.imageFile( "c:/tmp/image.png");
// Set modified cel for output port
outputport = Context.output();
outputport.setCel(cel);

◆ imageFile [1/2]

File Cel::imageFile ( )
slot

Get a permanent copy of cel image file. This function without parameters is valid only for ports that point to a physically valid file on disk.

Returns
File

◆ imageFile [2/2]

File Cel::imageFile ( const String &  name)
slot

Get a permanent copy of cel image file of specific format.

Parameters
nameName of file to create
Returns
File

◆ imageFileAs

File Cel::imageFileAs ( const String &  name,
const String &  formatstring,
const String &  optionstring 
)
slot

Get a permanent copy of cel image file of specific format.

Parameters
nameName of file to create
formatstringFormat to convert image into
optionstringImage extension specific option (ie. TGA, TGA3, TGA4, SGIDP)
Returns
File

◆ isCel3D

bool Cel::isCel3D ( ) const
slot

◆ rect

QList<int> Cel::rect ( )
slot

Retrieve full area of image.

Returns
Full rect. 4-tuple (x1, y1, width, height).

◆ setEmpty

void Cel::setEmpty ( )
slot

Set wrapped cel as empty.

◆ workingCopy

File Cel::workingCopy ( )
slot

Get a temporary copy of cel image file.

Returns
File

◆ workingCopyAs

File Cel::workingCopyAs ( const String &  ext,
const String &  formatstring = String(),
const String &  optionstring = String() 
)
slot

Get a temporary copy of cel image file of specific format.

Parameters
extExtension of image file to create
formatstringFormat to convert image into
optionstringImage extension specific option
Returns
File