18 #include "pandatoolbase.h" 22 #include "typedWritable.h" 23 #include "eggRenderMode.h" 54 void read_txa_file(istream &txa_file,
const string &txa_filename);
75 static const char *yesno(
bool flag);
78 static int _pi_version;
79 static int _min_pi_version;
80 static int _read_pi_version;
96 string _default_groupname;
97 string _default_groupdir;
103 string _generated_image_pattern;
107 int _pal_x_size, _pal_y_size;
111 bool _omit_everything;
112 double _coverage_threshold;
114 bool _aggressively_clean_mapdir;
118 RemapUV _remap_uv, _remap_char_uv;
123 EggRenderMode::AlphaMode _cutout_mode;
124 double _cutout_ratio;
128 void compute_statistics(ostream &out,
int indent_level,
129 const Placements &placements)
const;
135 CommandLineEggs _command_line_eggs;
138 CommandLineTextures _command_line_textures;
146 TextureConflicts _texture_conflicts;
173 static void init_type() {
174 TypedWritable::init_type();
175 register_type(_type_handle,
"Palettizer",
176 TypedWritable::get_class_type());
179 return get_class_type();
bool is_valid() const
Returns true if the palette information file was read correctly, or false if there was some error and...
void report_statistics() const
Output a report of the palettization effectiveness, texture memory utilization, and so on...
PaletteGroup * test_palette_group(const string &name) const
Returns the PaletteGroup with the given name.
bool get_noabs() const
Returns the current setting of the noabs flag.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the main engine behind egg-palettize.
Base class for objects that can be written to and read from Bam files.
void process_all(bool force_texture_read, const Filename &state_filename)
Reprocesses all textures known.
This is the highest level of grouping for TextureImages.
This is the base class of a family of classes that represent particular image file types that PNMImag...
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
This is the base class for all three-component vectors and points.
EggFile * get_egg_file(const string &name)
Returns the EggFile with the given name.
This is a single matching line in the .txa file.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void write_datagram(BamWriter *writer, Datagram &datagram)
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
bool remove_egg_file(const string &name)
Removes the named egg file from the database, if it exists.
void read_txa_file(istream &txa_file, const string &txa_filename)
Reads in the .txa file and keeps it ready for matching textures and egg files.
static RemapUV string_remap(const string &str)
Returns the RemapUV code corresponding to the indicated string, or RU_invalid if the string is invali...
void report_pi() const
Output a verbose description of all the palettization information to standard output, for the user's perusal.
The name of a file, such as a texture file or an Egg file.
void all_params_set()
Called after all command line parameters have been set up, this is a hook to do whatever initializati...
void reset_images()
Throws away all of the current PaletteImages, so that new ones may be created (and the packing made m...
bool write_eggs()
Adjusts the egg files to reference the newly generated textures, and writes them out.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This corresponds to a particular assignment of a TextureImage with a PaletteGroup, and specifically describes which PaletteImage (if any), and where on the PaletteImage, the TextureImage has been assigned to.
void generate_images(bool redo_all)
Actually generates the appropriate palette and unplaced texture images into the map directories...
void process_command_line_eggs(bool force_texture_read, const Filename &state_filename)
Processes all the textures named in the _command_line_eggs, placing them on the appropriate palettes ...
void set_noabs(bool noabs)
Changes the current setting of the noabs flag.
static void register_with_read_factory()
Registers the current object as something that can be read from a Bam file.
PaletteGroup * get_default_group()
Returns the default group to which an egg file should be assigned if it is not mentioned in the ...
A class to retrieve the individual data elements previously stored in a Datagram. ...
This represents a single source texture that is referenced by one or more egg files.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Called after the object is otherwise completely read from a Bam file, this function's job is to store...
void optimal_resize()
Attempts to resize each PalettteImage down to its smallest possible size.
TypeHandle is the identifier used to differentiate C++ class types.
bool read_stale_eggs(bool redo_all)
Reads in any egg file that is known to be stale, even if it was not listed on the command line...
void add_command_line_egg(EggFile *egg_file)
Adds the indicated EggFile to the list of eggs that are considered to have been read on the command l...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
TextureImage * get_texture(const string &name)
Returns the TextureImage with the given name.
PaletteGroup * get_palette_group(const string &name)
Returns the PaletteGroup with the given name.
This represents a single egg file known to the palettizer.
This represents the .txa file (usually textures.txa) that contains the user instructions for resizing...