14 #ifndef TEXTUREPROPERTIES_H 15 #define TEXTUREPROPERTIES_H 56 EggTexture::Format _format;
60 EggTexture::FilterType _minfilter, _magfilter;
61 EggTexture::QualityLevel _quality_level;
62 int _anisotropic_degree;
67 static std::string get_format_string(EggTexture::Format format);
68 static std::string get_filter_string(EggTexture::FilterType filter_type);
69 static std::string get_anisotropic_degree_string(
int aniso_degree);
70 static std::string get_quality_level_string(EggTexture::QualityLevel quality_level);
71 static std::string get_type_string(
PNMFileType *color_type,
74 static EggTexture::Format union_format(EggTexture::Format a,
75 EggTexture::Format b);
77 static EggTexture::FilterType union_filter(EggTexture::FilterType a,
78 EggTexture::FilterType b);
79 static EggTexture::QualityLevel union_quality_level(EggTexture::QualityLevel a,
80 EggTexture::QualityLevel b);
82 bool _got_num_channels;
84 int _effective_num_channels;
103 static void init_type() {
104 TypedWritable::init_type();
106 TypedWritable::get_class_type());
109 return get_class_type();
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
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,...
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.
std::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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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,...