8 ostream&
printpgm(ostream& os,
int xsize,
int ysize,
const double *
const * matrix){
11 os<<
"P5" << endl << xsize << endl << ysize << endl << 255 << endl;
12 for (
int y=ysize-1; y>=0; y--){
13 for (
int x=0;x<xsize; x++){
14 unsigned char c=(
unsigned char)(255*fabs(1.-matrix[x][y]));
ostream & printpgm(ostream &os, int xsize, int ysize, const double *const *matrix)