Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TextureProperties Class Reference

This is the set of characteristics of a texture that, if different from another texture, prevent the two textures from sharing a PaletteImage. More...

`#include "textureProperties.h"`

Inheritance diagram for TextureProperties:

## Public Member Functions
| TextureProperties (const TextureProperties &copy)
void | clear_basic ()
| Resets only the properties that might be changed by update_properties() to a neutral state.
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.
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.
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().
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.
void | fully_define ()
| If any properties remain unspecified, specify them now.
int | get_num_channels () const
| Returns the number of channels (1 through 4) associated with the image.
std::string | get_string () const
| Returns a string corresponding to the TextureProperties object.
virtual TypeHandle | get_type () const
bool | has_num_channels () const
| Returns true if the number of channels is known.
bool | operator!= (const TextureProperties &other) const
bool | operator< (const TextureProperties &other) const
void | operator= (const TextureProperties &copy)
bool | operator== (const TextureProperties &other) const
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 | update_egg_tex (EggTexture *egg_tex) const
| Adjusts the texture properties of the indicated egg reference to match these properties.
void | update_properties (const TextureProperties &other)
| If the indicate TextureProperties structure is more specific than this one, updates this one.
bool | uses_alpha () const
| Returns true if the texture uses an alpha channel, false otherwise.
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.
Public Member Functions inherited from TypedWritable
| TypedWritable (const TypedWritable &copy)
virtual ReferenceCount * | as_reference_count ()
| Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
vector_uchar | encode_to_bam_stream () const
| Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object.
bool | encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) const
| Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
virtual void | finalize (BamReader *manager)
| Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
virtual TypeHandle | force_init_type ()
UpdateSeq | get_bam_modified () const
| Returns the current bam_modified counter.
void | mark_bam_modified ()
| Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
void | operator= (const TypedWritable &copy)
virtual bool | require_fully_complete () const
| Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
virtual void | update_bam_nested (BamWriter *manager)
| Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
int | get_best_parent_from_Set (const std::set< int > &) const
int | get_type_index () const
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)

## 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.
Static Public Member Functions inherited from TypedWritable
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, vector_uchar data, BamReader *reader=nullptr)
| Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes.
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedObject
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.

## Public Attributes
PNMFileType * | _alpha_type
int | _anisotropic_degree
PNMFileType * | _color_type
bool | _force_format
EggTexture::Format | _format
bool | _generic_format
bool | _keep_format
EggTexture::FilterType | _magfilter
EggTexture::FilterType | _minfilter
EggTexture::QualityLevel | _quality_level
Public Attributes inherited from TypedObject
| get_type

## Additional Inherited Members
Static Public Attributes inherited from TypedWritable
static TypedWritable *const | Null = nullptr

## Detailed Description

This is the set of characteristics of a texture that, if different from another texture, prevent the two textures from sharing a PaletteImage.

It includes properties such as mipmapping, number of channels, etc.

Definition at line 30 of file textureProperties.h.

## Constructor & Destructor Documentation

## ◆ TextureProperties() [1/2]

TextureProperties::TextureProperties | ( |  | ) |

Definition at line 30 of file textureProperties.cxx.

## ◆ TextureProperties() [2/2]

TextureProperties::TextureProperties | ( | const TextureProperties & | copy | ) |

Definition at line 50 of file textureProperties.cxx.

## Member Function Documentation

## ◆ clear_basic()

void TextureProperties::clear_basic | ( |  | ) |

Resets only the properties that might be changed by update_properties() to a neutral state.

Definition at line 92 of file textureProperties.cxx.

Referenced by ImageFile::clear_basic_properties().

## ◆ complete_pointers()

int TextureProperties::complete_pointers | ( | TypedWritable ** | p_list,
|  | BamReader * | manager )
| virtual

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 784 of file textureProperties.cxx.

References TypedWritable::complete_pointers().

## ◆ egg_properties_match()

bool TextureProperties::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.

Definition at line 476 of file textureProperties.cxx.

## ◆ fillin()

void TextureProperties::fillin | ( | DatagramIterator & | scan,
|  | BamReader * | manager )
| virtual

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 821 of file textureProperties.cxx.

References TypedWritable::fillin(), DatagramIterator::get_bool(), DatagramIterator::get_int32(), and BamReader::read_pointer().

## ◆ force_grayscale()

void TextureProperties::force_grayscale | ( |  | ) |

Sets the actual number of channels to indicate a grayscale image, presumably after discovering that the image contains no colored pixels.

Definition at line 137 of file textureProperties.cxx.

## ◆ force_nonalpha()

void TextureProperties::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.

Definition at line 149 of file textureProperties.cxx.

## ◆ fully_define()

void TextureProperties::fully_define | ( |  | ) |

If any properties remain unspecified, specify them now.

Also reconcile conflicting information.

Definition at line 237 of file textureProperties.cxx.

## ◆ get_class_type()

static TypeHandle TextureProperties::get_class_type | ( |  | ) |
| inline static

Definition at line 100 of file textureProperties.h.

## ◆ get_num_channels()

int TextureProperties::get_num_channels | ( |  | ) | const

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 116 of file textureProperties.cxx.

Referenced by TextureImage::write_source_pathnames().

## ◆ get_string()

string TextureProperties::get_string | ( |  | ) | const

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 183 of file textureProperties.cxx.

## ◆ get_type()

virtual TypeHandle TextureProperties::get_type | ( |  | ) | const
| inline virtual

Reimplemented from TypedWritable.

Definition at line 108 of file textureProperties.h.

## ◆ has_num_channels()

bool TextureProperties::has_num_channels | ( |  | ) | const

Returns true if the number of channels is known.

Definition at line 107 of file textureProperties.cxx.

Referenced by TextureImage::write_source_pathnames().

## ◆ init_type()

static void TextureProperties::init_type | ( |  | ) |
| inline static

Definition at line 103 of file textureProperties.h.

## ◆ operator!=()

bool TextureProperties::operator!= | ( | const TextureProperties & | other | ) | const

Definition at line 534 of file textureProperties.cxx.

## ◆ operator<()

bool TextureProperties::operator< | ( | const TextureProperties & | other | ) | const

Definition at line 488 of file textureProperties.cxx.

## ◆ operator=()

void TextureProperties::operator= | ( | const TextureProperties & | copy | ) |

Definition at line 71 of file textureProperties.cxx.

## ◆ operator==()

bool TextureProperties::operator== | ( | const TextureProperties & | other | ) | const

Definition at line 519 of file textureProperties.cxx.

## ◆ register_with_read_factory()

void TextureProperties::register_with_read_factory | ( |  | ) |
| static

Registers the current object as something that can be read from a Bam file.

Definition at line 750 of file textureProperties.cxx.

References BamReader::get_factory().

Referenced by init_palettizer().

## ◆ set_num_channels()

void TextureProperties::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.

Definition at line 126 of file textureProperties.cxx.

## ◆ update_egg_tex()

void TextureProperties::update_egg_tex | ( | EggTexture * | egg_tex | ) | const

Adjusts the texture properties of the indicated egg reference to match these properties.

Definition at line 462 of file textureProperties.cxx.

References EggTexture::set_anisotropic_degree.

## ◆ update_properties()

void TextureProperties::update_properties | ( | const TextureProperties & | other | ) |

If the indicate TextureProperties structure is more specific than this one, updates this one.

Definition at line 206 of file textureProperties.cxx.

## ◆ uses_alpha()

bool TextureProperties::uses_alpha | ( |  | ) | const

Returns true if the texture uses an alpha channel, false otherwise.

Definition at line 159 of file textureProperties.cxx.

## ◆ write_datagram()

void TextureProperties::write_datagram | ( | BamWriter * | writer,
|  | Datagram & | datagram )
| virtual

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 760 of file textureProperties.cxx.

References Datagram::add_bool(), Datagram::add_int32(), TypedWritable::write_datagram(), and BamWriter::write_pointer().

## Member Data Documentation

## ◆ _alpha_type

PNMFileType* TextureProperties::_alpha_type

Definition at line 64 of file textureProperties.h.

## ◆ _anisotropic_degree

int TextureProperties::_anisotropic_degree

Definition at line 62 of file textureProperties.h.

## ◆ _color_type

PNMFileType* TextureProperties::_color_type

Definition at line 63 of file textureProperties.h.

## ◆ _force_format

bool TextureProperties::_force_format

Definition at line 57 of file textureProperties.h.

## ◆ _format

EggTexture::Format TextureProperties::_format

Definition at line 56 of file textureProperties.h.

## ◆ _generic_format

bool TextureProperties::_generic_format

Definition at line 58 of file textureProperties.h.

## ◆ _keep_format

bool TextureProperties::_keep_format

Definition at line 59 of file textureProperties.h.

## ◆ _magfilter

EggTexture::FilterType TextureProperties::_magfilter

Definition at line 60 of file textureProperties.h.

## ◆ _minfilter

EggTexture::FilterType TextureProperties::_minfilter

Definition at line 60 of file textureProperties.h.

## ◆ _quality_level

EggTexture::QualityLevel TextureProperties::_quality_level

Definition at line 61 of file textureProperties.h.

The documentation for this class was generated from the following files:

- pandatool/src/palettizer/textureProperties.h
- pandatool/src/palettizer/textureProperties.cxx