| 346 | #if OCIO_USE_SSE2 |
| 347 | template<bool CLAMP> |
| 348 | void CDLRendererFwdSSE<CLAMP>::apply(const void * inImg, void * outImg, long numPixels) const |
| 349 | { |
| 350 | __m128 slope, offset, power, saturation, pix; |
| 351 | LoadRenderParams(this->m_renderParams, slope, offset, power, saturation); |
| 352 | |
| 353 | float inAlpha; |
| 354 | |
| 355 | const float * in = (const float *)inImg; |
| 356 | float * out = (float *)outImg; |
| 357 | |
| 358 | for(long idx=0; idx<numPixels; ++idx) |
| 359 | { |
| 360 | pix = LoadPixel(in, inAlpha); |
| 361 | |
| 362 | pix = _mm_mul_ps(pix, slope); |
| 363 | pix = _mm_add_ps(pix, offset); |
| 364 | |
| 365 | ApplyPower<CLAMP>(pix, power); |
| 366 | |
| 367 | ApplySaturation(pix, saturation); |
| 368 | ApplyClamp<CLAMP>(pix); |
| 369 | |
| 370 | StorePixel(out, pix, inAlpha); |
| 371 | |
| 372 | in += 4; |
| 373 | out += 4; |
| 374 | } |
| 375 | } |
| 376 | #endif |
| 377 | |
| 378 | template<bool CLAMP> |
no test coverage detected