Panda3D
eggTextureCards.h
1 // Filename: eggTextureCards.h
2 // Created by: drose (21Feb01)
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 EGGTEXTURECARDS_H
16 #define EGGTEXTURECARDS_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "eggWriter.h"
21 #include "eggTexture.h"
22 #include "luse.h"
23 #include "vector_string.h"
24 
25 class EggVertexPool;
26 class EggVertex;
27 
28 ////////////////////////////////////////////////////////////////////
29 // Class : EggTextureCards
30 // Description : Generates an egg file featuring a number of polygons,
31 // one for each named texture. This is a support
32 // program for getting textures through egg-palettize.
33 ////////////////////////////////////////////////////////////////////
34 class EggTextureCards : public EggWriter {
35 public:
37 
38 protected:
39  virtual bool handle_args(Args &args);
40 
41  static bool dispatch_wrap_mode(const string &opt, const string &arg, void *var);
42  static bool dispatch_filter_type(const string &opt, const string &arg, void *var);
43  static bool dispatch_quality_level(const string &opt, const string &arg, void *var);
44  static bool dispatch_format(const string &opt, const string &arg, void *var);
45 
46 private:
47  bool scan_texture(const Filename &filename, LVecBase4d &geometry,
48  int &num_channels);
49  void make_vertices(const LPoint4d &geometry, EggVertexPool *vpool,
50  EggVertex *&v1, EggVertex *&v2, EggVertex *&v3, EggVertex *&v4);
51 
52 public:
53  void run();
54 
55  LVecBase4d _polygon_geometry;
56  LVecBase2d _pixel_scale;
57  bool _got_pixel_scale;
58  vector_string _suffixes;
59  LColor _polygon_color;
60  vector_string _texture_names;
61  EggTexture::WrapMode _wrap_mode;
62  EggTexture::WrapMode _wrap_u;
63  EggTexture::WrapMode _wrap_v;
64  EggTexture::FilterType _minfilter;
65  EggTexture::FilterType _magfilter;
66  bool _got_aniso_degree;
67  int _aniso_degree;
68  EggTexture::QualityLevel _quality_level;
69  EggTexture::Format _format;
70  EggTexture::Format _format_1, _format_2, _format_3, _format_4;
71  bool _apply_bface;
72  double _frame_rate;
73  bool _noexist;
74 };
75 
76 #endif
77 
This is the base class for all two-component vectors and points.
Definition: lvecBase2.h:1257
This is a four-component point in space.
Definition: lpoint4.h:457
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:1677
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
Definition: eggVertex.h:41
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
Generates an egg file featuring a number of polygons, one for each named texture. ...
This is the base class for a program that generates an egg file output, but doesn't read any for inpu...
Definition: eggWriter.h:30
A collection of vertices.
Definition: eggVertexPool.h:46