Panda3D
|
Public Types | |
enum | ComponentType { TUnsignedByte = 0, TUnsignedShort = 1, TFloat = 2, TUnsignedInt248 = 3 } |
enum | CompressionMode { CMDefault = 0, CMOff = 1, CMOn = 2, CMFxt1 = 3, CMDxt1 = 4, CMDxt2 = 5, CMDxt3 = 6, CMDxt4 = 7, CMDxt5 = 8 } |
enum | FilterType { FTNearest = 0, FTLinear = 1, FTNearestMipmapNearest = 2, FTLinearMipmapNearest = 3, FTNearestMipmapLinear = 4, FTLinearMipmapLinear = 5, FTShadow = 6, FTDefault = 7, FTInvalid = 8 } |
enum | Format { FDepthStencil = 1, FColorIndex = 2, FRed = 3, FGreen = 4, FBlue = 5, FAlpha = 6, FRgb = 7, FRgb5 = 8, FRgb8 = 9, FRgb12 = 10, FRgb332 = 11, FRgba = 12, FRgbm = 13, FRgba4 = 14, FRgba5 = 15, FRgba8 = 16, FRgba12 = 17, FLuminance = 18, FLuminanceAlpha = 19, FLuminanceAlphamask = 20, FRgba16 = 21, FRgba32 = 22, FDepthComponent = 23, FDepthComponent16 = 24, FDepthComponent24 = 25, FDepthComponent32 = 26 } |
enum | QualityLevel { QLDefault = 0, QLFastest = 1, QLNormal = 2, QLBest = 3 } |
enum | TextureType { TT1dTexture = 0, TT2dTexture = 1, TT3dTexture = 2, TTCubeMap = 3 } |
enum | WrapMode { WMClamp = 0, WMRepeat = 1, WMMirror = 2, WMMirrorOnce = 3, WMBorderColor = 4, WMInvalid = 5 } |
Public Member Functions | |
FFMpegTexture (string name) | |
FFMpegTexture () | |
clear () | |
Reinitializes the texture to its default, empty state (except for the name). | |
clearAlphaFilename () | |
Removes the alpha filename, if it was previously set. | |
clearAlphaFullpath () | |
Removes the alpha fullpath, if it was previously set. | |
clearAuxData (string key) | |
Removes a record previously recorded via set_aux_data(). | |
clearFilename () | |
Removes the alpha filename, if it was previously set. | |
clearFullpath () | |
Removes the alpha fullpath, if it was previously set. | |
clearName () | |
Resets the Namable's name to empty. | |
clearRamImage () | |
Discards the current system-RAM image. | |
clearRamMipmapImage (int n) | |
Discards the current system-RAM image for the nth mipmap level. | |
clearRamMipmapImages () | |
Discards the current system-RAM image for all mipmap levels, except level 0 (the base image). | |
clearSimpleRamImage () | |
Discards the current "simple" image. | |
bool | compressRamImage (CompressionMode compression, QualityLevel quality_level, GraphicsStateGuardianBase gsg) |
Attempts to compress the texture's RAM image internally, to a format supported by the indicated GSG. | |
bool | compressRamImage (CompressionMode compression, QualityLevel quality_level) |
Attempts to compress the texture's RAM image internally, to a format supported by the indicated GSG. | |
bool | compressRamImage (CompressionMode compression) |
Attempts to compress the texture's RAM image internally, to a format supported by the indicated GSG. | |
bool | compressRamImage () |
Attempts to compress the texture's RAM image internally, to a format supported by the indicated GSG. | |
considerRescale (PNMImage pnmimage) | |
Asks the PNMImage to change its scale when it reads the image, according to the whims of the Config.prc file. | |
string | encodeToBamStream () |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. | |
bool | encodeToBamStream (basic_stringchar data, BamWriter writer) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
bool | encodeToBamStream (basic_stringchar data) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
unsigned int | estimateTextureMemory () |
Estimates the amount of texture memory that will be consumed by loading this texture. | |
generateAlphaScaleMap () | |
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. | |
generateNormalizationCubeMap (int size) | |
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 () | |
Automatically fills in the n mipmap levels of the Texture, based on the texture's source image. | |
generateSimpleRamImage () | |
Computes the "simple" ram image by loading the main RAM image, if it is not already available, and reducing it to 16x16 or smaller. | |
bool | getActive (PreparedGraphicsObjects prepared_objects) |
Returns true if this Texture was rendered in the most recent frame within the indicated GSG. | |
Filename const | getAlphaFilename () |
Returns the alpha_filename that has been set. | |
Filename const | getAlphaFullpath () |
Returns the alpha_fullpath that has been set. | |
int | getAnisotropicDegree () |
Returns the degree of anisotropic filtering that should be applied to the texture. | |
TypedReferenceCount | getAuxData (string key) |
Returns a record previously recorded via set_aux_data(). | |
UpdateSeq | getBamModified () |
Returns the current bam_modified counter. | |
VBase4 | getBorderColor () |
Returns the solid color of the texture's border. | |
ComponentType | getComponentType () |
Returns the numeric interpretation of each component of the texture. | |
int | getComponentWidth () |
Returns the number of bytes stored for each color component of a texel. | |
CompressionMode | getCompression () |
Returns the compression mode requested for this particular texture, or CM_off if the texture is not to be compressed. | |
unsigned int | getDataSizeBytes (PreparedGraphicsObjects prepared_objects) |
Returns the number of bytes which the texture is reported to consume within graphics memory, for the indicated GSG. | |
int | getEffectiveAnisotropicDegree () |
Returns the degree of anisotropic filtering that should be applied to the texture. | |
FilterType | getEffectiveMagfilter () |
Returns the filter mode of the texture for magnification, with special treatment for FT_default. | |
FilterType | getEffectiveMinfilter () |
Returns the filter mode of the texture for minification, with special treatment for FT_default. | |
QualityLevel | getEffectiveQualityLevel () |
Returns the current quality_level hint, or the global default quality_level if this texture doesn't specify a quality level. | |
int | getExpectedMipmapXSize (int n) |
Returns the x_size that the nth mipmap level should have, based on the texture's size. | |
int | getExpectedMipmapYSize (int n) |
Returns the y_size that the nth mipmap level should have, based on the texture's size. | |
int | getExpectedMipmapZSize (int n) |
Returns the z_size that the nth mipmap level should have, based on the texture's size. | |
int | getExpectedNumMipmapLevels () |
Returns the number of mipmap levels that should be defined for this texture, given the texture's size. | |
unsigned int | getExpectedRamImageSize () |
Returns the number of bytes that *ought* to be used by the in-memory image, based on the texture parameters. | |
unsigned int | getExpectedRamMipmapImageSize (int n) |
Returns the number of bytes that *ought* to be used by the in-memory image for mipmap level n, based on the texture parameters. | |
unsigned int | getExpectedRamMipmapPageSize (int n) |
Returns the number of bytes that should be used per each Z page of the 3-d texture, for mipmap level n. | |
unsigned int | getExpectedRamPageSize () |
Returns the number of bytes that should be used per each Z page of the 3-d texture. | |
Filename const | getFilename () |
Returns the filename that has been set. | |
Format | getFormat () |
Returns the format of the texture, which represents both the semantic meaning of the texels and, to some extent, their storage information. | |
double | getFrac () |
Returns the fractional part of the current frame. | |
int | getFrame () |
Returns the current integer frame number. | |
double | getFrameRate () |
Returns the native frame rate of the animation. | |
double | getFullFframe () |
Returns the current floating-point frame number. | |
int | getFullFrame () |
Returns the current integer frame number. | |
Filename const | getFullpath () |
Returns the fullpath that has been set. | |
UpdateSeq | getImageModified () |
Returns a sequence number which is guaranteed to change at least every time the texture image data (including mipmap levels) are modified. | |
bool | getKeepRamImage () |
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. | |
bool | getLoadedFromImage () |
Returns the flag that indicates the texture has been loaded from a disk file or PNMImage. | |
bool | getLoadedFromTxo () |
Returns the flag that indicates the texture has been loaded from a txo file. | |
FilterType | getMagfilter () |
Returns the filter mode of the texture for magnification. | |
bool | getMatchFramebufferFormat () |
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). | |
FilterType | getMinfilter () |
Returns the filter mode of the texture for minification. | |
string | getName () |
int | getNextFrame () |
Returns the current integer frame number + 1, constrained to the range 0 <= f < get_num_frames(). | |
int | getNumComponents () |
Returns the number of color components for each texel of the texture image. | |
int | getNumFrames () |
Returns the number of frames in the animation. | |
int | getNumLoadableRamMipmapImages () |
Returns the number of contiguous mipmap levels that exist in RAM, up until the first gap in the sequence. | |
int | getNumRamMipmapImages () |
Returns the maximum number of mipmap level images available in system memory. | |
int | getOrigFileXSize () |
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. | |
int | getOrigFileYSize () |
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. | |
int | getOrigFileZSize () |
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. | |
int | getPadXSize () |
Returns size of the pad region. | |
int | getPadYSize () |
Returns size of the pad region. | |
int | getPadZSize () |
Returns size of the pad region. | |
double | getPlayRate () |
Returns the rate at which the animation plays. | |
bool | getPostLoadStoreCache () |
Returns the setting of the post_load_store_cache flag. | |
UpdateSeq | getPropertiesModified () |
Returns a sequence number which is guaranteed to change at least every time the texture properties (unrelated to the image) are modified. | |
QualityLevel | getQualityLevel () |
Returns the current quality_level hint. | |
ConstPointerToArrayunsigned char | getRamImage () |
Returns the system-RAM image data associated with the texture. | |
ConstPointerToArrayunsigned char | getRamImageAs (string requested_format) |
Returns the uncompressed system-RAM image data associated with the texture. | |
CompressionMode | getRamImageCompression () |
Returns the compression mode in which the ram image is already stored pre-compressed. | |
unsigned int | getRamImageSize () |
Returns the number of bytes used by the in-memory image, or 0 if there is no in-memory image. | |
ConstPointerToArrayunsigned char | getRamMipmapImage (int n) |
Returns the system-RAM image data associated with the nth mipmap level, if present. | |
unsigned int | getRamMipmapImageSize (int n) |
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. | |
unsigned int | getRamMipmapPageSize (int n) |
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. | |
getRamMipmapPointer (int n) | |
Similiar to get_ram_mipmap_image(), however, in this case the void pointer for the given ram image is returned. | |
unsigned int | getRamPageSize () |
Returns the number of bytes used by the in-memory image per page, or 0 if there is no in-memory image. | |
int | getRefCount () |
Returns the current reference count. | |
bool | getRenderToTexture () |
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. | |
bool | getResident (PreparedGraphicsObjects prepared_objects) |
Returns true if this Texture is reported to be resident within graphics memory for the indicated GSG. | |
UpdateSeq | getSimpleImageModified () |
Returns a sequence number which is guaranteed to change at least every time the texture's "simple" image data is modified. | |
ConstPointerToArrayunsigned char | getSimpleRamImage () |
Returns the image data associated with the "simple" texture image. | |
unsigned int | getSimpleRamImageSize () |
Returns the number of bytes used by the "simple" image, or 0 if there is no simple image. | |
int | getSimpleXSize () |
Returns the width of the "simple" image in texels. | |
int | getSimpleYSize () |
Returns the height of the "simple" image in texels. | |
VBase2 | getTexScale () |
Returns a scale pair that is suitable for applying to geometry via NodePath.set_tex_scale(), which will convert texture coordinates on the geometry from the range 0..1 into the appropriate range to render the video part of the texture. | |
TextureType | getTextureType () |
Returns the overall interpretation of the texture. | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
ConstPointerToArrayunsigned char | getUncompressedRamImage () |
Returns the system-RAM image associated with the texture, in an uncompressed form if at all possible. | |
int | getVideoHeight () |
Returns the height in texels of the source video stream. | |
int | getVideoWidth () |
Returns the width in texels of the source video stream. | |
WrapMode | getWrapU () |
Returns the wrap mode of the texture in the U direction. | |
WrapMode | getWrapV () |
Returns the wrap mode of the texture in the V direction. | |
WrapMode | getWrapW () |
Returns the wrap mode of the texture in the W direction. | |
int | getXSize () |
Returns the width of the texture image in texels. | |
int | getYSize () |
Returns the height of the texture image in texels. | |
int | getZSize () |
Returns the depth of the texture image in texels. | |
bool | hasAllRamMipmapImages () |
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. | |
bool | hasAlphaFilename () |
Returns true if the alpha_filename has been set and is available. | |
bool | hasAlphaFullpath () |
Returns true if the alpha_fullpath has been set and is available. | |
bool | hasCompression () |
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. | |
bool | hasFilename () |
Returns true if the filename has been set and is available. | |
bool | hasFullpath () |
Returns true if the fullpath has been set and is available. | |
bool | hasName () |
Returns true if the Namable has a nonempty name set, false if the name is empty. | |
bool | hasRamImage () |
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. | |
bool | hasRamMipmapImage (int n) |
Returns true if the Texture has the nth mipmap level available in system memory, false otherwise. | |
bool | hasSimpleRamImage () |
Returns true if the Texture has a "simple" image available in main RAM. | |
bool | hasUncompressedRamImage () |
Returns true if the Texture has its image contents available in main RAM and is uncompressed, false otherwise. | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. | |
bool | isPlaying () |
Returns true if the animation is currently playing, false if it is stopped (e.g. | |
bool | isPrepared (PreparedGraphicsObjects prepared_objects) |
Returns true if the texture has already been prepared or enqueued for preparation on the indicated GSG, false otherwise. | |
bool | load (PNMImage const pnmimage, LoaderOptions const options) |
Replaces the texture with the indicated image. | |
bool | load (PNMImage const pnmimage) |
Replaces the texture with the indicated image. | |
bool | load (PNMImage const pnmimage, int z, int n, LoaderOptions const options) |
Stores the indicated image in the given page and mipmap level. | |
bool | load (PNMImage const pnmimage, int z, int n) |
Stores the indicated image in the given page and mipmap level. | |
Texture | loadRelated (InternalName const suffix) |
Loads a texture whose filename is derived by concatenating a suffix to the filename of this texture. | |
loop (bool restart) | |
Starts the entire animation looping. | |
loop (bool restart, double from, double to) | |
Loops the animation from the frame "from" to and including the frame "to", indefinitely. | |
Texture | makeCopy () |
Returns a new copy of the same Texture. | |
PointerToArrayunsigned char | makeRamImage () |
Discards the current system-RAM image for the texture, if any, and allocates a new buffer of the appropriate size. | |
PointerToArrayunsigned char | makeRamMipmapImage (int n) |
Discards the current system-RAM image for the nth mipmap level, if any, and allocates a new buffer of the appropriate size. | |
markBamModified () | |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
bool | mightHaveRamImage () |
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. | |
PointerToArrayunsigned char | modifyRamImage () |
Returns a modifiable pointer to the system-RAM image. | |
PointerToArrayunsigned char | modifyRamMipmapImage (int n) |
Returns a modifiable pointer to the system-RAM image for the nth mipmap level. | |
PointerToArrayunsigned char | modifySimpleRamImage () |
Returns a modifiable pointer to the internal "simple" texture image. | |
PointerToArrayunsigned char | newSimpleRamImage (int x_size, int y_size) |
Creates an empty array for the simple ram image of the indicated size, and returns a modifiable pointer to the new array. | |
output (ostream out) | |
output (ostream out) | |
Outputs the Namable. | |
TexturePeeker | peek () |
Returns a TexturePeeker object that can be used to examine the individual texels stored within this Texture by (u, v) coordinate. | |
pingpong (bool restart) | |
Starts the entire animation bouncing back and forth between its first frame and last frame. | |
pingpong (bool restart, double from, double to) | |
Loops the animation from the frame "from" to and including the frame "to", and then back in the opposite direction, indefinitely. | |
play (double from, double to) | |
Runs the animation from the frame "from" to and including the frame "to", at which point the animation is stopped. | |
play () | |
Runs the entire animation from beginning to end and stops. | |
pose (double frame) | |
Sets the animation to the indicated frame and holds it there. | |
prepare (PreparedGraphicsObjects prepared_objects) | |
Indicates that the texture should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame. | |
TextureContext | prepareNow (PreparedGraphicsObjects prepared_objects, GraphicsStateGuardianBase gsg) |
Creates a context for the texture on the particular GSG, if it does not already exist. | |
bool | read (Filename const fullpath, int z, int n, bool read_pages, bool read_mipmaps, LoaderOptions const options) |
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. | |
bool | read (Filename const fullpath, Filename const alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, int z, int n, bool read_pages, bool read_mipmaps, BamCacheRecord record) |
Reads the texture from the indicated filename. | |
bool | read (Filename const fullpath, int z, int n, bool read_pages, bool read_mipmaps) |
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. | |
bool | read (Filename const fullpath, Filename const alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, LoaderOptions const options) |
Combine a 3-component image with a grayscale image to get a 4-component image. | |
bool | read (Filename const fullpath, Filename const alpha_fullpath, int primary_file_num_channels, int alpha_file_channel) |
Combine a 3-component image with a grayscale image to get a 4-component image. | |
bool | read (Filename const fullpath, Filename const alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, int z, int n, bool read_pages, bool read_mipmaps, BamCacheRecord record, LoaderOptions const options) |
Reads the texture from the indicated filename. | |
bool | read (Filename const fullpath, LoaderOptions const options) |
Reads the named filename into the texture. | |
bool | read (Filename const fullpath) |
Reads the named filename into the texture. | |
bool | read (Filename const fullpath, Filename const alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, int z, int n, bool read_pages, bool read_mipmaps) |
Reads the texture from the indicated filename. | |
bool | readDds (istream in, string filename, bool header_only) |
Reads the texture from a DDS file object. | |
bool | readDds (istream in, string filename) |
Reads the texture from a DDS file object. | |
bool | readDds (istream in) |
Reads the texture from a DDS file object. | |
bool | readTxo (istream in, string filename) |
Reads the texture from a Panda texture object. | |
bool | readTxo (istream in) |
Reads the texture from a Panda texture object. | |
PyObject | reduce (PyObject self) |
This special Python method is implement to provide support for the pickle module. | |
PyObject | reducePersist (PyObject self, PyObject pickler) |
This special Python method is implement to provide support for the pickle module. | |
ref () | |
Explicitly increments the reference count. | |
bool | release (PreparedGraphicsObjects prepared_objects) |
Frees the texture context only on the indicated object, if it exists there. | |
int | releaseAll () |
Frees the context allocated on all objects for which the texture has been declared. | |
bool | reload () |
Re-reads the Texture from its disk file. | |
setAlphaFilename (Filename const alpha_filename) | |
Sets the name of the file that contains the image's alpha channel contents. | |
setAlphaFullpath (Filename const alpha_fullpath) | |
Sets the full pathname to the file that contains the image's alpha channel contents, as found along the search path. | |
setAnisotropicDegree (int anisotropic_degree) | |
Specifies the level of anisotropic filtering to apply to the texture. | |
setAuxData (string key, TypedReferenceCount aux_data) | |
Records an arbitrary object in the Texture, associated with a specified key. | |
setBorderColor (VBase4 const color) | |
Specifies the solid color of the texture's border. | |
setComponentType (ComponentType component_type) | |
Changes the data value for the texture components. | |
setCompression (CompressionMode compression) | |
Requests that this particular Texture be compressed when it is loaded into texture memory. | |
setFilename (Filename const filename) | |
Sets the name of the file that contains the image's contents. | |
setFormat (Format format) | |
Changes the format value for the texture components. | |
setFullpath (Filename const fullpath) | |
Sets the full pathname to the file that contains the image's contents, as found along the search path. | |
setKeepRamImage (bool keep_ram_image) | |
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. | |
setLoadedFromImage () | |
Sets the flag that indicates the texture has been loaded from a disk file or PNMImage. | |
setLoadedFromTxo () | |
Sets the flag that indicates the texture has been loaded from a txo file. | |
setMagfilter (FilterType filter) | |
setMatchFramebufferFormat (bool flag) | |
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). | |
setMinfilter (FilterType filter) | |
setName (string name) | |
setOrigFileSize (int x, int y) | |
Specifies the size of the texture as it exists in its original disk file, before any Panda scaling. | |
setOrigFileSize (int x, int y, int z) | |
Specifies the size of the texture as it exists in its original disk file, before any Panda scaling. | |
setPadSize () | |
Sets the size of the pad region. | |
setPadSize (int x) | |
Sets the size of the pad region. | |
setPadSize (int x, int y) | |
Sets the size of the pad region. | |
setPadSize (int x, int y, int z) | |
Sets the size of the pad region. | |
setPlayRate (double play_rate) | |
Changes the rate at which the animation plays. | |
setPostLoadStoreCache (bool flag) | |
Sets the post_load_store_cache flag. | |
setQualityLevel (QualityLevel quality_level) | |
Sets a hint to the renderer about the desired performance / quality tradeoff for this particular texture. | |
setRamImage (ConstPointerToArrayunsigned char image, CompressionMode compression) | |
Replaces the current system-RAM image with the new data. | |
setRamImage (ConstPointerToArrayunsigned char image) | |
Replaces the current system-RAM image with the new data. | |
setRamImage (ConstPointerToArrayunsigned char image, CompressionMode compression, unsigned int page_size) | |
Replaces the current system-RAM image with the new data. | |
setRamMipmapImage (int n, ConstPointerToArrayunsigned char image, unsigned int page_size) | |
Replaces the current system-RAM image for the indicated mipmap level with the new data. | |
setRamMipmapImage (int n, ConstPointerToArrayunsigned char image) | |
Replaces the current system-RAM image for the indicated mipmap level with the new data. | |
setRamMipmapPointerFromInt (long long int pointer, int n, int page_size) | |
Accepts a raw pointer cast as an int, which is then passed to set_ram_mipmap_pointer(); see the documentation for that method. | |
setRenderToTexture (bool render_to_texture) | |
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. | |
setSimpleRamImage (ConstPointerToArrayunsigned char image, int x_size, int y_size) | |
Replaces the internal "simple" texture image. | |
setSizePadded () | |
Changes the size of the texture, padding if necessary, and setting the pad region as well. | |
setSizePadded (int x) | |
Changes the size of the texture, padding if necessary, and setting the pad region as well. | |
setSizePadded (int x, int y, int z) | |
Changes the size of the texture, padding if necessary, and setting the pad region as well. | |
setSizePadded (int x, int y) | |
Changes the size of the texture, padding if necessary, and setting the pad region as well. | |
setup1dTexture (int x_size, ComponentType component_type, Format format) | |
Sets the texture as an empty 1-d texture with the specified dimensions and properties. | |
setup1dTexture () | |
Sets the texture as an empty 1-d texture with no dimensions. | |
setup2dTexture (int x_size, int y_size, ComponentType component_type, Format format) | |
Sets the texture as an empty 2-d texture with the specified dimensions and properties. | |
setup2dTexture () | |
Sets the texture as an empty 2-d texture with no dimensions. | |
setup3dTexture (int x_size, int y_size, int z_size, ComponentType component_type, Format format) | |
Sets the texture as an empty 3-d texture with the specified dimensions and properties. | |
setup3dTexture (int z_size) | |
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). | |
setup3dTexture () | |
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). | |
setupCubeMap (int size, ComponentType component_type, Format format) | |
Sets the texture as an empty cube map texture with the specified dimensions and properties. | |
setupCubeMap () | |
Sets the texture as an empty cube map texture with no dimensions. | |
setupTexture (TextureType texture_type, int x_size, int y_size, int z_size, ComponentType component_type, Format format) | |
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 (WrapMode wrap) | |
setWrapV (WrapMode wrap) | |
setWrapW (WrapMode wrap) | |
The W wrap direction is only used for 3-d textures. | |
setXSize (int x_size) | |
Changes the x size indicated for the texture. | |
setYSize (int y_size) | |
Changes the y size indicated for the texture. | |
setZSize (int z_size) | |
Changes the z size indicated for the texture. | |
stop () | |
Stops a currently playing or looping animation right where it is. | |
bool | store (PNMImage pnmimage) |
Saves the texture to the indicated PNMImage, but does not write it to disk. | |
bool | store (PNMImage pnmimage, int z, int n) |
Saves the indicated page and mipmap level of the texture to the PNMImage. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
bool | uncompressRamImage () |
Attempts to uncompress the texture's RAM image internally. | |
bool | unref () |
Explicitly decrements the reference count. | |
bool | usesMipmaps () |
Returns true if the minfilter settings on this texture indicate the use of mipmapping, false otherwise. | |
bool | wasImageModified (PreparedGraphicsObjects prepared_objects) |
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 (ostream out, int indent_level) | |
Not to be confused with write(Filename), this method simply describes the texture properties. | |
bool | write (Filename const fullpath) |
Writes the texture to the named filename. | |
bool | write (Filename const fullpath, int z, int n, bool write_pages, bool write_mipmaps) |
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. | |
bool | writeTxo (ostream out) |
Writes the texture to a Panda texture object. | |
bool | writeTxo (ostream out, string filename) |
Writes the texture to a Panda texture object. | |
Static Public Member Functions | |
static | considerRescale (PNMImage pnmimage, string name) |
Asks the PNMImage to change its scale when it reads the image, according to the whims of the Config.prc file. | |
static TypedWritableReferenceCount | decodeFromBamStream (string data, BamReader reader) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypedWritableReferenceCount | decodeFromBamStream (string data) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static int | downToPower2 (int value) |
Returns the largest power of 2 less than or equal to value. | |
static TypeHandle | getClassType () |
static AutoTextureScale | getTexturesPower2 () |
This flag returns ATS_none, ATS_up, or ATS_down and controls the scaling of textures. | |
static bool | haveTexturesPower2 () |
If true, then get_textures_power_2 has been set using set_textures_power_2. | |
static bool | isMipmap (FilterType type) |
Returns true if the indicated filter type requires the use of mipmaps, or false if it does not. | |
static | setTexturesPower2 (AutoTextureScale scale) |
Set this flag to ATS_none, ATS_up, or ATS_down to control the scaling of textures. | |
static int | upToPower2 (int value) |
Returns the smallest power of 2 greater than or equal to value. |
enum ComponentType [inherited] |
enum CompressionMode [inherited] |
enum FilterType [inherited] |
enum Format [inherited] |
enum QualityLevel [inherited] |
enum TextureType [inherited] |
enum WrapMode [inherited] |
FFMpegTexture | ( | string | name | ) |
FFMpegTexture | ( | ) |
clear | ( | ) | [inherited] |
Reinitializes the texture to its default, empty state (except for the name).
clearAlphaFilename | ( | ) | [inherited] |
Removes the alpha filename, if it was previously set.
See set_alpha_filename().
clearAlphaFullpath | ( | ) | [inherited] |
Removes the alpha fullpath, if it was previously set.
See set_alpha_fullpath().
clearAuxData | ( | string | key | ) | [inherited] |
Removes a record previously recorded via set_aux_data().
clearFilename | ( | ) | [inherited] |
Removes the alpha filename, if it was previously set.
See set_filename().
clearFullpath | ( | ) | [inherited] |
Removes the alpha fullpath, if it was previously set.
See set_fullpath().
clearName | ( | ) | [inherited] |
Resets the Namable's name to empty.
Reimplemented in AsyncTask.
clearRamImage | ( | ) | [inherited] |
Discards the current system-RAM image.
clearRamMipmapImage | ( | int | n | ) | [inherited] |
Discards the current system-RAM image for the nth mipmap level.
clearRamMipmapImages | ( | ) | [inherited] |
Discards the current system-RAM image for all mipmap levels, except level 0 (the base image).
clearSimpleRamImage | ( | ) | [inherited] |
Discards the current "simple" image.
bool compressRamImage | ( | CompressionMode | compression, |
QualityLevel | quality_level, | ||
GraphicsStateGuardianBase | gsg | ||
) | [inherited] |
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.
bool compressRamImage | ( | CompressionMode | compression, |
QualityLevel | quality_level | ||
) | [inherited] |
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.
bool compressRamImage | ( | CompressionMode | compression | ) | [inherited] |
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.
bool compressRamImage | ( | ) | [inherited] |
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.
considerRescale | ( | PNMImage | pnmimage | ) | [inherited] |
Asks the PNMImage to change its scale when it reads the image, according to the whims of the Config.prc file.
This method should be called after pnmimage.read_header() has been called, but before pnmimage.read().
static considerRescale | ( | PNMImage | pnmimage, |
string | name | ||
) | [static, inherited] |
Asks the PNMImage to change its scale when it reads the image, according to the whims of the Config.prc file.
This method should be called after pnmimage.read_header() has been called, but before pnmimage.read().
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data, |
BamReader | reader | ||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data | ) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
Returns the largest power of 2 less than or equal to value.
string encodeToBamStream | ( | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data, |
BamWriter | writer | ||
) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
unsigned int estimateTextureMemory | ( | ) | [inherited] |
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 | ( | ) | [inherited] |
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 | ( | int | size | ) | [inherited] |
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 | ( | ) | [inherited] |
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 | ( | ) | [inherited] |
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.
bool getActive | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
Returns true if this Texture was rendered in the most recent frame within the indicated GSG.
Filename const getAlphaFilename | ( | ) | [inherited] |
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().
Filename const getAlphaFullpath | ( | ) | [inherited] |
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.
int getAnisotropicDegree | ( | ) | [inherited] |
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.
TypedReferenceCount getAuxData | ( | string | key | ) | [inherited] |
Returns a record previously recorded via set_aux_data().
Returns NULL if there was no record associated with the indicated key.
UpdateSeq getBamModified | ( | ) | [inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
VBase4 getBorderColor | ( | ) | [inherited] |
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.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from VideoTexture.
ComponentType getComponentType | ( | ) | [inherited] |
Returns the numeric interpretation of each component of the texture.
int getComponentWidth | ( | ) | [inherited] |
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.
CompressionMode getCompression | ( | ) | [inherited] |
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.
unsigned int getDataSizeBytes | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
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.
int getEffectiveAnisotropicDegree | ( | ) | [inherited] |
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.
FilterType getEffectiveMagfilter | ( | ) | [inherited] |
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.
FilterType getEffectiveMinfilter | ( | ) | [inherited] |
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.
QualityLevel getEffectiveQualityLevel | ( | ) | [inherited] |
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)
Returns the x_size that the nth mipmap level should have, based on the texture's size.
Returns the y_size that the nth mipmap level should have, based on the texture's size.
Returns the z_size that the nth mipmap level should have, based on the texture's size.
int getExpectedNumMipmapLevels | ( | ) | [inherited] |
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.
unsigned int getExpectedRamImageSize | ( | ) | [inherited] |
Returns the number of bytes that *ought* to be used by the in-memory image, based on the texture parameters.
Returns the number of bytes that *ought* to be used by the in-memory image for mipmap level n, based on the texture parameters.
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).
unsigned int getExpectedRamPageSize | ( | ) | [inherited] |
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().
Filename const getFilename | ( | ) | [inherited] |
Returns the filename that has been set.
This is the name of the file as it was requested. Also see get_fullpath().
Format getFormat | ( | ) | [inherited] |
Returns the format of the texture, which represents both the semantic meaning of the texels and, to some extent, their storage information.
double getFrac | ( | ) | [inherited] |
Returns the fractional part of the current frame.
Normally, this is in the range 0.0 <= f < 1.0, but in the one special case of an animation playing to its end frame and stopping, it might exactly equal 1.0.
It will always be true that get_full_frame() + get_frac() == get_full_fframe().
int getFrame | ( | ) | [inherited] |
Returns the current integer frame number.
This number will be in the range 0 <= f < get_num_frames().
double getFrameRate | ( | ) | [inherited] |
Returns the native frame rate of the animation.
This is the number of frames per second that will elapse when the play_rate is set to 1.0. It is a fixed property of the animation and may not be adjusted by the user.
double getFullFframe | ( | ) | [inherited] |
Returns the current floating-point frame number.
Unlike the value returned by get_frame(), this frame number may extend beyond the range of get_num_frames() if the frame range passed to play(), loop(), etc. did.
Unlike the value returned by get_full_frame(), this return value may equal (to_frame + 1.0), when the animation has played to its natural end. However, in this case the return value of get_full_frame() will be to_frame, not (to_frame + 1).
int getFullFrame | ( | ) | [inherited] |
Returns the current integer frame number.
Unlike the value returned by get_frame(), this frame number may extend beyond the range of get_num_frames() if the frame range passed to play(), loop(), etc. did.
Unlike the value returned by get_full_fframe(), this return value will never exceed the value passed to to_frame in the play() method.
Filename const getFullpath | ( | ) | [inherited] |
Returns the fullpath that has been set.
This is the full path to the file as it was found along the texture search path.
UpdateSeq getImageModified | ( | ) | [inherited] |
Returns a sequence number which is guaranteed to change at least every time the texture image data (including mipmap levels) are modified.
bool getKeepRamImage | ( | ) | [inherited] |
bool getLoadedFromImage | ( | ) | [inherited] |
Returns the flag that indicates the texture has been loaded from a disk file or PNMImage.
See set_loaded_from_image().
bool getLoadedFromTxo | ( | ) | [inherited] |
Returns the flag that indicates the texture has been loaded from a txo file.
FilterType getMagfilter | ( | ) | [inherited] |
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().
bool getMatchFramebufferFormat | ( | ) | [inherited] |
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).
FilterType getMinfilter | ( | ) | [inherited] |
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().
string getName | ( | ) | [inherited] |
Reimplemented in DynamicTextFont.
int getNextFrame | ( | ) | [inherited] |
Returns the current integer frame number + 1, constrained to the range 0 <= f < get_num_frames().
If the play mode is PM_play, this will clamp to the same value as get_frame() at the end of the animation. If the play mode is any other value, this will wrap around to frame 0 at the end of the animation.
int getNumComponents | ( | ) | [inherited] |
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.
int getNumFrames | ( | ) | [inherited] |
Returns the number of frames in the animation.
This is a property of the animation and may not be directly adjusted by the user (although it may change without warning with certain kinds of animations, since this is a virtual method that may be overridden).
Reimplemented in SequenceNode.
int getNumLoadableRamMipmapImages | ( | ) | [inherited] |
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.
int getNumRamMipmapImages | ( | ) | [inherited] |
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().
int getOrigFileXSize | ( | ) | [inherited] |
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.
int getOrigFileYSize | ( | ) | [inherited] |
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.
int getOrigFileZSize | ( | ) | [inherited] |
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.
int getPadXSize | ( | ) | [inherited] |
Returns size of the pad region.
See set_pad_size.
int getPadYSize | ( | ) | [inherited] |
Returns size of the pad region.
See set_pad_size.
int getPadZSize | ( | ) | [inherited] |
Returns size of the pad region.
See set_pad_size.
double getPlayRate | ( | ) | [inherited] |
Returns the rate at which the animation plays.
See set_play_rate().
bool getPostLoadStoreCache | ( | ) | [inherited] |
Returns the setting of the post_load_store_cache flag.
See set_post_load_store_cache().
UpdateSeq getPropertiesModified | ( | ) | [inherited] |
Returns a sequence number which is guaranteed to change at least every time the texture properties (unrelated to the image) are modified.
QualityLevel getQualityLevel | ( | ) | [inherited] |
Returns the current quality_level hint.
See set_quality_level(). This value may return QL_default; see get_effective_quality_level().
ConstPointerToArrayunsigned char getRamImage | ( | ) | [inherited] |
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.
ConstPointerToArrayunsigned char getRamImageAs | ( | string | requested_format | ) | [inherited] |
Returns the uncompressed system-RAM image data associated with the texture.
Rather than just returning a pointer to the data, like get_uncompressed_ram_image, this function first processes the data and reorders the components using the specified format string, and places these into a new char array. The 'format' argument 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.
CompressionMode getRamImageCompression | ( | ) | [inherited] |
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()).
unsigned int getRamImageSize | ( | ) | [inherited] |
Returns the number of bytes used by the in-memory image, or 0 if there is no in-memory image.
Returns the system-RAM image data associated with the nth mipmap level, if present.
Returns NULL if the nth mipmap level is not present.
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.
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).
getRamMipmapPointer | ( | int | n | ) | [inherited] |
Similiar to get_ram_mipmap_image(), however, in this case the void pointer for the given ram image is returned.
This will be NULL unless it has been explicitly set.
unsigned int getRamPageSize | ( | ) | [inherited] |
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).
int getRefCount | ( | ) | [inherited] |
Returns the current reference count.
bool getRenderToTexture | ( | ) | [inherited] |
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.
bool getResident | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
Returns true if this Texture is reported to be resident within graphics memory for the indicated GSG.
UpdateSeq getSimpleImageModified | ( | ) | [inherited] |
Returns a sequence number which is guaranteed to change at least every time the texture's "simple" image data is modified.
ConstPointerToArrayunsigned char getSimpleRamImage | ( | ) | [inherited] |
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.
unsigned int getSimpleRamImageSize | ( | ) | [inherited] |
Returns the number of bytes used by the "simple" image, or 0 if there is no simple image.
int getSimpleXSize | ( | ) | [inherited] |
Returns the width of the "simple" image in texels.
int getSimpleYSize | ( | ) | [inherited] |
Returns the height of the "simple" image in texels.
VBase2 getTexScale | ( | ) | [inherited] |
Returns a scale pair that is suitable for applying to geometry via NodePath.set_tex_scale(), which will convert texture coordinates on the geometry from the range 0..1 into the appropriate range to render the video part of the texture.
This is necessary in the event the video source is not a power of two and set_power_2() is true. In this case, the video image will be mapped to the lower-left corner of the texture, and the rest of the texture space will be unused; so we will need to remap any texture coordinates to fill the space correctly.
static AutoTextureScale getTexturesPower2 | ( | ) | [static, inherited] |
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.
TextureType getTextureType | ( | ) | [inherited] |
Returns the overall interpretation of the texture.
TypeHandle getType | ( | ) | [inherited] |
Reimplemented in AnimChannelBase.
int getTypeIndex | ( | ) | [inherited] |
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().
ConstPointerToArrayunsigned char getUncompressedRamImage | ( | ) | [inherited] |
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.
int getVideoHeight | ( | ) | [inherited] |
Returns the height in texels of the source video stream.
This is not necessarily the height of the actual texture, since the texture may have been expanded to raise it to a power of 2.
int getVideoWidth | ( | ) | [inherited] |
Returns the width in texels of the source video stream.
This is not necessarily the width of the actual texture, since the texture may have been expanded to raise it to a power of 2.
WrapMode getWrapU | ( | ) | [inherited] |
Returns the wrap mode of the texture in the U direction.
WrapMode getWrapV | ( | ) | [inherited] |
Returns the wrap mode of the texture in the V direction.
WrapMode getWrapW | ( | ) | [inherited] |
Returns the wrap mode of the texture in the W direction.
This is the depth direction of 3-d textures.
int getXSize | ( | ) | [inherited] |
Returns the width of the texture image in texels.
int getYSize | ( | ) | [inherited] |
Returns the height of the texture image in texels.
For a 1-d texture, this will be 1.
int getZSize | ( | ) | [inherited] |
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.
bool hasAllRamMipmapImages | ( | ) | [inherited] |
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.
bool hasAlphaFilename | ( | ) | [inherited] |
Returns true if the alpha_filename has been set and is available.
See set_alpha_filename().
bool hasAlphaFullpath | ( | ) | [inherited] |
Returns true if the alpha_fullpath has been set and is available.
See set_alpha_fullpath().
bool hasCompression | ( | ) | [inherited] |
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.
bool hasFilename | ( | ) | [inherited] |
Returns true if the filename has been set and is available.
See set_filename().
bool hasFullpath | ( | ) | [inherited] |
Returns true if the fullpath has been set and is available.
See set_fullpath().
bool hasName | ( | ) | [inherited] |
Returns true if the Namable has a nonempty name set, false if the name is empty.
bool hasRamImage | ( | ) | [inherited] |
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.
bool hasRamMipmapImage | ( | int | n | ) | [inherited] |
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.
bool hasSimpleRamImage | ( | ) | [inherited] |
Returns true if the Texture has a "simple" image available in main RAM.
bool hasUncompressedRamImage | ( | ) | [inherited] |
Returns true if the Texture has its image contents available in main RAM and is uncompressed, false otherwise.
See has_ram_image().
static bool haveTexturesPower2 | ( | ) | [static, inherited] |
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.
bool isExactType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is the indicated type exactly.
static bool isMipmap | ( | FilterType | type | ) | [static, inherited] |
Returns true if the indicated filter type requires the use of mipmaps, or false if it does not.
bool isOfType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is or derives from the indicated type.
bool isPlaying | ( | ) | [inherited] |
bool isPrepared | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
Returns true if the texture has already been prepared or enqueued for preparation on the indicated GSG, false otherwise.
bool load | ( | PNMImage const | pnmimage, |
LoaderOptions const | options | ||
) | [inherited] |
Replaces the texture with the indicated image.
bool load | ( | PNMImage const | pnmimage | ) | [inherited] |
Replaces the texture with the indicated image.
bool load | ( | PNMImage const | pnmimage, |
int | z, | ||
int | n, | ||
LoaderOptions const | options | ||
) | [inherited] |
Stores the indicated image in the given page and mipmap level.
See read().
Stores the indicated image in the given page and mipmap level.
See read().
Texture loadRelated | ( | InternalName const | suffix | ) | [inherited] |
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.
loop | ( | bool | restart, |
double | from, | ||
double | to | ||
) | [inherited] |
Loops the animation from the frame "from" to and including the frame "to", indefinitely.
If restart is true, the animation is restarted from the beginning; otherwise, it continues from the current frame.
loop | ( | bool | restart | ) | [inherited] |
Starts the entire animation looping.
If restart is true, the animation is restarted from the beginning; otherwise, it continues from the current frame.
Texture makeCopy | ( | ) | [inherited] |
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.
PointerToArrayunsigned char makeRamImage | ( | ) | [inherited] |
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.
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.
markBamModified | ( | ) | [inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
bool mightHaveRamImage | ( | ) | [inherited] |
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.
PointerToArrayunsigned char modifyRamImage | ( | ) | [inherited] |
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.
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.
PointerToArrayunsigned char modifySimpleRamImage | ( | ) | [inherited] |
Returns a modifiable pointer to the internal "simple" texture image.
See set_simple_ram_image().
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().
output | ( | ostream | out | ) | [inherited] |
Outputs the Namable.
This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.
Reimplemented in PandaNode, MouseWatcherRegion, TextNode, AdaptiveLru, SimpleLru, AsyncTask, Material, AsyncTaskChain, AsyncTaskManager, Thread, CollisionTraverser, PartBundle, AnimGroup, AnimControl, PandaLoader, LightNode, and LightLensNode.
output | ( | ostream | out | ) | [inherited] |
Reimplemented in AnimControl.
TexturePeeker peek | ( | ) | [inherited] |
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.
pingpong | ( | bool | restart | ) | [inherited] |
Starts the entire animation bouncing back and forth between its first frame and last frame.
If restart is true, the animation is restarted from the beginning; otherwise, it continues from the current frame.
pingpong | ( | bool | restart, |
double | from, | ||
double | to | ||
) | [inherited] |
Loops the animation from the frame "from" to and including the frame "to", and then back in the opposite direction, indefinitely.
play | ( | double | from, |
double | to | ||
) | [inherited] |
Runs the animation from the frame "from" to and including the frame "to", at which point the animation is stopped.
Both "from" and "to" frame numbers may be outside the range (0, get_num_frames()) and the animation will follow the range correctly, reporting numbers modulo get_num_frames(). For instance, play(0, get_num_frames() * 2) will play the animation twice and then stop.
play | ( | ) | [inherited] |
Runs the entire animation from beginning to end and stops.
pose | ( | double | frame | ) | [inherited] |
Sets the animation to the indicated frame and holds it there.
prepare | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
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.
TextureContext prepareNow | ( | PreparedGraphicsObjects | prepared_objects, |
GraphicsStateGuardianBase | gsg | ||
) | [inherited] |
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.
bool read | ( | Filename const | fullpath, |
Filename const | alpha_fullpath, | ||
int | primary_file_num_channels, | ||
int | alpha_file_channel, | ||
int | z, | ||
int | n, | ||
bool | read_pages, | ||
bool | read_mipmaps, | ||
BamCacheRecord | record | ||
) | [inherited] |
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.
bool read | ( | Filename const | fullpath, |
int | z, | ||
int | n, | ||
bool | read_pages, | ||
bool | read_mipmaps, | ||
LoaderOptions const | options | ||
) | [inherited] |
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.
bool read | ( | Filename const | fullpath, |
Filename const | alpha_fullpath, | ||
int | primary_file_num_channels, | ||
int | alpha_file_channel, | ||
LoaderOptions const | options | ||
) | [inherited] |
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.
bool read | ( | Filename const | fullpath, |
LoaderOptions const | options | ||
) | [inherited] |
Reads the named filename into the texture.
bool read | ( | Filename const | fullpath, |
Filename const | alpha_fullpath, | ||
int | primary_file_num_channels, | ||
int | alpha_file_channel, | ||
int | z, | ||
int | n, | ||
bool | read_pages, | ||
bool | read_mipmaps, | ||
BamCacheRecord | record, | ||
LoaderOptions const | options | ||
) | [inherited] |
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.
bool read | ( | Filename const | fullpath, |
Filename const | alpha_fullpath, | ||
int | primary_file_num_channels, | ||
int | alpha_file_channel | ||
) | [inherited] |
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.
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.
bool read | ( | Filename const | fullpath, |
Filename const | alpha_fullpath, | ||
int | primary_file_num_channels, | ||
int | alpha_file_channel, | ||
int | z, | ||
int | n, | ||
bool | read_pages, | ||
bool | read_mipmaps | ||
) | [inherited] |
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.
bool read | ( | Filename const | fullpath | ) | [inherited] |
Reads the named filename into the texture.
bool readDds | ( | istream | in | ) | [inherited] |
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.
bool readDds | ( | istream | in, |
string | filename, | ||
bool | header_only | ||
) | [inherited] |
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.
bool readDds | ( | istream | in, |
string | filename | ||
) | [inherited] |
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.
bool readTxo | ( | istream | in | ) | [inherited] |
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.
bool readTxo | ( | istream | in, |
string | filename | ||
) | [inherited] |
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.
PyObject reduce | ( | PyObject | self | ) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This hooks into the native pickle and cPickle modules, but it cannot properly handle self-referential BAM objects.
PyObject reducePersist | ( | PyObject | self, |
PyObject | pickler | ||
) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This is similar to __reduce__, but it provides additional support for the missing persistent-state object needed to properly support self-referential BAM objects written to the pickle stream. This hooks into the pickle and cPickle modules implemented in direct/src/stdpy.
ref | ( | ) | [inherited] |
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.
bool release | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
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.
int releaseAll | ( | ) | [inherited] |
Frees the context allocated on all objects for which the texture has been declared.
Returns the number of contexts which have been freed.
bool reload | ( | ) | [inherited] |
setAlphaFilename | ( | Filename const | alpha_filename | ) | [inherited] |
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 | ( | Filename const | alpha_fullpath | ) | [inherited] |
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 | ( | int | anisotropic_degree | ) | [inherited] |
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 | ( | string | key, |
TypedReferenceCount | aux_data | ||
) | [inherited] |
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 | ( | VBase4 const | color | ) | [inherited] |
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 | ( | ComponentType | component_type | ) | [inherited] |
Changes the data value for the texture components.
This implicitly sets component_width as well.
setCompression | ( | CompressionMode | compression | ) | [inherited] |
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 | ( | Filename const | filename | ) | [inherited] |
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 | ( | Format | format | ) | [inherited] |
Changes the format value for the texture components.
This implicitly sets num_components as well.
setFullpath | ( | Filename const | fullpath | ) | [inherited] |
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 | ( | bool | keep_ram_image | ) | [inherited] |
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 | ( | ) | [inherited] |
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 | ( | ) | [inherited] |
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 | ( | FilterType | filter | ) | [inherited] |
setMatchFramebufferFormat | ( | bool | flag | ) | [inherited] |
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 | ( | FilterType | filter | ) | [inherited] |
Specifies the size of the texture as it exists in its original disk file, before any Panda scaling.
Specifies the size of the texture as it exists in its original disk file, before any Panda scaling.
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.
setPadSize | ( | ) | [inherited] |
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.
setPadSize | ( | int | x | ) | [inherited] |
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.
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.
setPlayRate | ( | double | play_rate | ) | [inherited] |
Changes the rate at which the animation plays.
1.0 is the normal speed, 2.0 is twice normal speed, and 0.5 is half normal speed. 0.0 is legal to pause the animation, and a negative value will play the animation backwards.
setPostLoadStoreCache | ( | bool | flag | ) | [inherited] |
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 | ( | QualityLevel | quality_level | ) | [inherited] |
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 | ( | ConstPointerToArrayunsigned char | image | ) | [inherited] |
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.
setRamImage | ( | ConstPointerToArrayunsigned char | image, |
CompressionMode | compression, | ||
unsigned int | page_size | ||
) | [inherited] |
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.
setRamImage | ( | ConstPointerToArrayunsigned char | image, |
CompressionMode | compression | ||
) | [inherited] |
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 | ( | int | n, |
ConstPointerToArrayunsigned char | image, | ||
unsigned int | page_size | ||
) | [inherited] |
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.
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.
Accepts a raw pointer cast as an int, which is then passed to set_ram_mipmap_pointer(); see the documentation for that method.
This variant is particularly useful to set an external pointer from a language like Python, which doesn't support void pointers directly.
setRenderToTexture | ( | bool | render_to_texture | ) | [inherited] |
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.
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 | ( | ) | [inherited] |
Changes the size of the texture, padding if necessary, and setting the pad region as well.
setSizePadded | ( | int | x | ) | [inherited] |
Changes the size of the texture, padding if necessary, and setting the pad region as well.
Changes the size of the texture, padding if necessary, and setting the pad region as well.
Changes the size of the texture, padding if necessary, and setting the pad region as well.
static setTexturesPower2 | ( | AutoTextureScale | scale | ) | [static, inherited] |
Set this flag to ATS_none, ATS_up, or ATS_down to control the scaling of textures.
setup1dTexture | ( | int | x_size, |
ComponentType | component_type, | ||
Format | format | ||
) | [inherited] |
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.
setup1dTexture | ( | ) | [inherited] |
setup2dTexture | ( | ) | [inherited] |
setup2dTexture | ( | int | x_size, |
int | y_size, | ||
ComponentType | component_type, | ||
Format | format | ||
) | [inherited] |
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 | ( | int | z_size | ) | [inherited] |
setup3dTexture | ( | int | x_size, |
int | y_size, | ||
int | z_size, | ||
ComponentType | component_type, | ||
Format | format | ||
) | [inherited] |
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.
setup3dTexture | ( | ) | [inherited] |
setupCubeMap | ( | ) | [inherited] |
setupCubeMap | ( | int | size, |
ComponentType | component_type, | ||
Format | format | ||
) | [inherited] |
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 | ( | TextureType | texture_type, |
int | x_size, | ||
int | y_size, | ||
int | z_size, | ||
ComponentType | component_type, | ||
Format | format | ||
) | [inherited] |
setWrapU | ( | WrapMode | wrap | ) | [inherited] |
setWrapV | ( | WrapMode | wrap | ) | [inherited] |
setWrapW | ( | WrapMode | wrap | ) | [inherited] |
The W wrap direction is only used for 3-d textures.
setXSize | ( | int | x_size | ) | [inherited] |
Changes the x size indicated for the texture.
This also implicitly unloads the texture if it has already been loaded.
setYSize | ( | int | y_size | ) | [inherited] |
Changes the y size indicated for the texture.
This also implicitly unloads the texture if it has already been loaded.
setZSize | ( | int | z_size | ) | [inherited] |
Changes the z size indicated for the texture.
This also implicitly unloads the texture if it has already been loaded.
stop | ( | ) | [inherited] |
Stops a currently playing or looping animation right where it is.
The animation remains posed at the current frame.
bool store | ( | PNMImage | pnmimage | ) | [inherited] |
Saves the texture to the indicated PNMImage, but does not write it to disk.
Saves the indicated page and mipmap level of the texture to the PNMImage.
bool testRefCountIntegrity | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
bool testRefCountNonzero | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
bool uncompressRamImage | ( | ) | [inherited] |
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.
bool unref | ( | ) | [inherited] |
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.) 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.
Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.
Returns the smallest power of 2 greater than or equal to value.
bool usesMipmaps | ( | ) | [inherited] |
Returns true if the minfilter settings on this texture indicate the use of mipmapping, false otherwise.
bool wasImageModified | ( | PreparedGraphicsObjects | prepared_objects | ) | [inherited] |
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.
bool write | ( | Filename const | fullpath | ) | [inherited] |
Writes the texture to the named filename.
Not to be confused with write(Filename), this method simply describes the texture properties.
bool write | ( | Filename const | fullpath, |
int | z, | ||
int | n, | ||
bool | write_pages, | ||
bool | write_mipmaps | ||
) | [inherited] |
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.
bool writeTxo | ( | ostream | out | ) | [inherited] |
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.