Panda3D
 All Classes Functions Variables Enumerations
pfmTrans.h
1 // Filename: pfmTrans.h
2 // Created by: drose (23Dec10)
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 PFMTRANS_H
16 #define PFMTRANS_H
17 
18 #include "pandatoolbase.h"
19 #include "programBase.h"
20 #include "filename.h"
21 #include "pvector.h"
22 #include "nodePath.h"
23 #include "luse.h"
24 
25 class PfmFile;
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : PfmTrans
29 // Description : Operates on a pfm file.
30 ////////////////////////////////////////////////////////////////////
31 class PfmTrans : public ProgramBase {
32 public:
33  PfmTrans();
34 
35  void run();
36  bool process_pfm(const Filename &input_filename, PfmFile &file);
37 
38  void add_transform_options();
39 
40 protected:
41  virtual bool handle_args(Args &args);
42 
43  static bool dispatch_scale(const string &opt, const string &arg, void *var);
44  static bool dispatch_rotate_xyz(ProgramBase *self, const string &opt, const string &arg, void *var);
45  bool ns_dispatch_rotate_xyz(const string &opt, const string &arg, void *var);
46  static bool dispatch_rotate_axis(ProgramBase *self, const string &opt, const string &arg, void *var);
47  bool ns_dispatch_rotate_axis(const string &opt, const string &arg, void *var);
48  static bool dispatch_translate(const string &opt, const string &arg, void *var);
49 
50 private:
52  Filenames _input_filenames;
53 
54  bool _got_zero_special;
55  bool _got_no_data_nan;
56  int _no_data_nan_num_channels;
57  bool _got_vis_inverse;
58  bool _got_vis_2d;
59  bool _got_resize;
60  int _resize[2];
61  bool _got_crop;
62  int _crop[4];
63  bool _got_autocrop;
64  int _rotate;
65  bool _got_mirror_x;
66  bool _got_mirror_y;
67 
68  bool _got_output_filename;
69  Filename _output_filename;
70  bool _got_output_dirname;
71  Filename _output_dirname;
72  bool _got_vis_filename;
73  Filename _vis_filename;
74  bool _got_vistex_filename;
75  Filename _vistex_filename;
76  bool _got_ls_filename;
77  Filename _ls_filename;
78 
79  bool _got_transform;
80  LMatrix4 _transform;
81 
82  NodePath _mesh_root;
83 };
84 
85 #endif
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
Definition: programBase.h:37
Operates on a pfm file.
Definition: pfmTrans.h:31
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component, or with a special extension, 2- or 4-component.
Definition: pfmFile.h:34
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
bool process_pfm(const Filename &input_filename, PfmFile &file)
Handles a single pfm file.
Definition: pfmTrans.cxx:175
void add_transform_options()
Adds -TS, -TT, etc.
Definition: pfmTrans.cxx:298
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165