15 #ifndef TEXTUREPROPERTIES_H 16 #define TEXTUREPROPERTIES_H 18 #include "pandatoolbase.h" 20 #include "eggTexture.h" 21 #include "typedWritable.h" 60 EggTexture::Format _format;
64 EggTexture::FilterType _minfilter, _magfilter;
65 EggTexture::QualityLevel _quality_level;
66 int _anisotropic_degree;
71 static string get_format_string(EggTexture::Format format);
72 static string get_filter_string(EggTexture::FilterType filter_type);
73 static string get_anisotropic_degree_string(
int aniso_degree);
74 static string get_quality_level_string(EggTexture::QualityLevel quality_level);
75 static string get_type_string(
PNMFileType *color_type,
78 static EggTexture::Format union_format(EggTexture::Format a,
79 EggTexture::Format b);
81 static EggTexture::FilterType union_filter(EggTexture::FilterType a,
82 EggTexture::FilterType b);
83 static EggTexture::QualityLevel union_quality_level(EggTexture::QualityLevel a,
84 EggTexture::QualityLevel b);
86 bool _got_num_channels;
88 int _effective_num_channels;
107 static void init_type() {
108 TypedWritable::init_type();
109 register_type(_type_handle,
"TextureProperties",
110 TypedWritable::get_class_type());
113 return get_class_type();
void set_num_channels(int num_channels)
Sets the number of channels (1 through 4) associated with the image, presumably after reading this in...
int get_num_channels() const
Returns the number of channels (1 through 4) associated with the image.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Defines a texture map that may be applied to geometry.
Base class for objects that can be written to and read from Bam files.
This is the base class of a family of classes that represent particular image file types that PNMImag...
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...
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.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void update_egg_tex(EggTexture *egg_tex) const
Adjusts the texture properties of the indicated egg reference to match these properties.
string get_string() const
Returns a string corresponding to the TextureProperties object.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void force_nonalpha()
Sets the actual number of channels to indicate an image with no alpha channel, presumably after disco...
bool uses_alpha() const
Returns true if the texture uses an alpha channel, false otherwise.
bool has_num_channels() const
Returns true if the number of channels is known.
void fillin(DatagramIterator &scan, BamReader *manager)
Reads the binary data from the given datagram iterator, which was written by a previous call to write...
void force_grayscale()
Sets the actual number of channels to indicate a grayscale image, presumably after discovering that t...
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 T...
static void register_with_read_factory()
Registers the current object as something that can be read from a Bam file.
void clear_basic()
Resets only the properties that might be changed by update_properties() to a neutral state...
A class to retrieve the individual data elements previously stored in a Datagram. ...
void update_properties(const TextureProperties &other)
If the indicate TextureProperties structure is more specific than this one, updates this one...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void fully_define()
If any properties remain unspecified, specify them now.
This is the set of characteristics of a texture that, if different from another texture, prevent the two textures from sharing a PaletteImage.