| 575 | |
| 576 | template<typename T> |
| 577 | T CalcMagnitude(UserData* pUserData) { |
| 578 | T sum = T(); |
| 579 | i32 bufSize = pUserData->width * pUserData->height; |
| 580 | for (i32 i = 0; i < bufSize; i++) { |
| 581 | T* pData = (T*)pUserData->pData; |
| 582 | T elem = pData[i]; |
| 583 | sum += elem*elem; |
| 584 | } |
| 585 | return (T)sqrtf((f32)sum); |
| 586 | } |
| 587 | |
| 588 | // *********************************************************************** |
| 589 |
nothing calls this directly
no outgoing calls
no test coverage detected