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