Logo Search packages:      
Sourcecode: djvulibre version File versions

void GPixmap::color_correct ( double  corr,
GPixel pixels,
int  npixels 
) [static]

Applies a luminance gamma correction to an array of pixels. This function is {static} and does not modify this pixmap.

Definition at line 675 of file GPixmap.cpp.

References GPixel::b, GPixel::g, and GPixel::r.

{
  // Trivial corrections
  if (gamma_correction>0.999 && gamma_correction<1.001)
    return;
  // Compute correction table
  unsigned char gtable[256];
  color_correction_table_cache(gamma_correction, gtable);
  // Perform correction
  while (--npixels>=0)
    {
      pix->r = gtable[pix->r];
      pix->g = gtable[pix->g];
      pix->b = gtable[pix->b];
      pix++;
    }
}


Generated by  Doxygen 1.6.0   Back to index