Panda3D
|
An instance of this object is returned by Texture::peek(). More...
#include "texturePeeker.h"
Public Member Functions | |
void | filter_rect (LColor &color, PN_stdfloat min_u, PN_stdfloat min_v, PN_stdfloat max_u, PN_stdfloat max_v) const |
Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range. More... | |
void | filter_rect (LColor &color, PN_stdfloat min_u, PN_stdfloat min_v, PN_stdfloat min_w, PN_stdfloat max_u, PN_stdfloat max_v, PN_stdfloat max_w) const |
Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range. More... | |
int | get_x_size () const |
Returns the width of the texture image that is contributing to the TexturePeeker's information. More... | |
int | get_y_size () const |
Returns the height of the texture image that is contributing to the TexturePeeker's information. More... | |
int | get_z_size () const |
Returns the depth of the texture image that is contributing to the TexturePeeker's information. More... | |
bool | is_valid () const |
Returns true if the TexturePeeker was able to initialize itself and is ready to return texel colors. More... | |
void | lookup (LColor &color, PN_stdfloat u, PN_stdfloat v) const |
Fills "color" with the RGBA color of the texel at point (u, v). More... | |
void | lookup (LColor &color, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w) const |
Fills "color" with the RGBA color of the texel at point (u, v, w). More... | |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_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 | 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... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Friends | |
class | Texture |
Additional Inherited Members | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
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.
Definition at line 30 of file texturePeeker.h.
void TexturePeeker::filter_rect | ( | LColor & | color, |
PN_stdfloat | min_u, | ||
PN_stdfloat | min_v, | ||
PN_stdfloat | max_u, | ||
PN_stdfloat | max_v | ||
) | const |
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.
Definition at line 210 of file texturePeeker.cxx.
Referenced by lookup().
void TexturePeeker::filter_rect | ( | LColor & | color, |
PN_stdfloat | min_u, | ||
PN_stdfloat | min_v, | ||
PN_stdfloat | min_w, | ||
PN_stdfloat | max_u, | ||
PN_stdfloat | max_v, | ||
PN_stdfloat | max_w | ||
) | const |
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.
Definition at line 242 of file texturePeeker.cxx.
References ConstPointerToArray< Element >::p().
|
inline |
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.
Definition at line 37 of file texturePeeker.I.
References get_y_size().
Referenced by is_valid().
|
inline |
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.
Definition at line 50 of file texturePeeker.I.
References get_z_size().
Referenced by get_x_size().
|
inline |
Returns the depth of the texture image that is contributing to the TexturePeeker's information.
Definition at line 61 of file texturePeeker.I.
Referenced by get_y_size().
|
inline |
Returns true if the TexturePeeker was able to initialize itself and is ready to return texel colors.
Definition at line 24 of file texturePeeker.I.
References get_x_size(), and PointerToVoid::is_null().
void TexturePeeker::lookup | ( | LColor & | color, |
PN_stdfloat | u, | ||
PN_stdfloat | v | ||
) | const |
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.
Definition at line 163 of file texturePeeker.cxx.
References ConstPointerToArray< Element >::p().
void TexturePeeker::lookup | ( | LColor & | color, |
PN_stdfloat | u, | ||
PN_stdfloat | v, | ||
PN_stdfloat | w | ||
) | const |
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.
Definition at line 186 of file texturePeeker.cxx.
References filter_rect(), and ConstPointerToArray< Element >::p().