# Texture

from pandac.PandaModules import Texture

Class : Texture
Description : Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-d texture image, or the six 2-d faces of a cube map texture.
A texture's image data might be stored in system RAM (see get_ram_image()) or its image may be represented in texture memory on one or more GraphicsStateGuardians (see prepare()), or both. The typical usage pattern is that a texture is loaded from an image file on disk, which copies its image data into system RAM; then the first time the texture is rendered its image data is copied to texture memory (actually, to the graphics API), and the system RAM image is automatically freed.

## Inheritance:

Texture: TypedWritableReferenceCount Namable
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase
Namable:

## Methods of Texture:

Texture (Constructor)
clear
clearAlphaFilename
clearAlphaFullpath
clearAuxData
clearFilename
clearFullpath
clearRamImage
clearRamMipmapImage
clearRamMipmapImages
clearSimpleRamImage
compressRamImage
downToPower2
estimateTextureMemory
generateAlphaScaleMap
generateNormalizationCubeMap
generateRamMipmapImages
generateSimpleRamImage
getActive
getAlphaFilename
getAlphaFullpath
getAnisotropicDegree
getAuxData
getBorderColor
getClassType
getComponentType
getComponentWidth
getCompression
getDataSizeBytes
getEffectiveAnisotropicDegree
getEffectiveMagfilter
getEffectiveMinfilter
getEffectiveQualityLevel
getExpectedMipmapXSize
getExpectedMipmapYSize
getExpectedMipmapZSize
getExpectedNumMipmapLevels
getExpectedRamImageSize
getExpectedRamMipmapImageSize
getExpectedRamMipmapPageSize
getExpectedRamPageSize
getFilename
getFormat
getFullpath
getImageModified
getKeepRamImage
getLoadedFromImage
getLoadedFromTxo
getMagfilter
getMatchFramebufferFormat
getMinfilter
getNumComponents
getNumLoadableRamMipmapImages
getNumRamMipmapImages
getOrigFileXSize
getOrigFileYSize
getOrigFileZSize
getPadXSize
getPadYSize
getPadZSize
getPostLoadStoreCache
getPropertiesModified
getQualityLevel
getRamImage
getRamImageAs
getRamImageCompression
getRamImageSize
getRamMipmapImage
getRamMipmapImageSize
getRamMipmapPageSize
getRamPageSize
getRenderToTexture
getResident
getSimpleImageModified
getSimpleRamImage
getSimpleRamImageSize
getSimpleXSize
getSimpleYSize
getTexturesPower2
getTextureType
getUncompressedRamImage
getWrapU
getWrapV
getWrapW
getXSize
getYSize
getZSize
hasAllRamMipmapImages
hasAlphaFilename
hasAlphaFullpath
hasCompression
hasFilename
hasFullpath
hasRamImage
hasRamMipmapImage
hasSimpleRamImage
hasUncompressedRamImage
haveTexturesPower2
isMipmap
isPrepared
load
loadRelated
makeCopy
makeRamImage
makeRamMipmapImage
mightHaveRamImage
modifyRamImage
modifyRamMipmapImage
modifySimpleRamImage
newSimpleRamImage
peek
prepare
prepareNow
read
readDds
readTxo
release
releaseAll
reload
setAlphaFilename
setAlphaFullpath
setAnisotropicDegree
setAuxData
setBorderColor
setComponentType
setCompression
setFilename
setFormat
setFullpath
setKeepRamImage
setLoadedFromImage
setLoadedFromTxo
setMagfilter
setMatchFramebufferFormat
setMinfilter
setOrigFileSize
setPadSize
setPostLoadStoreCache
setQualityLevel
setRamImage
setRamMipmapImage
setRenderToTexture
setSimpleRamImage
setSizePadded
setTexturesPower2
setup1dTexture
setup2dTexture
setup3dTexture
setupCubeMap
setupTexture
setWrapU
setWrapV
setWrapW
setXSize
setYSize
setZSize
store
uncompressRamImage
upToPower2
usesMipmaps
wasImageModified
write
writeTxo

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

## Methods of Namable:

Namable (Constructor)
clearName
getClassType
getName
hasName
operator =
output
setName

## Constants in Texture:

TT1dTexture | (TextureType)
TT2dTexture | (TextureType)
TT3dTexture | (TextureType)
TTCubeMap | (TextureType)
TUnsignedByte | (ComponentType)
TUnsignedShort | (ComponentType)
TFloat | (ComponentType)
FDepthStencil | (Format)
FColorIndex | (Format)
FRed | (Format)
FGreen | (Format)
FBlue | (Format)
FAlpha | (Format)
FRgb | (Format)
FRgb5 | (Format)
FRgb8 | (Format)
FRgb12 | (Format)
FRgb332 | (Format)
FRgba | (Format)
FRgbm | (Format)
FRgba4 | (Format)
FRgba5 | (Format)
FRgba8 | (Format)
FRgba12 | (Format)
FLuminance | (Format)
FLuminanceAlpha | (Format)
FLuminanceAlphamask | (Format)
FRgba16 | (Format)
FRgba32 | (Format)
FDepthComponent | (Format)
FTNearest | (FilterType)
FTLinear | (FilterType)
FTNearestMipmapNearest | (FilterType)
FTLinearMipmapNearest | (FilterType)
FTNearestMipmapLinear | (FilterType)
FTLinearMipmapLinear | (FilterType)
FTShadow | (FilterType)
FTDefault | (FilterType)
FTInvalid | (FilterType)
WMClamp | (WrapMode)
WMRepeat | (WrapMode)
WMMirror | (WrapMode)
WMMirrorOnce | (WrapMode)
WMBorderColor | (WrapMode)
WMInvalid | (WrapMode)
CMDefault | (CompressionMode)
CMOff | (CompressionMode)
CMOn | (CompressionMode)
CMFxt1 | (CompressionMode)
CMDxt1 | (CompressionMode)
CMDxt2 | (CompressionMode)
CMDxt3 | (CompressionMode)
CMDxt4 | (CompressionMode)
CMDxt5 | (CompressionMode)
QLDefault | (QualityLevel)
QLFastest | (QualityLevel)
QLNormal | (QualityLevel)
QLBest | (QualityLevel)

Texture Texture::Texture(string const &name = ((string()))); Description: Constructs an empty texture. The default is to set up the texture as an empty 2-d texture; follow up with one of the variants of setup_texture() if this is not what you want. Description: Use Texture::make_copy() to make a duplicate copy of an existing Texture.

clear void Texture::clear(void); Description: Reinitializes the texture to its default, empty state (except for the name).

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().

clearAuxData void Texture::clear_aux_data(string const &key); Description: Removes a record previously recorded via set_aux_data().

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.

clearRamMipmapImage void Texture::clear_ram_mipmap_image(int n); Description: Discards the current system-RAM image for the nth mipmap level.

clearRamMipmapImages void Texture::clear_ram_mipmap_images(void); Description: Discards the current system-RAM image for all mipmap levels, except level 0 (the base image).

clearSimpleRamImage void Texture::clear_simple_ram_image(void); Description: Discards the current "simple" image.

compressRamImage bool Texture::compress_ram_image(Texture::CompressionMode compression = (CM_on), Texture::QualityLevel quality_level = (QL_default), GraphicsStateGuardianBase *gsg = ((void *)(0))); Description: Attempts to compress the texture's RAM image internally, to a format supported by the indicated GSG. In order for this to work, the squish library must have been compiled into Panda. If compression is CM_on, then an appropriate compression method that is supported by the indicated GSG is automatically chosen. If the GSG pointer is NULL, any of the standard DXT1/3/5 compression methods will be used, regardless of whether it is supported. If compression is any specific compression method, that method is used regardless of whether the GSG supports it. quality_level determines the speed/quality tradeoff of the compression. If it is QL_default, the texture's own quality_level parameter is used. Returns true if successful, false otherwise.

downToPower2 static int Texture::down_to_power_2(int value); Description: Returns the largest power of 2 less than or equal to value.

estimateTextureMemory unsigned int Texture::estimate_texture_memory(void) const; Description: Estimates the amount of texture memory that will be consumed by loading this texture. This returns a value that is not specific to any particular graphics card or driver; it tries to make a reasonable assumption about how a driver will load the texture. It does not account for texture compression or anything fancy. This is mainly useful for debugging and reporting purposes. Returns a value in bytes.

generateAlphaScaleMap void Texture::generate_alpha_scale_map(void); Description: Generates a special 256x1 1-d texture that can be used to apply an arbitrary alpha scale to objects by judicious use of texture matrix. The texture is a gradient, with an alpha of 0 on the left (U = 0), and 255 on the right (U = 1).

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).

generateRamMipmapImages void Texture::generate_ram_mipmap_images(void); Description: Automatically fills in the n mipmap levels of the Texture, based on the texture's source image. This requires the texture's uncompressed ram image to be available in system memory. If it is not already, it will be fetched if possible. This call is not normally necessary, since the mipmap levels will be generated automatically if needed. But there may be certain cases in which you would like to call this explicitly.

generateSimpleRamImage void Texture::generate_simple_ram_image(void); Description: Computes the "simple" ram image by loading the main RAM image, if it is not already available, and reducing it to 16x16 or smaller. This may be an expensive operation.

getActive bool Texture::get_active(PreparedGraphicsObjects *prepared_objects) const; Description: Returns true if this Texture was rendered in the most recent frame within the indicated GSG.

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. This value may return 0, indicating the default value; see also get_effective_anisotropic_degree.

getAuxData TypedReferenceCount *Texture::get_aux_data(string const &key) const; Description: Returns a record previously recorded via set_aux_data(). Returns NULL if there was no record associated with the indicated key.

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.

getCompression Texture::CompressionMode Texture::get_compression(void) const; Description: Returns the compression mode requested for this particular texture, or CM_off if the texture is not to be compressed. If a value other than CM_off is returned, this is not a guarantee that the texture is actually successfully compressed on the GSG. It may be that the GSG does not support the requested compression mode, in which case the texture may actually be stored uncompressed in texture memory.

getDataSizeBytes unsigned int Texture::get_data_size_bytes(PreparedGraphicsObjects *prepared_objects) const; Description: Returns the number of bytes which the texture is reported to consume within graphics memory, for the indicated GSG. This may return a nonzero value even if the texture is not currently resident; you should also check get_resident() if you want to know how much space the texture is actually consuming right now.

getEffectiveAnisotropicDegree int Texture::get_effective_anisotropic_degree(void) const; Description: Returns the degree of anisotropic filtering that should be applied to the texture. This value will normally not return 0, unless there is an error in the config file.

getEffectiveMagfilter Texture::FilterType Texture::get_effective_magfilter(void) const; Description: Returns the filter mode of the texture for magnification, with special treatment for FT_default. This will normally not return FT_default, unless there is an error in the config file.

getEffectiveMinfilter Texture::FilterType Texture::get_effective_minfilter(void) const; Description: Returns the filter mode of the texture for minification, with special treatment for FT_default. This will normally not return FT_default, unless there is an error in the config file.

getEffectiveQualityLevel Texture::QualityLevel Texture::get_effective_quality_level(void) const; Description: Returns the current quality_level hint, or the global default quality_level if this texture doesn't specify a quality level. This value will not normally return QL_default (unless there is an error in the config file)

getExpectedMipmapXSize int Texture::get_expected_mipmap_x_size(int n) const; Description: Returns the x_size that the nth mipmap level should have, based on the texture's size.

getExpectedMipmapYSize int Texture::get_expected_mipmap_y_size(int n) const; Description: Returns the y_size that the nth mipmap level should have, based on the texture's size.

getExpectedMipmapZSize int Texture::get_expected_mipmap_z_size(int n) const; Description: Returns the z_size that the nth mipmap level should have, based on the texture's size.

getExpectedNumMipmapLevels int Texture::get_expected_num_mipmap_levels(void) const; Description: Returns the number of mipmap levels that should be defined for this texture, given the texture's size. Note that this returns a number appropriate for mipmapping, even if the texture does not currently have mipmapping enabled.

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.

getExpectedRamMipmapImageSize unsigned int Texture::get_expected_ram_mipmap_image_size(int n) const; Description: Returns the number of bytes that *ought* to be used by the in-memory image for mipmap level n, based on the texture parameters.

getExpectedRamMipmapPageSize unsigned int Texture::get_expected_ram_mipmap_page_size(int n) const; Description: Returns the number of bytes that should be used per each Z page of the 3-d texture, for mipmap level n. For a 2-d or 1-d texture, this is the same as get_expected_ram_mipmap_image_size(n).

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.

getImageModified UpdateSeq Texture::get_image_modified(void) const; Description: Returns a sequence number which is guaranteed to change at least every time the texture image data (including mipmap levels) are modified.

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().

getLoadedFromImage bool Texture::get_loaded_from_image(void) const; Description: Returns the flag that indicates the texture has been loaded from a disk file or PNMImage. See set_loaded_from_image().

getLoadedFromTxo bool Texture::get_loaded_from_txo(void) const; Description: Returns the flag that indicates the texture has been loaded from a txo file.

getMagfilter Texture::FilterType Texture::get_magfilter(void) const; Description: Returns the filter mode of the texture for magnification. The mipmap constants are invalid here. This may return FT_default; see also get_effective_minfilter().

getMatchFramebufferFormat bool Texture::get_match_framebuffer_format(void) const; Description: Returns true if the special flag was set that indicates to the GSG that the Texture's format should be chosen to exactly match the framebuffer's format, presumably because the application intends to copy image data from the framebuffer into the Texture (or vice-versa).

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. This may return FT_default; see also get_effective_minfilter().

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.

getNumLoadableRamMipmapImages int Texture::get_num_loadable_ram_mipmap_images(void) const; Description: Returns the number of contiguous mipmap levels that exist in RAM, up until the first gap in the sequence. It is guaranteed that at least mipmap levels [0, get_num_ram_mipmap_images()) exist. The number returned will never exceed the number of required mipmap images based on the size of the texture and its filter mode. This method is different from get_num_ram_mipmap_images() in that it returns only the number of mipmap levels that can actually be usefully loaded, regardless of the actual number that may be stored.

getNumRamMipmapImages int Texture::get_num_ram_mipmap_images(void) const; Description: Returns the maximum number of mipmap level images available in system memory. The actual number may be less than this (that is, there might be gaps in the sequence); use has_ram_mipmap_image() to verify each level. Also see get_num_loadable_ram_mipmap_images().

getOrigFileXSize int Texture::get_orig_file_x_size(void) const; Description: Returns the X size of the original disk image that this Texture was loaded from (if it came from a disk file), before any automatic rescaling by Panda.

getOrigFileYSize int Texture::get_orig_file_y_size(void) const; Description: Returns the Y size of the original disk image that this Texture was loaded from (if it came from a disk file), before any automatic rescaling by Panda.

getOrigFileZSize int Texture::get_orig_file_z_size(void) const; Description: Returns the Z size of the original disk image that this Texture was loaded from (if it came from a disk file), before any automatic rescaling by Panda.

getPadXSize int Texture::get_pad_x_size(void) const; Description: Returns size of the pad region. See set_pad_size.

getPadYSize int Texture::get_pad_y_size(void) const; Description: Returns size of the pad region. See set_pad_size.

getPadZSize int Texture::get_pad_z_size(void) const; Description: Returns size of the pad region. See set_pad_size.

getPostLoadStoreCache bool Texture::get_post_load_store_cache(void) const; Description: Returns the setting of the post_load_store_cache flag. See set_post_load_store_cache().

getPropertiesModified UpdateSeq Texture::get_properties_modified(void) const; Description: Returns a sequence number which is guaranteed to change at least every time the texture properties (unrelated to the image) are modified.

getQualityLevel Texture::QualityLevel Texture::get_quality_level(void) const; Description: Returns the current quality_level hint. See set_quality_level(). This value may return QL_default; see get_effective_quality_level().

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.

getRamImageAs ConstPointerToArray< unsigned char > Texture::get_ram_image_as(string const &requested_format); Description: Returns the uncompressed system-RAM image data associated with the texture, but rather than just returning a pointer to the data, like get_uncompressed_ram_image, this function first processes the data, reorders the components using the specified format string, and fills these into a new area. The 'format' arugment should specify in which order the components of the texture must be. For example, valid format strings are "RGBA", "GA", "ABRG" or "AAA". A component can also be written as "0" or "1", which means an empty/black or a full/white channel, respectively. This function is particularly useful to copy an image in-memory to a different library (for example, PIL or wxWidgets) that require a different component order than Panda's internal format, BGRA. Note, however, that this conversion can still be too slow if you want to do it every frame, and should thus be avoided for that purpose. The only requirement for the reordering is that an uncompressed image must be available. If the RAM image is compressed, it will attempt to re-load the texture from disk, if it doesn't find an uncompressed image there, it will return NULL.

getRamImageCompression Texture::CompressionMode Texture::get_ram_image_compression(void) const; Description: Returns the compression mode in which the ram image is already stored pre-compressed. If this is other than CM_off, you cannot rely on the contents of the ram image to be anything predicatable (it will not be an array of x by y pixels, and it probably won't have the same length as get_expected_ram_image_size()).

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.

getRamMipmapImage ConstPointerToArray< unsigned char > Texture::get_ram_mipmap_image(int n); Description: Returns the system-RAM image data associated with the nth mipmap level, if present. Returns NULL if the nth mipmap level is not present.

getRamMipmapImageSize unsigned int Texture::get_ram_mipmap_image_size(int n) const; Description: Returns the number of bytes used by the in-memory image for mipmap level n, or 0 if there is no in-memory image for this mipmap level.

getRamMipmapPageSize unsigned int Texture::get_ram_mipmap_page_size(int n) const; Description: Returns the number of bytes used by the in-memory image per page for mipmap level n, or 0 if there is no in-memory image for this mipmap level. For a non-compressed texture, this is the same as get_expected_ram_mipmap_page_size(). For a compressed texture, this may be a smaller value. (We do assume that all pages will be the same size on a compressed texture).

getRamPageSize unsigned int Texture::get_ram_page_size(void) const; Description: Returns the number of bytes used by the in-memory image per page, or 0 if there is no in-memory image. For a non-compressed texture, this is the same as get_expected_ram_page_size(). For a compressed texture, this may be a smaller value. (We do assume that all pages will be the same size on a compressed texture).

getRenderToTexture bool Texture::get_render_to_texture(void) const; Description: Returns a flag on the texture that indicates whether the texture is intended to be used as a direct-render target, by binding a framebuffer to a texture and rendering directly into the texture. Normally, a user should not need to set this flag directly; it is set automatically by the low-level display code when a texture is bound to a framebuffer.

getResident bool Texture::get_resident(PreparedGraphicsObjects *prepared_objects) const; Description: Returns true if this Texture is reported to be resident within graphics memory for the indicated GSG.

getSimpleImageModified UpdateSeq Texture::get_simple_image_modified(void) const; Description: Returns a sequence number which is guaranteed to change at least every time the texture's "simple" image data is modified.

getSimpleRamImage ConstPointerToArray< unsigned char > Texture::get_simple_ram_image(void) const; Description: Returns the image data associated with the "simple" texture image. This is provided for some textures as an option to display while the main texture image is being loaded from disk. Unlike get_ram_image(), this function will always return immediately. Either the simple image is available, or it is not. The "simple" image is always 4 components, 1 byte each, regardless of the parameters of the full texture. The simple image is only supported for ordinary 2-d textures.

getSimpleRamImageSize unsigned int Texture::get_simple_ram_image_size(void) const; Description: Returns the number of bytes used by the "simple" image, or 0 if there is no simple image.

getSimpleXSize int Texture::get_simple_x_size(void) const; Description: Returns the width of the "simple" image in texels.

getSimpleYSize int Texture::get_simple_y_size(void) const; Description: Returns the height of the "simple" image in texels.

getTexturesPower2 static AutoTextureScale Texture::get_textures_power_2(void); Description: This flag returns ATS_none, ATS_up, or ATS_down and controls the scaling of textures. It is initialized from the config variable of the same name, but it can be subsequently adjusted.

getTextureType Texture::TextureType Texture::get_texture_type(void) const; Description: Returns the overall interpretation of the texture.

getUncompressedRamImage ConstPointerToArray< unsigned char > Texture::get_uncompressed_ram_image(void); Description: Returns the system-RAM image associated with the texture, in an uncompressed form if at all possible. If get_ram_image_compression() is CM_off, then the system-RAM image is already uncompressed, and this returns the same thing as get_ram_image(). If get_ram_image_compression() is anything else, then the system-RAM image is compressed. In this case, the image will be reloaded from the *original* file (not from the cache), in the hopes that an uncompressed image will be found there. If an uncompressed image cannot be found, returns NULL.

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.

hasAllRamMipmapImages bool Texture::has_all_ram_mipmap_images(void) const; Description: Returns true if all expected mipmap levels have been defined and exist in the system RAM, or false if even one mipmap level is missing.

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().

hasCompression bool Texture::has_compression(void) const; Description: Returns true if the texture indicates it wants to be compressed, either with CM_on or higher, or CM_default and compressed-textures is true. If true returned, this is not a guarantee that the texture is actually successfully compressed on the GSG. It may be that the GSG does not support the requested compression mode, in which case the texture may actually be stored uncompressed in texture memory.

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 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.

hasRamMipmapImage bool Texture::has_ram_mipmap_image(int n) const; Description: Returns true if the Texture has the nth mipmap level available in system memory, false otherwise. If the texture's minfilter mode requires mipmapping (see uses_mipmaps()), and all the texture's mipmap levels are not available when the texture is rendered, they will be generated automatically.

hasSimpleRamImage bool Texture::has_simple_ram_image(void) const; Description: Returns true if the Texture has a "simple" image available in main RAM.

hasUncompressedRamImage bool Texture::has_uncompressed_ram_image(void) const; Description: Returns true if the Texture has its image contents available in main RAM and is uncompressed, false otherwise. See has_ram_image().

haveTexturesPower2 static bool Texture::have_textures_power_2(void); Description: If true, then get_textures_power_2 has been set using set_textures_power_2. If false, then get_textures_power_2 simply returns the config variable of the same name.

isMipmap static bool Texture::is_mipmap(Texture::FilterType type); Description: Returns true if the indicated filter type requires the use of mipmaps, or false if it does not.

isPrepared bool Texture::is_prepared(PreparedGraphicsObjects *prepared_objects) const; Description: Returns true if the texture has already been prepared or enqueued for preparation on the indicated GSG, false otherwise.

load bool Texture::load(PNMImage const &pnmimage, LoaderOptions const &options = ((()))); Description: Replaces the texture with the indicated image. Description: Stores the indicated image in the given page and mipmap level. See read().

loadRelated Texture *Texture::load_related(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 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 a VideoTexture, 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 does *not* affect keep_ram_image.

makeRamMipmapImage PointerToArray< unsigned char > Texture::make_ram_mipmap_image(int n); Description: Discards the current system-RAM image for the nth mipmap level, if any, and allocates a new buffer of the appropriate size. Returns the new buffer. This does *not* affect keep_ram_image.

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. This assumes the RAM image should be uncompressed. If the RAM image has been dumped, or is stored compressed, creates a new one. This does *not* affect keep_ram_image.

modifyRamMipmapImage PointerToArray< unsigned char > Texture::modify_ram_mipmap_image(int n); Description: Returns a modifiable pointer to the system-RAM image for the nth mipmap level. This assumes the RAM image is uncompressed; if this is not the case, raises an assertion. This does *not* affect keep_ram_image.

modifySimpleRamImage PointerToArray< unsigned char > Texture::modify_simple_ram_image(void); Description: Returns a modifiable pointer to the internal "simple" texture image. See set_simple_ram_image().

newSimpleRamImage PointerToArray< unsigned char > Texture::new_simple_ram_image(int x_size, int y_size); Description: Creates an empty array for the simple ram image of the indicated size, and returns a modifiable pointer to the new array. See set_simple_ram_image().

peek PointerTo< TexturePeeker > Texture::peek(void); Description: Returns a TexturePeeker object that can be used to examine the individual texels stored within this Texture by (u, v) coordinate. If the texture has a ram image resident, that image is used. If it does not have a full ram image but does have a simple_ram_image resident, that image is used instead. If neither image is resident the full image is reloaded. Returns NULL if the texture cannot find an image to load, or the texture format is incompatible.

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.

prepareNow TextureContext *Texture::prepare_now(PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg); Description: Creates a context for the texture on the particular GSG, if it does not already exist. Returns the new (or old) TextureContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new textures. If this is not necessarily the case, you should use prepare() instead. Normally, this is not called directly except by the GraphicsStateGuardian; a texture does not need to be explicitly prepared by the user before it may be rendered.

read bool Texture::read(Filename const &fullpath, LoaderOptions const &options = ((()))); Description: Reads the named filename into the texture. Description: Combine a 3-component image with a grayscale image to get a 4-component image. See the description of the full-parameter read() method for the meaning of the primary_file_num_channels and alpha_file_channel parameters. Description: Reads a single file into a single page or mipmap level, or automatically reads a series of files into a series of pages and/or mipmap levels. See the description of the full-parameter read() method for the meaning of the various parameters. Description: Reads the texture from the indicated filename. If primary_file_num_channels is not 0, it specifies the number of components to downgrade the image to if it is greater than this number. If the filename has the extension .txo, this implicitly reads a texture object instead of a filename (which replaces all of the texture properties). In this case, all the rest of the parameters are ignored, and the filename should not contain any hash marks; just the one named file will be read, since a single .txo file can contain all pages and mipmaps necessary to define a texture. If alpha_fullpath is not empty, it specifies the name of a file from which to retrieve the alpha. In this case, alpha_file_channel represents the numeric channel of this image file to use as the resulting texture's alpha channel; usually, this is 0 to indicate the grayscale combination of r, g, b; or it may be a one-based channel number, e.g. 1 for the red channel, 2 for the green channel, and so on. If read pages is false, then z indicates the page number into which this image will be assigned. Normally this is 0 for the first (or only) page of the texture. 3-D textures have one page for each level of depth, and cube map textures always have six pages. If read_pages is true, multiple images will be read at once, one for each page of a cube map or a 3-D texture. In this case, 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. In this case, the z parameter indicates the maximum z value that will be loaded, or 0 to load all filenames that exist. If read_mipmaps is false, then n indicates the mipmap level to which this image will be assigned. Normally this is 0 for the base texture image, but it is possible to load custom mipmap levels into the later images. After the base texture image is loaded (thus defining the size of the texture), you can call get_expected_num_mipmap_levels() to determine the maximum sensible value for n. If read_mipmaps is true, multiple images will be read as above, but this time the images represent the different mipmap levels of the texture image. In this case, the n parameter indicates the maximum n value that will be loaded, or 0 to load all filenames that exist (up to the expected number of mipmap levels). If both read_pages and read_mipmaps is true, then both sequences will be read; the filename should contain two sequences of hash marks, separated by some character such as a hyphen, underscore, or dot. The first hash mark sequence will be filled in with the mipmap level, while the second hash mark sequence will be the page index. This method implicitly sets keep_ram_image to false.

readDds bool Texture::read_dds(istream &in, string const &filename = ("stream"), bool header_only = (0)); Description: Reads the texture from a DDS file object. This is a Microsoft-defined file format; it is similar in principle to a txo object, in that it is designed to contain the texture image in a form as similar as possible to its runtime image, and it can contain mipmaps, pre-compressed textures, and so on. As with read_txo, the filename is just for reference.

readTxo bool Texture::read_txo(istream &in, string const &filename = ("stream")); Description: Reads the texture from a Panda texture object. This defines the complete Texture specification, including the image data as well as all texture properties. The filename is just for reference.

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.

reload bool Texture::reload(void); Description: Re-reads the Texture from its disk file. Useful when you know the image on disk has recently changed, and you want to update the Texture image. Returns true on success, false on failure (in which case, the Texture may or may not still be valid).

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. Set this 0 to indicate the default value, which is specified in the texture-anisotropic-degree config variable. To explicitly disable anisotropic filtering, set this value to 1. To explicitly enable anisotropic filtering, set it to a value higher than 1; larger numbers indicate greater degrees of filtering.

setAuxData void Texture::set_aux_data(string const &key, TypedReferenceCount *aux_data); Description: Records an arbitrary object in the Texture, associated with a specified key. The object may later be retrieved by calling get_aux_data() with the same key. These data objects are not recorded to a bam or txo file.

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.

setCompression void Texture::set_compression(Texture::CompressionMode compression); Description: Requests that this particular Texture be compressed when it is loaded into texture memory. This refers to the internal compression of the texture image within texture memory; it is not related to jpeg or png compression, which are disk file compression formats. The actual disk file that generated this texture may be stored in a compressed or uncompressed format supported by Panda; it will be decompressed on load, and then recompressed by the graphics API if this parameter is not CM_off. If the GSG does not support this texture compression mode, the texture will silently be loaded uncompressed.

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 false 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.

setLoadedFromImage void Texture::set_loaded_from_image(void); Description: Sets the flag that indicates the texture has been loaded from a disk file or PNMImage. 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.

setLoadedFromTxo void Texture::set_loaded_from_txo(void); Description: Sets the flag that indicates the texture has been loaded from a txo file. You probably shouldn't be setting this directly; it is set automatically when a Texture is loaded.

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

setMatchFramebufferFormat void Texture::set_match_framebuffer_format(bool flag); Description: Sets the special flag that, if true, indicates to the GSG that the Texture's format should be chosen to exactly match the framebuffer's format, presumably because the application intends to copy image data from the framebuffer into the Texture (or vice-versa). This sets only the graphics card's idea of the texture format; it is not related to the system-memory format.

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

setOrigFileSize void Texture::set_orig_file_size(int x, int y, int z = (1)); Description: Specifies the size of the texture as it exists in its original disk file, before any Panda scaling.

setPadSize void Texture::set_pad_size(int x = (0), int y = (0), int z = (0)); Description: Sets the size of the pad region. Sometimes, when a video card demands power-of-two textures, it is necessary to create a big texture and then only use a portion of it. The pad region indicates which portion of the texture is not really in use. All operations use the texture as a whole, including the pad region, unless they explicitly state that they use only the non-pad region. Changing the texture's size clears the pad region.

setPostLoadStoreCache void Texture::set_post_load_store_cache(bool flag); Description: Sets the post_load_store_cache flag. When this is set, the next time the texture is loaded on a GSG, it will automatically extract its RAM image from the GSG and save it to the global BamCache. This is used to store compressed RAM images in the BamCache. This flag should not be set explicitly; it is set automatically by the TexturePool when model-cache-compressed-textures is set true.

setQualityLevel void Texture::set_quality_level(Texture::QualityLevel quality_level); Description: Sets a hint to the renderer about the desired performance / quality tradeoff for this particular texture. This is most useful for the tinydisplay software renderer; for normal, hardware-accelerated renderers, this may have little or no effect.

setRamImage void Texture::set_ram_image(ConstPointerToArray< unsigned char > image, Texture::CompressionMode compression = (CM_off), unsigned int page_size = (0)); Description: Replaces the current system-RAM image with the new data. If compression is not CM_off, it indicates that the new data is already pre-compressed in the indicated format. This does *not* affect keep_ram_image.

setRamMipmapImage void Texture::set_ram_mipmap_image(int n, ConstPointerToArray< unsigned char > image, unsigned int page_size = (0)); Description: Replaces the current system-RAM image for the indicated mipmap level with the new data. If compression is not CM_off, it indicates that the new data is already pre-compressed in the indicated format. This does *not* affect keep_ram_image.

setRenderToTexture void Texture::set_render_to_texture(bool render_to_texture); Description: Sets a flag on the texture that indicates whether the texture is intended to be used as a direct-render target, by binding a framebuffer to a texture and rendering directly into the texture. This controls some low-level choices made about the texture object itself. For instance, compressed textures are disallowed when this flag is set true. Normally, a user should not need to set this flag directly; it is set automatically by the low-level display code when a texture is bound to a framebuffer.

setSimpleRamImage void Texture::set_simple_ram_image(ConstPointerToArray< unsigned char > image, int x_size, int y_size); Description: Replaces the internal "simple" texture image. This can be used as an option to display while the main texture image is being loaded from disk. It is normally a very small image, 16x16 or smaller (and maybe even 1x1), that is designed to give just enough sense of color to serve as a placeholder until the full texture is available. The "simple" image is always 4 components, 1 byte each, regardless of the parameters of the full texture. The simple image is only supported for ordinary 2-d textures. Also see generate_simple_ram_image(), modify_simple_ram_image(), and new_simple_ram_image().

setSizePadded void Texture::set_size_padded(int x = (1), int y = (1), int z = (1)); Description: Changes the size of the texture, padding if necessary, and setting the pad region as well.

setTexturesPower2 static void Texture::set_textures_power_2(AutoTextureScale scale); Description: Set this flag to ATS_none, ATS_up, or ATS_down to control the scaling of textures.

setup1dTexture void Texture::setup_1d_texture(void); 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().

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.

store bool Texture::store(PNMImage &pnmimage) const; Description: Saves the texture to the indicated PNMImage, but does not write it to disk. Description: Saves the indicated page and mipmap level of the texture to the PNMImage.

uncompressRamImage bool Texture::uncompress_ram_image(void); Description: Attempts to uncompress the texture's RAM image internally. In order for this to work, the squish library must have been compiled into Panda, and the ram image must be compressed in a format supported by squish. Returns true if successful, false otherwise.

upToPower2 static int Texture::up_to_power_2(int value); Description: Returns the smallest power of 2 greater than or equal to value.

usesMipmaps bool Texture::uses_mipmaps(void) const; Description: Returns true if the minfilter settings on this texture indicate the use of mipmapping, false otherwise.

wasImageModified bool Texture::was_image_modified(PreparedGraphicsObjects *prepared_objects) const; Description: Returns true if the texture needs to be re-loaded onto the indicated GSG, either because its image data is out-of-date, or because it's not fully prepared now.

write bool Texture::write(Filename const &fullpath); Description: Writes the texture to the named filename. Description: Writes a single page or mipmap level to a single file, or automatically writes a series of pages and/or mipmap levels to a numbered series of files. If the filename ends in the extension .txo, this implicitly writes a Panda texture object (.txo) instead of an image file. In this case, the remaining parameters are ignored, and only one file is written, which will contain all of the pages and resident mipmap levels in the texture. If write_pages is false, then z indicates the page number to write. 3-D textures have one page number for each level of depth; cube maps have six pages number 0 through 5. Other kinds of textures have only one page, numbered 0. If write_pages is true, then all pages of the texture will be written. In this case z is ignored, and the filename should contain a sequence of hash marks ("#") which will be filled in with the page index number. If write_mipmaps is false, then n indicates the mipmap level number to write. Normally, this is 0, for the base texture image. Normally, the mipmap levels of a texture are not available in RAM (they are generated automatically by the graphics card). However, if you have the mipmap levels available, for instance because you called generate_ram_mipmap_images() to generate them internally, or you called GraphicsEngine::extract_texture_data() to retrieve them from the graphics card, then you may write out each mipmap level with this parameter. If write_mipmaps is true, then all mipmap levels of the texture will be written. In this case n is ignored, and the filename should contain a sequence of hash marks ("#") which will be filled in with the mipmap level number. If both write_pages and write_mipmaps is true, then all pages and all mipmap levels will be written. In this case, the filename should contain two different sequences of hash marks, separated by a character such as a hyphen, underscore, or dot. The first hash mark sequence will be filled in with the mipmap level, while the second hash mark sequence will be the page index. Description: Not to be confused with write(Filename), this method simply describes the texture properties.

writeTxo bool Texture::write_txo(ostream &out, string const &filename = ("stream")) const; Description: Writes the texture to a Panda texture object. This defines the complete Texture specification, including the image data as well as all texture properties. The filename is just for reference.

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

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 void 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.

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.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool 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 true if the new reference count is nonzero, false if it is zero.

Namable Namable::Namable(string const &initial_name = ("")); Description:

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: