15 #include "imageWriter.h"
28 if (_allow_last_param) {
29 add_runline(
"[opts] outputimage");
31 add_runline(
"[opts] -o outputimage");
34 if (_allow_last_param) {
36 "Specify the filename to which the resulting image file will be written. "
37 "If this option is omitted, the last parameter name is taken to be the "
38 "name of the output file.";
41 "Specify the filename to which the resulting image file will be written.";
45 (
"o",
"filename", 50, o_description,
46 &ImageWriter::dispatch_filename, &_got_output_filename, &_output_filename);
59 nout <<
"Unable to write output image to "
75 if (!check_last_arg(args, 0)) {
80 nout <<
"Unexpected arguments on command line:\n";
81 Args::const_iterator ai;
82 for (ai = args.begin(); ai != args.end(); ++ai) {
bool write(const Filename &filename, PNMFileType *type=NULL) const
Writes the image to the indicated filename.
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
Filename get_output_filename() const
If has_output_filename() returns true, this is the filename that the user specified.
This is the bare functionality (intended to be inherited from along with ProgramBase or some derivati...
ImageWriter(bool allow_last_param)
Image-writing type programs *must* specify their output file using -o.
void write_image()
Writes the generated to the user's specified output filename.