| 389 | } |
| 390 | |
| 391 | void LogRenderer::apply(const void * inImg, void * outImg, long numPixels) const |
| 392 | { |
| 393 | static constexpr float minValue = std::numeric_limits<float>::min(); |
| 394 | |
| 395 | const float * in = (const float *)inImg; |
| 396 | float * out = (float *)outImg; |
| 397 | |
| 398 | for (long idx = 0; idx<numPixels; ++idx) |
| 399 | { |
| 400 | const float alphares = in[3]; |
| 401 | |
| 402 | // NB: 'in' and 'out' could be pointers to the same memory buffer. |
| 403 | std::memcpy(out, in, 4 * sizeof(float)); |
| 404 | |
| 405 | ApplyMax(out, minValue); |
| 406 | ApplyLog2(out); |
| 407 | ApplyScale(out, m_logScale); |
| 408 | |
| 409 | out[3] = alphares; |
| 410 | |
| 411 | in += 4; |
| 412 | out += 4; |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | #if OCIO_USE_SSE2 |
| 417 | LogRendererSSE::LogRendererSSE(ConstLogOpDataRcPtr & log, float logScale) |
nothing calls this directly
no test coverage detected