Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VideoTexture Class Referenceabstract

The base class for a family of animated Textures that take their input from a video source, such as a movie file. More...

#include "videoTexture.h"

Inheritance diagram for VideoTexture:
Texture AnimInterface TypedWritableReferenceCount Namable TypedWritable ReferenceCount MemoryBase TypedObject MemoryBase MemoryBase

Public Member Functions

virtual bool cull_callback (CullTraverser *trav, const CullTraverserData &data) const
 If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time. More...
 
virtual TypeHandle force_init_type ()
 
virtual bool get_keep_ram_image () const
 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. More...
 
virtual TypeHandle get_type () const
 
int get_video_height () const
 
int get_video_width () const
 
virtual bool has_cull_callback () const
 Should be overridden by derived classes to return true if cull_callback() has been defined. More...
 
- Public Member Functions inherited from Texture
 Texture (const std::string &name=std::string())
 Constructs an empty texture. More...
 
bool adjust_this_size (int &x_size, int &y_size, const std::string &name, bool for_padding) const
 Works like adjust_size, but also considers the texture class. More...
 
void clear ()
 
void clear_alpha_filename ()
 
void clear_alpha_fullpath ()
 
void clear_aux_data (const std::string &key)
 
void clear_clear_color ()
 
void clear_filename ()
 
void clear_fullpath ()
 
void clear_image ()
 Clears the texture data without changing its format or resolution. More...
 
void clear_ram_image ()
 Discards the current system-RAM image. More...
 
void clear_ram_mipmap_image (int n)
 Discards the current system-RAM image for the nth mipmap level. More...
 
void clear_ram_mipmap_images ()
 Discards the current system-RAM image for all mipmap levels, except level 0 (the base image). More...
 
void clear_simple_ram_image ()
 Discards the current "simple" image. More...
 
bool compress_ram_image (CompressionMode compression=CM_on, QualityLevel quality_level=QL_default, GraphicsStateGuardianBase *gsg=nullptr)
 Attempts to compress the texture's RAM image internally, to a format supported by the indicated GSG. More...
 
void consider_rescale (PNMImage &pnmimage)
 Asks the PNMImage to change its scale when it reads the image, according to the whims of the Config.prc file. More...
 
virtual void ensure_loader_type (const Filename &filename)
 May be called prior to calling read_txo() or any bam-related Texture- creating callback, to ensure that the proper dynamic libraries for a Texture of the current class type, and the indicated filename, have been already loaded. More...
 
size_t estimate_texture_memory () const
 Estimates the amount of texture memory that will be consumed by loading this texture. More...
 
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More...
 
void generate_alpha_scale_map ()
 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. More...
 
void generate_normalization_cube_map (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). More...
 
void generate_ram_mipmap_images ()
 Automatically fills in the n mipmap levels of the Texture, based on the texture's source image. More...
 
void generate_simple_ram_image ()
 Computes the "simple" ram image by loading the main RAM image, if it is not already available, and reducing it to 16x16 or smaller. More...
 
bool get_active (PreparedGraphicsObjects *prepared_objects) const
 Returns true if this Texture was rendered in the most recent frame within the indicated GSG. More...
 
const Filenameget_alpha_filename () const
 
const Filenameget_alpha_fullpath () const
 
int get_anisotropic_degree () const
 
AutoTextureScale get_auto_texture_scale () const
 
TypedReferenceCountget_aux_data (const std::string &key) const
 
LColor get_border_color () const
 
LColor get_clear_color () const
 
vector_uchar get_clear_data () const
 Returns the raw image data for a single pixel if it were set to the clear color. More...
 
ComponentType get_component_type () const
 
int get_component_width () const
 
CompressionMode get_compression () const
 
size_t get_data_size_bytes (PreparedGraphicsObjects *prepared_objects) const
 Returns the number of bytes which the texture is reported to consume within graphics memory, for the indicated GSG. More...
 
const SamplerStateget_default_sampler () const
 
int get_effective_anisotropic_degree () const
 
SamplerState::FilterType get_effective_magfilter () const
 
SamplerState::FilterType get_effective_minfilter () const
 
QualityLevel get_effective_quality_level () const
 
int get_expected_mipmap_num_pages (int n) const
 Returns the total number of pages that the nth mipmap level should have, based on the texture's size. More...
 
int get_expected_mipmap_x_size (int n) const
 Returns the x_size that the nth mipmap level should have, based on the texture's size. More...
 
int get_expected_mipmap_y_size (int n) const
 Returns the y_size that the nth mipmap level should have, based on the texture's size. More...
 
int get_expected_mipmap_z_size (int n) const
 Returns the z_size that the nth mipmap level should have, based on the texture's size. More...
 
int get_expected_num_mipmap_levels () const
 
size_t get_expected_ram_image_size () const
 
size_t get_expected_ram_mipmap_image_size (int n) const
 Returns the number of bytes that *ought* to be used by the in-memory image for mipmap level n, based on the texture parameters. More...
 
size_t get_expected_ram_mipmap_page_size (int n) const
 Returns the number of bytes that should be used per each Z page of the 3-d texture, for mipmap level n. More...
 
size_t get_expected_ram_mipmap_view_size (int n) const
 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. More...
 
size_t get_expected_ram_page_size () const
 
const Filenameget_filename () const
 
Format get_format () const
 
const Filenameget_fullpath () const
 
UpdateSeq get_image_modified () const
 
bool get_loaded_from_image () const
 
bool get_loaded_from_txo () const
 
SamplerState::FilterType get_magfilter () const
 
bool get_match_framebuffer_format () const
 
SamplerState::FilterType get_minfilter () const
 
int get_num_components () const
 
int get_num_loadable_ram_mipmap_images () const
 
int get_num_pages () const
 
int get_num_ram_mipmap_images () const
 
int get_num_views () const
 
int get_orig_file_x_size () const
 
int get_orig_file_y_size () const
 
int get_orig_file_z_size () const
 
int get_pad_x_size () const
 Returns size of the pad region. More...
 
int get_pad_y_size () const
 Returns size of the pad region. More...
 
int get_pad_z_size () const
 Returns size of the pad region. More...
 
bool get_post_load_store_cache () const
 
UpdateSeq get_properties_modified () const
 
QualityLevel get_quality_level () const
 
CPTA_uchar get_ram_image ()
 Returns the system-RAM image data associated with the texture. More...
 
CPTA_uchar get_ram_image_as (const std::string &requested_format)
 Returns the uncompressed system-RAM image data associated with the texture. More...
 
CompressionMode get_ram_image_compression () const
 
size_t get_ram_image_size () const
 
CPTA_uchar get_ram_mipmap_image (int n) const
 Returns the system-RAM image data associated with the nth mipmap level, if present. More...
 
size_t get_ram_mipmap_image_size (int n) const
 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. More...
 
size_t get_ram_mipmap_page_size (int n) const
 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. More...
 
void * get_ram_mipmap_pointer (int n) const
 Similiar to get_ram_mipmap_image(), however, in this case the void pointer for the given ram image is returned. More...
 
size_t get_ram_mipmap_view_size (int n) const
 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. More...
 
size_t get_ram_page_size () const
 
size_t get_ram_view_size () const
 
bool get_render_to_texture () const
 
bool get_resident (PreparedGraphicsObjects *prepared_objects) const
 Returns true if this Texture is reported to be resident within graphics memory for the indicated GSG. More...
 
UpdateSeq get_simple_image_modified () const
 
CPTA_uchar get_simple_ram_image () const
 
size_t get_simple_ram_image_size () const
 Returns the number of bytes used by the "simple" image, or 0 if there is no simple image. More...
 
int get_simple_x_size () const
 
int get_simple_y_size () const
 
LVecBase2 get_tex_scale () const
 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. More...
 
TextureType get_texture_type () const
 
CPTA_uchar get_uncompressed_ram_image ()
 Returns the system-RAM image associated with the texture, in an uncompressed form if at all possible. More...
 
GeomEnums::UsageHint get_usage_hint () const
 
SamplerState::WrapMode get_wrap_u () const
 
SamplerState::WrapMode get_wrap_v () const
 
SamplerState::WrapMode get_wrap_w () const
 
int get_x_size () const
 
int get_y_size () const
 
int get_z_size () const
 
bool has_all_ram_mipmap_images () const
 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. More...
 
bool has_alpha_filename () const
 
bool has_alpha_fullpath () const
 
bool has_auto_texture_scale () const
 Returns true if set_auto_texture_scale() has been set to something other than ATS_unspecified for this particular texture. More...
 
bool has_clear_color () const
 
bool has_compression () const
 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. More...
 
bool has_filename () const
 
bool has_fullpath () const
 
bool has_ram_image () const
 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. More...
 
bool has_ram_mipmap_image (int n) const
 Returns true if the Texture has the nth mipmap level available in system memory, false otherwise. More...
 
bool has_simple_ram_image () const
 
bool has_uncompressed_ram_image () const
 Returns true if the Texture has its image contents available in main RAM and is uncompressed, false otherwise. More...
 
virtual bool is_cacheable () const
 
bool is_prepared (PreparedGraphicsObjects *prepared_objects) const
 Returns true if the texture has already been prepared or enqueued for preparation on the indicated GSG, false otherwise. More...
 
bool load (const PNMImage &pnmimage, const LoaderOptions &options=LoaderOptions())
 Replaces the texture with the indicated image. More...
 
bool load (const PNMImage &pnmimage, int z, int n, const LoaderOptions &options=LoaderOptions())
 Stores the indicated image in the given page and mipmap level. More...
 
bool load (const PfmFile &pfm, const LoaderOptions &options=LoaderOptions())
 Replaces the texture with the indicated image. More...
 
bool load (const PfmFile &pfm, int z, int n, const LoaderOptions &options=LoaderOptions())
 Stores the indicated image in the given page and mipmap level. More...
 
Textureload_related (const InternalName *suffix) const
 Loads a texture whose filename is derived by concatenating a suffix to the filename of this texture. More...
 
bool load_sub_image (const PNMImage &pnmimage, int x, int y, int z=0, int n=0)
 Stores the indicated image in a region of the texture. More...
 
PTA_uchar make_ram_image ()
 Discards the current system-RAM image for the texture, if any, and allocates a new buffer of the appropriate size. More...
 
PTA_uchar make_ram_mipmap_image (int n)
 Discards the current system-RAM image for the nth mipmap level, if any, and allocates a new buffer of the appropriate size. More...
 
bool might_have_ram_image () const
 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. More...
 
PTA_uchar modify_ram_image ()
 Returns a modifiable pointer to the system-RAM image. More...
 
PTA_uchar modify_ram_mipmap_image (int n)
 Returns a modifiable pointer to the system-RAM image for the nth mipmap level. More...
 
PTA_uchar modify_simple_ram_image ()
 Returns a modifiable pointer to the internal "simple" texture image. More...
 
PTA_uchar new_simple_ram_image (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. More...
 
TextureContextprepare_now (int view, PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg)
 Creates a context for the texture on the particular GSG, if it does not already exist. More...
 
typedef PT (Texture) MakeTextureFunc()
 
 PT (Texture) make_copy() const
 
 PT (TexturePeeker) peek()
 
 PT (AsyncFuture) prepare(PreparedGraphicsObjects *prepared_objects)
 
bool read (const Filename &fullpath, const LoaderOptions &options=LoaderOptions())
 Reads the named filename into the texture. More...
 
bool read (const Filename &fullpath, const Filename &alpha_fullpath, int primary_file_num_channels, int alpha_file_channel, const LoaderOptions &options=LoaderOptions())
 Combine a 3-component image with a grayscale image to get a 4-component image. More...
 
bool read (const Filename &fullpath, int z, int n, bool read_pages, bool read_mipmaps, const LoaderOptions &options=LoaderOptions())
 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. More...
 
bool read (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=nullptr, const LoaderOptions &options=LoaderOptions())
 Reads the texture from the indicated filename. More...
 
bool read_dds (std::istream &in, const std::string &filename="", bool header_only=false)
 Reads the texture from a DDS file object. More...
 
bool read_ktx (std::istream &in, const std::string &filename="", bool header_only=false)
 Reads the texture from a KTX file object. More...
 
bool read_txo (std::istream &in, const std::string &filename="")
 Reads the texture from a Panda texture object. More...
 
bool release (PreparedGraphicsObjects *prepared_objects)
 Frees the texture context only on the indicated object, if it exists there. More...
 
int release_all ()
 Frees the context allocated on all objects for which the texture has been declared. More...
 
bool reload ()
 Re-reads the Texture from its disk file. More...
 
bool rescale_texture ()
 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. More...
 
void set_alpha_filename (const Filename &alpha_filename)
 
void set_alpha_fullpath (const Filename &alpha_fullpath)
 
void set_anisotropic_degree (int anisotropic_degree)
 
void set_auto_texture_scale (AutoTextureScale scale)
 
void set_aux_data (const std::string &key, TypedReferenceCount *aux_data)
 
void set_border_color (const LColor &color)
 
void set_clear_color (const LColor &color)
 
void set_component_type (ComponentType component_type)
 
void set_compression (CompressionMode compression)
 
void set_default_sampler (const SamplerState &sampler)
 
void set_filename (const Filename &filename)
 
void set_format (Format format)
 
void set_fullpath (const Filename &fullpath)
 
void set_keep_ram_image (bool keep_ram_image)
 
void set_loaded_from_image (bool flag=true)
 
void set_loaded_from_txo (bool flag=true)
 
void set_magfilter (FilterType filter)
 
void set_match_framebuffer_format (bool flag)
 
void set_minfilter (FilterType filter)
 
void set_num_views (int num_views)
 
void set_orig_file_size (int x, int y, int z=1)
 Specifies the size of the texture as it exists in its original disk file, before any Panda scaling. More...
 
void set_pad_size (int x=0, int y=0, int z=0)
 Sets the size of the pad region. More...
 
void set_post_load_store_cache (bool flag)
 
void set_quality_level (QualityLevel quality_level)
 
void set_ram_image (CPTA_uchar image, CompressionMode compression=CM_off, size_t page_size=0)
 Replaces the current system-RAM image with the new data. More...
 
void set_ram_image_as (CPTA_uchar image, const std::string &provided_format)
 Replaces the current system-RAM image with the new data, converting it first if necessary from the indicated component-order format. More...
 
void set_ram_mipmap_image (int n, CPTA_uchar image, size_t page_size=0)
 Replaces the current system-RAM image for the indicated mipmap level with the new data. More...
 
void set_ram_mipmap_pointer (int n, void *image, size_t page_size=0)
 Sets an explicit void pointer as the texture's mipmap image for the indicated level. More...
 
void set_ram_mipmap_pointer_from_int (long 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. More...
 
void set_render_to_texture (bool render_to_texture)
 
void set_simple_ram_image (CPTA_uchar image, int x_size, int y_size)
 Replaces the internal "simple" texture image. More...
 
void set_size_padded (int x=1, int y=1, int z=1)
 Changes the size of the texture, padding if necessary, and setting the pad region as well. More...
 
void set_wrap_u (WrapMode wrap)
 
void set_wrap_v (WrapMode wrap)
 
void set_wrap_w (WrapMode wrap)
 
void set_x_size (int x_size)
 
void set_y_size (int y_size)
 
void set_z_size (int z_size)
 
void setup_1d_texture ()
 Sets the texture as an empty 1-d texture with no dimensions. More...
 
void setup_1d_texture (int x_size, ComponentType component_type, Format format)
 Sets the texture as an empty 1-d texture with the specified dimensions and properties. More...
 
void setup_2d_texture ()
 Sets the texture as an empty 2-d texture with no dimensions. More...
 
void setup_2d_texture (int x_size, int y_size, ComponentType component_type, Format format)
 Sets the texture as an empty 2-d texture with the specified dimensions and properties. More...
 
void setup_2d_texture_array (int z_size=1)
 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). More...
 
void setup_2d_texture_array (int x_size, int y_size, int z_size, ComponentType component_type, Format format)
 Sets the texture as an empty 2-d texture array with the specified dimensions and properties. More...
 
void setup_3d_texture (int z_size=1)
 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). More...
 
void setup_3d_texture (int x_size, int y_size, int z_size, ComponentType component_type, Format format)
 Sets the texture as an empty 3-d texture with the specified dimensions and properties. More...
 
void setup_buffer_texture (int size, ComponentType component_type, Format format, GeomEnums::UsageHint usage)
 Sets the texture as an empty buffer texture with the specified size and properties. More...
 
void setup_cube_map ()
 Sets the texture as an empty cube map texture with no dimensions. More...
 
void setup_cube_map (int size, ComponentType component_type, Format format)
 Sets the texture as an empty cube map texture with the specified dimensions and properties. More...
 
void setup_cube_map_array (int num_cube_maps)
 Sets the texture as cube map array with N cube maps. More...
 
void setup_cube_map_array (int size, int num_cube_maps, ComponentType component_type, Format format)
 Sets the texture as cube map array with N cube maps with the specified dimensions and format. More...
 
void setup_texture (TextureType texture_type, int x_size, int y_size, int z_size, ComponentType component_type, Format format)
 Sets the texture to the indicated type and dimensions, presumably in preparation for calling read() or load(), or set_ram_image() or modify_ram_image(), or use set_clear_color to let the texture be cleared to a solid color. More...
 
bool store (PNMImage &pnmimage) const
 Saves the texture to the indicated PNMImage, but does not write it to disk. More...
 
bool store (PNMImage &pnmimage, int z, int n) const
 Saves the indicated page and mipmap level of the texture to the PNMImage. More...
 
bool store (PfmFile &pfm) const
 Saves the texture to the indicated PfmFile, but does not write it to disk. More...
 
bool store (PfmFile &pfm, int z, int n) const
 Saves the indicated page and mipmap level of the texture to the PfmFile. More...
 
void texture_uploaded ()
 This method is called by the GraphicsEngine at the beginning of the frame *after* a texture has been successfully uploaded to graphics memory. More...
 
bool uncompress_ram_image ()
 Attempts to uncompress the texture's RAM image internally. More...
 
bool uses_mipmaps () const
 Returns true if the minfilter settings on this texture indicate the use of mipmapping, false otherwise. More...
 
bool was_image_modified (PreparedGraphicsObjects *prepared_objects) const
 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. More...
 
bool write (const Filename &fullpath)
 Writes the texture to the named filename. More...
 
bool write (const Filename &fullpath, int z, int n, bool write_pages, bool write_mipmaps)
 Writes a single page or mipmap level to a single file, or automatically writes a series of pages and/or mipmap levels to a numbered series of files. More...
 
void write (std::ostream &out, int indent_level) const
 Not to be confused with write(Filename), this method simply describes the texture properties. More...
 
virtual void write_datagram (BamWriter *manager, Datagram &me)
 Function to write the important information in the particular object to a Datagram. More...
 
- Public Member Functions inherited from TypedWritableReferenceCount
 TypedWritableReferenceCount (const TypedWritableReferenceCount &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
void operator= (const TypedWritableReferenceCount &copy)
 
- Public Member Functions inherited from TypedWritable
 TypedWritable (const TypedWritable &copy)
 
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). More...
 
vector_uchar encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More...
 
bool encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
virtual void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
void operator= (const TypedWritable &copy)
 
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More...
 
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 
- Public Member Functions inherited from Namable
 Namable (const std::string &initial_name="")
 
void clear_name ()
 Resets the Namable's name to empty. More...
 
const std::string & get_name () const
 
bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty. More...
 
void output (std::ostream &out) const
 Outputs the Namable. More...
 
void set_name (const std::string &name)
 
- Public Member Functions inherited from AnimInterface
double get_frac () const
 
int get_frame () const
 
double get_frame_rate () const
 
double get_full_fframe () const
 
int get_full_frame () const
 
int get_next_frame () const
 
virtual int get_num_frames () const
 
double get_play_rate () const
 
bool is_playing () const
 
void loop (bool restart)
 Starts the entire animation looping. More...
 
void loop (bool restart, double from, double to)
 Loops the animation from the frame "from" to and including the frame "to", indefinitely. More...
 
virtual void output (std::ostream &out) const
 
void pingpong (bool restart)
 Starts the entire animation bouncing back and forth between its first frame and last frame. More...
 
void pingpong (bool restart, double from, double to)
 Loops the animation from the frame "from" to and including the frame "to", and then back in the opposite direction, indefinitely. More...
 
void play ()
 Runs the entire animation from beginning to end and stops. More...
 
void play (double from, double to)
 Runs the animation from the frame "from" to and including the frame "to", at which point the animation is stopped. More...
 
void pose (double frame)
 Sets the animation to the indicated frame and holds it there. More...
 
void set_play_rate (double play_rate)
 
void stop ()
 Stops a currently playing or looping animation right where it is. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from Texture
static bool adjust_size (int &x_size, int &y_size, const std::string &name, bool for_padding, AutoTextureScale auto_texture_scale=ATS_unspecified)
 Computes the proper size of the texture, based on the original size, the filename, and the resizing whims of the config file. More...
 
static void consider_rescale (PNMImage &pnmimage, const std::string &name, AutoTextureScale auto_texture_scale=ATS_unspecified)
 Asks the PNMImage to change its scale when it reads the image, according to the whims of the Config.prc file. More...
 
static int down_to_power_2 (int value)
 Returns the largest power of 2 less than or equal to value. More...
 
static std::string format_component_type (ComponentType ct)
 Returns the indicated ComponentType converted to a string word. More...
 
static std::string format_compression_mode (CompressionMode cm)
 Returns the indicated CompressionMode converted to a string word. More...
 
static std::string format_format (Format f)
 Returns the indicated Format converted to a string word. More...
 
static std::string format_quality_level (QualityLevel tql)
 Returns the indicated QualityLevel converted to a string word. More...
 
static std::string format_texture_type (TextureType tt)
 Returns the indicated TextureType converted to a string word. More...
 
static TypeHandle get_class_type ()
 
static AutoTextureScale get_textures_power_2 ()
 This flag returns ATS_none, ATS_up, or ATS_down and controls the scaling of textures in general. More...
 
static bool has_alpha (Format format)
 Returns true if the indicated format includes alpha, false otherwise. More...
 
static bool has_binary_alpha (Format format)
 Returns true if the indicated format includes a binary alpha only, false otherwise. More...
 
static bool has_textures_power_2 ()
 If true, then get_textures_power_2 has been set using set_textures_power_2. More...
 
static void init_type ()
 
static bool is_specific (CompressionMode compression)
 Returns true if the indicated compression mode is one of the specific compression types, false otherwise. More...
 
static bool is_srgb (Format format)
 Returns true if the indicated format is in the sRGB color space, false otherwise. More...
 
static bool is_unsigned (ComponentType ctype)
 Returns true if the indicated component type is unsigned, false otherwise. More...
 
static PT (Texture) make_texture()
 
static void register_with_read_factory ()
 Factory method to generate a Texture object. More...
 
static void set_textures_power_2 (AutoTextureScale 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. More...
 
static ComponentType string_component_type (const std::string &str)
 Returns the ComponentType corresponding to the indicated string word. More...
 
static CompressionMode string_compression_mode (const std::string &str)
 Returns the CompressionMode value associated with the given string representation. More...
 
static Format string_format (const std::string &str)
 Returns the Format corresponding to the indicated string word. More...
 
static QualityLevel string_quality_level (const std::string &str)
 Returns the QualityLevel value associated with the given string representation. More...
 
static TextureType string_texture_type (const std::string &str)
 Returns the TextureType corresponding to the indicated string word. More...
 
static int up_to_power_2 (int value)
 Returns the smallest power of 2 greater than or equal to value. More...
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
static PT (TypedWritableReferenceCount) decode_from_bam_stream(vector_uchar data
 
- Static Public Member Functions inherited from TypedWritable
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, vector_uchar data, BamReader *reader=nullptr)
 Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from Namable
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from AnimInterface
static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

 get_video_height
 Returns the height in texels of the source video stream. More...
 
 get_video_width
 Returns the width in texels of the source video stream. More...
 
- Public Attributes inherited from Texture
 clear_alpha_filename
 Removes the alpha filename, if it was previously set. More...
 
 clear_alpha_fullpath
 Removes the alpha fullpath, if it was previously set. More...
 
 clear_aux_data
 Removes a record previously recorded via set_aux_data(). More...
 
 clear_clear_color
 The opposite of set_clear_color. More...
 
 clear_filename
 Removes the alpha filename, if it was previously set. More...
 
 clear_fullpath
 Removes the alpha fullpath, if it was previously set. More...
 
 get_alpha_filename
 Returns the alpha_filename that has been set. More...
 
 get_alpha_fullpath
 Returns the alpha_fullpath that has been set. More...
 
 get_anisotropic_degree
 Returns the degree of anisotropic filtering that should be applied to the texture. More...
 
 get_auto_texture_scale
 Returns the power-of-2 texture-scaling mode that will be applied to this particular texture when it is next loaded from disk. More...
 
 get_aux_data
 Returns a record previously recorded via set_aux_data(). More...
 
 get_border_color
 Returns the solid color of the texture's border. More...
 
 get_clear_color
 Returns the color that was previously set using set_clear_color. More...
 
 get_component_type
 Returns the numeric interpretation of each component of the texture. More...
 
 get_component_width
 Returns the number of bytes stored for each color component of a texel. More...
 
 get_compression
 Returns the compression mode requested for this particular texture, or CM_off if the texture is not to be compressed. More...
 
 get_default_sampler
 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. More...
 
 get_effective_anisotropic_degree
 Returns the degree of anisotropic filtering that should be applied to the texture. More...
 
 get_effective_magfilter
 Returns the filter mode of the texture for magnification, with special treatment for FT_default. More...
 
 get_effective_minfilter
 Returns the filter mode of the texture for minification, with special treatment for FT_default. More...
 
 get_effective_quality_level
 Returns the current quality_level hint, or the global default quality_level if this texture doesn't specify a quality level. More...
 
 get_expected_num_mipmap_levels
 Returns the number of mipmap levels that should be defined for this texture, given the texture's size. More...
 
 get_expected_ram_image_size
 Returns the number of bytes that *ought* to be used by the in-memory image, based on the texture parameters. More...
 
 get_expected_ram_page_size
 Returns the number of bytes that should be used per each Z page of the 3-d texture. More...
 
 get_filename
 Returns the filename that has been set. More...
 
 get_format
 Returns the format of the texture, which represents both the semantic meaning of the texels and, to some extent, their storage information. More...
 
 get_fullpath
 Returns the fullpath that has been set. More...
 
 get_image_modified
 Returns a sequence number which is guaranteed to change at least every time the texture image data (including mipmap levels) are modified. More...
 
 get_keep_ram_image
 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. More...
 
 get_loaded_from_image
 Returns the flag that indicates the texture has been loaded from a disk file or PNMImage. More...
 
 get_loaded_from_txo
 Returns the flag that indicates the texture has been loaded from a txo file. More...
 
 get_magfilter
 Returns the filter mode of the texture for magnification. More...
 
 get_match_framebuffer_format
 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). More...
 
 get_minfilter
 Returns the filter mode of the texture for minification. More...
 
 get_num_components
 Returns the number of color components for each texel of the texture image. More...
 
 get_num_loadable_ram_mipmap_images
 Returns the number of contiguous mipmap levels that exist in RAM, up until the first gap in the sequence. More...
 
 get_num_pages
 Returns the total number of pages in the texture. More...
 
 get_num_ram_mipmap_images
 Returns the maximum number of mipmap level images available in system memory. More...
 
 get_num_views
 Returns the number of "views" in the texture. More...
 
 get_orig_file_x_size
 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. More...
 
 get_orig_file_y_size
 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. More...
 
 get_orig_file_z_size
 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. More...
 
 get_post_load_store_cache
 Returns the setting of the post_load_store_cache flag. More...
 
 get_properties_modified
 Returns a sequence number which is guaranteed to change at least every time the texture properties (unrelated to the image) are modified. More...
 
 get_quality_level
 Returns the current quality_level hint. More...
 
 get_ram_image_compression
 Returns the compression mode in which the ram image is already stored pre- compressed. More...
 
 get_ram_image_size
 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. More...
 
 get_ram_page_size
 Returns the number of bytes used by the in-memory image per page, or 0 if there is no in-memory image. More...
 
 get_ram_view_size
 Returns the number of bytes used by the in-memory image per view, or 0 if there is no in-memory image. More...
 
 get_render_to_texture
 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. More...
 
 get_simple_image_modified
 Returns a sequence number which is guaranteed to change at least every time the texture's "simple" image data is modified. More...
 
 get_simple_ram_image
 Returns the image data associated with the "simple" texture image. More...
 
 get_simple_x_size
 Returns the width of the "simple" image in texels. More...
 
 get_simple_y_size
 Returns the height of the "simple" image in texels. More...
 
 get_texture_type
 Returns the overall interpretation of the texture. More...
 
 get_usage_hint
 Returns the usage hint specified for buffer textures, or UH_unspecified for all other texture types. More...
 
 get_wrap_u
 Returns the wrap mode of the texture in the U direction. More...
 
 get_wrap_v
 Returns the wrap mode of the texture in the V direction. More...
 
 get_wrap_w
 Returns the wrap mode of the texture in the W direction. More...
 
 get_x_size
 Returns the width of the texture image in texels. More...
 
 get_y_size
 Returns the height of the texture image in texels. More...
 
 get_z_size
 Returns the depth of the texture image in texels. More...
 
 has_alpha_filename
 Returns true if the alpha_filename has been set and is available. More...
 
 has_alpha_fullpath
 Returns true if the alpha_fullpath has been set and is available. More...
 
 has_clear_color
 Returns true if a color was previously set using set_clear_color. More...
 
 has_filename
 Returns true if the filename has been set and is available. More...
 
 has_fullpath
 Returns true if the fullpath has been set and is available. More...
 
 has_simple_ram_image
 Returns true if the Texture has a "simple" image available in main RAM. More...
 
 is_cacheable
 Returns true if there is enough information in this Texture object to write it to the bam cache successfully, false otherwise. More...
 
 set_alpha_filename
 Sets the name of the file that contains the image's alpha channel contents. More...
 
 set_alpha_fullpath
 Sets the full pathname to the file that contains the image's alpha channel contents, as found along the search path. More...
 
 set_anisotropic_degree
 Specifies the level of anisotropic filtering to apply to the texture. More...
 
 set_auto_texture_scale
 Specifies the power-of-2 texture-scaling mode that will be applied to this particular texture when it is next loaded from disk. More...
 
 set_aux_data
 Records an arbitrary object in the Texture, associated with a specified key. More...
 
 set_border_color
 Specifies the solid color of the texture's border. More...
 
 set_clear_color
 Sets the color that will be used to fill the texture image in absence of any image data. More...
 
 set_component_type
 Changes the data value for the texture components. More...
 
 set_compression
 Requests that this particular Texture be compressed when it is loaded into texture memory. More...
 
 set_default_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. More...
 
 set_filename
 Sets the name of the file that contains the image's contents. More...
 
 set_format
 Changes the format value for the texture components. More...
 
 set_fullpath
 Sets the full pathname to the file that contains the image's contents, as found along the search path. More...
 
 set_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. More...
 
 set_loaded_from_image
 Sets the flag that indicates the texture has been loaded from a disk file or PNMImage. More...
 
 set_loaded_from_txo
 Sets the flag that indicates the texture has been loaded from a txo file. More...
 
 set_magfilter
 Sets the filtering method that should be used when viewing the texture up close. More...
 
 set_match_framebuffer_format
 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). More...
 
 set_minfilter
 Sets the filtering method that should be used when viewing the texture from a distance. More...
 
 set_num_views
 Sets the number of "views" within a texture. More...
 
 set_post_load_store_cache
 Sets the post_load_store_cache flag. More...
 
 set_quality_level
 Sets a hint to the renderer about the desired performance / quality tradeoff for this particular texture. More...
 
 set_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. More...
 
 set_wrap_u
 This setting determines what happens when the texture is sampled with a U value outside the range 0.0-1.0. More...
 
 set_wrap_v
 This setting determines what happens when the texture is sampled with a V value outside the range 0.0-1.0. More...
 
 set_wrap_w
 The W wrap direction is only used for 3-d textures. More...
 
 set_x_size
 Changes the x size indicated for the texture. More...
 
 set_y_size
 Changes the y size indicated for the texture. More...
 
 set_z_size
 Changes the z size indicated for the texture. More...
 
- Public Attributes inherited from TypedWritableReferenceCount
static BamReaderreader = nullptr)
 
- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count. More...
 
- Public Attributes inherited from Namable
 get_name
 
 set_name
 
- Public Attributes inherited from AnimInterface
 get_frac
 Returns the fractional part of the current frame. More...
 
 get_frame
 Returns the current integer frame number. More...
 
 get_frame_rate
 Returns the native frame rate of the animation. More...
 
 get_full_fframe
 Returns the current floating-point frame number. More...
 
 get_full_frame
 Returns the current integer frame number. More...
 
 get_next_frame
 Returns the current integer frame number + 1, constrained to the range 0 <= f < get_num_frames(). More...
 
 get_num_frames
 Returns the number of frames in the animation. More...
 
 get_play_rate
 Returns the rate at which the animation plays. More...
 
 is_playing
 Returns true if the animation is currently playing, false if it is stopped (e.g. More...
 
 set_play_rate
 Changes the rate at which the animation plays. More...
 

Additional Inherited Members

- Public Types inherited from Texture
enum  ComponentType {
  T_unsigned_byte, T_unsigned_short, T_float, T_unsigned_int_24_8,
  T_int, T_byte, T_short, T_half_float,
  T_unsigned_int
}
 
enum  CompressionMode {
  CM_default, CM_off, CM_on, CM_fxt1,
  CM_dxt1, CM_dxt2, CM_dxt3, CM_dxt4,
  CM_dxt5, CM_pvr1_2bpp, CM_pvr1_4bpp, CM_rgtc,
  CM_etc1, CM_etc2, CM_eac
}
 
enum  DeprecatedFilterType {
  FT_nearest = SamplerState::FT_nearest, FT_linear = SamplerState::FT_linear, FT_nearest_mipmap_nearest = SamplerState::FT_nearest_mipmap_nearest, FT_linear_mipmap_nearest = SamplerState::FT_linear_mipmap_nearest,
  FT_nearest_mipmap_linear = SamplerState::FT_nearest_mipmap_linear, FT_linear_mipmap_linear = SamplerState::FT_linear_mipmap_linear, FT_shadow = SamplerState::FT_shadow, FT_default = SamplerState::FT_default,
  FT_invalid = SamplerState::FT_invalid
}
 
enum  DeprecatedWrapMode {
  WM_clamp = SamplerState::WM_clamp, WM_repeat = SamplerState::WM_repeat, WM_mirror = SamplerState::WM_mirror, WM_mirror_once = SamplerState::WM_mirror_once,
  WM_border_color = SamplerState::WM_border_color, WM_invalid = SamplerState::WM_invalid
}
 
typedef SamplerState::FilterType FilterType
 
enum  Format {
  F_depth_stencil = 1, F_color_index, F_red, F_green,
  F_blue, F_alpha, F_rgb, F_rgb5,
  F_rgb8, F_rgb12, F_rgb332, F_rgba,
  F_rgbm, F_rgba4, F_rgba5, F_rgba8,
  F_rgba12, F_luminance, F_luminance_alpha, F_luminance_alphamask,
  F_rgba16, F_rgba32, F_depth_component, F_depth_component16,
  F_depth_component24, F_depth_component32, F_r16, F_rg16,
  F_rgb16, F_srgb, F_srgb_alpha, F_sluminance,
  F_sluminance_alpha, F_r32i, F_r32, F_rg32,
  F_rgb32, F_r8i, F_rg8i, F_rgb8i,
  F_rgba8i, F_r11_g11_b10, F_rgb9_e5, F_rgb10_a2,
  F_rg, F_r16i
}
 
enum  QualityLevel { QL_default, QL_fastest, QL_normal, QL_best }
 
enum  TextureType {
  TT_1d_texture, TT_2d_texture, TT_3d_texture, TT_2d_texture_array,
  TT_cube_map, TT_buffer_texture, TT_cube_map_array, TT_1d_texture_array
}
 
typedef SamplerState::WrapMode WrapMode
 
- Static Public Attributes inherited from TypedWritable
static TypedWritable *const Null = nullptr
 

Detailed Description

The base class for a family of animated Textures that take their input from a video source, such as a movie file.

These Textures may be stopped, started, etc. using the AnimInterface controls, similar to an animated character.

Definition at line 28 of file videoTexture.h.

Member Function Documentation

◆ cull_callback()

bool VideoTexture::cull_callback ( CullTraverser trav,
const CullTraverserData data 
) const
virtual

If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

This is called each time the Texture is discovered applied to a Geom in the traversal. It should return true if the Geom is visible, false if it should be omitted.

Reimplemented from Texture.

Definition at line 85 of file videoTexture.cxx.

◆ get_keep_ram_image()

bool VideoTexture::get_keep_ram_image ( ) const
virtual

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

Reimplemented from Texture.

Definition at line 60 of file videoTexture.cxx.

◆ has_cull_callback()

bool VideoTexture::has_cull_callback ( ) const
virtual

Should be overridden by derived classes to return true if cull_callback() has been defined.

Otherwise, returns false to indicate cull_callback() does not need to be called for this node during the cull traversal.

Reimplemented from Texture.

Definition at line 71 of file videoTexture.cxx.

Member Data Documentation

◆ get_video_height

int VideoTexture::get_video_height
inline

Returns the height in texels of the source video stream.

This is not necessarily the height of the actual texture, since the texture may have been expanded to raise it to a power of 2.

Definition at line 39 of file videoTexture.h.

◆ get_video_width

int VideoTexture::get_video_width
inline

Returns the width in texels of the source video stream.

This is not necessarily the width of the actual texture, since the texture may have been expanded to raise it to a power of 2.

Definition at line 38 of file videoTexture.h.


The documentation for this class was generated from the following files: