#include <textureProperties.h>
Inheritance diagram for TextureProperties:
Public Member Functions | |
TextureProperties () | |
TextureProperties (const TextureProperties ©) | |
void | operator= (const TextureProperties ©) |
void | clear_basic () |
Resets only the properties that might be changed by update_properties() to a neutral state. | |
bool | has_num_channels () const |
Returns true if the number of channels is known. | |
int | get_num_channels () const |
Returns the number of channels (1 through 4) associated with the image. | |
void | set_num_channels (int num_channels) |
Sets the number of channels (1 through 4) associated with the image, presumably after reading this information from the image header. | |
void | force_grayscale () |
Sets the actual number of channels to indicate a grayscale image, presumably after discovering that the image contains no colored pixels. | |
void | force_nonalpha () |
Sets the actual number of channels to indicate an image with no alpha channel, presumably after discovering that the alpha channel contains no meaningful pixels. | |
bool | uses_alpha () const |
Returns true if the texture uses an alpha channel, false otherwise. | |
string | get_string () const |
Returns a string corresponding to the TextureProperties object. | |
void | update_properties (const TextureProperties &other) |
If the indicate TextureProperties structure is more specific than this one, updates this one. | |
void | fully_define () |
If any properties remain unspecified, specify them now. | |
void | update_egg_tex (EggTexture *egg_tex) const |
Adjusts the texture properties of the indicated egg reference to match these properties. | |
bool | egg_properties_match (const TextureProperties &other) const |
Returns true if all of the properties that are reflected directly in an egg file match between this TextureProperties object and the other, or false if any of them differ. | |
bool | operator< (const TextureProperties &other) const |
bool | operator== (const TextureProperties &other) const |
bool | operator!= (const TextureProperties &other) 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. | |
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 | fillin (DatagramIterator &scan, BamReader *manager) |
Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram(). | |
virtual TypeHandle | get_type () const |
virtual void | finalize () |
virtual TypeHandle | force_init_type (void) |
int | get_type_index () const |
bool | is_of_type (TypeHandle handle) const |
bool | is_exact_type (TypeHandle handle) const |
Static Public Member Functions | |
void | register_with_read_factory () |
Registers the current object as something that can be read from a Bam file. | |
TypeHandle | get_class_type () |
void | init_type () |
Public Attributes | |
EggTexture::Format | _format |
bool | _force_format |
bool | _generic_format |
EggTexture::FilterType | _minfilter |
EggTexture::FilterType | _magfilter |
int | _anisotropic_degree |
PNMFileType * | _color_type |
PNMFileType * | _alpha_type |
Static Public Attributes | |
TypedWritable *const | Null |
Static Protected Member Functions | |
TypedWritable * | make_TextureProperties (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. | |
Static Private Member Functions | |
string | get_format_string (EggTexture::Format format) |
Returns a short string representing the given EggTexture format. | |
string | get_filter_string (EggTexture::FilterType filter_type) |
Returns a short string representing the given EggTexture filter type. | |
string | get_anisotropic_degree_string (int aniso_degree) |
Returns a short string describing the anisotropic degree. | |
string | get_type_string (PNMFileType *color_type, PNMFileType *alpha_type) |
Returns a short string representing whether the color and/or alpha type has been specified or not. | |
EggTexture::Format | union_format (EggTexture::Format a, EggTexture::Format b) |
Returns the EggTexture format which is the more specific of the two. | |
EggTexture::FilterType | union_filter (EggTexture::FilterType a, EggTexture::FilterType b) |
Returns the EggTexture filter type which is the more specific of the two. | |
Private Attributes | |
bool | _got_num_channels |
int | _num_channels |
int | _effective_num_channels |
Static Private Attributes | |
TypeHandle | _type_handle |
It includes properties such as mipmapping, number of channels, etc.
Definition at line 48 of file textureProperties.h.
|
Definition at line 40 of file textureProperties.cxx. References _alpha_type, _anisotropic_degree, _color_type, _force_format, _generic_format, _magfilter, _minfilter, EggTexture::FT_unspecified, and NULL. |
|
Definition at line 62 of file textureProperties.cxx. |
|
Resets only the properties that might be changed by update_properties() to a neutral state.
Definition at line 110 of file textureProperties.cxx. References _got_num_channels. Referenced by ImageFile::has_num_channels(). |
|
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 TypedWritable. Definition at line 914 of file textureProperties.cxx. Referenced by TextureReference::translate_geom_uvs(). |
|
Returns true if all of the properties that are reflected directly in an egg file match between this TextureProperties object and the other, or false if any of them differ.
Definition at line 571 of file textureProperties.cxx. References EggTexture::F_rgba, EggTexture::F_rgbm, and EggTexture::F_unspecified. |
|
Reads the binary data from the given datagram iterator, which was written by a previous call to write_datagram().
Reimplemented from TypedWritable. Definition at line 968 of file textureProperties.cxx. Referenced by PalettePage::write_datagram(). |
|
Sets the actual number of channels to indicate a grayscale image, presumably after discovering that the image contains no colored pixels.
Definition at line 183 of file textureProperties.cxx. References EggTexture::F_alpha, EggTexture::F_luminance_alpha, EggTexture::F_luminance_alphamask, EggTexture::F_rgba12, EggTexture::F_rgba4, EggTexture::F_rgba5, EggTexture::F_rgba8, and EggTexture::F_rgbm. |
|
Sets the actual number of channels to indicate an image with no alpha channel, presumably after discovering that the alpha channel contains no meaningful pixels.
Definition at line 204 of file textureProperties.cxx. References _anisotropic_degree, _effective_num_channels, _format, _magfilter, _minfilter, get_anisotropic_degree_string(), get_filter_string(), get_format_string(), and ostringstream::str(). |
|
If any properties remain unspecified, specify them now. Also reconcile conflicting information. Definition at line 320 of file textureProperties.cxx. References _format, EggTexture::F_rgb, EggTexture::F_rgb12, EggTexture::F_rgb332, EggTexture::F_rgb5, EggTexture::F_rgb8, EggTexture::F_rgba, EggTexture::F_rgba12, EggTexture::F_rgba4, EggTexture::F_rgba5, and EggTexture::F_rgba8. |
|
Returns a short string describing the anisotropic degree.
Definition at line 761 of file textureProperties.cxx. References get_class_type(), BamReader::get_factory(), and make_TextureProperties(). Referenced by force_nonalpha(). |
|
Reimplemented from TypedWritable. Definition at line 113 of file textureProperties.h. Referenced by get_anisotropic_degree_string(). |
|
Returns a short string representing the given EggTexture filter type.
Definition at line 725 of file textureProperties.cxx. References EggTexture::F_alpha. Referenced by force_nonalpha(). |
|
Returns a short string representing the given EggTexture format.
Definition at line 651 of file textureProperties.cxx. References EggTexture::FT_linear, EggTexture::FT_linear_mipmap_linear, EggTexture::FT_linear_mipmap_nearest, EggTexture::FT_nearest_mipmap_linear, and EggTexture::FT_nearest_mipmap_nearest. Referenced by force_nonalpha(). |
|
Returns the number of channels (1 through 4) associated with the image. It is an error to call this unless has_num_channels() returns true. Definition at line 146 of file textureProperties.cxx. References _effective_num_channels, _got_num_channels, _num_channels, and nassertv. Referenced by TextureImage::copy_unplaced(). |
|
Returns a string corresponding to the TextureProperties object. Each unique set of TextureProperties will generate a unique string. This is used to generate unique palette image filenames. Definition at line 256 of file textureProperties.cxx. References _force_format, _got_num_channels, _num_channels, EggTexture::F_rgb, EggTexture::F_rgb12, EggTexture::F_rgb332, EggTexture::F_rgb5, EggTexture::F_rgb8, EggTexture::F_rgba, EggTexture::F_rgba12, EggTexture::F_rgba4, EggTexture::F_rgba5, EggTexture::F_rgba8, EggTexture::F_rgbm, and EggTexture::F_unspecified. |
|
Reimplemented from TypedWritable. Definition at line 121 of file textureProperties.h. |
|
Returns a short string representing whether the color and/or alpha type has been specified or not.
Definition at line 780 of file textureProperties.cxx. References writer(). |
|
Returns true if the number of channels is known.
Definition at line 129 of file textureProperties.cxx. References _effective_num_channels, _got_num_channels, and _num_channels. Referenced by TextureImage::copy_unplaced(), and ImageFile::get_x_size(). |
|
Reimplemented from TypedWritable. Definition at line 116 of file textureProperties.h. References _type_handle. |
|
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 945 of file textureProperties.cxx. Referenced by get_anisotropic_degree_string(). |
|
Definition at line 636 of file textureProperties.cxx. |
|
Definition at line 586 of file textureProperties.cxx. References EggTexture::F_luminance_alpha, EggTexture::F_luminance_alphamask, EggTexture::F_rgb, EggTexture::F_rgb12, EggTexture::F_rgb332, EggTexture::F_rgb5, EggTexture::F_rgb8, EggTexture::F_rgba12, EggTexture::F_rgba4, EggTexture::F_rgba5, and EggTexture::F_rgba8. |
|
Definition at line 85 of file textureProperties.cxx. References _effective_num_channels, _format, and _num_channels. |
|
Definition at line 618 of file textureProperties.cxx. References EggTexture::F_alpha, EggTexture::F_blue, EggTexture::F_green, EggTexture::F_luminance, and EggTexture::F_red. |
|
Registers the current object as something that can be read from a Bam file.
Definition at line 864 of file textureProperties.cxx. |
|
Sets the number of channels (1 through 4) associated with the image, presumably after reading this information from the image header.
Definition at line 164 of file textureProperties.cxx. References _effective_num_channels, _got_num_channels, _num_channels, and nassertv. Referenced by TextureImage::mark_eggs_stale(). |
|
Returns the EggTexture filter type which is the more specific of the two.
Definition at line 845 of file textureProperties.cxx. References _anisotropic_degree, _effective_num_channels, _force_format, _format, _generic_format, _got_num_channels, _magfilter, _minfilter, _num_channels, Palettizer::_read_pi_version, TypedWritable::fillin(), DatagramIterator::get_bool(), and DatagramIterator::get_int32(). |
|
Returns the EggTexture format which is the more specific of the two.
Definition at line 801 of file textureProperties.cxx. References _alpha_type, _color_type, TypedWritable::complete_pointers(), DCAST_INTO_R, and NULL. |
|
Adjusts the texture properties of the indicated egg reference to match these properties.
Definition at line 549 of file textureProperties.cxx. References _alpha_type, _anisotropic_degree, _color_type, _format, _magfilter, _minfilter, and NULL. |
|
If the indicate TextureProperties structure is more specific than this one, updates this one.
Definition at line 284 of file textureProperties.cxx. References _num_channels, EggTexture::F_alpha, EggTexture::F_blue, EggTexture::F_green, EggTexture::F_luminance, EggTexture::F_luminance_alpha, EggTexture::F_luminance_alphamask, and EggTexture::F_red. |
|
Returns true if the texture uses an alpha channel, false otherwise.
Definition at line 221 of file textureProperties.cxx. Referenced by ImageFile::set_filename(). |
|
Fills the indicated datagram up with a binary representation of the current object, in preparation for writing to a Bam file.
Reimplemented from TypedWritable. Definition at line 882 of file textureProperties.cxx. |
|
Definition at line 80 of file textureProperties.h. Referenced by ImageFile::exists(), ImageFile::set_filename(), TextureProperties(), union_format(), and update_egg_tex(). |
|
Definition at line 78 of file textureProperties.h. Referenced by force_nonalpha(), TextureProperties(), union_filter(), and update_egg_tex(). |
|
Definition at line 79 of file textureProperties.h. Referenced by ImageFile::exists(), TextureProperties(), union_format(), update_egg_tex(), and ImageFile::update_properties(). |
|
Definition at line 97 of file textureProperties.h. Referenced by force_nonalpha(), get_num_channels(), has_num_channels(), operator=(), set_num_channels(), and union_filter(). |
|
Definition at line 75 of file textureProperties.h. Referenced by get_string(), TextureProperties(), and union_filter(). |
|
Definition at line 74 of file textureProperties.h. Referenced by TextureMemoryCounter::add_texture(), force_nonalpha(), fully_define(), operator=(), union_filter(), and update_egg_tex(). |
|
Definition at line 76 of file textureProperties.h. Referenced by TextureProperties(), and union_filter(). |
|
Definition at line 95 of file textureProperties.h. Referenced by clear_basic(), get_num_channels(), get_string(), has_num_channels(), set_num_channels(), and union_filter(). |
|
Definition at line 77 of file textureProperties.h. Referenced by force_nonalpha(), TextureProperties(), union_filter(), and update_egg_tex(). |
|
Definition at line 77 of file textureProperties.h. Referenced by force_nonalpha(), TextureProperties(), union_filter(), and update_egg_tex(). |
|
Definition at line 96 of file textureProperties.h. Referenced by get_num_channels(), get_string(), has_num_channels(), operator=(), set_num_channels(), union_filter(), and update_properties(). |
|
Reimplemented from TypedWritable. Definition at line 30 of file textureProperties.cxx. Referenced by init_type(). |