3#include "GrayLevelImage2D.hpp"
7int main(
int argc,
char** argv )
12 for (
int y = 0; y < img.h(); ++y )
13 for (
int x = 0; x < img.w(); ++x )
14 std::cout <<
" " << (
int) img.at( x, y );
15 std::cout << std::endl;
22 std::cout <<
" " << (
int) *it;
26 typedef GrayLevelImage2D::GrayLevel GrayLevel;
29 ifstream input( argv[1] );
31 img.importPGM( input );
33 catch (
char const * msg ) {
34 std::cerr <<
"Exception: " << msg << std::endl;
37 std::cerr <<
"Exception." << std::endl;
40 for ( Iterator it = img.
begin(), itE = img.end(); it != itE; ++it )
42 const GrayLevel g = (13*((int)(*it))) % 256;
45 ofstream output( argv[2] );
46 img.exportPGM( output,
false );
48 std::cout << std::endl;
Iterator begin()
[gli2d-sec3]