Panda3D
|
This represents a texture filename as it has been resized and copied to the map directory (e.g. More...
#include "destTextureImage.h"
Public Member Functions | |
DestTextureImage (TexturePlacement *placement) | |
void | copy (TextureImage *texture) |
Unconditionally copies the source texture into the appropriate filename. | |
void | copy_if_stale (const DestTextureImage *other, TextureImage *texture) |
Copies the source texture into the appropriate filename only if the indicated old reference, which represents the way it was last copied, is now out-of-date. | |
virtual TypeHandle | get_type () const |
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. | |
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_DestTextureImage (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. |
This represents a texture filename as it has been resized and copied to the map directory (e.g.
for an unplaced texture).
Definition at line 31 of file destTextureImage.h.
void DestTextureImage::copy | ( | TextureImage * | texture | ) |
Unconditionally copies the source texture into the appropriate filename.
Definition at line 72 of file destTextureImage.cxx.
References PNMImage::fill(), PNMImageHeader::get_maxval(), ImageFile::get_num_channels(), PNMImage::is_valid(), PNMImage::quick_filter_from(), TextureImage::read_source_image(), TextureImage::release_source_image(), and ImageFile::write().
Referenced by copy_if_stale().
void DestTextureImage::copy_if_stale | ( | const DestTextureImage * | other, |
TextureImage * | texture | ||
) |
Copies the source texture into the appropriate filename only if the indicated old reference, which represents the way it was last copied, is now out-of-date.
Definition at line 103 of file destTextureImage.cxx.
References copy(), ImageFile::get_filename(), ImageFile::get_num_channels(), TextureImage::get_preferred_source(), ImageFile::get_x_size(), and ImageFile::get_y_size().
void DestTextureImage::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().
Reimplemented from ImageFile.
Definition at line 186 of file destTextureImage.cxx.
Referenced by make_DestTextureImage().
static void DestTextureImage::init_type | ( | ) | [inline, static] |
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 58 of file destTextureImage.h.
TypedWritable * DestTextureImage::make_DestTextureImage | ( | const FactoryParams & | params | ) | [static, protected] |
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.
Definition at line 168 of file destTextureImage.cxx.
References fillin().
Referenced by register_with_read_factory().
void DestTextureImage::register_with_read_factory | ( | ) | [static] |
Registers the current object as something that can be read from a Bam file.
Definition at line 142 of file destTextureImage.cxx.
References BamReader::get_factory(), and make_DestTextureImage().
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
Reimplemented from ImageFile.
Definition at line 155 of file destTextureImage.cxx.