Panda3D
|
00001 // Filename: imageTransformColors.h 00002 // Created by: drose (25Mar09) 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 #ifndef IMAGETRANSFORMCOLORS_H 00016 #define IMAGETRANSFORMCOLORS_H 00017 00018 #include "pandatoolbase.h" 00019 #include "programBase.h" 00020 #include "pvector.h" 00021 #include "filename.h" 00022 #include "luse.h" 00023 00024 class PNMImage; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : ImageTransformColors 00028 // Description : This program can apply a 4x4 color transform to all 00029 // of the colors in the pixels of a series of images. 00030 //////////////////////////////////////////////////////////////////// 00031 class ImageTransformColors : public ProgramBase { 00032 public: 00033 ImageTransformColors(); 00034 00035 void run(); 00036 00037 protected: 00038 static bool dispatch_mat4(const string &opt, const string &arg, void *var); 00039 static bool dispatch_mat3(const string &opt, const string &arg, void *var); 00040 static bool dispatch_range(const string &opt, const string &arg, void *var); 00041 static bool dispatch_scale(const string &opt, const string &arg, void *var); 00042 static bool dispatch_add(const string &opt, const string &arg, void *var); 00043 00044 virtual bool handle_args(Args &args); 00045 Filename get_output_filename(const Filename &source_filename) const; 00046 00047 void process_image(PNMImage &image); 00048 00049 private: 00050 bool _hls; 00051 LMatrix4d _mat; 00052 00053 bool _got_output_filename; 00054 Filename _output_filename; 00055 bool _got_output_dirname; 00056 Filename _output_dirname; 00057 bool _inplace; 00058 00059 typedef pvector<Filename> Filenames; 00060 Filenames _filenames; 00061 }; 00062 00063 #include "imageTransformColors.I" 00064 00065 #endif 00066