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

Function IsM44Identity

src/OpenColorIO/MathUtils.cpp:163–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162template<typename T>
163bool IsM44Identity(const T * m44)
164{
165 static_assert(std::is_floating_point<T>::value,
166 "Only single and double precision floats are supported");
167
168 unsigned int index=0;
169
170 for(unsigned int j=0; j<4; ++j)
171 {
172 for(unsigned int i=0; i<4; ++i)
173 {
174 index = 4*j+i;
175
176 if(i==j)
177 {
178 if(!IsScalarEqualToOne(m44[index])) return false;
179 }
180 else
181 {
182 if(!IsScalarEqualToZero(m44[index])) return false;
183 }
184 }
185 }
186
187 return true;
188}
189
190template bool IsM44Identity(const float * m44);
191template bool IsM44Identity(const double * m44);

Callers 1

saveFunction · 0.85

Calls 2

IsScalarEqualToOneFunction · 0.85
IsScalarEqualToZeroFunction · 0.85

Tested by

no test coverage detected