Texture

from panda3d.core import Texture
class Texture

Bases: TypedWritableReferenceCount, Namable

Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-d texture image, or the six 2-d faces of a cube map texture.

A texture’s image data might be stored in system RAM (see get_ram_image()) or its image may be represented in texture memory on one or more GraphicsStateGuardians (see prepare()), or both. The typical usage pattern is that a texture is loaded from an image file on disk, which copies its image data into system RAM; then the first time the texture is rendered its image data is copied to texture memory (actually, to the graphics API), and the system RAM image is automatically freed.

Inheritance diagram

Inheritance diagram of Texture

CMDefault = 0
CMDxt1 = 4
CMDxt2 = 5
CMDxt3 = 6
CMDxt4 = 7
CMDxt5 = 8
CMEac = 14
CMEtc1 = 12
CMEtc2 = 13
CMFxt1 = 3
CMOff = 1
CMOn = 2
CMPvr12bpp = 9
CMPvr14bpp = 10
CMRgtc = 11
CM_default = 0
CM_dxt1 = 4
CM_dxt2 = 5
CM_dxt3 = 6
CM_dxt4 = 7
CM_dxt5 = 8
CM_eac = 14
CM_etc1 = 12
CM_etc2 = 13
CM_fxt1 = 3
CM_off = 1
CM_on = 2
CM_pvr1_2bpp = 9
CM_pvr1_4bpp = 10
CM_rgtc = 11
FAlpha = 6
FBlue = 5
FColorIndex = 2
FDepthComponent = 23
FDepthComponent16 = 24
FDepthComponent24 = 25
FDepthComponent32 = 26
FDepthStencil = 1
FGreen = 4
FLuminance = 18
FLuminanceAlpha = 19
FLuminanceAlphamask = 20
FR11G11B10 = 42
FR16 = 27
FR16i = 46
FR32 = 35
FR32i = 34
FR8i = 38
FRed = 3
FRg = 45
FRg16 = 28
FRg16i = 47
FRg32 = 36
FRg32i = 50
FRg8i = 39
FRgb = 7
FRgb10A2 = 44
FRgb12 = 10
FRgb16 = 29
FRgb16i = 48
FRgb32 = 37
FRgb32i = 51
FRgb332 = 11
FRgb5 = 8
FRgb8 = 9
FRgb8i = 40
FRgb9E5 = 43
FRgba = 12
FRgba12 = 17
FRgba16 = 21
FRgba16i = 49
FRgba32 = 22
FRgba32i = 52
FRgba4 = 14
FRgba5 = 15
FRgba8 = 16
FRgba8i = 41
FRgbm = 13
FSluminance = 32
FSluminanceAlpha = 33
FSrgb = 30
FSrgbAlpha = 31
FTDefault = 7
FTInvalid = 8
FTLinear = 1
FTLinearMipmapLinear = 5
FTLinearMipmapNearest = 3
FTNearest = 0
FTNearestMipmapLinear = 4
FTNearestMipmapNearest = 2
FTShadow = 6
FT_default = 7
FT_invalid = 8
FT_linear = 1
FT_linear_mipmap_linear = 5
FT_linear_mipmap_nearest = 3
FT_nearest = 0
FT_nearest_mipmap_linear = 4
FT_nearest_mipmap_nearest = 2
FT_shadow = 6
F_alpha = 6
F_blue = 5
F_color_index = 2
F_depth_component = 23
F_depth_component16 = 24
F_depth_component24 = 25
F_depth_component32 = 26
F_depth_stencil = 1
F_green = 4
F_luminance = 18
F_luminance_alpha = 19
F_luminance_alphamask = 20
F_r11_g11_b10 = 42
F_r16 = 27
F_r16i = 46
F_r32 = 35
F_r32i = 34
F_r8i = 38
F_red = 3
F_rg = 45
F_rg16 = 28
F_rg16i = 47
F_rg32 = 36
F_rg32i = 50
F_rg8i = 39
F_rgb = 7
F_rgb10_a2 = 44
F_rgb12 = 10
F_rgb16 = 29
F_rgb16i = 48
F_rgb32 = 37
F_rgb32i = 51
F_rgb332 = 11
F_rgb5 = 8
F_rgb8 = 9
F_rgb8i = 40
F_rgb9_e5 = 43
F_rgba = 12
F_rgba12 = 17
F_rgba16 = 21
F_rgba16i = 49
F_rgba32 = 22
F_rgba32i = 52
F_rgba4 = 14
F_rgba5 = 15
F_rgba8 = 16
F_rgba8i = 41
F_rgbm = 13
F_sluminance = 32
F_sluminance_alpha = 33
F_srgb = 30
F_srgb_alpha = 31
QLBest = 3
QLDefault = 0
QLFastest = 1
QLNormal = 2
QL_best = 3
QL_default = 0
QL_fastest = 1
QL_normal = 2
TByte = 5
TFloat = 2
THalfFloat = 7
TInt = 4
TShort = 6
TT1dTexture = 0
TT1dTextureArray = 7
TT2dTexture = 1
TT2dTextureArray = 3
TT3dTexture = 2
TTBufferTexture = 5
TTCubeMap = 4
TTCubeMapArray = 6
TT_1d_texture = 0
TT_1d_texture_array = 7
TT_2d_texture = 1
TT_2d_texture_array = 3
TT_3d_texture = 2
TT_buffer_texture = 5
TT_cube_map = 4
TT_cube_map_array = 6
TUnsignedByte = 0
TUnsignedInt = 8
TUnsignedInt248 = 3
TUnsignedShort = 1
T_byte = 5
T_float = 2
T_half_float = 7
T_int = 4
T_short = 6
T_unsigned_byte = 0
T_unsigned_int = 8
T_unsigned_int_24_8 = 3
T_unsigned_short = 1
WMBorderColor = 4
WMClamp = 0
WMInvalid = 5
WMMirror = 2
WMMirrorOnce = 3
WMRepeat = 1
WM_border_color = 4
WM_clamp = 0
WM_invalid = 5
WM_mirror = 2
WM_mirror_once = 3
WM_repeat = 1
__init__(*args, **kwargs)
alpha_filename
alpha_fullpath
anisotropic_degree
asyncEnsureRamImage()

C++ Interface: async_ensure_ram_image(const Texture self, bool allow_compression, int priority)

/**
  • Schedules a background task that reloads the the Texture from its disk file

  • if there is not currently a RAM image (or uncompressed RAM image, if

  • allow_compression is false).

  • A higher priority value indicates that this texture should be reloaded sooner

  • than textures with a lower priority value. If the reload hasn’t taken place

  • yet, you can call this again to update the priority value.

  • If someone else reloads the texture using an explicit call to reload() while

  • an async reload request is pending, the async reload request is cancelled.

*/

async_ensure_ram_image()

C++ Interface: async_ensure_ram_image(const Texture self, bool allow_compression, int priority)

/**
  • Schedules a background task that reloads the the Texture from its disk file

  • if there is not currently a RAM image (or uncompressed RAM image, if

  • allow_compression is false).

  • A higher priority value indicates that this texture should be reloaded sooner

  • than textures with a lower priority value. If the reload hasn’t taken place

  • yet, you can call this again to update the priority value.

  • If someone else reloads the texture using an explicit call to reload() while

  • an async reload request is pending, the async reload request is cancelled.

*/

auto_texture_scale
aux_data
border_color
cacheable
clear()

C++ Interface: clear(const Texture self)

/**
  • Reinitializes the texture to its default, empty state (except for the

  • name).

*/

clearAlphaFilename()

C++ Interface: clear_alpha_filename(const Texture self)

/**
  • Removes the alpha filename, if it was previously set. See

  • set_alpha_filename().

*/

clearAlphaFullpath()

C++ Interface: clear_alpha_fullpath(const Texture self)

/**
  • Removes the alpha fullpath, if it was previously set. See

  • set_alpha_fullpath().

*/

clearAuxData()

C++ Interface: clear_aux_data(const Texture self, str key)

/**
  • Removes a record previously recorded via set_aux_data().

*/

clearClearColor()

C++ Interface: clear_clear_color(const Texture self)

/**
  • The opposite of set_clear_color. If the image is cleared after setting

  • this, its contents may be undefined (or may in fact not be cleared at all).

*/

clearFilename()

C++ Interface: clear_filename(const Texture self)

/**
  • Removes the filename, if it was previously set. See set_filename().

*/

clearFullpath()

C++ Interface: clear_fullpath(const Texture self)

/**
  • Removes the fullpath, if it was previously set. See set_fullpath().

*/

clearImage()

C++ Interface: clear_image(const Texture self)

/**
  • Clears the texture data without changing its format or resolution. The

  • texture is cleared on both the graphics hardware and from RAM, unlike

  • clear_ram_image, which only removes the data from RAM.

  • If a clear color has been specified using set_clear_color, the texture will

  • be cleared using a solid color.

  • The texture data will be cleared the first time in which the texture is

  • used after this method is called.

*/

clearRamImage()

C++ Interface: clear_ram_image(const Texture self)

// !CPPPARSER || !HAVE_PYTHON

/**
  • Discards the current system-RAM image.

*/

clearRamMipmapImage()

C++ Interface: clear_ram_mipmap_image(const Texture self, int n)

/**
  • Discards the current system-RAM image for the nth mipmap level.

*/

clearRamMipmapImages()

C++ Interface: clear_ram_mipmap_images(const Texture self)

/**
  • Discards the current system-RAM image for all mipmap levels, except level 0

  • (the base image).

*/

clearSimpleRamImage()

C++ Interface: clear_simple_ram_image(const Texture self)

/**
  • Discards the current “simple” image.

*/

clear_alpha_filename()

C++ Interface: clear_alpha_filename(const Texture self)

/**
  • Removes the alpha filename, if it was previously set. See

  • set_alpha_filename().

*/

clear_alpha_fullpath()

C++ Interface: clear_alpha_fullpath(const Texture self)

/**
  • Removes the alpha fullpath, if it was previously set. See

  • set_alpha_fullpath().

*/

clear_aux_data()

C++ Interface: clear_aux_data(const Texture self, str key)

/**
  • Removes a record previously recorded via set_aux_data().

*/

clear_clear_color()

C++ Interface: clear_clear_color(const Texture self)

/**
  • The opposite of set_clear_color. If the image is cleared after setting

  • this, its contents may be undefined (or may in fact not be cleared at all).

*/

clear_color
clear_filename()

C++ Interface: clear_filename(const Texture self)

/**
  • Removes the filename, if it was previously set. See set_filename().

*/

clear_fullpath()

C++ Interface: clear_fullpath(const Texture self)

/**
  • Removes the fullpath, if it was previously set. See set_fullpath().

*/

clear_image()

C++ Interface: clear_image(const Texture self)

/**
  • Clears the texture data without changing its format or resolution. The

  • texture is cleared on both the graphics hardware and from RAM, unlike

  • clear_ram_image, which only removes the data from RAM.

  • If a clear color has been specified using set_clear_color, the texture will

  • be cleared using a solid color.

  • The texture data will be cleared the first time in which the texture is

  • used after this method is called.

*/

clear_ram_image()

C++ Interface: clear_ram_image(const Texture self)

// !CPPPARSER || !HAVE_PYTHON

/**
  • Discards the current system-RAM image.

*/

clear_ram_mipmap_image()

C++ Interface: clear_ram_mipmap_image(const Texture self, int n)

/**
  • Discards the current system-RAM image for the nth mipmap level.

*/

clear_ram_mipmap_images()

C++ Interface: clear_ram_mipmap_images(const Texture self)

/**
  • Discards the current system-RAM image for all mipmap levels, except level 0

  • (the base image).

*/

clear_simple_ram_image()

C++ Interface: clear_simple_ram_image(const Texture self)

/**
  • Discards the current “simple” image.

*/

component_type
component_width
compressRamImage()

C++ Interface: compress_ram_image(const Texture self, int compression, int quality_level, GraphicsStateGuardianBase gsg)

/**
  • 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.

*/

compress_ram_image()

C++ Interface: compress_ram_image(const Texture self, int compression, int quality_level, GraphicsStateGuardianBase gsg)

/**
  • 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.

*/

compression

Could maybe use has_compression here, too

considerRescale()

C++ Interface: consider_rescale(const Texture self, PNMImage pnmimage) consider_rescale(PNMImage pnmimage, str name, int auto_texture_scale)

/**
  • Asks the PNMImage to change its scale when it reads the image, according to

  • the whims of the Config.prc file.

  • For most efficient results, this method should be called after

  • pnmimage.read_header() has been called, but before pnmimage.read(). This

  • method may also be called after pnmimage.read(), i.e. when the pnmimage is

  • already loaded; in this case it will rescale the image on the spot. Also

  • see rescale_texture().

*/

/**
  • Asks the PNMImage to change its scale when it reads the image, according to

  • the whims of the Config.prc file.

  • For most efficient results, this method should be called after

  • pnmimage.read_header() has been called, but before pnmimage.read(). This

  • method may also be called after pnmimage.read(), i.e. when the pnmimage is

  • already loaded; in this case it will rescale the image on the spot. Also

  • see rescale_texture().

*/

consider_rescale()

C++ Interface: consider_rescale(const Texture self, PNMImage pnmimage) consider_rescale(PNMImage pnmimage, str name, int auto_texture_scale)

/**
  • Asks the PNMImage to change its scale when it reads the image, according to

  • the whims of the Config.prc file.

  • For most efficient results, this method should be called after

  • pnmimage.read_header() has been called, but before pnmimage.read(). This

  • method may also be called after pnmimage.read(), i.e. when the pnmimage is

  • already loaded; in this case it will rescale the image on the spot. Also

  • see rescale_texture().

*/

/**
  • Asks the PNMImage to change its scale when it reads the image, according to

  • the whims of the Config.prc file.

  • For most efficient results, this method should be called after

  • pnmimage.read_header() has been called, but before pnmimage.read(). This

  • method may also be called after pnmimage.read(), i.e. when the pnmimage is

  • already loaded; in this case it will rescale the image on the spot. Also

  • see rescale_texture().

*/

default_sampler
downToPower2()

C++ Interface: down_to_power_2(int value)

/**
  • Returns the largest power of 2 less than or equal to value.

*/

down_to_power_2()

C++ Interface: down_to_power_2(int value)

/**
  • Returns the largest power of 2 less than or equal to value.

*/

effective_anisotropic_degree
effective_magfilter
effective_minfilter
effective_quality_level
estimateTextureMemory()

C++ Interface: estimate_texture_memory(Texture self)

/**
  • 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.

*/

estimate_texture_memory()

C++ Interface: estimate_texture_memory(Texture self)

/**
  • 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.

*/

expected_num_mipmap_levels
expected_ram_image_size
expected_ram_page_size
filename
format
formatComponentType()

C++ Interface: format_component_type(int ct)

/**
  • Returns the indicated ComponentType converted to a string word.

*/

formatCompressionMode()

C++ Interface: format_compression_mode(int cm)

/**
  • Returns the indicated CompressionMode converted to a string word.

*/

formatFormat()

C++ Interface: format_format(int f)

/**
  • Returns the indicated Format converted to a string word.

*/

formatQualityLevel()

C++ Interface: format_quality_level(int tql)

/**
  • Returns the indicated QualityLevel converted to a string word.

*/

formatTextureType()

C++ Interface: format_texture_type(int tt)

/**
  • Returns the indicated TextureType converted to a string word.

*/

format_component_type()

C++ Interface: format_component_type(int ct)

/**
  • Returns the indicated ComponentType converted to a string word.

*/

format_compression_mode()

C++ Interface: format_compression_mode(int cm)

/**
  • Returns the indicated CompressionMode converted to a string word.

*/

format_format()

C++ Interface: format_format(int f)

/**
  • Returns the indicated Format converted to a string word.

*/

format_quality_level()

C++ Interface: format_quality_level(int tql)

/**
  • Returns the indicated QualityLevel converted to a string word.

*/

format_texture_type()

C++ Interface: format_texture_type(int tt)

/**
  • Returns the indicated TextureType converted to a string word.

*/

fullpath
generateAlphaScaleMap()

C++ Interface: generate_alpha_scale_map(const Texture self)

/**
  • 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()

C++ Interface: generate_normalization_cube_map(const Texture self, 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()

C++ Interface: generate_ram_mipmap_images(const Texture self)

/**
  • 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()

C++ Interface: generate_simple_ram_image(const Texture self)

/**
  • 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.

*/

generate_alpha_scale_map()

C++ Interface: generate_alpha_scale_map(const Texture self)

/**
  • 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).

*/

generate_normalization_cube_map()

C++ Interface: generate_normalization_cube_map(const Texture self, 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).

*/

generate_ram_mipmap_images()

C++ Interface: generate_ram_mipmap_images(const Texture self)

/**
  • 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.

*/

generate_simple_ram_image()

C++ Interface: generate_simple_ram_image(const Texture self)

/**
  • Computes the “simple” ram image by loading the main RAM image, if it is not

  • already available, and reducing it to 16x16 or smaller. This may be an

  • expensive operation.

*/

getActive()

C++ Interface: get_active(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Returns true if this Texture was rendered in the most recent frame within

  • the indicated GSG.

*/

getAlphaFilename()

C++ Interface: get_alpha_filename(Texture self)

/**
  • Returns the alpha_filename that has been set. If this is set, it

  • represents the name of the alpha component, which is stored in a separate

  • file. See also get_filename(), and get_alpha_fullpath().

*/

getAlphaFullpath()

C++ Interface: get_alpha_fullpath(Texture self)

/**
  • Returns the alpha_fullpath that has been set. This is the full path to the

  • alpha part of the image file as it was found along the texture search path.

*/

getAnisotropicDegree()

C++ Interface: get_anisotropic_degree(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getAutoTextureScale()

C++ Interface: get_auto_texture_scale(Texture self)

/**
  • Returns the power-of-2 texture-scaling mode that will be applied to this

  • particular texture when it is next loaded from disk. See

  • set_textures_power_2().

*/

getAuxData()

C++ Interface: get_aux_data(Texture self, str key)

/**
  • Returns a record previously recorded via set_aux_data(). Returns NULL if

  • there was no record associated with the indicated key.

*/

getBorderColor()

C++ Interface: get_border_color(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getClassType()

C++ Interface: get_class_type()

getClearColor()

C++ Interface: get_clear_color(Texture self)

/**
  • Returns the color that was previously set using set_clear_color.

*/

getClearData()

C++ Interface: get_clear_data(Texture self)

/**
  • Returns the raw image data for a single pixel if it were set to the clear

  • color.

*/

getComponentType()

C++ Interface: get_component_type(Texture self)

/**
  • Returns the numeric interpretation of each component of the texture.

*/

getComponentWidth()

C++ Interface: get_component_width(Texture self)

/**
  • Returns the number of bytes stored for each color component of a texel.

  • Typically this is 1, but it may be 2 for 16-bit texels.

*/

getCompression()

C++ Interface: get_compression(Texture self)

/**
  • Returns the compression mode requested for this particular texture, or

  • CM_off if the texture is not to be compressed.

  • If a value other than CM_off is returned, this is not a guarantee that the

  • texture is actually successfully compressed on the GSG. It may be that the

  • GSG does not support the requested compression mode, in which case the

  • texture may actually be stored uncompressed in texture memory.

*/

getDataSizeBytes()

C++ Interface: get_data_size_bytes(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • 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.

*/

getDefaultSampler()

C++ Interface: get_default_sampler(Texture self)

/**
  • This returns the default sampler state for this texture, containing the

  • wrap and filter properties specified on the texture level; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getEffectiveAnisotropicDegree()

C++ Interface: get_effective_anisotropic_degree(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getEffectiveMagfilter()

C++ Interface: get_effective_magfilter(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getEffectiveMinfilter()

C++ Interface: get_effective_minfilter(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getEffectiveQualityLevel()

C++ Interface: get_effective_quality_level(Texture self)

/**
  • 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)

*/

getExpectedMipmapNumPages()

C++ Interface: get_expected_mipmap_num_pages(Texture self, int n)

/**
  • Returns the total number of pages that the nth mipmap level should have,

  • based on the texture’s size. This is usually the same as

  • get_expected_mipmap_z_size(), except for a multiview texture, in which case

  • it is get_expected_mipmap_z_size() * get_num_views().

*/

getExpectedMipmapXSize()

C++ Interface: get_expected_mipmap_x_size(Texture self, int n)

/**
  • Returns the x_size that the nth mipmap level should have, based on the

  • texture’s size.

*/

getExpectedMipmapYSize()

C++ Interface: get_expected_mipmap_y_size(Texture self, int n)

/**
  • Returns the y_size that the nth mipmap level should have, based on the

  • texture’s size.

*/

getExpectedMipmapZSize()

C++ Interface: get_expected_mipmap_z_size(Texture self, int n)

/**
  • Returns the z_size that the nth mipmap level should have, based on the

  • texture’s size.

*/

getExpectedNumMipmapLevels()

C++ Interface: get_expected_num_mipmap_levels(Texture self)

/**
  • Returns the number of mipmap levels that should be defined for this

  • texture, given the texture’s size.

  • Note that this returns a number appropriate for mipmapping, even if the

  • texture does not currently have mipmapping enabled.

*/

getExpectedRamImageSize()

C++ Interface: get_expected_ram_image_size(Texture self)

/**
  • Returns the number of bytes that ought to be used by the in-memory image,

  • based on the texture parameters.

*/

getExpectedRamMipmapImageSize()

C++ Interface: get_expected_ram_mipmap_image_size(Texture self, 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.

*/

getExpectedRamMipmapPageSize()

C++ Interface: get_expected_ram_mipmap_page_size(Texture self, int n)

/**
  • 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_view_size(n).

*/

getExpectedRamMipmapViewSize()

C++ Interface: get_expected_ram_mipmap_view_size(Texture self, int n)

/**
  • Returns the number of bytes that ought to be used by each view of the in-

  • memory image for mipmap level n, based on the texture parameters. For a

  • normal, non-multiview texture, this is the same as

  • get_expected_ram_mipmap_image_size(n).

*/

getExpectedRamPageSize()

C++ Interface: get_expected_ram_page_size(Texture self)

/**
  • Returns the number of bytes that should be used per each Z page of the 3-d

  • texture. For a 2-d or 1-d texture, this is the same as

  • get_expected_ram_image_size().

*/

getFilename()

C++ Interface: get_filename(Texture self)

/**
  • Returns the filename that has been set. This is the name of the file as it

  • was requested. Also see get_fullpath().

*/

getFormat()

C++ Interface: get_format(Texture self)

/**
  • Returns the format of the texture, which represents both the semantic

  • meaning of the texels and, to some extent, their storage information.

*/

getFullpath()

C++ Interface: get_fullpath(Texture self)

/**
  • Returns the fullpath that has been set. This is the full path to the file

  • as it was found along the texture search path.

*/

getImageModified()

C++ Interface: get_image_modified(Texture self)

/**
  • Returns a sequence number which is guaranteed to change at least every time

  • the texture image data (including mipmap levels) are modified.

*/

getImageModifiedPages()

C++ Interface: get_image_modified_pages(Texture self, UpdateSeq since, int n)

/**
  • Returns a SparseArray containing all the image pages that have been modified

  • since the given UpdateSeq value.

*/

getKeepRamImage()

C++ Interface: get_keep_ram_image(Texture self)

/**
  • Returns the flag that indicates whether this Texture is eligible to have

  • its main RAM copy of the texture memory dumped when the texture is prepared

  • for rendering. See set_keep_ram_image().

*/

getLoadedFromImage()

C++ Interface: get_loaded_from_image(Texture self)

/**
  • Returns the flag that indicates the texture has been loaded from a disk

  • file or PNMImage. See set_loaded_from_image().

*/

getLoadedFromTxo()

C++ Interface: get_loaded_from_txo(Texture self)

/**
  • Returns the flag that indicates the texture has been loaded from a txo

  • file.

*/

getMagfilter()

C++ Interface: get_magfilter(Texture self)

/**
  • 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().

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getMatchFramebufferFormat()

C++ Interface: get_match_framebuffer_format(Texture self)

/**
  • Returns true if the special flag was set that indicates to the GSG that the

  • Texture’s format should be chosen to exactly match the framebuffer’s

  • format, presumably because the application intends to copy image data from

  • the framebuffer into the Texture (or vice-versa).

*/

getMinfilter()

C++ Interface: get_minfilter(Texture self)

/**
  • 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().

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getNumComponents()

C++ Interface: get_num_components(Texture self)

/**
  • Returns the number of color components for each texel of the texture image.

  • This is 3 for an rgb texture or 4 for an rgba texture; it may also be 1 or

  • 2 for a grayscale texture.

*/

getNumLoadableRamMipmapImages()

C++ Interface: get_num_loadable_ram_mipmap_images(Texture self)

/**
  • 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.

*/

getNumPages()

C++ Interface: get_num_pages(Texture self)

/**
  • Returns the total number of pages in the texture. Each “page” is a 2-d

  • texture image within the larger image–a face of a cube map, or a level of

  • a 3-d texture. Normally, get_num_pages() is the same as get_z_size().

  • However, in a multiview texture, this returns get_z_size() *

  • get_num_views().

*/

getNumRamMipmapImages()

C++ Interface: get_num_ram_mipmap_images(Texture self)

/**
  • 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().

*/

getNumViews()

C++ Interface: get_num_views(Texture self)

/**
  • Returns the number of “views” in the texture. A view is a completely

  • separate image stored within the Texture object. Most textures have only

  • one view, but a stereo texture, for instance, may have two views, a left

  • and a right image. Other uses for multiple views are not yet defined.

  • If this value is greater than one, the additional views are accessed as

  • additional pages beyond get_z_size().

*/

getOrigFileXSize()

C++ Interface: get_orig_file_x_size(Texture self)

/**
  • Returns the X size of the original disk image that this Texture was loaded

  • from (if it came from a disk file), before any automatic rescaling by

  • Panda.

*/

getOrigFileYSize()

C++ Interface: get_orig_file_y_size(Texture self)

/**
  • Returns the Y size of the original disk image that this Texture was loaded

  • from (if it came from a disk file), before any automatic rescaling by

  • Panda.

*/

getOrigFileZSize()

C++ Interface: get_orig_file_z_size(Texture self)

/**
  • Returns the Z size of the original disk image that this Texture was loaded

  • from (if it came from a disk file), before any automatic rescaling by

  • Panda.

*/

getPadXSize()

C++ Interface: get_pad_x_size(Texture self)

/**
  • Returns size of the pad region. See set_pad_size.

*/

getPadYSize()

C++ Interface: get_pad_y_size(Texture self)

/**
  • Returns size of the pad region. See set_pad_size.

*/

getPadZSize()

C++ Interface: get_pad_z_size(Texture self)

/**
  • Returns size of the pad region. See set_pad_size.

*/

getPostLoadStoreCache()

C++ Interface: get_post_load_store_cache(Texture self)

/**
  • Returns the setting of the post_load_store_cache flag. See

  • set_post_load_store_cache().

*/

getPropertiesModified()

C++ Interface: get_properties_modified(Texture self)

/**
  • Returns a sequence number which is guaranteed to change at least every time

  • the texture properties (unrelated to the image) are modified.

*/

getQualityLevel()

C++ Interface: get_quality_level(Texture self)

/**
  • Returns the current quality_level hint. See set_quality_level(). This

  • value may return QL_default; see get_effective_quality_level().

*/

getRamImage()

C++ Interface: get_ram_image(const Texture self)

/**
  • Returns the system-RAM image data associated with the texture. If the

  • texture does not currently have an associated RAM image, and the texture

  • was generated by loading an image from a disk file (the most common case),

  • this forces the reload of the same texture. This can happen if

  • keep_texture_ram is configured to false, and we have previously prepared

  • this texture with a GSG.

  • Note that it is not correct to call has_ram_image() first to test whether

  • this function will fail. A false return value from has_ram_image()

  • indicates only that get_ram_image() may need to reload the texture from

  • disk, which it will do automatically. However, you can call

  • might_have_ram_image(), which will return true if the ram image exists, or

  • there is a reasonable reason to believe it can be loaded.

  • On the other hand, it is possible that the texture cannot be found on disk

  • or is otherwise unavailable. If that happens, this function will return

  • NULL. There is no way to predict with 100% accuracy whether get_ram_image()

  • will return NULL without calling it first; might_have_ram_image() is the

  • closest.

*/

getRamImageAs()

C++ Interface: get_ram_image_as(const Texture self, str requested_format)

/**
  • 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.

*/

getRamImageCompression()

C++ Interface: get_ram_image_compression(Texture self)

/**
  • Returns the compression mode in which the ram image is already stored pre-

  • compressed. If this is other than CM_off, you cannot rely on the contents

  • of the ram image to be anything predicatable (it will not be an array of x

  • by y pixels, and it probably won’t have the same length as

  • get_expected_ram_image_size()).

*/

getRamImageSize()

C++ Interface: get_ram_image_size(Texture self)

/**
  • Returns the total number of bytes used by the in-memory image, across all

  • pages and views, or 0 if there is no in-memory image.

*/

getRamMipmapImage()

C++ Interface: get_ram_mipmap_image(Texture self, int n)

/**
  • Returns the system-RAM image data associated with the nth mipmap level, if

  • present. Returns NULL if the nth mipmap level is not present.

*/

getRamMipmapImageSize()

C++ Interface: get_ram_mipmap_image_size(Texture self, 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.

*/

getRamMipmapPageSize()

C++ Interface: get_ram_mipmap_page_size(Texture self, 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.

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

*/

getRamMipmapViewSize()

C++ Interface: get_ram_mipmap_view_size(Texture self, int n)

/**
  • Returns the number of bytes used by the in-memory image per view for mipmap

  • level n, or 0 if there is no in-memory image for this mipmap level.

  • A “view” is a collection of z_size pages for each mipmap level. Most

  • textures have only one view, except for multiview or stereo textures.

  • For a non-compressed texture, this is the same as

  • get_expected_ram_mipmap_view_size(). For a compressed texture, this may be

  • a smaller value. (We do assume that all pages will be the same size on a

  • compressed texture).

*/

getRamPageSize()

C++ Interface: get_ram_page_size(Texture self)

/**
  • 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).

*/

getRamViewSize()

C++ Interface: get_ram_view_size(Texture self)

/**
  • Returns the number of bytes used by the in-memory image per view, or 0 if

  • there is no in-memory image. Since each view is a stack of z_size pages,

  • this is get_z_size() * get_ram_page_size().

*/

getRenderToTexture()

C++ Interface: get_render_to_texture(Texture self)

/**
  • Returns a flag on the texture that indicates whether the texture is

  • intended to be used as a direct-render target, by binding a framebuffer to

  • a texture and rendering directly into the texture.

  • Normally, a user should not need to set this flag directly; it is set

  • automatically by the low-level display code when a texture is bound to a

  • framebuffer.

*/

getResident()

C++ Interface: get_resident(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Returns true if this Texture is reported to be resident within graphics

  • memory for the indicated GSG.

*/

getSimpleRamImage()

C++ Interface: get_simple_ram_image(Texture self)

/**
  • Returns the image data associated with the “simple” texture image. This is

  • provided for some textures as an option to display while the main texture

  • image is being loaded from disk.

  • Unlike get_ram_image(), this function will always return immediately.

  • Either the simple image is available, or it is not.

  • The “simple” image is always 4 components, 1 byte each, regardless of the

  • parameters of the full texture. The simple image is only supported for

  • ordinary 2-d textures.

*/

getSimpleRamImageSize()

C++ Interface: get_simple_ram_image_size(Texture self)

/**
  • Returns the number of bytes used by the “simple” image, or 0 if there is no

  • simple image.

*/

getSimpleXSize()

C++ Interface: get_simple_x_size(Texture self)

/**
  • Returns the width of the “simple” image in texels.

*/

getSimpleYSize()

C++ Interface: get_simple_y_size(Texture self)

/**
  • Returns the height of the “simple” image in texels.

*/

getTexScale()

C++ Interface: get_tex_scale(Texture self)

/**
  • 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 only if a padding size has been set via set_pad_size()

  • (or implicitly via something like “textures-power-2 pad” in the config.prc

  • file). In this case, this is a convenient way to generate UV’s that

  • reflect the built-in padding size.

*/

getTextureType()

C++ Interface: get_texture_type(Texture self)

/**
  • Returns the overall interpretation of the texture.

*/

getTexturesPower2()

C++ Interface: get_textures_power_2()

/**
  • This flag returns ATS_none, ATS_up, or ATS_down and controls the scaling of

  • textures in general. It is initialized from the config variable of the

  • same name, but it can be subsequently adjusted. See also

  • get_auto_texture_scale().

*/

getUncompressedRamImage()

C++ Interface: get_uncompressed_ram_image(const Texture self)

/**
  • 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.

*/

getUsageHint()

C++ Interface: get_usage_hint(Texture self)

/**
  • Returns the usage hint specified for buffer textures, or UH_unspecified for

  • all other texture types.

*/

getViewModifiedPages()

C++ Interface: get_view_modified_pages(Texture self, UpdateSeq since, int view, int n)

/**
  • Like get_image_modified_pages, but returns the result for a particular view.

*/

getWrapU()

C++ Interface: get_wrap_u(Texture self)

/**
  • Returns the wrap mode of the texture in the U direction.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getWrapV()

C++ Interface: get_wrap_v(Texture self)

/**
  • Returns the wrap mode of the texture in the V direction.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getWrapW()

C++ Interface: get_wrap_w(Texture self)

/**
  • Returns the wrap mode of the texture in the W direction. This is the depth

  • direction of 3-d textures.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

getXSize()

C++ Interface: get_x_size(Texture self)

/**
  • Returns the width of the texture image in texels.

*/

getYSize()

C++ Interface: get_y_size(Texture self)

/**
  • Returns the height of the texture image in texels. For a 1-d texture, this

  • will be 1.

*/

getZSize()

C++ Interface: get_z_size(Texture self)

/**
  • 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.

*/

get_active()

C++ Interface: get_active(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Returns true if this Texture was rendered in the most recent frame within

  • the indicated GSG.

*/

get_alpha_filename()

C++ Interface: get_alpha_filename(Texture self)

/**
  • 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().

*/

get_alpha_fullpath()

C++ Interface: get_alpha_fullpath(Texture self)

/**
  • 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.

*/

get_anisotropic_degree()

C++ Interface: get_anisotropic_degree(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_auto_texture_scale()

C++ Interface: get_auto_texture_scale(Texture self)

/**
  • Returns the power-of-2 texture-scaling mode that will be applied to this

  • particular texture when it is next loaded from disk. See

  • set_textures_power_2().

*/

get_aux_data()

C++ Interface: get_aux_data(Texture self, str key)

/**
  • Returns a record previously recorded via set_aux_data(). Returns NULL if

  • there was no record associated with the indicated key.

*/

get_border_color()

C++ Interface: get_border_color(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_class_type()

C++ Interface: get_class_type()

get_clear_color()

C++ Interface: get_clear_color(Texture self)

/**
  • Returns the color that was previously set using set_clear_color.

*/

get_clear_data()

C++ Interface: get_clear_data(Texture self)

/**
  • Returns the raw image data for a single pixel if it were set to the clear

  • color.

*/

get_component_type()

C++ Interface: get_component_type(Texture self)

/**
  • Returns the numeric interpretation of each component of the texture.

*/

get_component_width()

C++ Interface: get_component_width(Texture self)

/**
  • 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.

*/

get_compression()

C++ Interface: get_compression(Texture self)

/**
  • 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.

*/

get_data_size_bytes()

C++ Interface: get_data_size_bytes(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • 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.

*/

get_default_sampler()

C++ Interface: get_default_sampler(Texture self)

/**
  • This returns the default sampler state for this texture, containing the

  • wrap and filter properties specified on the texture level; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_effective_anisotropic_degree()

C++ Interface: get_effective_anisotropic_degree(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_effective_magfilter()

C++ Interface: get_effective_magfilter(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_effective_minfilter()

C++ Interface: get_effective_minfilter(Texture self)

/**
  • 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.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_effective_quality_level()

C++ Interface: get_effective_quality_level(Texture self)

/**
  • 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)

*/

get_expected_mipmap_num_pages()

C++ Interface: get_expected_mipmap_num_pages(Texture self, int n)

/**
  • Returns the total number of pages that the nth mipmap level should have,

  • based on the texture’s size. This is usually the same as

  • get_expected_mipmap_z_size(), except for a multiview texture, in which case

  • it is get_expected_mipmap_z_size() * get_num_views().

*/

get_expected_mipmap_x_size()

C++ Interface: get_expected_mipmap_x_size(Texture self, int n)

/**
  • Returns the x_size that the nth mipmap level should have, based on the

  • texture’s size.

*/

get_expected_mipmap_y_size()

C++ Interface: get_expected_mipmap_y_size(Texture self, int n)

/**
  • Returns the y_size that the nth mipmap level should have, based on the

  • texture’s size.

*/

get_expected_mipmap_z_size()

C++ Interface: get_expected_mipmap_z_size(Texture self, int n)

/**
  • Returns the z_size that the nth mipmap level should have, based on the

  • texture’s size.

*/

get_expected_num_mipmap_levels()

C++ Interface: get_expected_num_mipmap_levels(Texture self)

/**
  • 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.

*/

get_expected_ram_image_size()

C++ Interface: get_expected_ram_image_size(Texture self)

/**
  • Returns the number of bytes that ought to be used by the in-memory image,

  • based on the texture parameters.

*/

get_expected_ram_mipmap_image_size()

C++ Interface: get_expected_ram_mipmap_image_size(Texture self, 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.

*/

get_expected_ram_mipmap_page_size()

C++ Interface: get_expected_ram_mipmap_page_size(Texture self, int n)

/**
  • 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_view_size(n).

*/

get_expected_ram_mipmap_view_size()

C++ Interface: get_expected_ram_mipmap_view_size(Texture self, int n)

/**
  • Returns the number of bytes that ought to be used by each view of the in-

  • memory image for mipmap level n, based on the texture parameters. For a

  • normal, non-multiview texture, this is the same as

  • get_expected_ram_mipmap_image_size(n).

*/

get_expected_ram_page_size()

C++ Interface: get_expected_ram_page_size(Texture self)

/**
  • 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().

*/

get_filename()

C++ Interface: get_filename(Texture self)

/**
  • Returns the filename that has been set. This is the name of the file as it

  • was requested. Also see get_fullpath().

*/

get_format()

C++ Interface: get_format(Texture self)

/**
  • Returns the format of the texture, which represents both the semantic

  • meaning of the texels and, to some extent, their storage information.

*/

get_fullpath()

C++ Interface: get_fullpath(Texture self)

/**
  • Returns the fullpath that has been set. This is the full path to the file

  • as it was found along the texture search path.

*/

get_image_modified()

C++ Interface: get_image_modified(Texture self)

/**
  • Returns a sequence number which is guaranteed to change at least every time

  • the texture image data (including mipmap levels) are modified.

*/

get_image_modified_pages()

C++ Interface: get_image_modified_pages(Texture self, UpdateSeq since, int n)

/**
  • Returns a SparseArray containing all the image pages that have been modified

  • since the given UpdateSeq value.

*/

get_keep_ram_image()

C++ Interface: get_keep_ram_image(Texture self)

/**
  • Returns the flag that indicates whether this Texture is eligible to have

  • its main RAM copy of the texture memory dumped when the texture is prepared

  • for rendering. See set_keep_ram_image().

*/

get_loaded_from_image()

C++ Interface: get_loaded_from_image(Texture self)

/**
  • Returns the flag that indicates the texture has been loaded from a disk

  • file or PNMImage. See set_loaded_from_image().

*/

get_loaded_from_txo()

C++ Interface: get_loaded_from_txo(Texture self)

/**
  • Returns the flag that indicates the texture has been loaded from a txo

  • file.

*/

get_magfilter()

C++ Interface: get_magfilter(Texture self)

/**
  • 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().

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_match_framebuffer_format()

C++ Interface: get_match_framebuffer_format(Texture self)

/**
  • 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).

*/

get_minfilter()

C++ Interface: get_minfilter(Texture self)

/**
  • 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().

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_num_components()

C++ Interface: get_num_components(Texture self)

/**
  • 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.

*/

get_num_loadable_ram_mipmap_images()

C++ Interface: get_num_loadable_ram_mipmap_images(Texture self)

/**
  • 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.

*/

get_num_pages()

C++ Interface: get_num_pages(Texture self)

/**
  • Returns the total number of pages in the texture. Each “page” is a 2-d

  • texture image within the larger image–a face of a cube map, or a level of

  • a 3-d texture. Normally, get_num_pages() is the same as get_z_size().

  • However, in a multiview texture, this returns get_z_size() *

  • get_num_views().

*/

get_num_ram_mipmap_images()

C++ Interface: get_num_ram_mipmap_images(Texture self)

/**
  • 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().

*/

get_num_views()

C++ Interface: get_num_views(Texture self)

/**
  • Returns the number of “views” in the texture. A view is a completely

  • separate image stored within the Texture object. Most textures have only

  • one view, but a stereo texture, for instance, may have two views, a left

  • and a right image. Other uses for multiple views are not yet defined.

  • If this value is greater than one, the additional views are accessed as

  • additional pages beyond get_z_size().

*/

get_orig_file_x_size()

C++ Interface: get_orig_file_x_size(Texture self)

/**
  • 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.

*/

get_orig_file_y_size()

C++ Interface: get_orig_file_y_size(Texture self)

/**
  • 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.

*/

get_orig_file_z_size()

C++ Interface: get_orig_file_z_size(Texture self)

/**
  • 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.

*/

get_pad_x_size()

C++ Interface: get_pad_x_size(Texture self)

/**
  • Returns size of the pad region. See set_pad_size.

*/

get_pad_y_size()

C++ Interface: get_pad_y_size(Texture self)

/**
  • Returns size of the pad region. See set_pad_size.

*/

get_pad_z_size()

C++ Interface: get_pad_z_size(Texture self)

/**
  • Returns size of the pad region. See set_pad_size.

*/

get_post_load_store_cache()

C++ Interface: get_post_load_store_cache(Texture self)

/**
  • Returns the setting of the post_load_store_cache flag. See

  • set_post_load_store_cache().

*/

get_properties_modified()

C++ Interface: get_properties_modified(Texture self)

/**
  • Returns a sequence number which is guaranteed to change at least every time

  • the texture properties (unrelated to the image) are modified.

*/

get_quality_level()

C++ Interface: get_quality_level(Texture self)

/**
  • Returns the current quality_level hint. See set_quality_level(). This

  • value may return QL_default; see get_effective_quality_level().

*/

get_ram_image()

C++ Interface: get_ram_image(const Texture self)

/**
  • 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.

*/

get_ram_image_as()

C++ Interface: get_ram_image_as(const Texture self, str requested_format)

/**
  • 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.

*/

get_ram_image_compression()

C++ Interface: get_ram_image_compression(Texture self)

/**
  • 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()).

*/

get_ram_image_size()

C++ Interface: get_ram_image_size(Texture self)

/**
  • Returns the total number of bytes used by the in-memory image, across all

  • pages and views, or 0 if there is no in-memory image.

*/

get_ram_mipmap_image()

C++ Interface: get_ram_mipmap_image(Texture self, int n)

/**
  • Returns the system-RAM image data associated with the nth mipmap level, if

  • present. Returns NULL if the nth mipmap level is not present.

*/

get_ram_mipmap_image_size()

C++ Interface: get_ram_mipmap_image_size(Texture self, 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.

*/

get_ram_mipmap_page_size()

C++ Interface: get_ram_mipmap_page_size(Texture self, 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.

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

*/

get_ram_mipmap_view_size()

C++ Interface: get_ram_mipmap_view_size(Texture self, int n)

/**
  • Returns the number of bytes used by the in-memory image per view for mipmap

  • level n, or 0 if there is no in-memory image for this mipmap level.

  • A “view” is a collection of z_size pages for each mipmap level. Most

  • textures have only one view, except for multiview or stereo textures.

  • For a non-compressed texture, this is the same as

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

*/

get_ram_page_size()

C++ Interface: get_ram_page_size(Texture self)

/**
  • 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).

*/

get_ram_view_size()

C++ Interface: get_ram_view_size(Texture self)

/**
  • Returns the number of bytes used by the in-memory image per view, or 0 if

  • there is no in-memory image. Since each view is a stack of z_size pages,

  • this is get_z_size() * get_ram_page_size().

*/

get_render_to_texture()

C++ Interface: get_render_to_texture(Texture self)

/**
  • 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.

*/

get_resident()

C++ Interface: get_resident(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Returns true if this Texture is reported to be resident within graphics

  • memory for the indicated GSG.

*/

get_simple_ram_image()

C++ Interface: get_simple_ram_image(Texture self)

/**
  • 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.

*/

get_simple_ram_image_size()

C++ Interface: get_simple_ram_image_size(Texture self)

/**
  • Returns the number of bytes used by the “simple” image, or 0 if there is no

  • simple image.

*/

get_simple_x_size()

C++ Interface: get_simple_x_size(Texture self)

/**
  • Returns the width of the “simple” image in texels.

*/

get_simple_y_size()

C++ Interface: get_simple_y_size(Texture self)

/**
  • Returns the height of the “simple” image in texels.

*/

get_tex_scale()

C++ Interface: get_tex_scale(Texture self)

/**
  • 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 only if a padding size has been set via set_pad_size()

  • (or implicitly via something like “textures-power-2 pad” in the config.prc

  • file). In this case, this is a convenient way to generate UV’s that

  • reflect the built-in padding size.

*/

get_texture_type()

C++ Interface: get_texture_type(Texture self)

/**
  • Returns the overall interpretation of the texture.

*/

get_textures_power_2()

C++ Interface: get_textures_power_2()

/**
  • This flag returns ATS_none, ATS_up, or ATS_down and controls the scaling of

  • textures in general. It is initialized from the config variable of the

  • same name, but it can be subsequently adjusted. See also

  • get_auto_texture_scale().

*/

get_uncompressed_ram_image()

C++ Interface: get_uncompressed_ram_image(const Texture self)

/**
  • 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.

*/

get_usage_hint()

C++ Interface: get_usage_hint(Texture self)

/**
  • Returns the usage hint specified for buffer textures, or UH_unspecified for

  • all other texture types.

*/

get_view_modified_pages()

C++ Interface: get_view_modified_pages(Texture self, UpdateSeq since, int view, int n)

/**
  • Like get_image_modified_pages, but returns the result for a particular view.

*/

get_wrap_u()

C++ Interface: get_wrap_u(Texture self)

/**
  • Returns the wrap mode of the texture in the U direction.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_wrap_v()

C++ Interface: get_wrap_v(Texture self)

/**
  • Returns the wrap mode of the texture in the V direction.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_wrap_w()

C++ Interface: get_wrap_w(Texture self)

/**
  • Returns the wrap mode of the texture in the W direction. This is the depth

  • direction of 3-d textures.

  • This returns the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

get_x_size()

C++ Interface: get_x_size(Texture self)

/**
  • Returns the width of the texture image in texels.

*/

get_y_size()

C++ Interface: get_y_size(Texture self)

/**
  • Returns the height of the texture image in texels. For a 1-d texture, this

  • will be 1.

*/

get_z_size()

C++ Interface: get_z_size(Texture self)

/**
  • Returns the depth of the texture image in texels. For a 1-d texture or 2-d

  • texture, this will be 1. For a cube map texture, this will be 6.

*/

hasAllRamMipmapImages()

C++ Interface: has_all_ram_mipmap_images(Texture self)

/**
  • Returns true if all expected mipmap levels have been defined and exist in

  • the system RAM, or false if even one mipmap level is missing.

*/

hasAlphaFilename()

C++ Interface: has_alpha_filename(Texture self)

/**
  • Returns true if the alpha_filename has been set and is available. See

  • set_alpha_filename().

*/

hasAlphaFullpath()

C++ Interface: has_alpha_fullpath(Texture self)

/**
  • Returns true if the alpha_fullpath has been set and is available. See

  • set_alpha_fullpath().

*/

hasAutoTextureScale()

C++ Interface: has_auto_texture_scale(Texture self)

/**
  • Returns true if set_auto_texture_scale() has been set to something other

  • than ATS_unspecified for this particular texture.

*/

hasClearColor()

C++ Interface: has_clear_color(Texture self)

/**
  • Returns true if a color was previously set using set_clear_color.

*/

hasCompression()

C++ Interface: has_compression(Texture self)

/**
  • Returns true if the texture indicates it wants to be compressed, either

  • with CM_on or higher, or CM_default and compressed-textures is true.

  • If true returned, this is not a guarantee that the texture is actually

  • successfully compressed on the GSG. It may be that the GSG does not

  • support the requested compression mode, in which case the texture may

  • actually be stored uncompressed in texture memory.

*/

hasFilename()

C++ Interface: has_filename(Texture self)

/**
  • Returns true if the filename has been set and is available. See

  • set_filename().

*/

hasFullpath()

C++ Interface: has_fullpath(Texture self)

/**
  • Returns true if the fullpath has been set and is available. See

  • set_fullpath().

*/

hasRamImage()

C++ Interface: has_ram_image(Texture self)

/**
  • Returns true if the Texture has its image contents available in main RAM,

  • false if it exists only in texture memory or in the prepared GSG context.

  • Note that this has nothing to do with whether get_ram_image() will fail or

  • not. Even if has_ram_image() returns false, get_ram_image() may still

  • return a valid RAM image, because get_ram_image() will automatically load

  • the texture from disk if necessary. The only thing has_ram_image() tells

  • you is whether the texture is available right now without hitting the disk

  • first.

  • Note also that if an application uses only one GSG, it may appear that

  • has_ram_image() returns true if the texture has not yet been loaded by the

  • GSG, but this correlation is not true in general and should not be depended

  • on. Specifically, if an application ever uses multiple GSG’s in its

  • lifetime (for instance, by opening more than one window, or by closing its

  • window and opening another one later), then has_ram_image() may well return

  • false on textures that have never been loaded on the current GSG.

*/

hasRamMipmapImage()

C++ Interface: has_ram_mipmap_image(Texture self, int n)

/**
  • Returns true if the Texture has the nth mipmap level available in system

  • memory, false otherwise. If the texture’s minfilter mode requires

  • mipmapping (see uses_mipmaps()), and all the texture’s mipmap levels are

  • not available when the texture is rendered, they will be generated

  • automatically.

*/

hasSimpleRamImage()

C++ Interface: has_simple_ram_image(Texture self)

/**
  • Returns true if the Texture has a “simple” image available in main RAM.

*/

hasTexturesPower2()

C++ Interface: has_textures_power_2()

/**
  • 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.

*/

hasUncompressedRamImage()

C++ Interface: has_uncompressed_ram_image(Texture self)

/**
  • Returns true if the Texture has its image contents available in main RAM

  • and is uncompressed, false otherwise. See has_ram_image().

*/

has_all_ram_mipmap_images()

C++ Interface: has_all_ram_mipmap_images(Texture self)

/**
  • 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.

*/

has_alpha_filename()

C++ Interface: has_alpha_filename(Texture self)

/**
  • Returns true if the alpha_filename has been set and is available. See

  • set_alpha_filename().

*/

has_alpha_fullpath()

C++ Interface: has_alpha_fullpath(Texture self)

/**
  • Returns true if the alpha_fullpath has been set and is available. See

  • set_alpha_fullpath().

*/

has_auto_texture_scale()

C++ Interface: has_auto_texture_scale(Texture self)

/**
  • Returns true if set_auto_texture_scale() has been set to something other

  • than ATS_unspecified for this particular texture.

*/

has_clear_color()

C++ Interface: has_clear_color(Texture self)

/**
  • Returns true if a color was previously set using set_clear_color.

*/

has_compression()

C++ Interface: has_compression(Texture self)

/**
  • 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.

*/

has_filename()

C++ Interface: has_filename(Texture self)

/**
  • Returns true if the filename has been set and is available. See

  • set_filename().

*/

has_fullpath()

C++ Interface: has_fullpath(Texture self)

/**
  • Returns true if the fullpath has been set and is available. See

  • set_fullpath().

*/

has_ram_image()

C++ Interface: has_ram_image(Texture self)

/**
  • 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.

*/

has_ram_mipmap_image()

C++ Interface: has_ram_mipmap_image(Texture self, int n)

/**
  • 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.

*/

has_simple_ram_image()

C++ Interface: has_simple_ram_image(Texture self)

/**
  • Returns true if the Texture has a “simple” image available in main RAM.

*/

has_textures_power_2()

C++ Interface: has_textures_power_2()

/**
  • 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.

*/

has_uncompressed_ram_image()

C++ Interface: has_uncompressed_ram_image(Texture self)

/**
  • Returns true if the Texture has its image contents available in main RAM

  • and is uncompressed, false otherwise. See has_ram_image().

*/

image_modified
isCacheable()

C++ Interface: is_cacheable(Texture self)

/**
  • Returns true if there is enough information in this Texture object to write

  • it to the bam cache successfully, false otherwise. For most textures, this

  • is the same as has_ram_image().

*/

isPrepared()

C++ Interface: is_prepared(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Returns true if the texture has already been prepared or enqueued for

  • preparation on the indicated GSG, false otherwise.

*/

is_cacheable()

C++ Interface: is_cacheable(Texture self)

/**
  • Returns true if there is enough information in this Texture object to write

  • it to the bam cache successfully, false otherwise. For most textures, this

  • is the same as has_ram_image().

*/

is_prepared()

C++ Interface: is_prepared(Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Returns true if the texture has already been prepared or enqueued for

  • preparation on the indicated GSG, false otherwise.

*/

keep_ram_image
load()

C++ Interface: load(const Texture self, const PNMImage pnmimage) load(const Texture self, const PfmFile pfm) load(const Texture self, const PNMImage pnmimage, const LoaderOptions options) load(const Texture self, const PfmFile pfm, const LoaderOptions options) load(const Texture self, const PNMImage pnmimage, int z, int n, const LoaderOptions options) load(const Texture self, const PfmFile pfm, int z, int n, const LoaderOptions options)

/**
  • Replaces the texture with the indicated image.

*/

/**
  • Stores the indicated image in the given page and mipmap level. See read().

*/

/**
  • Replaces the texture with the indicated image.

*/

/**
  • Stores the indicated image in the given page and mipmap level. See read().

*/

loadRelated()

C++ Interface: load_related(Texture self, const InternalName suffix)

/**
  • 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.

*/

loadSubImage()

C++ Interface: load_sub_image(const Texture self, const PNMImage pnmimage, int x, int y, int z, int n)

/**
  • Stores the indicated image in a region of the texture. The texture

  • properties remain unchanged. This can be more efficient than updating an

  • entire texture, but has a few restrictions: for one, you must ensure that

  • the texture is still in RAM (eg. using set_keep_ram_image) and it may not

  • be compressed.

*/

C++ Interface: load_related(Texture self, const InternalName suffix)

/**
  • 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.

*/

load_sub_image()

C++ Interface: load_sub_image(const Texture self, const PNMImage pnmimage, int x, int y, int z, int n)

/**
  • Stores the indicated image in a region of the texture. The texture

  • properties remain unchanged. This can be more efficient than updating an

  • entire texture, but has a few restrictions: for one, you must ensure that

  • the texture is still in RAM (eg. using set_keep_ram_image) and it may not

  • be compressed.

*/

loaded_from_image
loaded_from_txo
magfilter
makeCopy()

C++ Interface: make_copy(Texture self)

/**
  • 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.

*/

makeFromTxo()

C++ Interface: make_from_txo(istream in, str filename)

/**
  • Constructs a new Texture object from the txo file. This is similar to

  • Texture::read_txo(), but it constructs and returns a new object, which

  • allows it to return a subclass of Texture (for instance, a movie texture).

  • Pass a real filename if it is available, or empty string if it is not.

*/

makeRamImage()

C++ Interface: make_ram_image(const Texture self)

/**
  • Discards the current system-RAM image for the texture, if any, and

  • allocates a new buffer of the appropriate size. Returns the new buffer.

  • This does not affect keep_ram_image.

*/

makeRamMipmapImage()

C++ Interface: make_ram_mipmap_image(const Texture self, int n)

/**
  • 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.

*/

make_copy()

C++ Interface: make_copy(Texture self)

/**
  • 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.

*/

make_from_txo()

C++ Interface: make_from_txo(istream in, str filename)

/**
  • Constructs a new Texture object from the txo file. This is similar to

  • Texture::read_txo(), but it constructs and returns a new object, which

  • allows it to return a subclass of Texture (for instance, a movie texture).

  • Pass a real filename if it is available, or empty string if it is not.

*/

make_ram_image()

C++ Interface: make_ram_image(const Texture self)

/**
  • 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.

*/

make_ram_mipmap_image()

C++ Interface: make_ram_mipmap_image(const Texture self, int n)

/**
  • 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.

*/

match_framebuffer_format
mightHaveRamImage()

C++ Interface: might_have_ram_image(Texture self)

/**
  • 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.

*/

might_have_ram_image()

C++ Interface: might_have_ram_image(Texture self)

/**
  • 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.

*/

minfilter
modifyRamImage()

C++ Interface: modify_ram_image(const Texture self)

/**
  • Returns a modifiable pointer to the system-RAM image. This assumes the RAM

  • image should be uncompressed. If the RAM image has been dumped, or is

  • stored compressed, creates a new one.

  • This does not affect keep_ram_image.

*/

modifyRamMipmapImage()

C++ Interface: modify_ram_mipmap_image(const Texture self, int n)

/**
  • Returns a modifiable pointer to the system-RAM image for the nth mipmap

  • level. This assumes the RAM image is uncompressed; if this is not the

  • case, raises an assertion.

  • This does not affect keep_ram_image.

*/

modifySimpleRamImage()

C++ Interface: modify_simple_ram_image(const Texture self)

/**
  • Returns a modifiable pointer to the internal “simple” texture image. See

  • set_simple_ram_image().

*/

modify_ram_image()

C++ Interface: modify_ram_image(const Texture self)

/**
  • 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.

*/

modify_ram_mipmap_image()

C++ Interface: modify_ram_mipmap_image(const Texture self, int n)

/**
  • 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.

*/

modify_simple_ram_image()

C++ Interface: modify_simple_ram_image(const Texture self)

/**
  • Returns a modifiable pointer to the internal “simple” texture image. See

  • set_simple_ram_image().

*/

newSimpleRamImage()

C++ Interface: new_simple_ram_image(const Texture self, 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. See set_simple_ram_image().

*/

new_simple_ram_image()

C++ Interface: new_simple_ram_image(const Texture self, 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. See set_simple_ram_image().

*/

num_components
num_loadable_ram_mipmap_images
num_pages
num_ram_mipmap_images
num_views
orig_file_x_size
orig_file_y_size
orig_file_z_size
peek()

C++ Interface: peek(const Texture self)

/**
  • 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.

*/

post_load_store_cache
prepare()

C++ Interface: prepare(const Texture self, 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. This will

  • ensure the texture is already loaded into texture memory if it is expected

  • to be rendered soon.

  • Use this function instead of prepare_now() to preload textures from a user

  • interface standpoint.

*/

prepareNow()

C++ Interface: prepare_now(const Texture self, PreparedGraphicsObjects prepared_objects, GraphicsStateGuardianBase gsg) prepare_now(const Texture self, int view, PreparedGraphicsObjects prepared_objects, GraphicsStateGuardianBase gsg)

/**
  • 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.

*/

/**
  • @deprecated See prepare_now() without a view parameter.

*/

prepare_now()

C++ Interface: prepare_now(const Texture self, PreparedGraphicsObjects prepared_objects, GraphicsStateGuardianBase gsg) prepare_now(const Texture self, int view, PreparedGraphicsObjects prepared_objects, GraphicsStateGuardianBase gsg)

/**
  • 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.

*/

/**
  • @deprecated See prepare_now() without a view parameter.

*/

properties_modified
quality_level
ram_image_compression
ram_image_size
ram_page_size
ram_view_size
read()

C++ Interface: read(const Texture self, const Filename fullpath) read(const Texture self, const Filename fullpath, const LoaderOptions options) read(const Texture self, const Filename fullpath, const Filename alpha_fullpath, int primary_file_num_channels, int alpha_file_channel) read(const Texture self, const Filename fullpath, int z, int n, bool read_pages, bool read_mipmaps) read(const Texture self, const Filename fullpath, const Filename alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, const LoaderOptions options) read(const Texture self, const Filename fullpath, int z, int n, bool read_pages, bool read_mipmaps, const LoaderOptions options) read(const Texture self, const Filename fullpath, const Filename alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, int z, int n, bool read_pages, bool read_mipmaps, BamCacheRecord record, const LoaderOptions options)

/**
  • Reads the named filename into the texture.

*/

/**
  • 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.

*/

/**
  • Reads the texture from the indicated filename. If

  • primary_file_num_channels is not 0, it specifies the number of components

  • to downgrade the image to if it is greater than this number.

  • If the filename has the extension .txo, this implicitly reads a texture

  • object instead of a filename (which replaces all of the texture

  • properties). In this case, all the rest of the parameters are ignored, and

  • the filename should not contain any hash marks; just the one named file

  • will be read, since a single .txo file can contain all pages and mipmaps

  • necessary to define a texture.

  • If alpha_fullpath is not empty, it specifies the name of a file from which

  • to retrieve the alpha. In this case, alpha_file_channel represents the

  • numeric channel of this image file to use as the resulting texture’s alpha

  • channel; usually, this is 0 to indicate the grayscale combination of r, g,

  • b; or it may be a one-based channel number, e.g. 1 for the red channel, 2

  • for the green channel, and so on.

  • If read pages is false, then z indicates the page number into which this

  • image will be assigned. Normally this is 0 for the first (or only) page of

  • the texture. 3-D textures have one page for each level of depth, and cube

  • map textures always have six pages.

  • If read_pages is true, multiple images will be read at once, one for each

  • page of a cube map or a 3-D texture. In this case, the filename should

  • contain a sequence of one or more hash marks (“#”) which will be filled in

  • with the z value of each page, zero-based. In this case, the z parameter

  • indicates the maximum z value that will be loaded, or 0 to load all

  • filenames that exist.

  • If read_mipmaps is false, then n indicates the mipmap level to which this

  • image will be assigned. Normally this is 0 for the base texture image, but

  • it is possible to load custom mipmap levels into the later images. After

  • the base texture image is loaded (thus defining the size of the texture),

  • you can call get_expected_num_mipmap_levels() to determine the maximum

  • sensible value for n.

  • If read_mipmaps is true, multiple images will be read as above, but this

  • time the images represent the different mipmap levels of the texture image.

  • In this case, the n parameter indicates the maximum n value that will be

  • loaded, or 0 to load all filenames that exist (up to the expected number of

  • mipmap levels).

  • If both read_pages and read_mipmaps is true, then both sequences will be

  • read; the filename should contain two sequences of hash marks, separated by

  • some character such as a hyphen, underscore, or dot. The first hash mark

  • sequence will be filled in with the mipmap level, while the second hash

  • mark sequence will be the page index.

  • This method implicitly sets keep_ram_image to false.

*/

readDds()

C++ Interface: read_dds(const Texture self, istream in, str filename, bool header_only)

/**
  • 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.

*/

readKtx()

C++ Interface: read_ktx(const Texture self, istream in, str filename, bool header_only)

/**
  • Reads the texture from a KTX file object. This is a Khronos-defined file

  • format; it is similar in principle to a dds 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_dds, the filename is just for reference.

*/

readTxo()

C++ Interface: read_txo(const Texture self, istream in, str filename)

/**
  • Reads the texture from a Panda texture object. This defines the complete

  • Texture specification, including the image data as well as all texture

  • properties. This only works if the txo file contains a static Texture

  • image, as opposed to a subclass of Texture such as a movie texture.

  • Pass a real filename if it is available, or empty string if it is not.

*/

read_dds()

C++ Interface: read_dds(const Texture self, istream in, str filename, bool header_only)

/**
  • 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.

*/

read_ktx()

C++ Interface: read_ktx(const Texture self, istream in, str filename, bool header_only)

/**
  • Reads the texture from a KTX file object. This is a Khronos-defined file

  • format; it is similar in principle to a dds 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_dds, the filename is just for reference.

*/

read_txo()

C++ Interface: read_txo(const Texture self, istream in, str filename)

/**
  • Reads the texture from a Panda texture object. This defines the complete

  • Texture specification, including the image data as well as all texture

  • properties. This only works if the txo file contains a static Texture

  • image, as opposed to a subclass of Texture such as a movie texture.

  • Pass a real filename if it is available, or empty string if it is not.

*/

release()

C++ Interface: release(const Texture self, PreparedGraphicsObjects prepared_objects)

/**
  • Frees the texture context only on the indicated object, if it exists there.

  • Returns true if it was released, false if it had not been prepared.

*/

releaseAll()

C++ Interface: release_all(const Texture self)

/**
  • Frees the context allocated on all objects for which the texture has been

  • declared. Returns the number of contexts which have been freed.

*/

release_all()

C++ Interface: release_all(const Texture self)

/**
  • Frees the context allocated on all objects for which the texture has been

  • declared. Returns the number of contexts which have been freed.

*/

reload()

C++ Interface: reload(const Texture self)

/**
  • Re-reads the Texture from its disk file. Useful when you know the image on

  • disk has recently changed, and you want to update the Texture image.

  • Returns true on success, false on failure (in which case, the Texture may

  • or may not still be valid).

*/

render_to_texture
rescaleTexture()

C++ Interface: rescale_texture(const Texture self)

/**
  • This method is similar to consider_rescale(), but instead of scaling a

  • separate PNMImage, it will ask the Texture to rescale its own internal

  • image to a power of 2, according to the config file requirements. This may

  • be useful after loading a Texture image by hand, instead of reading it from

  • a disk file. Returns true if the texture is changed, false if it was not.

*/

rescale_texture()

C++ Interface: rescale_texture(const Texture self)

/**
  • This method is similar to consider_rescale(), but instead of scaling a

  • separate PNMImage, it will ask the Texture to rescale its own internal

  • image to a power of 2, according to the config file requirements. This may

  • be useful after loading a Texture image by hand, instead of reading it from

  • a disk file. Returns true if the texture is changed, false if it was not.

*/

setAlphaFilename()

C++ Interface: set_alpha_filename(const Texture self, const Filename alpha_filename)

/**
  • 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, the alpha_filename is updated to contain the name of the image file

  • that was loaded into the buffer’s alpha channel.

*/

setAlphaFullpath()

C++ Interface: set_alpha_fullpath(const Texture self, const Filename alpha_fullpath)

/**
  • 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()

C++ Interface: set_anisotropic_degree(const Texture self, int anisotropic_degree)

/**
  • 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.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setAutoTextureScale()

C++ Interface: set_auto_texture_scale(const Texture self, int scale)

/**
  • Specifies the power-of-2 texture-scaling mode that will be applied to this

  • particular texture when it is next loaded from disk. See

  • set_textures_power_2().

*/

setAuxData()

C++ Interface: set_aux_data(const Texture self, str key, TypedReferenceCount aux_data)

/**
  • 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()

C++ Interface: set_border_color(const Texture self, const LVecBase4f color)

/**
  • 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.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setClearColor()

C++ Interface: set_clear_color(const Texture self, const LVecBase4f color)

/**
  • Sets the color that will be used to fill the texture image in absence of

  • any image data. It is used when any of the setup_texture functions or

  • clear_image is called and image data is not provided using read() or

  • modify_ram_image().

  • This does not affect a texture that has already been cleared; call

  • clear_image to clear it again.

*/

setComponentType()

C++ Interface: set_component_type(const Texture self, int component_type)

/**
  • Changes the data value for the texture components. This implicitly sets

  • component_width as well.

*/

setCompression()

C++ Interface: set_compression(const Texture self, int compression)

/**
  • 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.

*/

setDefaultSampler()

C++ Interface: set_default_sampler(const Texture self, const SamplerState sampler)

/**
  • This sets the default sampler state for this texture, containing the wrap

  • and filter properties specified on the texture level; it may still be

  • overridden by a sampler state specified at a higher level. This

  • encompasses the settings for get_wrap_u, get_minfilter,

  • get_anisotropic_degree, etc.

  • This makes a copy of the SamplerState object, so future modifications of

  • the same SamplerState will have no effect on this texture unless you call

  • set_default_sampler again.

*/

setFilename()

C++ Interface: set_filename(const Texture self, const Filename filename)

/**
  • 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()

C++ Interface: set_format(const Texture self, int format)

/**
  • Changes the format value for the texture components. This implicitly sets

  • num_components as well.

*/

setFullpath()

C++ Interface: set_fullpath(const Texture self, const Filename fullpath)

/**
  • 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()

C++ Interface: set_keep_ram_image(const Texture self, 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.

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

C++ Interface: set_loaded_from_image(const Texture self, bool flag)

/**
  • 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()

C++ Interface: set_loaded_from_txo(const Texture self, bool flag)

/**
  • 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()

C++ Interface: set_magfilter(const Texture self, int filter)

/**
  • Sets the filtering method that should be used when viewing the texture up

  • close.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setMatchFramebufferFormat()

C++ Interface: set_match_framebuffer_format(const Texture self, 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).

  • This sets only the graphics card’s idea of the texture format; it is not

  • related to the system-memory format.

*/

setMinfilter()

C++ Interface: set_minfilter(const Texture self, int filter)

/**
  • Sets the filtering method that should be used when viewing the texture from

  • a distance.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setNumViews()

C++ Interface: set_num_views(const Texture self, int num_views)

/**
  • Sets the number of “views” within a texture. A view is a completely

  • separate image stored within the Texture object. Most textures have only

  • one view, but a stereo texture, for instance, may have two views, a left

  • and a right image. Other uses for multiple views are not yet defined.

  • If this value is greater than one, the additional views are accessed as

  • additional pages beyond get_z_size().

  • This also implicitly unloads the texture if it has already been loaded.

*/

setOrigFileSize()

C++ Interface: set_orig_file_size(const Texture self, 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()

C++ Interface: set_pad_size(const Texture self, int x, int y, int z)

/**
  • Sets the size of the pad region.

  • Sometimes, when a video card demands power-of-two textures, it is necessary

  • to create a big texture and then only use a portion of it. The pad region

  • indicates which portion of the texture is not really in use. All

  • operations use the texture as a whole, including the pad region, unless

  • they explicitly state that they use only the non-pad region.

  • Changing the texture’s size clears the pad region.

*/

setPostLoadStoreCache()

C++ Interface: set_post_load_store_cache(const Texture self, bool flag)

/**
  • 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()

C++ Interface: set_quality_level(const Texture self, int quality_level)

/**
  • 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()

C++ Interface: set_ram_image(const Texture self, object image, int compression, int page_size)

/**
  • 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.

*/

setRamImageAs()

C++ Interface: set_ram_image_as(const Texture self, object image, str provided_format)

/**
  • Replaces the current system-RAM image with the new data, converting it

  • first if necessary from the indicated component-order format. See

  • get_ram_image_as() for specifications about the format. This method cannot

  • support compressed image data or sub-pages; use set_ram_image() for that.

*/

setRamMipmapImage()

C++ Interface: set_ram_mipmap_image(const Texture self, int n, ConstPointerToArray image, int page_size)

/**
  • 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.

*/

setRamMipmapPointerFromInt()

C++ Interface: set_ram_mipmap_pointer_from_int(const Texture self, long 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.

  • This variant is particularly useful to set an external pointer from a

  • language like Python, which doesn’t support void pointers directly.

*/

setRenderToTexture()

C++ Interface: set_render_to_texture(const Texture self, 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.

  • This controls some low-level choices made about the texture object itself.

  • For instance, compressed textures are disallowed when this flag is set

  • true.

  • Normally, a user should not need to set this flag directly; it is set

  • automatically by the low-level display code when a texture is bound to a

  • framebuffer.

*/

setSimpleRamImage()

C++ Interface: set_simple_ram_image(const Texture self, ConstPointerToArray image, int x_size, int y_size)

/**
  • 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()

C++ Interface: set_size_padded(const Texture self, int x, int y, int z)

/**
  • Changes the size of the texture, padding if necessary, and setting the pad

  • region as well.

*/

setTexturesPower2()

C++ Interface: set_textures_power_2(int scale)

/**
  • Set this flag to ATS_none, ATS_up, ATS_down, or ATS_pad to control the

  • scaling of textures in general, if a particular texture does not override

  • this. See also set_auto_texture_scale() for the per-texture override.

*/

setWrapU()

C++ Interface: set_wrap_u(const Texture self, int wrap)

/**
  • This setting determines what happens when the texture is sampled with a U

  • value outside the range 0.0-1.0. The default is WM_repeat, which indicates

  • that the texture should repeat indefinitely.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setWrapV()

C++ Interface: set_wrap_v(const Texture self, int wrap)

/**
  • This setting determines what happens when the texture is sampled with a V

  • value outside the range 0.0-1.0. The default is WM_repeat, which indicates

  • that the texture should repeat indefinitely.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setWrapW()

C++ Interface: set_wrap_w(const Texture self, int wrap)

/**
  • The W wrap direction is only used for 3-d textures.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

setXSize()

C++ Interface: set_x_size(const Texture self, int x_size)

/**
  • Changes the x size indicated for the texture. This also implicitly unloads

  • the texture if it has already been loaded.

*/

setYSize()

C++ Interface: set_y_size(const Texture self, int y_size)

/**
  • Changes the y size indicated for the texture. This also implicitly unloads

  • the texture if it has already been loaded.

*/

setZSize()

C++ Interface: set_z_size(const Texture self, int z_size)

/**
  • Changes the z size indicated for the texture. This also implicitly unloads

  • the texture if it has already been loaded.

*/

set_alpha_filename()

C++ Interface: set_alpha_filename(const Texture self, const Filename alpha_filename)

/**
  • 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, the alpha_filename is updated to contain the name of the image file

  • that was loaded into the buffer’s alpha channel.

*/

set_alpha_fullpath()

C++ Interface: set_alpha_fullpath(const Texture self, const Filename alpha_fullpath)

/**
  • 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().

*/

set_anisotropic_degree()

C++ Interface: set_anisotropic_degree(const Texture self, int anisotropic_degree)

/**
  • 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.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_auto_texture_scale()

C++ Interface: set_auto_texture_scale(const Texture self, int scale)

/**
  • Specifies the power-of-2 texture-scaling mode that will be applied to this

  • particular texture when it is next loaded from disk. See

  • set_textures_power_2().

*/

set_aux_data()

C++ Interface: set_aux_data(const Texture self, str key, TypedReferenceCount aux_data)

/**
  • 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.

*/

set_border_color()

C++ Interface: set_border_color(const Texture self, const LVecBase4f color)

/**
  • 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.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_clear_color()

C++ Interface: set_clear_color(const Texture self, const LVecBase4f color)

/**
  • Sets the color that will be used to fill the texture image in absence of

  • any image data. It is used when any of the setup_texture functions or

  • clear_image is called and image data is not provided using read() or

  • modify_ram_image().

  • This does not affect a texture that has already been cleared; call

  • clear_image to clear it again.

*/

set_component_type()

C++ Interface: set_component_type(const Texture self, int component_type)

/**
  • Changes the data value for the texture components. This implicitly sets

  • component_width as well.

*/

set_compression()

C++ Interface: set_compression(const Texture self, int compression)

/**
  • 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.

*/

set_default_sampler()

C++ Interface: set_default_sampler(const Texture self, const SamplerState sampler)

/**
  • This sets the default sampler state for this texture, containing the wrap

  • and filter properties specified on the texture level; it may still be

  • overridden by a sampler state specified at a higher level. This

  • encompasses the settings for get_wrap_u, get_minfilter,

  • get_anisotropic_degree, etc.

  • This makes a copy of the SamplerState object, so future modifications of

  • the same SamplerState will have no effect on this texture unless you call

  • set_default_sampler again.

*/

set_filename()

C++ Interface: set_filename(const Texture self, const Filename filename)

/**
  • 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.

*/

set_format()

C++ Interface: set_format(const Texture self, int format)

/**
  • Changes the format value for the texture components. This implicitly sets

  • num_components as well.

*/

set_fullpath()

C++ Interface: set_fullpath(const Texture self, const Filename fullpath)

/**
  • 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().

*/

set_keep_ram_image()

C++ Interface: set_keep_ram_image(const Texture self, 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.

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

*/

set_loaded_from_image()

C++ Interface: set_loaded_from_image(const Texture self, bool flag)

/**
  • 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.

*/

set_loaded_from_txo()

C++ Interface: set_loaded_from_txo(const Texture self, bool flag)

/**
  • 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.

*/

set_magfilter()

C++ Interface: set_magfilter(const Texture self, int filter)

/**
  • Sets the filtering method that should be used when viewing the texture up

  • close.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_match_framebuffer_format()

C++ Interface: set_match_framebuffer_format(const Texture self, 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).

  • This sets only the graphics card’s idea of the texture format; it is not

  • related to the system-memory format.

*/

set_minfilter()

C++ Interface: set_minfilter(const Texture self, int filter)

/**
  • Sets the filtering method that should be used when viewing the texture from

  • a distance.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_num_views()

C++ Interface: set_num_views(const Texture self, int num_views)

/**
  • Sets the number of “views” within a texture. A view is a completely

  • separate image stored within the Texture object. Most textures have only

  • one view, but a stereo texture, for instance, may have two views, a left

  • and a right image. Other uses for multiple views are not yet defined.

  • If this value is greater than one, the additional views are accessed as

  • additional pages beyond get_z_size().

  • This also implicitly unloads the texture if it has already been loaded.

*/

set_orig_file_size()

C++ Interface: set_orig_file_size(const Texture self, int x, int y, int z)

/**
  • Specifies the size of the texture as it exists in its original disk file,

  • before any Panda scaling.

*/

set_pad_size()

C++ Interface: set_pad_size(const Texture self, int x, int y, int z)

/**
  • 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.

*/

set_post_load_store_cache()

C++ Interface: set_post_load_store_cache(const Texture self, bool flag)

/**
  • 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.

*/

set_quality_level()

C++ Interface: set_quality_level(const Texture self, int quality_level)

/**
  • 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.

*/

set_ram_image()

C++ Interface: set_ram_image(const Texture self, object image, int compression, int page_size)

/**
  • 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.

*/

set_ram_image_as()

C++ Interface: set_ram_image_as(const Texture self, object image, str provided_format)

/**
  • Replaces the current system-RAM image with the new data, converting it

  • first if necessary from the indicated component-order format. See

  • get_ram_image_as() for specifications about the format. This method cannot

  • support compressed image data or sub-pages; use set_ram_image() for that.

*/

set_ram_mipmap_image()

C++ Interface: set_ram_mipmap_image(const Texture self, int n, ConstPointerToArray image, int page_size)

/**
  • 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.

*/

set_ram_mipmap_pointer_from_int()

C++ Interface: set_ram_mipmap_pointer_from_int(const Texture self, long 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.

  • This variant is particularly useful to set an external pointer from a

  • language like Python, which doesn’t support void pointers directly.

*/

set_render_to_texture()

C++ Interface: set_render_to_texture(const Texture self, 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.

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

*/

set_simple_ram_image()

C++ Interface: set_simple_ram_image(const Texture self, ConstPointerToArray image, int x_size, int y_size)

/**
  • 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().

*/

set_size_padded()

C++ Interface: set_size_padded(const Texture self, int x, int y, int z)

/**
  • Changes the size of the texture, padding if necessary, and setting the pad

  • region as well.

*/

set_textures_power_2()

C++ Interface: set_textures_power_2(int scale)

/**
  • Set this flag to ATS_none, ATS_up, ATS_down, or ATS_pad to control the

  • scaling of textures in general, if a particular texture does not override

  • this. See also set_auto_texture_scale() for the per-texture override.

*/

set_wrap_u()

C++ Interface: set_wrap_u(const Texture self, int wrap)

/**
  • This setting determines what happens when the texture is sampled with a U

  • value outside the range 0.0-1.0. The default is WM_repeat, which indicates

  • that the texture should repeat indefinitely.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_wrap_v()

C++ Interface: set_wrap_v(const Texture self, int wrap)

/**
  • This setting determines what happens when the texture is sampled with a V

  • value outside the range 0.0-1.0. The default is WM_repeat, which indicates

  • that the texture should repeat indefinitely.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_wrap_w()

C++ Interface: set_wrap_w(const Texture self, int wrap)

/**
  • The W wrap direction is only used for 3-d textures.

  • This sets the default sampler state for this texture; it may still be

  • overridden by a sampler state specified at a higher level.

*/

set_x_size()

C++ Interface: set_x_size(const Texture self, int x_size)

/**
  • Changes the x size indicated for the texture. This also implicitly unloads

  • the texture if it has already been loaded.

*/

set_y_size()

C++ Interface: set_y_size(const Texture self, int y_size)

/**
  • Changes the y size indicated for the texture. This also implicitly unloads

  • the texture if it has already been loaded.

*/

set_z_size()

C++ Interface: set_z_size(const Texture self, int z_size)

/**
  • Changes the z size indicated for the texture. This also implicitly unloads

  • the texture if it has already been loaded.

*/

setup1dTexture()

C++ Interface: setup_1d_texture(const Texture self) setup_1d_texture(const Texture self, int x_size, int component_type, int format)

/**
  • Sets the texture as an empty 1-d texture with no dimensions. Follow up

  • with read() or load() to fill the texture properties and image data, or use

  • set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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, or use set_clear_color to let the texture be cleared to a

  • solid color.

*/

setup2dTexture()

C++ Interface: setup_2d_texture(const Texture self) setup_2d_texture(const Texture self, int x_size, int y_size, int component_type, int format)

/**
  • Sets the texture as an empty 2-d texture with no dimensions. Follow up

  • with read() or load() to fill the texture properties and image data, or use

  • set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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, or use set_clear_color to let the texture be cleared to a

  • solid color.

*/

setup2dTextureArray()

C++ Interface: setup_2d_texture_array(const Texture self) setup_2d_texture_array(const Texture self, int z_size) setup_2d_texture_array(const Texture self, int x_size, int y_size, int z_size, int component_type, int format)

/**
  • Sets the texture as an empty 2-d texture array with no dimensions (though

  • if you know the depth ahead of time, it saves a bit of reallocation later).

  • Follow up with read() or load() to fill the texture properties and image

  • data, or use set_clear_color to let the texture be cleared to a solid

  • color.

*/

/**
  • Sets the texture as an empty 2-d texture array with the specified

  • dimensions and properties. Follow up with set_ram_image() or

  • modify_ram_image() to fill the image data, or use set_clear_color to let

  • the texture be cleared to a solid color.

*/

setup3dTexture()

C++ Interface: setup_3d_texture(const Texture self) setup_3d_texture(const Texture self, int z_size) setup_3d_texture(const Texture self, int x_size, int y_size, int z_size, int component_type, int format)

/**
  • Sets the texture as an empty 3-d texture with no dimensions (though if you

  • know the depth ahead of time, it saves a bit of reallocation later). Follow

  • up with read() or load() to fill the texture properties and image data, or

  • use set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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.

*/

setupAsyncTransfer()

C++ Interface: setup_async_transfer(const Texture self, int num_buffers)

/**
  • Sets the number of buffers for asynchronous upload of texture data. If this

  • number is higher than 0, future texture uploads will occur in the background,

  • up to the provided amount at a time. The asynchronous upload will be

  • triggered by calls to prepare() or when the texture comes into view and

  • allow-incomplete-render is true.

  • Each buffer is only large enough to contain a single view, so you may wish

  • to create twice as many buffers if you want to update twice as many views.

  • You can also pass the special value -1, which means to create as many

  • buffers as is necessary for all asynchronous uploads to take place, and they

  • will be deleted afterwards automatically.

  • This setting will take effect immediately.

*/

setupBufferTexture()

C++ Interface: setup_buffer_texture(const Texture self, int size, int component_type, int format, int usage)

/**
  • Sets the texture as an empty buffer texture with the specified size and

  • properties. Follow up with set_ram_image() or modify_ram_image() to fill

  • the image data, or use set_clear_color to let the texture be cleared to a

  • solid color.

  • Note that a buffer texture’s format needs to match the component type.

*/

setupCubeMap()

C++ Interface: setup_cube_map(const Texture self) setup_cube_map(const Texture self, int size, int component_type, int format)

/**
  • Sets the texture as an empty cube map texture with no dimensions. Follow

  • up with read() or load() to fill the texture properties and image data, or

  • use set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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, or use set_clear_color to let the texture be cleared

  • to a solid color.

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

*/

setupCubeMapArray()

C++ Interface: setup_cube_map_array(const Texture self, int num_cube_maps) setup_cube_map_array(const Texture self, int size, int num_cube_maps, int component_type, int format)

/**
  • Sets the texture as cube map array with N cube maps. Note that this number

  • is not the same as the z_size. Follow up with read() or load() to fill the

  • texture properties and image data, or use set_clear_color to let the

  • texture be cleared to a solid color.

  • @since 1.10.0

*/

/**
  • Sets the texture as cube map array with N cube maps with the specified

  • dimensions and format. Follow up with set_ram_image() or

  • modify_ram_image() to fill the image data, or use set_clear_color to let

  • the texture be cleared to a solid color.

  • The num_cube_maps given here is multiplied by six to become the z_size of

  • the image.

  • @since 1.10.0

*/

setupTexture()

C++ Interface: setup_texture(const Texture self, int texture_type, int x_size, int y_size, int z_size, int component_type, int 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(), or use set_clear_color to let the texture be cleared to

  • a solid color.

*/

setup_1d_texture()

C++ Interface: setup_1d_texture(const Texture self) setup_1d_texture(const Texture self, int x_size, int component_type, int format)

/**
  • Sets the texture as an empty 1-d texture with no dimensions. Follow up

  • with read() or load() to fill the texture properties and image data, or use

  • set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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, or use set_clear_color to let the texture be cleared to a

  • solid color.

*/

setup_2d_texture()

C++ Interface: setup_2d_texture(const Texture self) setup_2d_texture(const Texture self, int x_size, int y_size, int component_type, int format)

/**
  • Sets the texture as an empty 2-d texture with no dimensions. Follow up

  • with read() or load() to fill the texture properties and image data, or use

  • set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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, or use set_clear_color to let the texture be cleared to a

  • solid color.

*/

setup_2d_texture_array()

C++ Interface: setup_2d_texture_array(const Texture self) setup_2d_texture_array(const Texture self, int z_size) setup_2d_texture_array(const Texture self, int x_size, int y_size, int z_size, int component_type, int format)

/**
  • Sets the texture as an empty 2-d texture array with no dimensions (though

  • if you know the depth ahead of time, it saves a bit of reallocation later).

  • Follow up with read() or load() to fill the texture properties and image

  • data, or use set_clear_color to let the texture be cleared to a solid

  • color.

*/

/**
  • Sets the texture as an empty 2-d texture array with the specified

  • dimensions and properties. Follow up with set_ram_image() or

  • modify_ram_image() to fill the image data, or use set_clear_color to let

  • the texture be cleared to a solid color.

*/

setup_3d_texture()

C++ Interface: setup_3d_texture(const Texture self) setup_3d_texture(const Texture self, int z_size) setup_3d_texture(const Texture self, int x_size, int y_size, int z_size, int component_type, int format)

/**
  • Sets the texture as an empty 3-d texture with no dimensions (though if you

  • know the depth ahead of time, it saves a bit of reallocation later). Follow

  • up with read() or load() to fill the texture properties and image data, or

  • use set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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.

*/

setup_async_transfer()

C++ Interface: setup_async_transfer(const Texture self, int num_buffers)

/**
  • Sets the number of buffers for asynchronous upload of texture data. If this

  • number is higher than 0, future texture uploads will occur in the background,

  • up to the provided amount at a time. The asynchronous upload will be

  • triggered by calls to prepare() or when the texture comes into view and

  • allow-incomplete-render is true.

  • Each buffer is only large enough to contain a single view, so you may wish

  • to create twice as many buffers if you want to update twice as many views.

  • You can also pass the special value -1, which means to create as many

  • buffers as is necessary for all asynchronous uploads to take place, and they

  • will be deleted afterwards automatically.

  • This setting will take effect immediately.

*/

setup_buffer_texture()

C++ Interface: setup_buffer_texture(const Texture self, int size, int component_type, int format, int usage)

/**
  • Sets the texture as an empty buffer texture with the specified size and

  • properties. Follow up with set_ram_image() or modify_ram_image() to fill

  • the image data, or use set_clear_color to let the texture be cleared to a

  • solid color.

  • Note that a buffer texture’s format needs to match the component type.

*/

setup_cube_map()

C++ Interface: setup_cube_map(const Texture self) setup_cube_map(const Texture self, int size, int component_type, int format)

/**
  • Sets the texture as an empty cube map texture with no dimensions. Follow

  • up with read() or load() to fill the texture properties and image data, or

  • use set_clear_color to let the texture be cleared to a solid color.

*/

/**
  • 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, or use set_clear_color to let the texture be cleared

  • to a solid color.

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

*/

setup_cube_map_array()

C++ Interface: setup_cube_map_array(const Texture self, int num_cube_maps) setup_cube_map_array(const Texture self, int size, int num_cube_maps, int component_type, int format)

/**
  • Sets the texture as cube map array with N cube maps. Note that this number

  • is not the same as the z_size. Follow up with read() or load() to fill the

  • texture properties and image data, or use set_clear_color to let the

  • texture be cleared to a solid color.

  • @since 1.10.0

*/

/**
  • Sets the texture as cube map array with N cube maps with the specified

  • dimensions and format. Follow up with set_ram_image() or

  • modify_ram_image() to fill the image data, or use set_clear_color to let

  • the texture be cleared to a solid color.

  • The num_cube_maps given here is multiplied by six to become the z_size of

  • the image.

  • @since 1.10.0

*/

setup_texture()

C++ Interface: setup_texture(const Texture self, int texture_type, int x_size, int y_size, int z_size, int component_type, int 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(), or use set_clear_color to let the texture be cleared to

  • a solid color.

*/

simple_ram_image
simple_x_size
simple_y_size
store()

C++ Interface: store(Texture self, PfmFile pfm) store(Texture self, PNMImage pnmimage) store(Texture self, PNMImage pnmimage, int z, int n) store(Texture self, PfmFile pfm, int z, int n)

/**
  • 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.

*/

/**
  • Saves the texture to the indicated PfmFile, but does not write it to disk.

*/

/**
  • Saves the indicated page and mipmap level of the texture to the PfmFile.

*/

stringComponentType()

C++ Interface: string_component_type(str str)

/**
  • Returns the ComponentType corresponding to the indicated string word.

*/

stringCompressionMode()

C++ Interface: string_compression_mode(str str)

/**
  • Returns the CompressionMode value associated with the given string

  • representation.

*/

stringFormat()

C++ Interface: string_format(str str)

/**
  • Returns the Format corresponding to the indicated string word.

*/

stringQualityLevel()

C++ Interface: string_quality_level(str str)

/**
  • Returns the QualityLevel value associated with the given string

  • representation.

*/

stringTextureType()

C++ Interface: string_texture_type(str str)

/**
  • Returns the TextureType corresponding to the indicated string word.

*/

string_component_type()

C++ Interface: string_component_type(str str)

/**
  • Returns the ComponentType corresponding to the indicated string word.

*/

string_compression_mode()

C++ Interface: string_compression_mode(str str)

/**
  • Returns the CompressionMode value associated with the given string

  • representation.

*/

string_format()

C++ Interface: string_format(str str)

/**
  • Returns the Format corresponding to the indicated string word.

*/

string_quality_level()

C++ Interface: string_quality_level(str str)

/**
  • Returns the QualityLevel value associated with the given string

  • representation.

*/

string_texture_type()

C++ Interface: string_texture_type(str str)

/**
  • Returns the TextureType corresponding to the indicated string word.

*/

texture_type
uncompressRamImage()

C++ Interface: uncompress_ram_image(const Texture self)

/**
  • 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.

*/

uncompress_ram_image()

C++ Interface: uncompress_ram_image(const Texture self)

/**
  • Attempts to uncompress the texture’s RAM image internally. In order for

  • this to work, the squish library must have been compiled into Panda, and

  • the ram image must be compressed in a format supported by squish.

  • Returns true if successful, false otherwise.

*/

upToPower2()

C++ Interface: up_to_power_2(int value)

/**
  • Returns the smallest power of 2 greater than or equal to value.

*/

up_to_power_2()

C++ Interface: up_to_power_2(int value)

/**
  • Returns the smallest power of 2 greater than or equal to value.

*/

upcastToNamable()

C++ Interface: upcast_to_Namable(const Texture self)

upcast from Texture to Namable

upcastToTypedWritableReferenceCount()

C++ Interface: upcast_to_TypedWritableReferenceCount(const Texture self)

upcast from Texture to TypedWritableReferenceCount

upcast_to_Namable()

C++ Interface: upcast_to_Namable(const Texture self)

upcast from Texture to Namable

upcast_to_TypedWritableReferenceCount()

C++ Interface: upcast_to_TypedWritableReferenceCount(const Texture self)

upcast from Texture to TypedWritableReferenceCount

usage_hint
usesMipmaps()

C++ Interface: uses_mipmaps(Texture self)

/**
  • Returns true if the minfilter settings on this texture indicate the use of

  • mipmapping, false otherwise.

*/

uses_mipmaps()

C++ Interface: uses_mipmaps(Texture self)

/**
  • Returns true if the minfilter settings on this texture indicate the use of

  • mipmapping, false otherwise.

*/

wasImageModified()

C++ Interface: was_image_modified(Texture self, 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.

*/

was_image_modified()

C++ Interface: was_image_modified(Texture self, 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.

*/

wrap_u
wrap_v
wrap_w
write()

C++ Interface: write(const Texture self, const Filename fullpath) write(Texture self, ostream out, int indent_level) write(const Texture self, const Filename fullpath, int z, int n, bool write_pages, bool write_mipmaps)

/**
  • Writes the texture to the named filename.

*/

/**
  • 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 there are multiple views, the range of z is increased; the

  • total range is [0, get_num_pages()).

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

*/

/**
  • Not to be confused with write(Filename), this method simply describes the

  • texture properties.

*/

writeTxo()

C++ Interface: write_txo(Texture self, ostream out, str filename)

/**
  • 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.

*/

write_txo()

C++ Interface: write_txo(Texture self, ostream out, str filename)

/**
  • 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.

*/

x_size
y_size
z_size