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

Method validate

src/OpenColorIO/ops/lut3d/Lut3DOpData.cpp:360–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360void Lut3DOpData::validate() const
361{
362 if (!IsValidInterpolation(m_interpolation))
363 {
364 std::ostringstream oss;
365 oss << "Lut3D does not support interpolation algorithm: ";
366 oss << InterpolationToString(getInterpolation());
367 oss << ".";
368 throw Exception(oss.str().c_str());
369 }
370
371 try
372 {
373 getArray().validate();
374 }
375 catch (const Exception& e)
376 {
377 std::ostringstream oss;
378 oss << "Lut3D content array issue: ";
379 oss << e.what();
380
381 throw Exception(oss.str().c_str());
382 }
383
384 if (getArray().getNumColorComponents() != 3)
385 {
386 throw Exception("Lut3D has an incorrect number of color components. ");
387 }
388
389 if (getArray().getLength()>Max3DLUTLength)
390 {
391 // This should never happen. Enforced by resize.
392 std::ostringstream oss;
393 oss << "Lut3D length: " << getArray().getLength();
394 oss << " is not supported. ";
395
396 throw Exception(oss.str().c_str());
397 }
398}
399
400bool Lut3DOpData::isNoOp() const
401{

Callers 1

BuildLut3DOpFunction · 0.45

Calls 3

InterpolationToStringFunction · 0.85
getNumColorComponentsMethod · 0.80
getLengthMethod · 0.45

Tested by

no test coverage detected