本文整理汇总了C++中ocio_namespace::FileTransformRcPtr类的典型用法代码示例。如果您正苦于以下问题:C++ FileTransformRcPtr类的具体用法?C++ FileTransformRcPtr怎么用?C++ FileTransformRcPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FileTransformRcPtr类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFileTransform
OCIO_ADD_GPU_TEST(Lut1DOp, scale_lut1d_4_generic_shader)
{
OCIO::FileTransformRcPtr file = GetFileTransform("lut1d_4.spi1d");
OCIO::GpuShaderDescRcPtr shaderDesc = OCIO::GpuShaderDesc::CreateShaderDesc();
test.setContext(file->createEditableCopy(), shaderDesc);
test.setErrorThreshold(1e-4f);
}
示例2: _validate
void OCIOFileTransform::_validate(bool for_real)
{
if(!m_file)
{
error("The source file must be specified.");
return;
}
try
{
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create();
transform->setSrc(m_file);
transform->setCCCId(m_cccid.c_str());
if(m_dirindex == 0) transform->setDirection(OCIO::TRANSFORM_DIR_FORWARD);
else transform->setDirection(OCIO::TRANSFORM_DIR_INVERSE);
if(m_interpindex == 0) transform->setInterpolation(OCIO::INTERP_NEAREST);
else if(m_interpindex == 1) transform->setInterpolation(OCIO::INTERP_LINEAR);
else if(m_interpindex == 2) transform->setInterpolation(OCIO::INTERP_TETRAHEDRAL);
else if(m_interpindex == 3) transform->setInterpolation(OCIO::INTERP_BEST);
else
{
// Should never happen
error("Interpolation value out of bounds");
return;
}
m_processor = config->getProcessor(transform, OCIO::TRANSFORM_DIR_FORWARD);
}
catch(OCIO::Exception &e)
{
error(e.what());
return;
}
if(m_processor->isNoOp())
{
set_out_channels(DD::Image::Mask_None); // prevents engine() from being called
} else {
set_out_channels(DD::Image::Mask_All);
}
DD::Image::PixelIop::_validate(for_real);
}
示例3: _validate
void OCIOFileTransform::_validate(bool for_real)
{
input0().validate(for_real);
if(!src)
{
error("The source file must be specified.");
return;
}
try
{
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
config->sanityCheck();
OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create();
transform->setSrc(src);
// TODO: For some reason, cccid is NOT incorporated in this node's hash.
// Until then, cccid is considered broken. Figure out why.
transform->setCCCId(cccid.c_str());
if(dirindex == 0) transform->setDirection(OCIO::TRANSFORM_DIR_FORWARD);
else transform->setDirection(OCIO::TRANSFORM_DIR_INVERSE);
if(interpindex == 0) transform->setInterpolation(OCIO::INTERP_NEAREST);
else transform->setInterpolation(OCIO::INTERP_LINEAR);
processor = config->getProcessor(transform, OCIO::TRANSFORM_DIR_FORWARD);
}
catch(OCIO::Exception &e)
{
error(e.what());
return;
}
if(processor->isNoOp())
{
// TODO or call disable() ?
set_out_channels(DD::Image::Mask_None); // prevents engine() from being called
copy_info();
return;
}
set_out_channels(DD::Image::Mask_All);
DD::Image::PixelIop::_validate(for_real);
}
示例4: arg
OCIO::GroupTransformRcPtr
parse_luts(int argc, const char *argv[])
{
OCIO::GroupTransformRcPtr groupTransform = OCIO::GroupTransform::Create();
const char *lastCCCId = NULL; // Ugly to use this but using GroupTransform::getTransform()
// returns a const object so we must set this
// prior to using --lut for now.
for(int i=0; i<argc; ++i)
{
std::string arg(argv[i]);
if(arg == "--lut" || arg == "-lut")
{
if(i+1>=argc)
{
throw OCIO::Exception("Error parsing --lut. Invalid num args");
}
OCIO::FileTransformRcPtr t = OCIO::FileTransform::Create();
t->setSrc(argv[i+1]);
t->setInterpolation(OCIO::INTERP_BEST);
if (lastCCCId)
{
t->setCCCId(lastCCCId);
}
groupTransform->push_back(t);
i += 1;
}
else if(arg == "--cccid" || arg == "-cccid")
{
if(i+1>=argc)
{
throw OCIO::Exception("Error parsing --cccid. Invalid num args");
}
lastCCCId = argv[i+1];
i += 1;
}
else if(arg == "--invlut" || arg == "-invlut")
{
if(i+1>=argc)
{
throw OCIO::Exception("Error parsing --invlut. Invalid num args");
}
OCIO::FileTransformRcPtr t = OCIO::FileTransform::Create();
t->setSrc(argv[i+1]);
t->setInterpolation(OCIO::INTERP_BEST);
t->setDirection(OCIO::TRANSFORM_DIR_INVERSE);
groupTransform->push_back(t);
i += 1;
}
else if(arg == "--slope" || arg == "-slope")
{
if(i+3>=argc)
{
throw OCIO::Exception("Error parsing --slope. Invalid num args");
}
OCIO::CDLTransformRcPtr t = OCIO::CDLTransform::Create();
float scale[3];
scale[0] = (float) atof(argv[i+1]);
scale[1] = (float) atof(argv[i+2]);
scale[2] = (float) atof(argv[i+3]);
t->setSlope(scale);
groupTransform->push_back(t);
i += 3;
}
else if(arg == "--offset" || arg == "-offset")
{
if(i+3>=argc)
{
throw OCIO::Exception("Error parsing --offset. Invalid num args");
}
OCIO::CDLTransformRcPtr t = OCIO::CDLTransform::Create();
float offset[3];
offset[0] = (float) atof(argv[i+1]);
offset[1] = (float) atof(argv[i+2]);
offset[2] = (float) atof(argv[i+3]);
t->setOffset(offset);
groupTransform->push_back(t);
i += 3;
}
else if(arg == "--offset10" || arg == "-offset10")
{
if(i+3>=argc)
{
throw OCIO::Exception("Error parsing --offset10. Invalid num args");
}
OCIO::CDLTransformRcPtr t = OCIO::CDLTransform::Create();
//.........这里部分代码省略.........