printpgm.h
Go to the documentation of this file.
1 #include <fstream>
2 #include <iostream>
3 #include <sstream>
4 #include <unistd.h>
5 
6 
7 using namespace std;
8 ostream& printpgm(ostream& os, int xsize, int ysize, const double * const * matrix){
9  if (!os)
10  return os;
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]));
15  os.put(c);
16  }
17  }
18  return os;
19 }
ostream & printpgm(ostream &os, int xsize, int ysize, const double *const *matrix)
Definition: printpgm.h:8
unsigned int c
Definition: gfs2stream.cpp:41


openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Mon Jun 10 2019 14:04:22