57 PPMIO::PPMIO(
string filename ) : m_width(0), m_height(0), m_pixels(0)
61 ifstream in(filename.c_str());
91 for(
int i = 0; i <
m_width * m_height * 3; i++)
100 in.open(filename.c_str(), ios::binary);
119 cerr <<
"Unsupported tag, only P3 or P6 possible." << endl;
125 cout <<
"ReadPPM: Unable to open file " << filename <<
"." << endl;
131 ofstream out(filename.c_str());
155 in.getline(buffer, 256);
157 while(buffer[0] ==
'#' && in.good() );
void readLine(ifstream &in, char *buffer)
void write(string filename)
void setDataArray(unsigned char *array, int width, int height)