本文整理汇总了C++中ocio_namespace::ConstConfigRcPtr::serialize方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstConfigRcPtr::serialize方法的具体用法?C++ ConstConfigRcPtr::serialize怎么用?C++ ConstConfigRcPtr::serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ocio_namespace::ConstConfigRcPtr
的用法示例。
在下文中一共展示了ConstConfigRcPtr::serialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
if(convertsToLinear && convertsFromLinear)
{
std::cout << cs->getName() << std::endl;
}
else if(!convertsToLinear && !convertsFromLinear)
{
std::cout << cs->getName();
std::cout << " -- error" << std::endl;
std::cout << "\t" << convertsToLinearErrorText << std::endl;
std::cout << "\t" << convertsFromLinearErrorText << std::endl;
errorcount += 1;
}
else if(convertsToLinear)
{
std::cout << cs->getName();
std::cout << " -- input only" << std::endl;
}
else if(convertsFromLinear)
{
std::cout << cs->getName();
std::cout << " -- output only" << std::endl;
}
}
}
std::cout << std::endl;
std::cout << "** Looks **" << std::endl;
if(config->getNumLooks()>0)
{
for(int i=0; i<config->getNumLooks(); ++i)
{
std::cout << config->getLookNameByIndex(i) << std::endl;
}
}
else
{
std::cout << "no looks defined" << std::endl;
}
std::cout << std::endl;
std::cout << "** Sanity Check **" << std::endl;
try
{
config->sanityCheck();
std::cout << "passed" << std::endl;
}
catch(OCIO::Exception & exception)
{
std::cout << "ERROR" << std::endl;
errorcount += 1;
std::cout << exception.what() << std::endl;
}
if(!outputconfig.empty())
{
std::ofstream output;
output.open(outputconfig.c_str());
if(!output.is_open())
{
std::cout << "Error opening " << outputconfig << " for writing." << std::endl;
}
else
{
config->serialize(output);
output.close();
std::cout << "Wrote " << outputconfig << std::endl;
}
}
}
catch(OCIO::Exception & exception)
{
std::cout << "ERROR: " << exception.what() << std::endl;
return 1;
} catch (std::exception& exception) {
std::cout << "ERROR: " << exception.what() << "\n";
return 1;
}
catch(...)
{
std::cout << "Unknown error encountered." << std::endl;
return 1;
}
std::cout << std::endl;
if(errorcount == 0)
{
std::cout << "Tests complete." << std::endl << std::endl;
return 0;
}
else
{
std::cout << errorcount << " tests failed." << std::endl << std::endl;
return 1;
}
}