DynamicTextPage

Inheritance:

Methods of DynamicTextPage:

Methods of Texture:

Methods of TypedWritableReferenceCount:

Methods of TypedWritable:

Methods of TypedObject:

Methods of ReferenceCount:

Methods of Namable:

getClassType
static TypeHandle DynamicTextPage::get_class_type(void);

Undocumented function.

isEmpty
bool DynamicTextPage::is_empty(void) const;

Description: Returns true if the page has no glyphs, false otherwise.

clearAlphaFilename
void Texture::clear_alpha_filename(void);

Description: Removes the alpha filename, if it was previously set. See set_alpha_filename().

clearAlphaFullpath
void Texture::clear_alpha_fullpath(void);

Description: Removes the alpha fullpath, if it was previously set. See set_alpha_fullpath().

clearFilename
void Texture::clear_filename(void);

These are published, but in general, you shouldn't be mucking with these values; they are set automatically when a texture is loaded.
Description: Removes the alpha filename, if it was previously set. See set_filename().

clearFullpath
void Texture::clear_fullpath(void);

Description: Removes the alpha fullpath, if it was previously set. See set_fullpath().

clearRamImage
void Texture::clear_ram_image(void);

Description: Discards the current system-RAM image.

generateNormalizationCubeMap
void Texture::generate_normalization_cube_map(int size);

Description: Generates a special cube map image in the texture that can be used to apply bump mapping effects: for each texel in the cube map that is indexed by the 3-d texture coordinates (x, y, z), the resulting value is the normalized vector (x, y, z) (compressed from -1..1 into 0..1).
This also implicitly sets keep_ram_image to true.

getAlphaFilename
Filename const &Texture::get_alpha_filename(void) const;

Description: Returns the alpha_filename that has been set. If this is set, it represents the name of the alpha component, which is stored in a separate file. See also get_filename(), and get_alpha_fullpath().

getAlphaFullpath
Filename const &Texture::get_alpha_fullpath(void) const;

Description: Returns the alpha_fullpath that has been set. This is the full path to the alpha part of the image file as it was found along the texture search path.

getAnisotropicDegree
int Texture::get_anisotropic_degree(void) const;

Description: Returns the degree of anisotropic filtering that should be applied to the texture. Normally, this is 1, to indicate that anisotropic filtering should be disabled. If this is a number higher than 1, anisotropic filtering should be enabled (if the rendering backend supports it).

getBorderColor
LVecBase4f Texture::get_border_color(void) const;

Description: Returns the solid color of the texture's border. Some OpenGL implementations use a border for tiling textures; in Panda, it is only used for specifying the clamp color.

getClassType
static TypeHandle Texture::get_class_type(void);

Undocumented function.

getComponentType
Texture::ComponentType Texture::get_component_type(void) const;

Description: Returns the numeric interpretation of each component of the texture.

getComponentWidth
int Texture::get_component_width(void) const;

Description: Returns the number of bytes stored for each color component of a texel. Typically this is 1, but it may be 2 for 16-bit texels.

getExpectedRamImageSize
unsigned int Texture::get_expected_ram_image_size(void) const;

Description: Returns the number of bytes that *ought* to be used by the in-memory image, based on the texture parameters.

getExpectedRamPageSize
unsigned int Texture::get_expected_ram_page_size(void) const;

Description: Returns the number of bytes that should be used per each Z page of the 3-d texture. For a 2-d or 1-d texture, this is the same as get_expected_ram_image_size().

getFilename
Filename const &Texture::get_filename(void) const;

Description: Returns the filename that has been set. This is the name of the file as it was requested. Also see get_fullpath().

getFormat
Texture::Format Texture::get_format(void) const;

Description: Returns the format of the texture, which represents both the semantic meaning of the texels and, to some extent, their storage information.

getFullpath
Filename const &Texture::get_fullpath(void) const;

Description: Returns the fullpath that has been set. This is the full path to the file as it was found along the texture search path.

getKeepRamImage
virtual bool Texture::get_keep_ram_image(void) const;

Description: Returns the flag that indicates whether this Texture is eligible to have its main RAM copy of the texture memory dumped when the texture is prepared for rendering. See set_keep_ram_image().

getLoadedFromDisk
bool Texture::get_loaded_from_disk(void) const;

Description: Returns the flag that indicates the texture has been loaded from a disk file. See set_loaded_from_disk().

getMagfilter
Texture::FilterType Texture::get_magfilter(void) const;

Description: Returns the filter mode of the texture for magnification. The mipmap constants are invalid here.

getMinfilter
Texture::FilterType Texture::get_minfilter(void) const;

Description: Returns the filter mode of the texture for minification. If this is one of the mipmap constants, then the texture requires mipmaps.

getNumComponents
int Texture::get_num_components(void) const;

Description: Returns the number of color components for each texel of the texture image. This is 3 for an rgb texture or 4 for an rgba texture; it may also be 1 or 2 for a grayscale texture.

getRamImage
ConstPointerToArray< unsigned char > Texture::get_ram_image(void);

Description: Returns the system-RAM image data associated with the texture. If the texture does not currently have an associated RAM image, and the texture was generated by loading an image from a disk file (the most common case), this forces the reload of the same texture. This can happen if keep_texture_ram is configured to false, and we have previously prepared this texture with a GSG.
Note that it is not correct to call has_ram_image() first to test whether this function will fail. A false return value from has_ram_image() indicates only that get_ram_image() may need to reload the texture from disk, which it will do automatically. However, you can call might_have_ram_image(), which will return true if the ram image exists, or there is a reasonable reason to believe it can be loaded.
On the other hand, it is possible that the texture cannot be found on disk or is otherwise unavailable. If that happens, this function will return NULL. There is no way to predict with 100% accuracy whether get_ram_image() will return NULL without calling it first; might_have_ram_image() is the closest.

getRamImageSize
unsigned int Texture::get_ram_image_size(void) const;

Description: Returns the number of bytes used by the in-memory image, or 0 if there is no in-memory image.

getTextureType
Texture::TextureType Texture::get_texture_type(void) const;

Description: Returns the overall interpretation of the texture.

getWrapU
Texture::WrapMode Texture::get_wrap_u(void) const;

Description: Returns the wrap mode of the texture in the U direction.

getWrapV
Texture::WrapMode Texture::get_wrap_v(void) const;

Description: Returns the wrap mode of the texture in the V direction.

getWrapW
Texture::WrapMode Texture::get_wrap_w(void) const;

Description: Returns the wrap mode of the texture in the W direction. This is the depth direction of 3-d textures.

getXSize
int Texture::get_x_size(void) const;

Description: Returns the width of the texture image in texels.

getYSize
int Texture::get_y_size(void) const;

Description: Returns the height of the texture image in texels. For a 1-d texture, this will be 1.

getZSize
int Texture::get_z_size(void) const;

Description: Returns the depth of the texture image in texels. For a 1-d texture or 2-d texture, this will be 1. For a cube map texture, this will be 6.

hasAlphaFilename
bool Texture::has_alpha_filename(void) const;

Description: Returns true if the alpha_filename has been set and is available. See set_alpha_filename().

hasAlphaFullpath
bool Texture::has_alpha_fullpath(void) const;

Description: Returns true if the alpha_fullpath has been set and is available. See set_alpha_fullpath().

hasFilename
bool Texture::has_filename(void) const;

Description: Returns true if the filename has been set and is available. See set_filename().

hasFullpath
bool Texture::has_fullpath(void) const;

Description: Returns true if the fullpath has been set and is available. See set_fullpath().

hasRamImage
virtual bool Texture::has_ram_image(void) const;

Description: Returns true if the Texture has its image contents available in main RAM, false if it exists only in texture memory or in the prepared GSG context.
Note that this has nothing to do with whether get_ram_image() will fail or not. Even if has_ram_image() returns false, get_ram_image() may still return a valid RAM image, because get_ram_image() will automatically load the texture from disk if necessary. The only thing has_ram_image() tells you is whether the texture is available right now without hitting the disk first.
Note also that if an application uses only one GSG, it may appear that has_ram_image() returns true if the texture has not yet been loaded by the GSG, but this correlation is not true in general and should not be depended on. Specifically, if an application ever uses multiple GSG's in its lifetime (for instance, by opening more than one window, or by closing its window and opening another one later), then has_ram_image() may well return false on textures that have never been loaded on the current GSG.

load
virtual bool Texture::load(PNMImage const &pnmimage, int z = (0));

Description: Fills the texture system RAM data from the already-read PNMImage.
For a 3-d texture or a cube map, this must be called multiple times, one for each page (z value). Cube maps have exactly 6 pages, while 3-d textures can have any number and can dynamically grow as each page is loaded. For the first page loaded, this also sets the texture parameters; for subsequent pages, the texture parameters must match those which were loaded previously.
This also implicitly sets keep_ram_image to false if a filename has been set, or true if one has not been set.

loadRelated
Texture *Texture::load_related(PointerTo< InternalName > const &suffix) const;

Description: Loads a texture whose filename is derived by concatenating a suffix to the filename of this texture. May return NULL, for example, if this texture doesn't have a filename.

makeCopy
virtual PointerTo< Texture > Texture::make_copy(void);

Description: Returns a new copy of the same Texture. This copy, if applied to geometry, will be copied into texture as a separate texture from the original, so it will be duplicated in texture memory (and may be independently modified if desired).
If the Texture is an AviTexture, the resulting duplicate may be animated independently of the original.

makeRamImage
PointerToArray< unsigned char > Texture::make_ram_image(void);

Description: Discards the current system-RAM image for the texture, if any, and allocates a new buffer of the appropriate size. Returns the new buffer.
This also implicitly sets keep_ram_image to true.

mightHaveRamImage
bool Texture::might_have_ram_image(void) const;

Description: Returns true if the texture's image contents are currently available in main RAM, or there is reason to believe it can be loaded on demand. That is, this function returns a "best guess" as to whether get_ram_image() will succeed without actually calling it first.

modifyRamImage
PointerToArray< unsigned char > Texture::modify_ram_image(void);

Description: Returns a modifiable pointer to the system-RAM image. If the RAM image has been dumped, creates a new one.
This also implicitly sets keep_ram_image to true.

prepare
void Texture::prepare(PreparedGraphicsObjects *prepared_objects);

Description: Indicates that the texture should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame. This will ensure the texture is already loaded into texture memory if it is expected to be rendered soon.
Use this function instead of prepare_now() to preload textures from a user interface standpoint.

read
virtual bool Texture::read(Filename const &fullpath, int z = (0), int primary_file_num_channels = (0));

Description: Reads the texture from the indicated filename. If num_channels is not 0, it specifies the number of components to downgrade the image to if it is greater than this number.
This also implicitly sets keep_ram_image to false.
Description: Combine a 3-component image with a grayscale image to get a 4-component image

readPages
bool Texture::read_pages(Filename fullpath_pattern, int z_size = (0));

Description: Automatically reads in a sequence of pages, for the purpose of reading in a 3-d texture or a cube map texture. The filename should contain a sequence of one or more hash marks ("#") which will be filled in with the z value of each page, zero-based. If z_size is specified, the reading will stop there; otherwise, all found textures will be loaded, until a gap in the sequence is encountered.
If more than one hash mark is used, the numbers will be padded with zeroes if necessary to the corresponding number of digits.

release
bool Texture::release(PreparedGraphicsObjects *prepared_objects);

Description: Frees the texture context only on the indicated object, if it exists there. Returns true if it was released, false if it had not been prepared.

releaseAll
int Texture::release_all(void);

Description: Frees the context allocated on all objects for which the texture has been declared. Returns the number of contexts which have been freed.

setAlphaFilename
void Texture::set_alpha_filename(Filename const &alpha_filename);

Description: Sets the name of the file that contains the image's alpha channel contents. Normally, this is set automatically when the image is loaded, for instance via Texture::read().
The Texture's get_filename() function returns the name of the image file that was loaded into the buffer. In the case where a texture specified two separate files to load, a 1- or 3-channel color image and a 1-channel alpha image, this Filename is update to contain the name of the image file that was loaded into the buffer's alpha channel.

setAlphaFullpath
void Texture::set_alpha_fullpath(Filename const &alpha_fullpath);

Description: Sets the full pathname to the file that contains the image's alpha channel contents, as found along the search path. Normally, this is set automatically when the image is loaded, for instance via
Texture::read().

setAnisotropicDegree
void Texture::set_anisotropic_degree(int anisotropic_degree);

Description: Specifies the level of anisotropic filtering to apply to the texture. Normally, this is 1, to indicate anisotropic filtering is disabled. This may be set to a number higher than one to enable anisotropic filtering, if the rendering backend supports this.

setBorderColor
void Texture::set_border_color(LVecBase4f const &color);

Description: Specifies the solid color of the texture's border. Some OpenGL implementations use a border for tiling textures; in Panda, it is only used for specifying the clamp color.

setComponentType
void Texture::set_component_type(Texture::ComponentType component_type);

Description: Changes the data value for the texture components. This implicitly sets component_width as well.

setFilename
void Texture::set_filename(Filename const &filename);

These are published, but in general, you shouldn't be mucking with these values; they are set automatically when a texture is loaded.
Description: Sets the name of the file that contains the image's contents. Normally, this is set automatically when the image is loaded, for instance via
Texture::read().
The Texture's get_name() function used to return the filename, but now returns just the basename (without the extension), which is a more useful name for identifying an image in show code.

setFormat
void Texture::set_format(Texture::Format format);

Description: Changes the format value for the texture components. This implicitly sets num_components as well.

setFullpath
void Texture::set_fullpath(Filename const &fullpath);

Description: Sets the full pathname to the file that contains the image's contents, as found along the search path. Normally, this is set automatically when the image is loaded, for instance via Texture::read().

setKeepRamImage
void Texture::set_keep_ram_image(bool keep_ram_image);

Description: Sets the flag that indicates whether this Texture is eligible to have its main RAM copy of the texture memory dumped when the texture is prepared for rendering.
This will be true for most textures, which can reload their images if needed by rereading the input file. However, textures that were generated dynamically and cannot be easily reloaded will want to set this flag to true, so that the texture will always keep its image copy around.

setLoadedFromDisk
void Texture::set_loaded_from_disk(void);

Description: Sets the flag that indicates the texture has been loaded from a disk file. You should also ensure the filename has been set correctly. When this flag is true, the texture may be automatically reloaded when its ram image needs to be replaced.

setMagfilter
void Texture::set_magfilter(Texture::FilterType filter);

Description:

setMinfilter
void Texture::set_minfilter(Texture::FilterType filter);

Description:

setRamImage
void Texture::set_ram_image(PointerToArray< unsigned char > image);

Description: Replaces the current system-RAM image with the new data.
This also implicitly sets keep_ram_image to true.

setWrapU
void Texture::set_wrap_u(Texture::WrapMode wrap);

Description:

setWrapV
void Texture::set_wrap_v(Texture::WrapMode wrap);

Description:

setWrapW
void Texture::set_wrap_w(Texture::WrapMode wrap);

Description: The W wrap direction is only used for 3-d textures.

setXSize
void Texture::set_x_size(int x_size);

Description: Changes the x size indicated for the texture. This also implicitly unloads the texture if it has already been loaded.

setYSize
void Texture::set_y_size(int y_size);

Description: Changes the y size indicated for the texture. This also implicitly unloads the texture if it has already been loaded.

setZSize
void Texture::set_z_size(int z_size);

Description: Changes the z size indicated for the texture. This also implicitly unloads the texture if it has already been loaded.

setup1dTexture
void Texture::setup_1d_texture(void);

Filename: texture.I Created by: drose (05Feb99)
PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ .
To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net .
Description: Sets the texture as an empty 1-d texture with no dimensions. Follow up with read() or load() to fill the texture properties and image data.
Description: Sets the texture as an empty 1-d texture with the specified dimensions and properties. Follow up with set_ram_image() or modify_ram_image() to fill the image data.

setup2dTexture
void Texture::setup_2d_texture(void);

Description: Sets the texture as an empty 2-d texture with no dimensions. Follow up with read() or load() to fill the texture properties and image data.
Description: Sets the texture as an empty 2-d texture with the specified dimensions and properties. Follow up with set_ram_image() or modify_ram_image() to fill the image data.

setup3dTexture
void Texture::setup_3d_texture(int z_size = (1));

Description: Sets the texture as an empty 3-d texture with no dimensions (though if you know the depth ahead of time, it saves a bit of reallocation later). Follow up with read() or load() to fill the texture properties and image data.
Description: Sets the texture as an empty 3-d texture with the specified dimensions and properties. Follow up with set_ram_image() or modify_ram_image() to fill the image data.

setupCubeMap
void Texture::setup_cube_map(void);

Description: Sets the texture as an empty cube map texture with no dimensions. Follow up with read() or load() to fill the texture properties and image data.
Description: Sets the texture as an empty cube map texture with the specified dimensions and properties. Follow up with set_ram_image() or modify_ram_image() to fill the image data.
Note that a cube map should always consist of six square images, so x_size and y_size will be the same, and z_size is always 6.

setupTexture
void Texture::setup_texture(Texture::TextureType texture_type, int x_size, int y_size, int z_size, Texture::ComponentType component_type, Texture::Format format);

Description: Sets the texture to the indicated type and dimensions, presumably in preparation for calling read() or load(), or set_ram_image() or modify_ram_image().

store
bool Texture::store(PNMImage &pnmimage, int z = (0)) const;

Description: Saves the zth level of the texture to the indicated PNMImage, but does not write it to disk.

usesMipmaps
bool Texture::uses_mipmaps(void) const;

Description: Returns true if the minfilter settings on this texture indicate the use of mipmapping, false otherwise.

write
bool Texture::write(Filename const &fullpath, int z = (0)) const;

Description: Writes the texture to the indicated filename.

writePages
bool Texture::write_pages(Filename fullpath_pattern);

Description: Automatically writes out a sequence of pages, for the purpose of writing out a 3-d texture or a cube map texture. The filename should contain a sequence of one or more hash marks ("#") which will be filled in with the z value of each page, zero-based.
If more than one hash mark is used, the numbers will be padded with zeroes if necessary to the corresponding number of digits.

getClassType
static TypeHandle TypedWritableReferenceCount::get_class_type(void);

Undocumented function.

getClassType
static TypeHandle TypedWritable::get_class_type(void);

Undocumented function.

getBestParentFromSet
int TypedObject::get_best_parent_from_Set(set< int > const &) const;

Description: Returns true if the current object is the indicated type exactly.

getClassType
static TypeHandle TypedObject::get_class_type(void);

Undocumented function.

getType
virtual TypeHandle TypedObject::get_type(void) const = 0;

Derived classes should override this function to return get_class_type().

getTypeIndex
int TypedObject::get_type_index(void) const;

Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType
bool TypedObject::is_exact_type(TypeHandle handle) const;

Description: Returns true if the current object is the indicated type exactly.

isOfType
bool TypedObject::is_of_type(TypeHandle handle) const;

Description: Returns true if the current object is or derives from the indicated type.

getClassType
static TypeHandle ReferenceCount::get_class_type(void);

Undocumented function.

getRefCount
int ReferenceCount::get_ref_count(void) const;

Description: Returns the current reference count.

ref
int ReferenceCount::ref(void) const;

Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is the new reference count.

testRefCountIntegrity
bool ReferenceCount::test_ref_count_integrity(void) const;

Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

unref
int ReferenceCount::unref(void) const;

Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is the new reference count.

clearName
void Namable::clear_name(void);

Description: Resets the Namable's name to empty.

getClassType
static TypeHandle Namable::get_class_type(void);

Undocumented function.

getName
string const &Namable::get_name(void) const;

Description:

hasName
bool Namable::has_name(void) const;

Description: Returns true if the Namable has a nonempty name set, false if the name is empty.

operator =
Namable &Namable::operator =(Namable const &other);

Description:

output
void Namable::output(ostream &out) const;

In the absence of any definition to the contrary, outputting a Namable will write out its name.
Description: Outputs the Namable. This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

setName
void Namable::set_name(string const &name);

Description: