Example #1
0
int main(int argc, char** argv) {
  if (argc < 3) {
    cerr << "Usage: " << argv[0] << " <input file> <output file>" << endl;
    return 0;
  }
  string input_filename = argv[1];
  string output_filename = argv[2];
  
  PNG_Canvas_BW canvas;
  if (!canvas.load_image(input_filename)) {
    cerr << "Unable to load " << input_filename << ". Exiting..." << endl;
    return 0;
  }
  
  invert_image(canvas);

  canvas.save_image(output_filename);
}
Example #2
0
int main(int argc, char** argv) {
    if (argc < 3) {
        cerr << "Usage: " << argv[0] << " <input file> <output file>" << endl;
        return 0;
    }
    string input_filename = argv[1];
    string output_filename = argv[2];
    if (argc == 4) {
        sscanf(argv[3],"%lf",&sigma);
    }

    PNG_Canvas_BW canvas;
    if (!canvas.load_image(input_filename)) {
        cerr << "Unable to load " << input_filename << ". Exiting..." << endl;
        return 0;
    }

    process_image(canvas);
    canvas.save_image(output_filename);


}