printpgm.h
Go to the documentation of this file.
1 #include <fstream>
2 #include <iostream>
3 #include <sstream>
4 #ifndef _WIN32
5  #include <unistd.h>
6 #endif
7 
8 
9 using namespace std;
10 ostream& printpgm(ostream& os, int xsize, int ysize, const double * const * matrix){
11  if (!os)
12  return os;
13  os<< "P5" << endl << xsize << endl << ysize << endl << 255 << endl;
14  for (int y=ysize-1; y>=0; y--){
15  for (int x=0;x<xsize; x++){
16  unsigned char c=(unsigned char)(255*fabs(1.-matrix[x][y]));
17  os.put(c);
18  }
19  }
20  return os;
21 }
c
unsigned int c
Definition: gfs2stream.cpp:41
printpgm
ostream & printpgm(ostream &os, int xsize, int ysize, const double *const *matrix)
Definition: printpgm.h:10


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51