Beispiel #1
0
 void GetCDLTransforms(CDLTransformMap & transformMap,
                       CDLTransformVec & transformVec,
                       TiXmlElement * cccRootElement)
 {
     if(!cccRootElement)
     {
         std::ostringstream os;
         os << "GetCDLTransforms Error. ";
         os << "Null cccRootElement.";
         throw Exception(os.str().c_str());
     }
         
     if(std::string(cccRootElement->Value()) != "ColorCorrectionCollection")
     {
         std::ostringstream os;
         os << "GetCDLTransforms Error. ";
         os << "Root element is type '" << cccRootElement->Value() << "', ";
         os << "ColorCorrectionCollection expected.";
         throw Exception(os.str().c_str());
     }
     
     TiXmlNode * child = cccRootElement->FirstChild("ColorCorrection");
     while(child)
     {
         CDLTransformRcPtr transform = CDLTransform::Create();
         LoadCDL(transform.get(), child->ToElement());
         
         transformVec.push_back(transform);
         
         std::string id = transform->getID();
         if(!id.empty())
         {
             CDLTransformMap::iterator iter = transformMap.find(id);
             if(iter != transformMap.end())
             {
                 std::ostringstream os;
                 os << "Error loading ccc xml. ";
                 os << "Duplicate elements with '" << id << "' found. ";
                 os << "If id is specified, it must be unique.";
                 throw Exception(os.str().c_str());
             }
             
             transformMap[id] = transform;
         }
         
         child = child->NextSibling("ColorCorrection");
     }
 }
Beispiel #2
0
 void GetCDLTransforms(CDLTransformMap & transforms,
                       TiXmlElement * cccRootElement)
 {
     if(std::string(cccRootElement->Value()) != "ColorCorrectionCollection")
     {
         std::ostringstream os;
         os << "GetCDLTransforms Error. ";
         os << "Root element is type '" << cccRootElement->Value() << "', ";
         os << "ColorCorrectionCollection expected.";
         throw Exception(os.str().c_str());
     }
     
     TiXmlNode * child = cccRootElement->FirstChild("ColorCorrection");
     while(child)
     {
         CDLTransformRcPtr transform = CDLTransform::Create();
         LoadCDL(transform.get(), child->ToElement());
         
         std::string id = transform->getID();
         if(id.empty())
         {
             std::ostringstream os;
             os << "Error loading ccc xml, ";
             os << "All ASC ColorCorrections must specify an 'id' value.";
             throw Exception(os.str().c_str());
         }
         
         CDLTransformMap::iterator iter = transforms.find(id);
         if(iter != transforms.end())
         {
             std::ostringstream os;
             os << "Error loading ccc xml. ";
             os << "All ASC ColorCorrections must specify a unique 'id' value. ";
             os << "Duplicate elements with '" << id << "' found.";
             throw Exception(os.str().c_str());
         }
         
         transforms[id] = transform;
         
         child = child->NextSibling("ColorCorrection");
     }
 }