Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/imagebase/imageReader.cxx

Go to the documentation of this file.
00001 // Filename: imageReader.cxx
00002 // Created by:  drose (19Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include "imageReader.h"
00020 
00021 ////////////////////////////////////////////////////////////////////
00022 //     Function: ImageReader::Constructor
00023 //       Access: Public
00024 //  Description:
00025 ////////////////////////////////////////////////////////////////////
00026 ImageReader::
00027 ImageReader() {
00028   clear_runlines();
00029   add_runline("[opts] imagename");
00030 }
00031 
00032 ////////////////////////////////////////////////////////////////////
00033 //     Function: ImageReader::handle_args
00034 //       Access: Protected, Virtual
00035 //  Description:
00036 ////////////////////////////////////////////////////////////////////
00037 bool ImageReader::
00038 handle_args(ProgramBase::Args &args) {
00039   if (args.empty()) {
00040     nout << "You must specify the image file to read on the command line.\n";
00041     return false;
00042   }
00043 
00044   if (args.size() > 1) {
00045     nout << "Specify only one image on the command line.\n";
00046     return false;
00047   }
00048 
00049   if (!_image.read(args[0])) {
00050     nout << "Unable to read image file " << args[0] << ".\n";
00051     return false;
00052   }
00053 
00054   return true;
00055 }

Generated on Fri May 2 03:20:05 2003 for Panda-Tool by doxygen1.3