TexturePeeker

from acron.core import TexturePeeker
class TexturePeeker

Bases:

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

digraph inheritance4b6facdcc5 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TexturePeeker" [URL="acron.core.TexturePeeker.html#acron.core.TexturePeeker",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ReferenceCount" -> "TexturePeeker" [arrowsize=0.75,style=""]; }
__init__()

Use Texture.peek() to construct a TexturePeeker.

This constructor is called only by Texture.peek(), and assumes the texture’s lock is already held.

fetch_pixel()

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

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

filter_rect()

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].

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].

get_x_size()

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.

get_y_size()

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.

get_z_size()

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

has_pixel()

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

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

lookup()

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.

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.

lookup_bilinear()

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.