Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ImageBuffer Class Reference

#include <imageBuffer.h>

Inheritance diagram for ImageBuffer:

ReferenceCount WritableConfigurable Namable TypedWritable TypedObject PixelBuffer Texture List of all members.

Public Member Functions

 ImageBuffer ()
virtual ~ImageBuffer ()
virtual void config (void)
virtual void copy (GraphicsStateGuardianBase *, const DisplayRegion *)=0
virtual void copy (GraphicsStateGuardianBase *, const DisplayRegion *, const RenderBuffer &rb)=0
bool has_filename () const
 Returns true if the filename has been set and is available.

const Filenameget_filename () const
 Returns the filename that has been set.

bool has_alpha_filename () const
 Returns true if the alpha_filename has been set and is available.

const Filenameget_alpha_filename () const
 Returns the alpha_filename that has been set.

bool has_fullpath () const
 Returns true if the fullpath has been set and is available.

const Filenameget_fullpath () const
 Returns the fullpath that has been set.

bool has_alpha_fullpath () const
 Returns true if the alpha_fullpath has been set and is available.

const Filenameget_alpha_fullpath () const
 Returns the alpha_fullpath that has been set.

void set_filename (const Filename &filename)
 Sets the name of the file that contains the image's contents.

void clear_filename ()
 Removes the alpha filename, if it was previously set.

void set_alpha_filename (const Filename &alpha_filename)
 Sets the name of the file that contains the image's alpha channel contents.

void clear_alpha_filename ()
 Removes the alpha filename, if it was previously set.

void set_fullpath (const Filename &fullpath)
 Sets the full pathname to the file that contains the image's contents, as found along the search path.

void clear_fullpath ()
 Removes the alpha fullpath, if it was previously set.

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

void clear_alpha_fullpath ()
 Removes the alpha fullpath, if it was previously set.

virtual void write_datagram (BamWriter *manager, Datagram &me)
 Function to write the important information in the particular object to a Datagram.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
int get_ref_count () const
 Returns the current reference count.

int ref () const
 Explicitly increments the reference count.

int unref () const
 Explicitly decrements the reference count.

void test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.

void check_config () const
bool is_dirty (void) const
void make_dirty (void)
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().

virtual void finalize ()
 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.

int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.

void set_name (const string &name)
void clear_name ()
 Resets the Namable's name to empty.

bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.

const string & get_name () const
void output (ostream &out) const
 Outputs the Namable.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Static Public Attributes

TypedWritable *const Null = (TypedWritable*)0L

Protected Member Functions

void fillin (DatagramIterator &scan, BamReader *manager)
 Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.


Protected Attributes

int _primary_file_num_channels
int _alpha_file_channel

Private Attributes

Filename _filename
Filename _alpha_filename
Filename _fullpath
Filename _alpha_fullpath

Static Private Attributes

TypeHandle _type_handle

Constructor & Destructor Documentation

ImageBuffer::ImageBuffer  ) 
 

Definition at line 43 of file imageBuffer.cxx.

ImageBuffer::~ImageBuffer  )  [virtual]
 

Definition at line 57 of file imageBuffer.cxx.

References BTM_fullpath, BTM_unchanged, get_alpha_filename(), get_alpha_fullpath(), get_filename(), and get_fullpath().


Member Function Documentation

void WritableConfigurable::check_config  )  const [inline, inherited]
 

Definition at line 70 of file writableConfigurable.h.

References PUBLISHED.

Referenced by Geom::set_lengths().

void ImageBuffer::clear_alpha_filename  )  [inline]
 

Removes the alpha filename, if it was previously set.

See set_alpha_filename().

Definition at line 247 of file imageBuffer.I.

Referenced by Texture::~Texture().

void ImageBuffer::clear_alpha_fullpath  )  [inline]
 

Removes the alpha fullpath, if it was previously set.

See set_alpha_fullpath().

Definition at line 317 of file imageBuffer.I.

void ImageBuffer::clear_filename  )  [inline]
 

Removes the alpha filename, if it was previously set.

See set_filename().

Definition at line 196 of file imageBuffer.I.

References _fullpath, and INLINE.

void ImageBuffer::clear_fullpath  )  [inline]
 

Removes the alpha fullpath, if it was previously set.

See set_fullpath().

Definition at line 281 of file imageBuffer.I.

void Namable::clear_name  )  [inline, inherited]
 

Resets the Namable's name to empty.

Definition at line 82 of file namable.I.

References Namable::_name, and INLINE.

int TypedWritable::complete_pointers TypedWritable **  p_list,
BamReader manager
[virtual, inherited]
 

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in AnimBundleNode, AnimGroup, PartBundleNode, PartGroup, Character, CharacterJoint, CollisionNode, GeomSprite, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, RenderEffects, RenderState, TextureAttrib, Person, and Child.

Definition at line 94 of file typedWritable.cxx.

Referenced by RenderState::do_invert_compose().

virtual void ImageBuffer::config void   )  [inline, virtual]
 

Reimplemented from WritableConfigurable.

Reimplemented in PixelBuffer.

Definition at line 49 of file imageBuffer.h.

References INLINE, and PUBLISHED.

Referenced by PixelBuffer::operator=().

virtual void ImageBuffer::copy GraphicsStateGuardianBase ,
const DisplayRegion ,
const RenderBuffer rb
[pure virtual]
 

Implemented in PixelBuffer, and Texture.

virtual void ImageBuffer::copy GraphicsStateGuardianBase ,
const DisplayRegion
[pure virtual]
 

Implemented in PixelBuffer, and Texture.

void ImageBuffer::fillin DatagramIterator scan,
BamReader manager
[protected]
 

Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.

Reimplemented from TypedWritable.

Reimplemented in Texture.

Definition at line 134 of file imageBuffer.cxx.

void TypedWritable::finalize void   )  [virtual, inherited]
 

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.

Reimplemented in PartBundle, RenderAttrib, RenderEffect, RenderEffects, RenderState, and TransformState.

Definition at line 112 of file typedWritable.cxx.

Referenced by BamReader::skip_pointer().

virtual TypeHandle ImageBuffer::force_init_type void   )  [inline, virtual]
 

Reimplemented from WritableConfigurable.

Reimplemented in PixelBuffer, and Texture.

Definition at line 119 of file imageBuffer.h.

const Filename & ImageBuffer::get_alpha_filename  )  const [inline]
 

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

Definition at line 85 of file imageBuffer.I.

References _fullpath, and INLINE.

Referenced by EggGroupNode::remove_child(), and ~ImageBuffer().

const Filename & ImageBuffer::get_alpha_fullpath  )  const [inline]
 

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.

Definition at line 151 of file imageBuffer.I.

References _alpha_filename, and INLINE.

Referenced by Texture::unprepare(), and ~ImageBuffer().

TypeHandle ImageBuffer::get_class_type void   )  [inline, static]
 

Reimplemented from Namable.

Reimplemented in PixelBuffer, and Texture.

Definition at line 104 of file imageBuffer.h.

Referenced by PixelBuffer::get_class_type().

const Filename & ImageBuffer::get_filename  )  const [inline]
 

Returns the filename that has been set.

This is the name of the file as it was requested. Also see get_fullpath().

Definition at line 51 of file imageBuffer.I.

References _alpha_filename.

Referenced by TexturePool::ns_add_texture(), PixelBuffer::read(), EggGroupNode::remove_child(), and ~ImageBuffer().

const Filename & ImageBuffer::get_fullpath  )  const [inline]
 

Returns the fullpath that has been set.

This is the full path to the file as it was found along the texture search path.

Definition at line 117 of file imageBuffer.I.

References _filename, and INLINE.

Referenced by Texture::unprepare(), and ~ImageBuffer().

const string & Namable::get_name  )  const [inline, inherited]
 

Definition at line 109 of file namable.I.

Referenced by ComputedVerticesMaker::add_normal(), GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), BuilderBucket::BuilderBucket(), EggVertex::clear_grefs(), AnimBundleMaker::create_xfm_channel(), SceneGraphReducer::do_flatten_siblings(), BuilderBucket::done_geom(), DXTextureContext8::DXTextureContext8(), PartGroup::find_child(), EggLoader::find_collision_geometry(), EggGroupUniquifier::get_category(), PartBundle::get_control_effect(), PartGroup::get_num_children(), EggMorph< Parameter >::get_offset(), AnimChannelBase::has_changed(), Namable::has_name(), EggMaterial::is_equivalent_to(), Texture::load(), EggLoader::make_node(), AnimBundleMaker::make_node(), FindApproxPath::Component::matches(), LineSegs::move_to(), MovingPartBase::MovingPartBase(), NodeMap::NodeMap(), EggMorph< Parameter >::operator<(), operator<<(), MouseWatcherRegion::output(), AnimGroup::output(), EggXfmSAnim::r_transform(), Texture::read(), MouseWatcherGroup::remove_region(), EggLoader::reparent_decals(), CRGraphicsStateGuardian::set_blend_mode(), NodePath::set_color(), GLGraphicsStateGuardian::set_draw_buffer(), AnimChannelScalarTable::set_table(), NodePath::set_transparency(), NodePathComponent::uncollapse(), Texture::unprepare(), TextNode::wordwrap_to(), MovingPartBase::write(), CollisionNode::xform(), and EggVertex::~EggVertex().

int ReferenceCount::get_ref_count  )  const [inline, inherited]
 

Returns the current reference count.

Definition at line 183 of file referenceCount.I.

Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture().

virtual TypeHandle ImageBuffer::get_type void   )  const [inline, virtual]
 

Reimplemented from WritableConfigurable.

Reimplemented in PixelBuffer, and Texture.

Definition at line 116 of file imageBuffer.h.

int TypedObject::get_type_index  )  const [inline, inherited]
 

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

bool ImageBuffer::has_alpha_filename  )  const [inline]
 

Returns true if the alpha_filename has been set and is available.

See set_alpha_filename().

Definition at line 66 of file imageBuffer.I.

References _fullpath, Filename::empty(), and INLINE.

Referenced by EggGroupNode::remove_child().

bool ImageBuffer::has_alpha_fullpath  )  const [inline]
 

Returns true if the alpha_fullpath has been set and is available.

See set_alpha_fullpath().

Definition at line 132 of file imageBuffer.I.

References _filename, and INLINE.

Referenced by Texture::unprepare().

bool ImageBuffer::has_filename  )  const [inline]
 

Returns true if the filename has been set and is available.

See set_filename().

Definition at line 34 of file imageBuffer.I.

References _filename, and INLINE.

Referenced by Texture::read(), and Texture::unprepare().

bool ImageBuffer::has_fullpath  )  const [inline]
 

Returns true if the fullpath has been set and is available.

See set_fullpath().

Definition at line 100 of file imageBuffer.I.

References _alpha_fullpath, and INLINE.

bool Namable::has_name  )  const [inline, inherited]
 

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

Definition at line 97 of file namable.I.

References Namable::get_name(), and INLINE.

Referenced by EggGroupUniquifier::EggGroupUniquifier(), Texture::read(), and Texture::Texture().

void ImageBuffer::init_type void   )  [inline, static]
 

Reimplemented from Namable.

Reimplemented in PixelBuffer, and Texture.

Definition at line 107 of file imageBuffer.h.

Referenced by PixelBuffer::get_class_type().

bool WritableConfigurable::is_dirty void   )  const [inline, inherited]
 

Definition at line 82 of file writableConfigurable.h.

Referenced by Geom::get_texcoords(), and dDrawable::~dDrawable().

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

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

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

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

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

void WritableConfigurable::make_dirty void   )  [inline, inherited]
 

Definition at line 83 of file writableConfigurable.h.

Referenced by GeomSphere::draw_immediate(), Geom::get_coords_index(), GeomTri::get_tris(), PixelBuffer::set_size(), PixelBuffer::set_xorg(), PixelBuffer::set_ysize(), PixelBuffer::stencil_buffer(), Geom::transform_vertices(), and GeomLine::write_datagram().

void Namable::output ostream &  out  )  const [inline, inherited]
 

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented in BuilderBucket, AnimBundle, AnimChannelBase, AnimChannelFixed< SwitchType >, AnimGroup, PartBundle, CollisionNode, ButtonNode, HermiteCurve, RopeNode, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, PandaNode, PlaneNode, MouseWatcher, and MouseWatcherRegion.

Definition at line 126 of file namable.I.

int ReferenceCount::ref  )  const [inline, inherited]
 

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 225 of file referenceCount.I.

Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering().

void ImageBuffer::set_alpha_filename const Filename alpha_filename  )  [inline]
 

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 ImageBuffer's get_filename() function returns the name of the image file that was loaded into the buffer. In the case where a texture specified two separate files to load, a 1- or 3-channel color image and a 1-channel alpha image, this Filename is update to contain the name of the image file that was loaded into the buffer's alpha channel.

Definition at line 232 of file imageBuffer.I.

Referenced by Texture::read(), and EggGroupNode::remove_child().

void ImageBuffer::set_alpha_fullpath const Filename alpha_fullpath  )  [inline]
 

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

Definition at line 302 of file imageBuffer.I.

Referenced by Texture::read().

void ImageBuffer::set_filename const Filename filename  )  [inline]
 

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

Definition at line 181 of file imageBuffer.I.

References _fullpath, and INLINE.

Referenced by Texture::read(), EggGroupNode::remove_child(), and Texture::~Texture().

void ImageBuffer::set_fullpath const Filename fullpath  )  [inline]
 

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

Definition at line 266 of file imageBuffer.I.

Referenced by Texture::read().

void Namable::set_name const string &  name  )  [inline, inherited]
 

Definition at line 69 of file namable.I.

References Namable::_name.

Referenced by BuilderBucket::BuilderBucket(), SceneGraphReducer::do_flatten_siblings(), Texture::read(), PandaNode::reparent(), and Texture::Texture().

void ReferenceCount::test_ref_count_integrity  )  const [inline, inherited]
 

Does some easy checks to make sure that the reference count isn't completely bogus.

Definition at line 328 of file referenceCount.I.

References INLINE.

Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount().

int ReferenceCount::unref  )  const [inline, inherited]
 

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 293 of file referenceCount.I.

References INLINE.

Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds().

void ImageBuffer::write_datagram BamWriter manager,
Datagram me
[virtual]
 

Function to write the important information in the particular object to a Datagram.

Implements WritableConfigurable.

Reimplemented in Texture.

Definition at line 71 of file imageBuffer.cxx.

References BTM_relative.


Member Data Documentation

int ImageBuffer::_alpha_file_channel [protected]
 

Definition at line 93 of file imageBuffer.h.

Filename ImageBuffer::_alpha_filename [private]
 

Definition at line 79 of file imageBuffer.h.

Referenced by get_alpha_fullpath(), and get_filename().

Filename ImageBuffer::_alpha_fullpath [private]
 

Definition at line 81 of file imageBuffer.h.

Referenced by has_fullpath().

Filename ImageBuffer::_filename [private]
 

Definition at line 78 of file imageBuffer.h.

Referenced by get_fullpath(), has_alpha_fullpath(), and has_filename().

Filename ImageBuffer::_fullpath [private]
 

Definition at line 80 of file imageBuffer.h.

Referenced by clear_filename(), get_alpha_filename(), has_alpha_filename(), and set_filename().

int ImageBuffer::_primary_file_num_channels [protected]
 

Definition at line 87 of file imageBuffer.h.

TypeHandle ImageBuffer::_type_handle [static, private]
 

Reimplemented from Namable.

Reimplemented in PixelBuffer, and Texture.

Definition at line 32 of file imageBuffer.cxx.

TypedWritable *const TypedWritable::Null = (TypedWritable*)0L [static, inherited]
 

Definition at line 25 of file typedWritable.cxx.

Referenced by Child::complete_pointers(), Parent::complete_pointers(), Person::complete_pointers(), LoaderFileTypeBam::get_extension(), PartGroup::pick_channel_index(), BamReader::read_pointer(), and AnimGroup::write_datagram().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:51:34 2003 for Panda by doxygen1.3