Panda3D
pfmTrans.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pfmTrans.h
10  * @author drose
11  * @date 2010-12-23
12  */
13 
14 #ifndef PFMTRANS_H
15 #define PFMTRANS_H
16 
17 #include "pandatoolbase.h"
18 #include "programBase.h"
19 #include "filename.h"
20 #include "pvector.h"
21 #include "nodePath.h"
22 #include "luse.h"
23 
24 class PfmFile;
25 
26 /**
27  * Operates on a pfm file.
28  */
29 class PfmTrans : public ProgramBase {
30 public:
31  PfmTrans();
32 
33  void run();
34  bool process_pfm(const Filename &input_filename, PfmFile &file);
35 
36  void add_transform_options();
37 
38 protected:
39  virtual bool handle_args(Args &args);
40 
41  static bool dispatch_scale(const std::string &opt, const std::string &arg, void *var);
42  static bool dispatch_rotate_xyz(ProgramBase *self, const std::string &opt, const std::string &arg, void *var);
43  bool ns_dispatch_rotate_xyz(const std::string &opt, const std::string &arg, void *var);
44  static bool dispatch_rotate_axis(ProgramBase *self, const std::string &opt, const std::string &arg, void *var);
45  bool ns_dispatch_rotate_axis(const std::string &opt, const std::string &arg, void *var);
46  static bool dispatch_translate(const std::string &opt, const std::string &arg, void *var);
47 
48 private:
50  Filenames _input_filenames;
51 
52  bool _got_zero_special;
53  bool _got_no_data_nan;
54  int _no_data_nan_num_channels;
55  bool _got_vis_inverse;
56  bool _got_vis_2d;
57  bool _got_resize;
58  int _resize[2];
59  bool _got_crop;
60  int _crop[4];
61  bool _got_autocrop;
62  int _rotate;
63  bool _got_mirror_x;
64  bool _got_mirror_y;
65 
66  bool _got_output_filename;
67  Filename _output_filename;
68  bool _got_output_dirname;
69  Filename _output_dirname;
70  bool _got_vis_filename;
71  Filename _vis_filename;
72  bool _got_vistex_filename;
73  Filename _vistex_filename;
74  bool _got_ls_filename;
75  Filename _ls_filename;
76 
77  bool _got_transform;
78  LMatrix4 _transform;
79 
80  NodePath _mesh_root;
81 };
82 
83 #endif
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:159
Defines a pfm file, a 2-d table of floating-point numbers, either 3-component or 1-component,...
Definition: pfmFile.h:31
Operates on a pfm file.
Definition: pfmTrans.h:29
void add_transform_options()
Adds -TS, -TT, etc.
Definition: pfmTrans.cxx:288
bool process_pfm(const Filename &input_filename, PfmFile &file)
Handles a single pfm file.
Definition: pfmTrans.cxx:169
This is intended to be the base class for most general-purpose utility programs in the PANDATOOL tree...
Definition: programBase.h:34
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.