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

Method hasAlpha

src/OpenColorIO/ops/matrix/MatrixOpData.cpp:587–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587bool MatrixOpData::hasAlpha() const
588{
589 const ArrayDouble & a = getArray();
590 const ArrayDouble::Values & m = a.getValues();
591
592 // Now check the diagonal elements.
593
594 static constexpr double maxDiff = 1e-6;
595
596 return
597
598 // Last column.
599 (m[3] != 0.0) || // Strict comparison intended
600 (m[7] != 0.0) ||
601 (m[11] != 0.0) ||
602
603 // Diagonal.
604 !EqualWithAbsError(m[15], 1.0, maxDiff) ||
605
606 // Bottom row.
607 (m[12] != 0.0) || // Strict comparison intended
608 (m[13] != 0.0) ||
609 (m[14] != 0.0) ||
610
611 // Alpha offset
612 (m_offsets[3] != 0.0);
613
614}
615
616MatrixOpDataRcPtr MatrixOpData::CreateDiagonalMatrix(double diagValue)
617{

Callers 3

writeContentMethod · 0.80
writeOpsMethod · 0.80
OCIO_ADD_TESTFunction · 0.80

Calls 2

EqualWithAbsErrorFunction · 0.85
getValuesMethod · 0.80

Tested by 1

OCIO_ADD_TESTFunction · 0.64