FileTransform interface changes


Malcolm Humphreys <malcolmh...@...>
 

Hi,

As we are fast approaching 1.0 I know it's a bit late in the day for some API changes. But I noticed these while doing the JNI wrapping for the android port some things which would be really good to change before 1.0.

Could we add the following to control the interpolation of the shaper lut

Interpolation FileTransform::getShaperInterpolation() const;
void FileTransform::setShaperInterpolation(Interpolation interp);
bool FileTransform::hasShaper();

Also these seem a bit smelly and very format specific in the current interface.

FileTransform::getCCCId();
FileTransform::setCCCId(const char * id);

Could this be replaced with some kind of key, type, value interface.

Maybe along the lines of (I would think the order of vars/parameters would be important for ui's which is why it's all index based):

int FileTransform::getNumVars();
VarType FileTransform::getVarType(int index);
const char * FileTransform::getVarName(int index);
int FileTransform::getVarIndex(const char * name);

void FileTransform::setStringVar(int index, const char * value);
const char * FileTransform::getStringVar(int index);

void FileTransform::setFloatVar(int index, float value);
float FileTransform::getFloatVar(int index);

enum VarType
{
        VAR_TYPE_NONE = 0,
        VAR_TYPE_STRING = 1,
        VAR_TYPE_FLOAT = 2
};

eg.
--snip--
int index = ptr->getVarIndex("CCCId");
if(ptr->getVarType(index) == VAR_TYPE_STRING)
ptr->setStringVar(, "MYSHOTCCC");
--snip--

This would allow me to move the ICCTransfrom code into a FileTransform impl which would be nice.

If your down with the idea I'm happy to whip something up when I have sometime after work.

.malcolm

Join ocio-dev@lists.aswf.io to automatically receive all group messages.