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

Function saveLogParam

src/OpenColorIO/OCIOYaml.cpp:2687–2706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2685}
2686
2687inline void saveLogParam(YAML::Emitter& out, const double(&param)[3],
2688 double defaultVal, const char * paramName)
2689{
2690 // (See test in Config_test.cpp that verifies double precision is preserved.)
2691 if (param[0] == param[1] && param[0] == param[2])
2692 {
2693 // Set defaultVal to NaN if there is no default value. It will always write param,
2694 // otherwise default params are not saved.
2695 if (param[0] != defaultVal)
2696 {
2697 out << YAML::Key << paramName << YAML::Value << param[0];
2698 }
2699 }
2700 else
2701 {
2702 std::vector<double> vals;
2703 vals.assign(param, param + 3);
2704 out << YAML::Key << paramName << YAML::Value << vals;
2705 }
2706}
2707
2708inline void save(YAML::Emitter& out, ConstLogAffineTransformRcPtr t)
2709{

Callers 1

saveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected