Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
om::graphics::textures::TextureFilter Class Reference

A class that specifies how texture should be magnified or reduced in size. More...

#include <omGraphicsTextureFilter.h>

Public Types

enum  Enum {
  NEAREST, LINEAR, BILINEAR, TRILINEAR,
  UNDEFINED
}
 An enum type which represents the different texture filtering types. More...
 

Public Member Functions

 TextureFilter ()
 Create a new UNDEFINED texture filter. More...
 
 TextureFilter (Enum newType)
 Create a new texture filter with the specified filter type and default anisotropy of 1.0. More...
 
 TextureFilter (Enum newType, Float newAnisotropy)
 Create a new texture filter with the specified filter type and anisotropy. More...
 
 operator Enum () const
 Convert this texture filter to an enum value. More...
 
Float getAnisotropy () const
 Get the maximum level of anisotropy which this texture filter should use. More...
 
void setAnisotropy (Float newAnisotropy)
 Set the maximum level of anisotropy which this texture filter should use. More...
 
String toString () const
 Return a string representation of the texture filter. More...
 
 operator String () const
 Convert this texture filter into a string representation. More...
 

Static Public Member Functions

static Float getMaxAnisotropy ()
 Return the maximum texture filter anisotropy allowed by the graphics implementation. More...
 

Detailed Description

A class that specifies how texture should be magnified or reduced in size.

This class allows the user to specify the basic filter type used to decrease or increase the size of a texture, as well as a floating-point anisotropy level. This anisotropy level indicates how much anisotropic filtering can be done.

Member Enumeration Documentation

An enum type which represents the different texture filtering types.

Enumerator
NEAREST 

A nearest-neighbor filter type. The closest texel is chosen without any interpolation.

This filter type is generally undesireable because it will produce blocky artifacts when used to enlarge a texture and will produce texture 'sparkling' when used to reduce a texture's size.

LINEAR 

A linear filter type. The final texel is computed from a linear interpolation of the nearest texels.

This filter type produces smooth texel interpolation when used for texture magnification. This filter type is undesirable for texture minification because it produces 'sparkling' artifacts because no mip-maps are used.

BILINEAR 

A linear filter type. The final texel is computed from a linear interpolation of the nearest texels in the nearest mipmap level.

This filter type should not be used for texture magnification, use LINEAR instead. This filter type produces better results for texture minification than LINEAR, but still produces artifacts where mip-map levels change.

TRILINEAR 

A linear filter type. The final texel is computed from a linear interpolation of the nearest texels in the nearest two mipmap levels.

This filter type should not be used for texture magnification, use LINEAR instead. This filter type produces better results for texture minification than LINEAR or BILINEAR. Texture mip-map levels are smoothly interpolated between, resulting in the smoothest kind of texture filtering.

UNDEFINED 

An undefined type of textuer filtering.

Constructor & Destructor Documentation

om::graphics::textures::TextureFilter::TextureFilter ( )
inline

Create a new UNDEFINED texture filter.

om::graphics::textures::TextureFilter::TextureFilter ( Enum  newType)
inline

Create a new texture filter with the specified filter type and default anisotropy of 1.0.

om::graphics::textures::TextureFilter::TextureFilter ( Enum  newType,
Float  newAnisotropy 
)
inline

Create a new texture filter with the specified filter type and anisotropy.

Member Function Documentation

om::graphics::textures::TextureFilter::operator Enum ( ) const
inline

Convert this texture filter to an enum value.

Float om::graphics::textures::TextureFilter::getAnisotropy ( ) const
inline

Get the maximum level of anisotropy which this texture filter should use.

void om::graphics::textures::TextureFilter::setAnisotropy ( Float  newAnisotropy)
inline

Set the maximum level of anisotropy which this texture filter should use.

static Float om::graphics::textures::TextureFilter::getMaxAnisotropy ( )
static

Return the maximum texture filter anisotropy allowed by the graphics implementation.

String om::graphics::textures::TextureFilter::toString ( ) const

Return a string representation of the texture filter.

om::graphics::textures::TextureFilter::operator String ( ) const
inline

Convert this texture filter into a string representation.


The documentation for this class was generated from the following file: