24 if (_allow_last_param) {
25 add_runline(
"[opts] outputimage");
27 add_runline(
"[opts] -o outputimage");
29 std::string o_description;
30 if (_allow_last_param) {
32 "Specify the filename to which the resulting image file will be written. " 33 "If this option is omitted, the last parameter name is taken to be the " 34 "name of the output file.";
37 "Specify the filename to which the resulting image file will be written.";
41 (
"o",
"filename", 50, o_description,
42 &ImageWriter::dispatch_filename, &_got_output_filename, &_output_filename);
52 nout <<
"Unable to write output image to " 65 if (!check_last_arg(args, 0)) {
70 nout <<
"Unexpected arguments on command line:\n";
71 Args::const_iterator ai;
72 for (ai = args.begin(); ai != args.end(); ++ai) {
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
bool write(const Filename &filename, PNMFileType *type=nullptr) const
Writes the image to the indicated filename.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.