panda3d.core.TexturePeeker

class TexturePeeker

Bases: ReferenceCount

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.

Inheritance diagram

Inheritance diagram of TexturePeeker

__init__(param0: TexturePeeker) → None
getXSize() → int

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

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

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

hasPixel(x: int, y: int) → bool

Returns whether a given coordinate is inside of the texture dimensions.

lookup(color: LColor, u: float, v: float) → None

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(color: LColor, u: float, v: float, w: float) → None

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.

fetchPixel(color: LColor, x: int, y: int) → None

Works like TexturePeeker.lookup(), but instead uv-coordinates integer coordinates are used.

lookupBilinear(color: LColor, u: float, v: float) → bool

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.

filterRect(color: LColor, min_u: float, min_v: float, max_u: float, max_v: float) → None

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(color: LColor, min_u: float, min_v: float, min_w: float, max_u: float, max_v: float, max_w: float) → None

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.