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

PixelBuffer Class Reference

#include <pixelBuffer.h>

Inheritance diagram for PixelBuffer:

ImageBuffer ReferenceCount WritableConfigurable Namable TypedWritable TypedObject List of all members.

Public Types

enum  Type { T_unsigned_byte, T_unsigned_short, T_unsigned_byte_332, T_float }
enum  Format {
  F_color_index, F_stencil_index, F_depth_component, 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
}

Public Member Functions

 PixelBuffer (void)
 PixelBuffer (int xsize, int ysize, int components, int component_width, Type type, Format format)
 PixelBuffer (int xsize, int ysize, int components, int component_width, Type type, Format format, bool bAllocateRAM)
 create a pixel buffer with specified format but do not alloc CPU RAM for it

 PixelBuffer (const PixelBuffer &copy)
void operator= (const PixelBuffer &copy)
 ~PixelBuffer (void)
virtual void config (void)
bool read (const Filename &name)
bool write (const Filename &name) const
bool load (const PNMImage &pnmimage)
 Extracts the image data from the given PNMImage and stores it in the _image member, as an unadorned array of pixel values.

bool store (PNMImage &pnmimage) const
void copy (const PixelBuffer *pb)
 Deep copy of pixel buffer.

virtual void copy (GraphicsStateGuardianBase *gsg, const DisplayRegion *dr)
virtual void copy (GraphicsStateGuardianBase *gsg, const DisplayRegion *dr, const RenderBuffer &rb)
void set_xsize (int size)
void set_ysize (int size)
void set_xorg (int org)
void set_yorg (int org)
void set_size (int x_org, int y_org, int x_size, int y_size)
void set_format (Format format)
int get_xsize () const
int get_ysize () const
int get_xorg () const
int get_yorg () const
int get_border () const
int get_num_components () const
int get_component_width () const
Format get_format () const
Type get_image_type () const
void set_uchar_rgb_texel (const uchar color[3], int x, int y, int width)
 This is only valid when the PixelBuffer is an RGB buffer with uchar components.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
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.

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

PixelBuffer rgb_buffer (int xsize, int ysize)
 Constructs a PixelBuffer suitable for RGB.

PixelBuffer rgba_buffer (int xsize, int ysize)
 Constructs a PixelBuffer suitable for RGBA.

PixelBuffer depth_buffer (int xsize, int ysize)
 Constructs a PixelBuffer suitable for depth maps.

PixelBuffer stencil_buffer (int xsize, int ysize)
 Constructs a PixelBuffer suitable for stencil buffers.

TypeHandle get_class_type ()
void init_type ()

Public Attributes

PTA_uchar _image

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 _xsize
int _ysize
int _xorg
int _yorg
int _border
int _components
int _component_width
Format _format
Type _type
bool _loaded
int _primary_file_num_channels
int _alpha_file_channel

Private Member Functions

void store_unscaled_byte (int &index, int value)
 This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned bytes.

void store_unscaled_short (int &index, int value)
 This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned shorts.

void store_scaled_byte (int &index, int value, double scale)
 This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned bytes.

void store_scaled_short (int &index, int value, double scale)
 This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned shorts.

double get_unsigned_byte (int &index) const
 This is used by store() to retieve the next consecutive component value from the indicated element of the array, which is taken to be an array of unsigned bytes.

double get_unsigned_short (int &index) const
 This is used by store() to retieve the next consecutive component value from the indicated element of the array, which is taken to be an array of unsigned shorts.


Static Private Attributes

TypeHandle _type_handle

Member Enumeration Documentation

enum PixelBuffer::Format
 

Enumeration values:
F_color_index 
F_stencil_index 
F_depth_component 
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 

Definition at line 75 of file pixelBuffer.h.

Referenced by get_yorg(), and Texture::string_wrap_mode().

enum PixelBuffer::Type
 

Enumeration values:
T_unsigned_byte 
T_unsigned_short 
T_unsigned_byte_332 
T_float 

Definition at line 68 of file pixelBuffer.h.

Referenced by DXTextureContext8::CreateTexture(), DXTextureContext7::CreateTexture(), and get_border().


Constructor & Destructor Documentation

PixelBuffer::PixelBuffer void   ) 
 

Definition at line 40 of file pixelBuffer.cxx.

References _component_width, _components, _format, _image, _loaded, _type, F_rgb, and T_unsigned_byte.

Referenced by rgb_buffer(), and rgba_buffer().

PixelBuffer::PixelBuffer int  xsize,
int  ysize,
int  components,
int  component_width,
Type  type,
Format  format
 

Definition at line 64 of file pixelBuffer.cxx.

References _component_width, _components, _format, _image, _loaded, and _type.

PixelBuffer::PixelBuffer int  xsize,
int  ysize,
int  components,
int  component_width,
Type  type,
Format  format,
bool  bAllocateRAM
 

create a pixel buffer with specified format but do not alloc CPU RAM for it

Definition at line 90 of file pixelBuffer.cxx.

References _image, and _loaded.

PixelBuffer::PixelBuffer const PixelBuffer &  copy  ) 
 

Definition at line 116 of file pixelBuffer.cxx.

References _border, _component_width, _components, _format, _image, _loaded, _type, _xorg, _xsize, _yorg, and _ysize.

PixelBuffer::~PixelBuffer void   )  [inline]
 

Definition at line 87 of file pixelBuffer.I.


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, inherited]
 

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, inherited]
 

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, inherited]
 

Removes the alpha filename, if it was previously set.

See set_filename().

Definition at line 196 of file imageBuffer.I.

References ImageBuffer::_fullpath, and INLINE.

void ImageBuffer::clear_fullpath  )  [inline, inherited]
 

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

void PixelBuffer::config void   )  [virtual]
 

Reimplemented from ImageBuffer.

Definition at line 160 of file pixelBuffer.cxx.

void PixelBuffer::copy GraphicsStateGuardianBase gsg,
const DisplayRegion dr,
const RenderBuffer rb
[virtual]
 

Implements ImageBuffer.

Definition at line 458 of file pixelBuffer.cxx.

void PixelBuffer::copy GraphicsStateGuardianBase gsg,
const DisplayRegion dr
[virtual]
 

Implements ImageBuffer.

Definition at line 454 of file pixelBuffer.cxx.

void PixelBuffer::copy const PixelBuffer *  pb  ) 
 

Deep copy of pixel buffer.

Definition at line 440 of file pixelBuffer.cxx.

PixelBuffer PixelBuffer::depth_buffer int  xsize,
int  ysize
[inline, static]
 

Constructs a PixelBuffer suitable for depth maps.

Definition at line 60 of file pixelBuffer.I.

Referenced by GLGraphicsStateGuardian::enable_lighting(), PlanarReflector::init(), and CRGraphicsStateGuardian::issue_transformed_color().

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

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 PixelBuffer::force_init_type void   )  [inline, virtual]
 

Reimplemented from ImageBuffer.

Definition at line 174 of file pixelBuffer.h.

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

Returns the alpha_filename that has been set.

If this is set, it represents the name of the alpha component, which is stored in a separate file. See also get_filename(), and get_alpha_fullpath().

Definition at line 85 of file imageBuffer.I.

References ImageBuffer::_fullpath, and INLINE.

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

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

Returns the alpha_fullpath that has been set.

This is the full path to the alpha part of the image file as it was found along the texture search path.

Definition at line 151 of file imageBuffer.I.

References ImageBuffer::_alpha_filename, and INLINE.

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

int PixelBuffer::get_border  )  const [inline]
 

Definition at line 237 of file pixelBuffer.I.

References _type, INLINE, and Type.

Referenced by GLGraphicsStateGuardian::set_draw_buffer().

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

Reimplemented from ImageBuffer.

Definition at line 163 of file pixelBuffer.h.

References ImageBuffer::get_class_type(), and ImageBuffer::init_type().

int PixelBuffer::get_component_width  )  const [inline]
 

Definition at line 261 of file pixelBuffer.I.

References _image, and INLINE.

Referenced by CRGraphicsStateGuardian::set_blend_mode().

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

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 ImageBuffer::_alpha_filename.

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

PixelBuffer::Format PixelBuffer::get_format  )  const [inline]
 

Definition at line 273 of file pixelBuffer.I.

References INLINE.

Referenced by GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::copy_texture(), CRGraphicsStateGuardian::set_blend_mode(), GLGraphicsStateGuardian::set_draw_buffer(), and CRGraphicsStateGuardian::set_read_buffer().

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

Returns the fullpath that has been set.

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

Definition at line 117 of file imageBuffer.I.

References ImageBuffer::_filename, and INLINE.

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

PixelBuffer::Type PixelBuffer::get_image_type  )  const [inline]
 

Definition at line 285 of file pixelBuffer.I.

References uchar, and ushort.

Referenced by GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::copy_texture(), CRGraphicsStateGuardian::set_blend_mode(), GLGraphicsStateGuardian::set_draw_buffer(), and CRGraphicsStateGuardian::set_read_buffer().

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 PixelBuffer::get_num_components  )  const [inline]
 

Definition at line 249 of file pixelBuffer.I.

References _image, INLINE, width, x, and y.

Referenced by CRGraphicsStateGuardian::copy_texture(), and CRGraphicsStateGuardian::set_blend_mode().

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 PixelBuffer::get_type void   )  const [inline, virtual]
 

Reimplemented from ImageBuffer.

Definition at line 171 of file pixelBuffer.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.

double PixelBuffer::get_unsigned_byte int &  index  )  const [inline, private]
 

This is used by store() to retieve the next consecutive component value from the indicated element of the array, which is taken to be an array of unsigned bytes.

Definition at line 413 of file pixelBuffer.I.

double PixelBuffer::get_unsigned_short int &  index  )  const [inline, private]
 

This is used by store() to retieve the next consecutive component value from the indicated element of the array, which is taken to be an array of unsigned shorts.

Definition at line 433 of file pixelBuffer.I.

Referenced by store().

int PixelBuffer::get_xorg void   )  const [inline]
 

Definition at line 213 of file pixelBuffer.I.

References _component_width, and INLINE.

Referenced by GLGraphicsStateGuardian::copy_texture().

int PixelBuffer::get_xsize void   )  const [inline]
 

Definition at line 188 of file pixelBuffer.I.

References _yorg, and INLINE.

Referenced by GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), GLGraphicsStateGuardian::copy_texture(), CRGraphicsStateGuardian::copy_texture(), CRGraphicsStateGuardian::set_blend_mode(), GLGraphicsStateGuardian::set_draw_buffer(), CRGraphicsStateGuardian::set_read_buffer(), and Spotlight::write().

int PixelBuffer::get_yorg void   )  const [inline]
 

Definition at line 225 of file pixelBuffer.I.

References _format, Format, and INLINE.

Referenced by GLGraphicsStateGuardian::copy_texture().

int PixelBuffer::get_ysize void   )  const [inline]
 

Definition at line 200 of file pixelBuffer.I.

References _border.

Referenced by GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), GLGraphicsStateGuardian::copy_texture(), CRGraphicsStateGuardian::copy_texture(), CRGraphicsStateGuardian::set_blend_mode(), GLGraphicsStateGuardian::set_draw_buffer(), and CRGraphicsStateGuardian::set_read_buffer().

bool ImageBuffer::has_alpha_filename  )  const [inline, inherited]
 

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 ImageBuffer::_fullpath, Filename::empty(), and INLINE.

Referenced by EggGroupNode::remove_child().

bool ImageBuffer::has_alpha_fullpath  )  const [inline, inherited]
 

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 ImageBuffer::_filename, and INLINE.

Referenced by Texture::unprepare().

bool ImageBuffer::has_filename  )  const [inline, inherited]
 

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

See set_filename().

Definition at line 34 of file imageBuffer.I.

References ImageBuffer::_filename, and INLINE.

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

bool ImageBuffer::has_fullpath  )  const [inline, inherited]
 

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

See set_fullpath().

Definition at line 100 of file imageBuffer.I.

References ImageBuffer::_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 PixelBuffer::init_type void   )  [inline, static]
 

Reimplemented from ImageBuffer.

Definition at line 166 of file pixelBuffer.h.

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

bool PixelBuffer::load const PNMImage pnmimage  ) 
 

Extracts the image data from the given PNMImage and stores it in the _image member, as an unadorned array of pixel values.

Note that we now store pixel components in the order B, G, R, A.

Definition at line 231 of file pixelBuffer.cxx.

References _format.

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(), set_size(), set_xorg(), set_ysize(), stencil_buffer(), Geom::transform_vertices(), and GeomLine::write_datagram().

void PixelBuffer::operator= const PixelBuffer &  copy  ) 
 

Definition at line 139 of file pixelBuffer.cxx.

References ImageBuffer::config().

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.

bool PixelBuffer::read const Filename name  ) 
 

Definition at line 173 of file pixelBuffer.cxx.

References Filename::empty(), ImageBuffer::get_filename(), store(), and PNMImage::write().

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

PixelBuffer PixelBuffer::rgb_buffer int  xsize,
int  ysize
[inline, static]
 

Constructs a PixelBuffer suitable for RGB.

Definition at line 32 of file pixelBuffer.I.

References F_rgba, INLINE, PixelBuffer(), T_unsigned_byte, and uchar.

Referenced by PlanarReflector::init().

PixelBuffer PixelBuffer::rgba_buffer int  xsize,
int  ysize
[inline, static]
 

Constructs a PixelBuffer suitable for RGBA.

Definition at line 46 of file pixelBuffer.I.

References F_depth_component, INLINE, PixelBuffer(), and T_float.

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

Sets the name of the file that contains the image's alpha channel contents.

Normally, this is set automatically when the image is loaded, for instance via Texture::read().

The 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, inherited]
 

Sets the full pathname to the file that contains the image's alpha channel contents, as found along the search path.

Normally, this is set automatically when the image is loaded, for instance via Texture::read().

Definition at line 302 of file imageBuffer.I.

Referenced by Texture::read().

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

Sets the name of the file that contains the image's contents.

Normally, this is set automatically when the image is loaded, for instance via Texture::read().

The 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 ImageBuffer::_fullpath, and INLINE.

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

void PixelBuffer::set_format PixelBuffer::Format  format  )  [inline]
 

Definition at line 172 of file pixelBuffer.I.

References _xorg, and INLINE.

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

Sets the full pathname to the file that contains the image's contents, as found along the search path.

Normally, this is set automatically when the image is loaded, for instance via Texture::read().

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 PixelBuffer::set_size int  x_org,
int  y_org,
int  x_size,
int  y_size
[inline]
 

Definition at line 92 of file pixelBuffer.I.

References _xsize, INLINE, and WritableConfigurable::make_dirty().

void PixelBuffer::set_uchar_rgb_texel const uchar  color[3],
int  x,
int  y,
int  width
[inline]
 

This is only valid when the PixelBuffer is an RGB buffer with uchar components.

Definition at line 300 of file pixelBuffer.I.

References INLINE, and store_unscaled_byte().

void PixelBuffer::set_xorg int  org  )  [inline]
 

Definition at line 141 of file pixelBuffer.I.

References _format, INLINE, and WritableConfigurable::make_dirty().

void PixelBuffer::set_xsize int  size  )  [inline]
 

Definition at line 111 of file pixelBuffer.I.

Referenced by motion_display_func().

void PixelBuffer::set_yorg int  org  )  [inline]
 

Definition at line 156 of file pixelBuffer.I.

References _xsize, and INLINE.

void PixelBuffer::set_ysize int  size  )  [inline]
 

Definition at line 126 of file pixelBuffer.I.

References _yorg, INLINE, and WritableConfigurable::make_dirty().

Referenced by motion_display_func().

PixelBuffer PixelBuffer::stencil_buffer int  xsize,
int  ysize
[inline, static]
 

Constructs a PixelBuffer suitable for stencil buffers.

Definition at line 74 of file pixelBuffer.I.

References _xorg, _xsize, _yorg, _ysize, INLINE, and WritableConfigurable::make_dirty().

bool PixelBuffer::store PNMImage pnmimage  )  const
 

Definition at line 381 of file pixelBuffer.cxx.

References get_unsigned_short(), and PNMImage::set_gray().

Referenced by read().

void PixelBuffer::store_scaled_byte int &  index,
int  value,
double  scale
[inline, private]
 

This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned bytes.

The value will be scaled by the indicated factor before storing it.

Definition at line 373 of file pixelBuffer.I.

void PixelBuffer::store_scaled_short int &  index,
int  value,
double  scale
[inline, private]
 

This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned shorts.

The value will be scaled by the indicated factor before storing it.

Definition at line 394 of file pixelBuffer.I.

void PixelBuffer::store_unscaled_byte int &  index,
int  value
[inline, private]
 

This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned bytes.

The value is assumed to be in the range 0-255.

Definition at line 325 of file pixelBuffer.I.

References _image, INLINE, nassertr, and PointerToArray< unsigned char >::size().

Referenced by set_uchar_rgb_texel().

void PixelBuffer::store_unscaled_short int &  index,
int  value
[inline, private]
 

This is used by load() to store the next consecutive component value into the indicated element of the array, which is taken to be an array of unsigned shorts.

The value is assumed to be in the range 0-65535.

Definition at line 346 of file pixelBuffer.I.

References uchar, and ushort.

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

bool PixelBuffer::write const Filename name  )  const
 

Definition at line 196 of file pixelBuffer.cxx.

References _components, _format, _loaded, PNMImageHeader::CT_color, PNMImageHeader::CT_four_channel, PNMImageHeader::CT_grayscale, PNMImageHeader::CT_two_channel, F_luminance, F_luminance_alpha, F_rgb, F_rgba, PNMImageHeader::get_color_type(), and PNMImageHeader::get_num_channels().

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

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, inherited]
 

Definition at line 93 of file imageBuffer.h.

int PixelBuffer::_border [protected]
 

Definition at line 190 of file pixelBuffer.h.

Referenced by get_ysize(), and PixelBuffer().

int PixelBuffer::_component_width [protected]
 

Definition at line 192 of file pixelBuffer.h.

Referenced by get_xorg(), and PixelBuffer().

int PixelBuffer::_components [protected]
 

Definition at line 191 of file pixelBuffer.h.

Referenced by PixelBuffer(), and write().

Format PixelBuffer::_format [protected]
 

Definition at line 193 of file pixelBuffer.h.

Referenced by get_yorg(), load(), PixelBuffer(), set_xorg(), and write().

PTA_uchar PixelBuffer::_image
 

Definition at line 201 of file pixelBuffer.h.

Referenced by CRGraphicsStateGuardian::copy_texture(), get_component_width(), get_num_components(), motion_display_func(), PixelBuffer(), GLGraphicsStateGuardian::set_draw_buffer(), CRGraphicsStateGuardian::set_read_buffer(), store_unscaled_byte(), and GLGraphicsStateGuardian::texture_to_pixel_buffer().

bool PixelBuffer::_loaded [protected]
 

Definition at line 196 of file pixelBuffer.h.

Referenced by PixelBuffer(), and write().

int ImageBuffer::_primary_file_num_channels [protected, inherited]
 

Definition at line 87 of file imageBuffer.h.

Type PixelBuffer::_type [protected]
 

Definition at line 194 of file pixelBuffer.h.

Referenced by get_border(), and PixelBuffer().

TypeHandle PixelBuffer::_type_handle [static, private]
 

Reimplemented from ImageBuffer.

Definition at line 30 of file pixelBuffer.cxx.

int PixelBuffer::_xorg [protected]
 

Definition at line 188 of file pixelBuffer.h.

Referenced by PixelBuffer(), set_format(), and stencil_buffer().

int PixelBuffer::_xsize [protected]
 

Definition at line 183 of file pixelBuffer.h.

Referenced by PixelBuffer(), set_size(), set_yorg(), and stencil_buffer().

int PixelBuffer::_yorg [protected]
 

Definition at line 189 of file pixelBuffer.h.

Referenced by get_xsize(), PixelBuffer(), set_ysize(), and stencil_buffer().

int PixelBuffer::_ysize [protected]
 

Definition at line 184 of file pixelBuffer.h.

Referenced by PixelBuffer(), and stencil_buffer().

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:53:43 2003 for Panda by doxygen1.3