Panda3D
Public Member Functions | Friends

TexturePeeker Class Reference

An instance of this object is returned by Texture::peek(). More...

#include "texturePeeker.h"

Inheritance diagram for TexturePeeker:
ReferenceCount MemoryBase

List of all members.

Public Member Functions

void filter_rect (Colorf &color, float min_u, float min_v, float max_u, float max_v) const
 Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range.
void filter_rect (Colorf &color, float min_u, float min_v, float min_w, float max_u, float max_v, float max_w) const
 Fills "color" with the average RGBA color of the texels within the rectangle defined by the specified coordinate range.
int get_x_size () const
 Returns the width of the texture image that is contributing to the TexturePeeker's information.
int get_y_size () const
 Returns the height of the texture image that is contributing to the TexturePeeker's information.
int get_z_size () const
 Returns the depth of the texture image that is contributing to the TexturePeeker's information.
bool is_valid () const
 Returns true if the TexturePeeker was able to initialize itself and is ready to return texel colors.
void lookup (Colorf &color, float u, float v, float w) const
 Fills "color" with the RGBA color of the texel at point (u, v, w).
void lookup (Colorf &color, float u, float v) const
 Fills "color" with the RGBA color of the texel at point (u, v).

Friends

class Texture

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.

Definition at line 30 of file texturePeeker.h.


Member Function Documentation

void TexturePeeker::filter_rect ( Colorf color,
float  min_u,
float  min_v,
float  max_u,
float  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.

void TexturePeeker::filter_rect ( Colorf color,
float  min_u,
float  min_v,
float  min_w,
float  max_u,
float  max_v,
float  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.

int TexturePeeker::get_x_size ( ) const [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.

int TexturePeeker::get_y_size ( ) const [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.

int TexturePeeker::get_z_size ( ) const [inline]

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

Definition at line 61 of file texturePeeker.I.

bool TexturePeeker::is_valid ( ) const [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 PointerToVoid::is_null().

void TexturePeeker::lookup ( Colorf color,
float  u,
float  v,
float  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 ConstPointerToArray< Element >::p().

void TexturePeeker::lookup ( Colorf color,
float  u,
float  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().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations