Panda3D
 All Classes Functions Variables Enumerations
imageTransformColors.h
1 // Filename: imageTransformColors.h
2 // Created by: drose (25Mar09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef IMAGETRANSFORMCOLORS_H
16 #define IMAGETRANSFORMCOLORS_H
17 
18 #include "pandatoolbase.h"
19 #include "programBase.h"
20 #include "pvector.h"
21 #include "filename.h"
22 #include "luse.h"
23 
24 class PNMImage;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : ImageTransformColors
28 // Description : This program can apply a 4x4 color transform to all
29 // of the colors in the pixels of a series of images.
30 ////////////////////////////////////////////////////////////////////
32 public:
34 
35  void run();
36 
37 protected:
38  static bool dispatch_mat4(const string &opt, const string &arg, void *var);
39  static bool dispatch_mat3(const string &opt, const string &arg, void *var);
40  static bool dispatch_range(const string &opt, const string &arg, void *var);
41  static bool dispatch_scale(const string &opt, const string &arg, void *var);
42  static bool dispatch_add(const string &opt, const string &arg, void *var);
43 
44  virtual bool handle_args(Args &args);
45  Filename get_output_filename(const Filename &source_filename) const;
46 
47  void process_image(PNMImage &image);
48 
49 private:
50  bool _hls;
51  LMatrix4d _mat;
52 
53  bool _got_output_filename;
54  Filename _output_filename;
55  bool _got_output_dirname;
56  Filename _output_dirname;
57  bool _inplace;
58 
60  Filenames _filenames;
61 };
62 
63 #include "imageTransformColors.I"
64 
65 #endif
66 
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
Definition: programBase.h:37
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
Definition: pnmImage.h:68
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This program can apply a 4x4 color transform to all of the colors in the pixels of a series of images...