Go to the documentation of this file.
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();
void set_num_channels(int num_channels)
Sets the number of channels (1 through 4) associated with the image, presumably after reading this in...
A class to retrieve the individual data elements previously stored in a Datagram.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
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.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void update_egg_tex(EggTexture *egg_tex) const
Adjusts the texture properties of the indicated egg reference to match these properties.
Base class for objects that can be written to and read from Bam files.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
TypeHandle is the identifier used to differentiate C++ class types.
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,...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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...
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.
bool uses_alpha() const
Returns true if the texture uses an alpha channel, false otherwise.
This is the set of characteristics of a texture that, if different from another texture,...
void force_nonalpha()
Sets the actual number of channels to indicate an image with no alpha channel, presumably after disco...
void fully_define()
If any properties remain unspecified, specify them now.
void force_grayscale()
Sets the actual number of channels to indicate a grayscale image, presumably after discovering that t...
Defines a texture map that may be applied to geometry.
void update_properties(const TextureProperties &other)
If the indicate TextureProperties structure is more specific than this one, updates this one.
This is the base class of a family of classes that represent particular image file types that PNMImag...