18 #include "pandatoolbase.h" 20 #include "textureProperties.h" 23 #include "typedWritable.h" 53 bool set_filename(
const string &dirname,
const string &basename);
71 int _alpha_file_channel;
89 static void init_type() {
90 TypedWritable::init_type();
91 register_type(_type_handle,
"ImageFile",
92 TypedWritable::get_class_type());
95 return get_class_type();
bool write(const PNMImage &image) const
Writes out the image in the indicated PNMImage to the _filename and/or _alpha_filename.
bool read(PNMImage &image) const
Reads in the image (or images, if the alpha_filename is separate) and stores it in the indicated PNMI...
void update_egg_tex(EggTexture *egg_tex) const
Sets the indicated EggTexture to refer to this file.
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
bool exists() const
Returns true if the file or files named by the image file exist, false otherwise. ...
int get_alpha_file_channel() const
Returns the particular channel number of the alpha image file from which the alpha channel should be ...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
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...
bool set_filename(PaletteGroup *group, const string &basename)
Sets the filename, and if applicable, the alpha_filename, from the indicated basename.
Defines a texture map that may be applied to geometry.
int get_y_size() const
Returns the size of the image file in pixels in the Y direction.
Base class for objects that can be written to and read from Bam files.
This is the highest level of grouping for TextureImages.
void output_filename(ostream &out) const
Writes the filename (or pair of filenames) to the indicated output stream.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
bool make_shadow_image(const string &basename)
Sets up the ImageFile as a "shadow image" of a particular PaletteImage.
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.
const TextureProperties & get_properties() const
Returns the grouping properties of the image.
bool is_size_known() const
Returns true if the size of the image file is known, false otherwise.
The name of a file, such as a texture file or an Egg file.
int get_x_size() const
Returns the size of the image file in pixels in the X direction.
This is the base class of both TextureImage and PaletteImage.
int get_num_channels() const
Returns the number of channels of the image.
void clear_basic_properties()
Resets the properties to a neutral state, for instance in preparation for calling update_properties()...
const Filename & get_alpha_filename() const
Returns the alpha filename of the image file.
void unlink()
Deletes the image file or files.
bool has_num_channels() const
Returns true if the number of channels in the image is known, false otherwise.
void update_properties(const TextureProperties &properties)
If the indicate TextureProperties structure is more specific than this one, updates this one...
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
const Filename & get_filename() const
Returns the primary filename of the image file.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This is the set of characteristics of a texture that, if different from another texture, prevent the two textures from sharing a PaletteImage.