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

Function GetSafeScalarInverse

src/OpenColorIO/MathUtils.cpp:94–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92template bool VecsEqualWithRelError(const double * v1, unsigned int size1, const double * v2, unsigned int size2, double e);
93
94float GetSafeScalarInverse(float v, float defaultValue)
95{
96 if(IsScalarEqualToZero(v)) return defaultValue;
97 return 1.0f / v;
98}
99
100bool VecContainsZero(const float* v, int size)
101{

Callers

nothing calls this directly

Calls 1

IsScalarEqualToZeroFunction · 0.85

Tested by

no test coverage detected