Logo Search packages:      
Sourcecode: djvulibre version File versions

void GPixmap::color_correct ( double  corr  ) 

Applies a luminance gamma correction factor of corr#. Values greater than #1.0# make the image brighter. Values smaller than #1.0# make the image darker. The documentation of program {ppmcoco} explains how to properly use this function.

Definition at line 652 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
  for (int y=0; y<nrows; y++)
  {
    GPixel *pix = (*this)[y];
    for (int x=0; x<ncolumns; x++, pix++)
    {
      pix->r = gtable[ pix->r ];
      pix->g = gtable[ pix->g ];
      pix->b = gtable[ pix->b ];
    }
  }
}


Generated by  Doxygen 1.6.0   Back to index