4#include "GrayLevelImage2D.hpp"
8int main(
int argc,
char** argv )
10 typedef GrayLevelImage2D::GrayLevel GrayLevel;
14 std::cerr <<
"Usage: double-brightness <input.pgm> <output.pgm>" << std::endl;
18 ifstream input( argv[1] );
19 bool ok = img.importPGM( input );
22 std::cerr <<
"Error reading input file." << std::endl;
26 for ( Iterator it = img.
begin(), itE = img.end(); it != itE; ++it )
28 *it = ( 2 * (int)(*it) ) % 256;
30 ofstream output( argv[2] );
31 ok = img.exportPGM( output,
false );
34 std::cerr <<
"Error writing output file." << std::endl;
Iterator begin()
[gli2d-sec3]