Logo Search packages:      
Sourcecode: djvulibre version File versions

void GPixmap::init ( int  nrows,
int  ncolumns,
const GPixel filler = 0 
)

Resets the GPixmap to nrows# rows and ncolumns# columns. When the optional argument filler# is specified, all pixels are initialized with the corresponding color. The previous content of the GPixmap is discarded.

Definition at line 286 of file GPixmap.cpp.

Referenced by downsample(), downsample43(), init(), operator=(), GPixmapScaler::scale(), upsample(), and upsample23().

{
  destroy();
  nrows = arows;
  ncolumns = acolumns;
  nrowsize = acolumns;
  int npix = nrows * nrowsize;
  if (npix > 0)
  {
    pixels = pixels_data = new GPixel[npix];
    if (filler)
    { 
      while (--npix>=0) 
        pixels_data[npix] = *filler;
    }
  }
}


Generated by  Doxygen 1.6.0   Back to index