Synergy Color Management Component - SDK -  2018.0.80
SYNCOLOR::Transform Class Referenceabstract

Color transform class. More...

Classes

class  ContentCallbacks
 Callback class for extracting color transform metadata. More...
 

Public Member Functions

virtual ~Transform ()
 Destructor. More...
 
virtual SYNCOLOR::TransformPtr clone () const =0
 Clone the Transform. More...
 
virtual const char * getId () const =0
 Color transform ID. More...
 
virtual SynStatus setId (const char *id)=0
 Set the color transform ID. More...
 
virtual const char * getUniqueId () const =0
 Transform unique ID. More...
 
virtual SynStatus setUniqueId (const char *id)=0
 Set the unique transform ID. More...
 
virtual const char * getName () const =0
 Transform name. More...
 
virtual void setName (const char *name)=0
 Set the color transform name. More...
 
virtual const char * getDescriptions () const =0
 Color transform description. More...
 
virtual void setDescription (const char *description)=0
 Set the transform description. More...
 
virtual const char * getInputDescriptor () const =0
 Color transform input description. More...
 
virtual void setInputDescriptor (const char *inDesc)=0
 Set the transform input description. More...
 
virtual const char * getOutputDescriptor () const =0
 Color transform output description. More...
 
virtual void setOutputDescriptor (const char *outDesc)=0
 Set the transform output description. More...
 
virtual SYNCOLOR::BitDepth getInputBitDepth () const =0
 Transform input bit depth. More...
 
virtual SYNCOLOR::BitDepth getOutputBitDepth () const =0
 Transform output bit depth. More...
 
virtual SYNCOLOR::PixelFormat getInputPixelFormat () const =0
 Transform input pixel format. More...
 
virtual SYNCOLOR::SynStatus setInputPixelFormat (SYNCOLOR::PixelFormat pf)=0
 Set the transform input pixel format. More...
 
virtual SYNCOLOR::PixelFormat getOutputPixelFormat () const =0
 Transform ouutput pixel format. More...
 
virtual SYNCOLOR::SynStatus setOutputPixelFormat (SYNCOLOR::PixelFormat pf)=0
 Set the transform output pixel format. More...
 
virtual SYNCOLOR::SynStatus setPixelFormats (SYNCOLOR::PixelFormat inPF, SYNCOLOR::PixelFormat outPF)=0
 Set both the input and the output pixel format. More...
 
virtual SYNCOLOR::SynStatus inverse (SYNCOLOR::TransformPtr &t) const =0
 Create the inverse transform. More...
 
virtual bool isInverseOf (const SYNCOLOR::TransformPtr &t) const =0
 Checks if a transform is the inverse of this instance. More...
 
virtual bool hasReferences () const =0
 Checks if this transform has references to resolve. More...
 
virtual bool hasAliasReferencesToResolve () const =0
 Checks if this transform has aliases to resolve. More...
 
virtual void extractContent (ContentCallbacks &callbacks) const =0
 Color transform metadata extraction. More...
 
virtual SynStatus setDynamicProperty (const DynamicProperty &prop)=0
 Set the value of a dynamic property. More...
 
virtual SynStatus getDynamicProperty (DynamicProperty &prop)=0
 Obtain a dynamic property value. More...
 
virtual const GPUAdaptorPtrgetGPUAdaptor () const =0
 Set the GPU Adaptor. More...
 
virtual SynStatus applyCPU (const void *srcBuf, const ROI &roi, void *dstBuf)=0
 Render the color transform to a memory buffer using the CPU renderer. You must call finalize on the transform before calling apply! More...
 
virtual SynStatus applyCPU (const void *srcBuf, unsigned srcRowSize, const ROI &roi, void *dstBuf, unsigned dstRowSize)=0
 Render the color transform to a padded memory buffer using the CPU renderer. You must call finalize on the transform before calling apply! More...
 
virtual void applyCPUSinglePixel (const void *srcBuf, void *dstBuf, unsigned x, unsigned y)=0
 Render the color transform for a single pixel using the CPU renderer. You must call finalize on the transform before calling apply! More...
 
virtual SynStatus applyGPU (unsigned inTexHandle, const SYNCOLOR::Vertices &texCoords, const SYNCOLOR::Vertices &screenCoords) const =0
 Render the color transform to the active render destination using the GPU renderer. You must call finalize on the transform before calling apply! More...
 

Detailed Description

Color transform class.

A color transform is a sequence of color operators to be applied to pixel values. Each operator can be one of many different types: a matrix, a 1-d LUT, a 3-d LUT, a gamma, and more. For more details on the structure of color transforms and for a list of color operators see the Autodesk Color Management Guide included with this SDK.

Constructor & Destructor Documentation

virtual SYNCOLOR::Transform::~Transform ( )
virtual

Destructor.

Member Function Documentation

virtual SYNCOLOR::TransformPtr SYNCOLOR::Transform::clone ( ) const
pure virtual

Clone the Transform.

Returns
TransformPtr containing a copy of the Transform.
virtual const char* SYNCOLOR::Transform::getId ( ) const
pure virtual

Color transform ID.

If the transform is read from a CTF file, the id can found in the XML description.

Returns
ID string. This string is not to be deleted.
virtual SynStatus SYNCOLOR::Transform::setId ( const char *  id)
pure virtual

Set the color transform ID.

Parameters
idNew transform ID.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual const char* SYNCOLOR::Transform::getUniqueId ( ) const
pure virtual

Transform unique ID.

This ID is different from the color transform ID above. It is used by the transform caching system.

Returns
Unique ID string. This string is not to be deleted.
virtual SynStatus SYNCOLOR::Transform::setUniqueId ( const char *  id)
pure virtual

Set the unique transform ID.

This method is used by the transform caching system and should not be used.

Parameters
idNew unique transform ID.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual const char* SYNCOLOR::Transform::getName ( ) const
pure virtual

Transform name.

This name is an optional attribute of the xml description in CTF files. The name empty string when not specified.

Returns
Name string. This char* is not to be deleted.
virtual void SYNCOLOR::Transform::setName ( const char *  name)
pure virtual

Set the color transform name.

Parameters
nameNew transform name.
virtual const char* SYNCOLOR::Transform::getDescriptions ( ) const
pure virtual

Color transform description.

The description is an optional segment of the CTF file. If more than one description entry is present in the file, the entries are separated by newlines in the returned string.

Returns
Concatenated descriptions string. This char* is not to be deleted. The char* is owned by a static string shared by all calls made to getDescriptions(). Returned value should be copied inside a new string if it needs to be preserved.
virtual void SYNCOLOR::Transform::setDescription ( const char *  description)
pure virtual

Set the transform description.

Parameters
descriptionNew transform description.
virtual const char* SYNCOLOR::Transform::getInputDescriptor ( ) const
pure virtual

Color transform input description.

This description is an optional element of the CTF file. If the description is not specified, the empty string is returned.

Returns
Input description string. This char* is not to be deleted.
virtual void SYNCOLOR::Transform::setInputDescriptor ( const char *  inDesc)
pure virtual

Set the transform input description.

Parameters
inDescNew input descriptor.
virtual const char* SYNCOLOR::Transform::getOutputDescriptor ( ) const
pure virtual

Color transform output description.

This description is an optional element of the CTF file. If the description is not specified, the empty string is returned.

Returns
Output description string. This char* is not to be deleted.
virtual void SYNCOLOR::Transform::setOutputDescriptor ( const char *  outDesc)
pure virtual

Set the transform output description.

Parameters
outDescNew output descriptor.
virtual SYNCOLOR::BitDepth SYNCOLOR::Transform::getInputBitDepth ( ) const
pure virtual

Transform input bit depth.

Returns
Input bit depth.
virtual SYNCOLOR::BitDepth SYNCOLOR::Transform::getOutputBitDepth ( ) const
pure virtual

Transform output bit depth.

Returns
Output bit depth.
virtual SYNCOLOR::PixelFormat SYNCOLOR::Transform::getInputPixelFormat ( ) const
pure virtual

Transform input pixel format.

Returns
Input pixel format.
virtual SYNCOLOR::SynStatus SYNCOLOR::Transform::setInputPixelFormat ( SYNCOLOR::PixelFormat  pf)
pure virtual

Set the transform input pixel format.

Parameters
pfNew input pixel format.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual SYNCOLOR::PixelFormat SYNCOLOR::Transform::getOutputPixelFormat ( ) const
pure virtual

Transform ouutput pixel format.

Returns
Output pixel format.
virtual SYNCOLOR::SynStatus SYNCOLOR::Transform::setOutputPixelFormat ( SYNCOLOR::PixelFormat  pf)
pure virtual

Set the transform output pixel format.

Parameters
pfNew output pixel format.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual SYNCOLOR::SynStatus SYNCOLOR::Transform::setPixelFormats ( SYNCOLOR::PixelFormat  inPF,
SYNCOLOR::PixelFormat  outPF 
)
pure virtual

Set both the input and the output pixel format.

Parameters
inPFNew input pixel format
outPFNew output pixel format
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual SYNCOLOR::SynStatus SYNCOLOR::Transform::inverse ( SYNCOLOR::TransformPtr t) const
pure virtual

Create the inverse transform.

Parameters
tReturn TransformPtr containing the inverse.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual bool SYNCOLOR::Transform::isInverseOf ( const SYNCOLOR::TransformPtr t) const
pure virtual

Checks if a transform is the inverse of this instance.

With the help of the transform IDs, this method determines whether a transform is the inverse of this one. This method is useful only if the two transforms originate from CTF files in the Autodesk color transform collection.

Parameters
tTransform to check against.
Returns
True if the supplied transform is the inverse of this one.
virtual bool SYNCOLOR::Transform::hasReferences ( ) const
pure virtual

Checks if this transform has references to resolve.

Returns
True if there are unresolved references.
virtual bool SYNCOLOR::Transform::hasAliasReferencesToResolve ( ) const
pure virtual

Checks if this transform has aliases to resolve.

Returns
true if there are unresolved aliase.
See also
finalize
virtual void SYNCOLOR::Transform::extractContent ( ContentCallbacks callbacks) const
pure virtual

Color transform metadata extraction.

Parameters
callbacksMetadata extraction callback class implementation instance.
virtual SynStatus SYNCOLOR::Transform::setDynamicProperty ( const DynamicProperty prop)
pure virtual

Set the value of a dynamic property.

Parameters
propProperty description.
See also
DynamicProperty.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred. If the property is not used by this transform instance, the error returned is ERR_PROPERTY_NOT_AVAILABLE.
virtual SynStatus SYNCOLOR::Transform::getDynamicProperty ( DynamicProperty prop)
pure virtual

Obtain a dynamic property value.

This method puts the return value in the value union based on the type provided in the DynamicProperty.

See also
Detailed description of DynamicProperty.
Parameters
propProperty instance.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred. If the property is not used by this transform instance, the error returned is ERR_PROPERTY_NOT_AVAILABLE.
virtual const GPUAdaptorPtr& SYNCOLOR::Transform::getGPUAdaptor ( ) const
pure virtual

Set the GPU Adaptor.

If GPU rendering is needed, an adaptor must be supplied to the color transform prior to the call to SYNCOLOR::finalize.

See also
Detailed description of GPUAdaptor.

Obtain the GPUAdaptor used by the transform..

Returns
A GPUAdaptorPtr containing the transform's GPUAdaptor.
virtual SynStatus SYNCOLOR::Transform::applyCPU ( const void *  srcBuf,
const ROI roi,
void *  dstBuf 
)
pure virtual

Render the color transform to a memory buffer using the CPU renderer. You must call finalize on the transform before calling apply!

Parameters
srcBufMemory area with the image to process. Must be of the appropriate input pixel format.
roiRegion of interest (ROI) to apply the transform to.
dstBufMemory area to write the transformed pixel values to. Must be of the appropriate output pixel format.
Note
If the input and output pixel formats are the same, the source and destination pointers can be the same (in-place processing).
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual SynStatus SYNCOLOR::Transform::applyCPU ( const void *  srcBuf,
unsigned  srcRowSize,
const ROI roi,
void *  dstBuf,
unsigned  dstRowSize 
)
pure virtual

Render the color transform to a padded memory buffer using the CPU renderer. You must call finalize on the transform before calling apply!

This version of applyCPU provides parameters to deal with images in padded memory buffers.

Parameters
srcBufMemory area with the image to process. Must be of the appropriate input pixel format.
srcRowSizeSource image row size in bytes.
roiRegion of interest (ROI) to apply the transform to.
dstBufMemory area to write the transformed pixel values to. Must be of the appropriate output pixel format.
dstRowSizeDestination image row size in bytes.
Note
If the input and output pixel formats and the row sizes are the same, the source and destination pointers can be the same (in-place processing).
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.
virtual void SYNCOLOR::Transform::applyCPUSinglePixel ( const void *  srcBuf,
void *  dstBuf,
unsigned  x,
unsigned  y 
)
pure virtual

Render the color transform for a single pixel using the CPU renderer. You must call finalize on the transform before calling apply!

Parameters
srcBufPointer to the pixel to process. Must be of the appropriate input pixel format.
dstBufPointer for where to put the output pixel value to. Must be of the appropriate output pixel format.
xis the column coordinate of the pixel location
yis the row coordinate of the pixel location
Note
If the input and output pixel formats are the same, the source and destination pointers can be the same (in-place processing).
virtual SynStatus SYNCOLOR::Transform::applyGPU ( unsigned  inTexHandle,
const SYNCOLOR::Vertices texCoords,
const SYNCOLOR::Vertices screenCoords 
) const
pure virtual

Render the color transform to the active render destination using the GPU renderer. You must call finalize on the transform before calling apply!

Using the GPUAdaptor::drawQuad method, the color transform is applied to the input texture specified and rendered into the active rendering destination.

Parameters
inTexHandleHandle to the texture to process.
texCoordsInput texture coordinates.
screenCoordsDestination coordinates.
Remarks
This method assumes normalized color values in the input texture.
Coordinates can be stored using a SYNCOLOR::Vertices or a SYNCOLOR::Rect as the vertices class accepts a class rect as input.
Returns
Returns a SYNCOLOR::SynStatus. Check the error code to determine if an error occurred.