MCPcopy Create free account
hub / github.com/crownengine/crown / edtaa3

Function edtaa3

3rdparty/bimg/src/image_encode.cpp:448–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446 }
447
448 static void edtaa3(bx::AllocatorI* _allocator, double* _dst, uint32_t _width, uint32_t _height, double* _src)
449 {
450 const uint32_t numPixels = _width*_height;
451
452 short* xdist = (short *)bx::alloc(_allocator, numPixels*sizeof(short) );
453 short* ydist = (short *)bx::alloc(_allocator, numPixels*sizeof(short) );
454 double* gx = (double*)bx::alloc(_allocator, numPixels*sizeof(double) );
455 double* gy = (double*)bx::alloc(_allocator, numPixels*sizeof(double) );
456
457 ::computegradient(_src, _width, _height, gx, gy);
458 ::edtaa3(_src, gx, gy, _width, _height, xdist, ydist, _dst);
459
460 for (uint32_t ii = 0; ii < numPixels; ++ii)
461 {
462 if (_dst[ii] < 0.0)
463 {
464 _dst[ii] = 0.0;
465 }
466 }
467
468 bx::free(_allocator, xdist);
469 bx::free(_allocator, ydist);
470 bx::free(_allocator, gx);
471 bx::free(_allocator, gy);
472 }
473
474 void imageMakeDist(bx::AllocatorI* _allocator, void* _dst, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src)
475 {

Callers 1

imageMakeDistFunction · 0.70

Calls 3

allocFunction · 0.85
computegradientFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected