MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / loadPivot

Function loadPivot

src/OpenColorIO/OCIOYaml.cpp:1568–1611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1566}
1567
1568inline void loadPivot(const YAML::Node & parent, const YAML::Node & node,
1569 double & val, bool & valLoaded,
1570 double & blackVal, bool & blackValLoaded,
1571 double & whiteVal, bool & whiteValLoaded)
1572{
1573 if (node.Type() == YAML::NodeType::Map)
1574 {
1575 for (Iterator iter = node.begin(); iter != node.end(); ++iter)
1576 {
1577 const std::string & key = iter->first.as<std::string>();
1578
1579 if (iter->second.IsNull() || !iter->second.IsDefined()) continue;
1580
1581 if (key == "contrast")
1582 {
1583 load(iter->second, val);
1584 valLoaded = true;
1585 }
1586 else if (key == "black")
1587 {
1588 load(iter->second, blackVal);
1589 blackValLoaded = true;
1590 }
1591 else if (key == "white")
1592 {
1593 load(iter->second, whiteVal);
1594 whiteValLoaded = true;
1595 }
1596 else
1597 {
1598 LogUnknownKeyWarning(node, iter->first);
1599 }
1600 }
1601
1602 if (!valLoaded && !blackValLoaded && !whiteValLoaded)
1603 {
1604 throwValueError(parent, "At least one of the pivot values must be provided.");
1605 }
1606 }
1607 else
1608 {
1609 throwValueError(parent, "The value needs to be a map.");
1610 }
1611}
1612
1613inline void loadClamp(const YAML::Node & parent, const YAML::Node & node,
1614 double & blackVal, bool & blackValLoaded,

Callers 1

loadFunction · 0.85

Calls 5

loadFunction · 0.85
LogUnknownKeyWarningFunction · 0.85
throwValueErrorFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected