Panda3D
 All Classes Functions Variables Enumerations
imageReader.cxx
00001 // Filename: imageReader.cxx
00002 // Created by:  drose (19Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "imageReader.h"
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: ImageReader::Constructor
00019 //       Access: Public
00020 //  Description:
00021 ////////////////////////////////////////////////////////////////////
00022 ImageReader::
00023 ImageReader() {
00024   clear_runlines();
00025   add_runline("[opts] imagename");
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: ImageReader::handle_args
00030 //       Access: Protected, Virtual
00031 //  Description:
00032 ////////////////////////////////////////////////////////////////////
00033 bool ImageReader::
00034 handle_args(ProgramBase::Args &args) {
00035   if (args.empty()) {
00036     nout << "You must specify the image file to read on the command line.\n";
00037     return false;
00038   }
00039 
00040   if (args.size() > 1) {
00041     nout << "Specify only one image on the command line.\n";
00042     return false;
00043   }
00044 
00045   if (!_image.read(args[0])) {
00046     nout << "Unable to read image file " << args[0] << ".\n";
00047     exit(1);
00048   }
00049 
00050   return true;
00051 }
 All Classes Functions Variables Enumerations