本文整理汇总了C++中ocio_namespace::ConstConfigRcPtr::getDefaultView方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstConfigRcPtr::getDefaultView方法的具体用法?C++ ConstConfigRcPtr::getDefaultView怎么用?C++ ConstConfigRcPtr::getDefaultView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ocio_namespace::ConstConfigRcPtr
的用法示例。
在下文中一共展示了ConstConfigRcPtr::getDefaultView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayDevice_CB
void displayDevice_CB(int id)
{
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
const char * display = config->getDisplay(id);
if(!display) return;
g_display = display;
const char * csname = config->getDisplayColorSpaceName(g_display.c_str(), g_transformName.c_str());
if(!csname)
{
g_transformName = config->getDefaultView(g_display.c_str());
}
UpdateOCIOGLState();
glutPostRedisplay();
}
示例2: InitOCIO
void InitOCIO(const char * filename)
{
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
g_display = config->getDefaultDisplay();
g_transformName = config->getDefaultView(g_display.c_str());
g_inputColorSpace = OCIO::ROLE_SCENE_LINEAR;
if(filename)
{
std::string cs = config->parseColorSpaceFromString(filename);
if(!cs.empty())
{
g_inputColorSpace = cs;
std::cout << "colorspace: " << cs << std::endl;
}
else
{
std::cout << "colorspace: " << g_inputColorSpace << " \t(could not determine from filename, using default)" << std::endl;
}
}
}
示例3: string
std::string
HdxColorCorrectionTask::_CreateOpenColorIOResources()
{
#ifdef PXR_OCIO_PLUGIN_ENABLED
// Use client provided OCIO values, or use default fallback values
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
const char* display = _displayOCIO.empty() ?
config->getDefaultDisplay() :
_displayOCIO.c_str();
const char* view = _viewOCIO.empty() ?
config->getDefaultView(display) :
_viewOCIO.c_str();
std::string inputColorSpace = _colorspaceOCIO;
if (inputColorSpace.empty()) {
OCIO::ConstColorSpaceRcPtr cs = config->getColorSpace("default");
if (cs) {
inputColorSpace = cs->getName();
} else {
inputColorSpace = OCIO::ROLE_SCENE_LINEAR;
}
}
// Setup the transformation we need to apply
OCIO::DisplayTransformRcPtr transform = OCIO::DisplayTransform::Create();
transform->setDisplay(display);
transform->setView(view);
transform->setInputColorSpaceName(inputColorSpace.c_str());
if (!_looksOCIO.empty()) {
transform->setLooksOverride(_looksOCIO.c_str());
transform->setLooksOverrideEnabled(true);
} else {
transform->setLooksOverrideEnabled(false);
}
OCIO::ConstProcessorRcPtr processor = config->getProcessor(transform);
// Create a GPU Shader Description
OCIO::GpuShaderDesc shaderDesc;
shaderDesc.setLanguage(OCIO::GPU_LANGUAGE_GLSL_1_0);
shaderDesc.setFunctionName("OCIODisplay");
shaderDesc.setLut3DEdgeLen(_lut3dSizeOCIO);
// Compute and the 3D LUT
int num3Dentries = 3 * _lut3dSizeOCIO*_lut3dSizeOCIO*_lut3dSizeOCIO;
std::vector<float> lut3d;
lut3d.resize(num3Dentries);
processor->getGpuLut3D(&lut3d[0], shaderDesc);
// Load the data into an OpenGL 3D Texture
if (_texture3dLUT != 0) {
glDeleteTextures(1, &_texture3dLUT);
}
GLint restoreTexture;
glGetIntegerv(GL_TEXTURE_BINDING_3D, &restoreTexture);
glGenTextures(1, &_texture3dLUT);
glBindTexture(GL_TEXTURE_3D, _texture3dLUT);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB32F,
_lut3dSizeOCIO, _lut3dSizeOCIO, _lut3dSizeOCIO,
0, GL_RGB, GL_FLOAT, &lut3d[0]);
glBindTexture(GL_TEXTURE_3D, restoreTexture);
const char* gpuShaderText = processor->getGpuShaderText(shaderDesc);
GLF_POST_PENDING_GL_ERRORS();
return std::string(gpuShaderText);
#else
return std::string();
#endif
}
示例4: 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;
//.........这里部分代码省略.........