|
|
|
This represents a single source texture that is referenced by one or more egg files.
More...
#include "textureImage.h"
List of all members.
Public Member Functions |
| void | assign_groups () |
| | Assigns the texture to all of the PaletteGroups the various egg files that use it need.
|
| void | clear_source_basic_properties () |
| | Calls clear_basic_properties() on each source texture image used by this texture, to reset the properties in preparation for re-applying them from the set of all known 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 the pointers that were retrieved from the Bam file for each pointer object written.
|
| void | copy_unplaced (bool redo_all) |
| | Copies the texture to whichever destination directories are appropriate for the groups in which it has been unplaced.
|
| void | determine_placement_size () |
| | Calls determine_size() on each TexturePlacement for the texture, to ensure that each TexturePlacement is still requesting the best possible size for the texture.
|
| void | force_replace () |
| | Removes the texture from any PaletteImages it is assigned to, but does not remove it from the groups.
|
| EggRenderMode::AlphaMode | get_alpha_mode () const |
| | Returns the alpha mode that should be used to render objects with this texture, as specified by the user or as determined from examining the texture's alpha channel.
|
| double | get_coverage_threshold () const |
| | Returns the appropriate coverage threshold for this texture.
|
| const PaletteGroups & | get_groups () const |
| | Once assign_groups() has been called, this returns the actual set of groups the TextureImage has been assigned to.
|
| int | get_margin () const |
| | Returns the appropriate margin for this texture.
|
| bool | get_omit () const |
| | Returns true if the user specifically requested to omit this texture via the "omit" keyword in the .txa file, or false otherwise.
|
| TexturePlacement * | get_placement (PaletteGroup *group) const |
| | Gets the TexturePlacement object which represents the assignment of this texture to the indicated group.
|
| SourceTextureImage * | get_preferred_source () |
| | Determines the preferred source image for examining size and reading pixels, etc.
|
| SourceTextureImage * | get_source (const Filename &filename, const Filename &alpha_filename, int alpha_file_channel) |
| | Returns the SourceTextureImage corresponding to the given filename(s).
|
| EggTexture::WrapMode | get_txa_wrap_u () const |
| | Returns the wrap mode specified in the u direction in the txa file, or WM_unspecified.
|
| EggTexture::WrapMode | get_txa_wrap_v () const |
| | Returns the wrap mode specified in the v direction in the txa file, or WM_unspecified.
|
|
virtual TypeHandle | get_type () const |
| bool | got_txa_file () const |
| | Returns true if this TextureImage has been looked up in the .txa file this session, false otherwise.
|
| bool | is_newer_than (const Filename &reference_filename) |
| | Returns true if the source image is newer than the indicated file, false otherwise.
|
| bool | is_surprise () const |
| | Returns true if this particular texture is a 'surprise', i.e.
|
| bool | is_texture_named () const |
| | Returns true if this particular texture has been named by the user for procession this session, for instance by listing an egg file on the command line that references it.
|
| bool | is_used () const |
| | Returns true if this particular texture has been placed somewhere, anywhere, or false if it is not used.
|
| void | mark_eggs_stale () |
| | Marks all the egg files that reference this texture stale.
|
| void | mark_texture_named () |
| | Indicates that this particular texture has been named by the user for processing this session, normally by listing an egg file on the command line that references it.
|
| void | note_egg_file (EggFile *egg_file) |
| | Records that a particular egg file references this texture.
|
| void | post_txa_file () |
| | Once the .txa file has been read and the TextureImage matched against it, considers applying the requested size change.
|
| void | pre_txa_file () |
| | Updates any internal state prior to reading the .txa file.
|
| void | read_header () |
| | Causes the header part of the image to be reread, usually to confirm that its image properties (size, number of channels, etc.) haven't changed.
|
| const PNMImage & | read_source_image () |
| | Reads in the original image, if it has not already been read, and returns it.
|
| void | release_source_image () |
| | Frees the memory that was allocated by a previous call to read_source_image().
|
| void | set_source_image (const PNMImage &image) |
| | Accepts the indicated source image as if it had been read from disk.
|
| 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_scale_info (ostream &out, int indent_level=0) |
| | Writes the information about the texture's size and placement.
|
| void | write_source_pathnames (ostream &out, int indent_level=0) const |
| | Writes the list of source pathnames that might contribute to this texture to the indicated output stream, one per line.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
| 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_TextureImage (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.
|
Friends |
|
class | TxaLine |
Detailed Description
This represents a single source texture that is referenced by one or more egg files.
It may be assigned to multiple PaletteGroups, and thus placed on multiple PaletteImages (up to one per PaletteGroup).
Since a TextureImage may be referenced by multiple egg files that are each assigned to a different set of groups, it tries to maximize sharing between egg files and minimize the number of different PaletteGroups it is assigned to.
Definition at line 51 of file textureImage.h.
Member Function Documentation
Returns the alpha mode that should be used to render objects with this texture, as specified by the user or as determined from examining the texture's alpha channel.
Definition at line 547 of file textureImage.cxx.
Referenced by TextureReference::update_egg().
Returns the appropriate coverage threshold for this texture.
This is either the Palettizer::_coverage_threshold parameter, given globally via -r, or a particular value for this texture as supplied by the "coverage" keyword in the .txa file.
Definition at line 491 of file textureImage.cxx.
Referenced by TexturePlacement::determine_size().
Returns the appropriate margin for this texture.
This is either the Palettizer::_margin parameter, or a particular value for this texture as supplied by the "margin" keyword in the .txa file.
Definition at line 504 of file textureImage.cxx.
Determines the preferred source image for examining size and reading pixels, etc.
This is the largest and most recent of all the available source images.
Definition at line 614 of file textureImage.cxx.
References ImageFile::exists(), SourceTextureImage::get_egg_count(), ImageFile::get_filename(), SourceTextureImage::get_size(), ImageFile::get_x_size(), and ImageFile::get_y_size().
Referenced by DestTextureImage::copy_if_stale(), is_newer_than(), TxaLine::match_texture(), post_txa_file(), pre_txa_file(), PaletteGroup::prepare(), read_header(), read_source_image(), PaletteImage::update_image(), and write_scale_info().
Returns true if this particular texture is a 'surprise', i.e.
it wasn't matched by a line in the .txa file that didn't include the keyword 'cont'.
Definition at line 516 of file textureImage.cxx.
Referenced by Palettizer::report_pi().
Returns true if this particular texture has been named by the user for procession this session, for instance by listing an egg file on the command line that references it.
Definition at line 282 of file textureImage.cxx.
Referenced by PaletteImage::update_image().
Marks all the egg files that reference this texture stale.
Should be called only when the texture properties change in some catastrophic way that will require every egg file referencing it to be regenerated, even if it is not palettized.
Definition at line 253 of file textureImage.cxx.
Referenced by post_txa_file().
Once the .txa file has been read and the TextureImage matched against it, considers applying the requested size change.
Updates the TextureImage's size with the size the texture ought to be, if this can be determined.
Definition at line 321 of file textureImage.cxx.
References TextureProperties::egg_properties_match(), force_replace(), TextureProperties::fully_define(), TextureProperties::get_num_channels(), ImageFile::get_num_channels(), get_preferred_source(), SourceTextureImage::get_size(), ImageFile::get_x_size(), ImageFile::get_y_size(), TextureProperties::has_num_channels(), mark_eggs_stale(), TexturePlacement::mark_unfilled(), and TextureProperties::set_num_channels().
Referenced by Palettizer::process_all(), Palettizer::process_command_line_eggs(), and PaletteGroup::update_unknown_textures().
Accepts the indicated source image as if it had been read from disk.
This image is copied into the structure, and will be returned by future calls to read_source_image().
Definition at line 827 of file textureImage.cxx.
Writes the list of source pathnames that might contribute to this texture to the indicated output stream, one per line.
Definition at line 879 of file textureImage.cxx.
References PaletteGroups::empty(), EggFile::get_default_group(), SourceTextureImage::get_egg_count(), EggFile::get_explicit_groups(), TextureProperties::get_num_channels(), ImageFile::get_properties(), ImageFile::get_x_size(), ImageFile::get_y_size(), TextureProperties::has_num_channels(), ImageFile::is_size_known(), and ImageFile::output_filename().
Referenced by Palettizer::report_pi().
The documentation for this class was generated from the following files:
| | |