void dng_opcode_MapTable::ProcessArea (dng_negative & /* negative */, uint32 /* threadIndex */, dng_pixel_buffer &buffer, const dng_rect &dstArea, const dng_rect & /* imageBounds */) { dng_rect overlap = fAreaSpec.Overlap (dstArea); if (overlap.NotEmpty ()) { for (uint32 plane = fAreaSpec.Plane (); plane < fAreaSpec.Plane () + fAreaSpec.Planes () && plane < buffer.Planes (); plane++) { DoMapArea16 (buffer.DirtyPixel_uint16 (overlap.t, overlap.l, plane), 1, (overlap.H () + fAreaSpec.RowPitch () - 1) / fAreaSpec.RowPitch (), (overlap.W () + fAreaSpec.ColPitch () - 1) / fAreaSpec.ColPitch (), 0, fAreaSpec.RowPitch () * buffer.RowStep (), fAreaSpec.ColPitch (), fTable->Buffer_uint16 ()); } } }
void dng_opcode_ScalePerColumn::ProcessArea (dng_negative & /* negative */, uint32 /* threadIndex */, dng_pixel_buffer &buffer, const dng_rect &dstArea, const dng_rect & /* imageBounds */) { dng_rect overlap = fAreaSpec.Overlap (dstArea); if (overlap.NotEmpty ()) { uint32 rows = (overlap.W () + fAreaSpec.RowPitch () - 1) / fAreaSpec.RowPitch (); int32 rowStep = buffer.RowStep () * fAreaSpec.RowPitch (); for (uint32 plane = fAreaSpec.Plane (); plane < fAreaSpec.Plane () + fAreaSpec.Planes () && plane < buffer.Planes (); plane++) { const real32 *table = fTable->Buffer_real32 () + ((overlap.l - fAreaSpec.Area ().l) / fAreaSpec.ColPitch ()); for (int32 col = overlap.l; col < overlap.r; col += fAreaSpec.ColPitch ()) { real32 colScale = *(table++); real32 *dPtr = buffer.DirtyPixel_real32 (overlap.t, col, plane); for (uint32 row = 0; row < rows; row++) { real32 x = dPtr [0]; real32 y = x * colScale; dPtr [0] = Min_real32 (y, 1.0f); dPtr += rowStep; } } } } }