Panda3D
Public Member Functions | List of all members
TexturePeeker Class Reference

An instance of this object is returned by Texture::peek(). This object allows quick and easy inspection of a texture's texels by (u, v) coordinates. More...

Inheritance diagram for TexturePeeker:
ReferenceCount MemoryBase

Public Member Functions

 filterRect (LColor color, float min_u, float min_v, float max_u, float max_v)
 Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range. More...
 
 filterRect (LColor color, float min_u, float min_v, float min_w, float max_u, float max_v, float max_w)
 Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range. More...
 
int getXSize ()
 Returns the width of the texture image that is contributing to the TexturePeeker's information. This may be either the Texture's full width, or its simple ram image's width. More...
 
int getYSize ()
 Returns the height of the texture image that is contributing to the TexturePeeker's information. This may be either the Texture's full height, or its simple ram image's height. More...
 
int getZSize ()
 Returns the depth of the texture image that is contributing to the TexturePeeker's information. More...
 
 lookup (LColor color, float u, float v)
 Fills "color" with the RGBA color of the texel at point (u, v). More...
 
 lookup (LColor color, float u, float v, float w)
 Fills "color" with the RGBA color of the texel at point (u, v, w). More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 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. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise. More...
 
bool unref ()
 Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete(). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Detailed Description

An instance of this object is returned by Texture::peek(). This object allows quick and easy inspection of a texture's texels by (u, v) coordinates.

Member Function Documentation

◆ filterRect() [1/2]

filterRect ( LColor  color,
float  min_u,
float  min_v,
float  max_u,
float  max_v 
)

Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range.

The texel color is linearly filtered over the entire region. u, v, and w will wrap around regardless of the texture's wrap mode.

◆ filterRect() [2/2]

filterRect ( LColor  color,
float  min_u,
float  min_v,
float  min_w,
float  max_u,
float  max_v,
float  max_w 
)

Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range.

The texel color is linearly filtered over the entire region. u, v, and w will wrap around regardless of the texture's wrap mode.

◆ getXSize()

int getXSize ( )

Returns the width of the texture image that is contributing to the TexturePeeker's information. This may be either the Texture's full width, or its simple ram image's width.

◆ getYSize()

int getYSize ( )

Returns the height of the texture image that is contributing to the TexturePeeker's information. This may be either the Texture's full height, or its simple ram image's height.

◆ getZSize()

int getZSize ( )

Returns the depth of the texture image that is contributing to the TexturePeeker's information.

◆ lookup() [1/2]

lookup ( LColor  color,
float  u,
float  v 
)

Fills "color" with the RGBA color of the texel at point (u, v).

The texel color is determined via nearest-point sampling (no filtering of adjacent pixels), regardless of the filter type associated with the texture. u, v, and w will wrap around regardless of the texture's wrap mode.

◆ lookup() [2/2]

lookup ( LColor  color,
float  u,
float  v,
float  w 
)

Fills "color" with the RGBA color of the texel at point (u, v, w).

The texel color is determined via nearest-point sampling (no filtering of adjacent pixels), regardless of the filter type associated with the texture. u, v, and w will wrap around regardless of the texture's wrap mode.