Panda3D
|
An instance of this object is returned by Texture::peek(). More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ (const TexturePeeker) | |
fetchPixel (LColor color, int x, int y) | |
Works like TexturePeeker::lookup(), but instead of uv-coordinates, integer coordinates are used. More... | |
fetchPixel (LColor color, int x, int y, int z) | |
Works like TexturePeeker::lookup(), but instead of uv-coordinates, integer coordinates are used. More... | |
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. More... | |
int | getYSize () |
Returns the height of the texture image that is contributing to the TexturePeeker's information. More... | |
int | getZSize () |
Returns the depth of the texture image that is contributing to the TexturePeeker's information. More... | |
bool | hasPixel (int x, int y) |
Returns whether a given coordinate is inside of the texture dimensions. More... | |
bool | hasPixel (int x, int y, int z) |
Returns whether a given coordinate is inside of the texture dimensions. 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... | |
bool | lookupBilinear (LColor color, float u, float v) |
Performs a bilinear lookup to retrieve the color value stored at the uv coordinate (u, v). More... | |
![]() | |
int | getRefCount () |
Returns the current reference count. More... | |
ref () | |
Explicitly increments the reference count. More... | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
bool | unref () |
Explicitly decrements the reference count. More... | |
Additional Inherited Members | |
![]() | |
static TypeHandle | getClassType () |
![]() | |
int | ref_count |
The current reference count. More... | |
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.
__init__ | ( | const | TexturePeeker | ) |
fetchPixel | ( | LColor | color, |
int | x, | ||
int | y | ||
) |
Works like TexturePeeker::lookup(), but instead of uv-coordinates, integer coordinates are used.
fetchPixel | ( | LColor | color, |
int | x, | ||
int | y, | ||
int | z | ||
) |
Works like TexturePeeker::lookup(), but instead of uv-coordinates, integer coordinates are used.
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 must be in the range [0, 1].
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 must be in the range [0, 1].
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.
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.
int getZSize | ( | ) |
Returns the depth of the texture image that is contributing to the TexturePeeker's information.
bool hasPixel | ( | int | x, |
int | y | ||
) |
Returns whether a given coordinate is inside of the texture dimensions.
bool hasPixel | ( | int | x, |
int | y, | ||
int | z | ||
) |
Returns whether a given coordinate is inside of the texture dimensions.
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 | ( | 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.
bool lookupBilinear | ( | LColor | color, |
float | u, | ||
float | v | ||
) |
Performs a bilinear lookup to retrieve the color value stored at the uv coordinate (u, v).
In case the point is outside of the uv range, color is set to zero, and false is returned. Otherwise true is returned.