22 set_program_brief(
"report the size of image files");
23 set_program_description
24 (
"This program reads the headers of a series of one or more " 25 "image files and reports the image sizes to standard output.");
29 "Report only images that have a non-power-of-two size in either " 30 "dimension. Images whose dimensions are both a power of two will " 32 &ImageInfo::dispatch_none, &_report_power_2,
nullptr);
40 Args::const_iterator ai;
41 for (ai = _filenames.begin(); ai != _filenames.end(); ++ai) {
47 nout << filename <<
": could not read image.\n";
49 nout << filename <<
": does not exist.\n";
53 if (!_report_power_2 ||
56 nout << filename <<
": " << header.
get_x_size() <<
" x " 58 <<
" (maxval = " << header.
get_maxval() <<
")\n";
72 nout <<
"List one or more image filenames on command line.\n";
84 is_power_2(
int value)
const {
85 return (value & (value - 1)) == 0;
89 int main(
int argc,
char *argv[]) {
virtual void parse_command_line(int argc, char **argv)
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
This program reads the headers of a series of one or more images and reports their sizes to standard ...
bool exists() const
Returns true if the filename exists on the disk, false otherwise.