本文整理汇总了C++中ocio_namespace::ConstConfigRcPtr::getRoleName方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstConfigRcPtr::getRoleName方法的具体用法?C++ ConstConfigRcPtr::getRoleName怎么用?C++ ConstConfigRcPtr::getRoleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ocio_namespace::ConstConfigRcPtr
的用法示例。
在下文中一共展示了ConstConfigRcPtr::getRoleName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char **argv)
{
bool help = false;
int errorcount = 0;
std::string inputconfig;
std::string outputconfig;
ArgParse ap;
ap.options("ociocheck -- validate an OpenColorIO configuration\n\n"
"usage: ociocheck [options]\n",
"--help", &help, "Print help message",
"--iconfig %s", &inputconfig, "Input .ocio configuration file (default: $OCIO)",
"--oconfig %s", &outputconfig, "Output .ocio file",
NULL);
if (ap.parse(argc, argv) < 0)
{
std::cout << ap.geterror() << std::endl;
ap.usage();
std::cout << DESC_STRING;
return 1;
}
if (help)
{
ap.usage();
std::cout << DESC_STRING;
return 1;
}
try
{
OCIO::ConstConfigRcPtr config;
std::cout << std::endl;
std::cout << "OpenColorIO Library Version: " << OCIO::GetVersion() << std::endl;
std::cout << "OpenColorIO Library VersionHex: " << OCIO::GetVersionHex() << std::endl;
if(!inputconfig.empty())
{
std::cout << "Loading " << inputconfig << std::endl;
config = OCIO::Config::CreateFromFile(inputconfig.c_str());
}
else if(getenv("OCIO"))
{
std::cout << "Loading $OCIO " << getenv("OCIO") << std::endl;
config = OCIO::Config::CreateFromEnv();
}
else
{
std::cout << "ERROR: You must specify an input OCIO configuration ";
std::cout << "(either with --iconfig or $OCIO).\n";
ap.usage ();
std::cout << DESC_STRING;
return 1;
}
std::cout << std::endl;
std::cout << "** General **" << std::endl;
std::cout << "Search Path: " << config->getSearchPath() << std::endl;
std::cout << "Working Dir: " << config->getWorkingDir() << std::endl;
std::cout << std::endl;
std::cout << "Default Display: " << config->getDefaultDisplay() << std::endl;
std::cout << "Default View: " << config->getDefaultView(config->getDefaultDisplay()) << std::endl;
{
std::cout << std::endl;
std::cout << "** Roles **" << std::endl;
std::set<std::string> usedroles;
const char * allroles[] = { OCIO::ROLE_DEFAULT, OCIO::ROLE_SCENE_LINEAR,
OCIO::ROLE_DATA, OCIO::ROLE_REFERENCE,
OCIO::ROLE_COMPOSITING_LOG, OCIO::ROLE_COLOR_TIMING,
OCIO::ROLE_COLOR_PICKING,
OCIO::ROLE_TEXTURE_PAINT, OCIO::ROLE_MATTE_PAINT,
NULL };
int MAXROLES=256;
for(int i=0;i<MAXROLES; ++i)
{
const char * role = allroles[i];
if(!role) break;
usedroles.insert(role);
OCIO::ConstColorSpaceRcPtr cs = config->getColorSpace(role);
if(cs)
{
std::cout << cs->getName() << " (" << role << ")" << std::endl;
}
else
{
std::cout << "ERROR: NOT DEFINED" << " (" << role << ")" << std::endl;
errorcount += 1;
}
}
for(int i=0; i<config->getNumRoles(); ++i)
{
const char * role = config->getRoleName(i);
if(usedroles.find(role) != usedroles.end()) continue;
//.........这里部分代码省略.........