|
|
|
This is a single palette image, one of several within a PalettePage, which is in turn one of several pages within a PaletteGroup.
More...
#include "paletteImage.h"
List of all members.
Classes |
| class | ClearedRegion |
Public Member Functions |
|
| PaletteImage (PalettePage *page, int index) |
|
| PaletteImage (PalettePage *page, int index, unsigned swapIndex) |
| void | check_solitary () |
| | To be called after all textures have been placed on the image, this checks to see if there is only one texture on the image.
|
| 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 the pointers that were retrieved from the Bam file for each pointer object written.
|
| double | count_coverage () const |
| | Returns the a weighted average of the fraction of coverage represented by all of the textures placed on the palette.
|
| double | count_utilization () const |
| | Returns the fraction of the PaletteImage that is actually used by any textures.
|
| PalettePage * | get_page () const |
| | Returns the particular PalettePage this image is associated with.
|
|
virtual TypeHandle | get_type () const |
| bool | is_empty () const |
| | Returns true if there are no textures, or only one "solitary" texture, placed on the image.
|
| void | optimal_resize () |
| | Attempts to resize the palette image to as small as it can go.
|
| bool | place (TexturePlacement *placement) |
| | Attempts to place the indicated texture on the image.
|
| void | reset_image () |
| | Unpacks each texture that has been placed on this image, resetting the image to empty.
|
| bool | resize_image (int x_size, int y_size) |
| | Attempts to resize the palette image, and repack all of the textures within the new size.
|
| void | resize_swapped_image (int x_size, int y_size) |
| | Attempts to resize the palette image, and repack all of the textures within the new size.
|
| void | setup_shadow_image () |
| | Ensures the _shadow_image has the correct filename and image types, based on what was supplied on the command line and in the .txa file.
|
| void | unplace (TexturePlacement *placement) |
| | Removes the texture from the image.
|
| bool | update_filename () |
| | Changes the image filename to match the current naming scheme, assuming something has changed since the image was created.
|
| void | update_image (bool redo_all) |
| | If the palette has changed since it was last written out, updates the image and writes out a new one.
|
| 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.
|
| void | write_placements (ostream &out, int indent_level=0) const |
| | Writes a list of the textures that have been placed on this image to the indicated output stream, one per line.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
| static void | register_with_read_factory () |
| | Registers the current object as something that can be read from a Bam file.
|
Protected Member Functions |
| void | fillin (DatagramIterator &scan, BamReader *manager) |
| | Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().
|
Static Protected Member Functions |
| static TypedWritable * | make_PaletteImage (const FactoryParams ¶ms) |
| | This method is called by the BamReader when an object of this type is encountered in a Bam file; it should allocate and return a new object with all the data read.
|
Detailed Description
This is a single palette image, one of several within a PalettePage, which is in turn one of several pages within a PaletteGroup.
Each palette image is a collage of several different textures that were all assigned to the same PaletteGroup, and all share the same properties of the PalettePage.
Definition at line 36 of file paletteImage.h.
Member Function Documentation
Called after the object is otherwise completely read from a Bam file, this function's job is to store the pointers that were retrieved from the Bam file for each pointer object written.
The return value is the number of pointers processed from the list.
Reimplemented from ImageFile.
Definition at line 1120 of file paletteImage.cxx.
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from ImageFile.
Definition at line 136 of file paletteImage.h.
Attempts to resize the palette image, and repack all of the textures within the new size.
Returns true if successful, false otherwise. If this fails, it will still result in repacking all the textures in the original size.
Definition at line 457 of file paletteImage.cxx.
References place().
Referenced by optimal_resize().
Attempts to resize the palette image, and repack all of the textures within the new size.
Returns true if successful, false otherwise. If this fails, it will still result in repacking all the textures in the original size.
Definition at line 527 of file paletteImage.cxx.
Referenced by optimal_resize().
If the palette has changed since it was last written out, updates the image and writes out a new one.
If redo_all is true, regenerates the image from scratch and writes it out again, whether it needed it or not.
Definition at line 598 of file paletteImage.cxx.
References ImageFile::exists(), TexturePlacement::fill_image(), TexturePlacement::fill_swapped_image(), ImageFile::get_filename(), TextureImage::get_preferred_source(), TexturePlacement::get_texture(), is_empty(), TexturePlacement::is_filled(), TextureImage::is_texture_named(), TexturePlacement::mark_unfilled(), update_filename(), and ImageFile::write().
Referenced by PalettePage::update_images().
The documentation for this class was generated from the following files:
| | |