TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::WrapMode Class Reference

#include <WrapMode.h>

Public Types

enum  Value {
  CLAMP, TILE, ZERO, IGNORE,
  ERROR
}
 

Public Member Functions

 G3D_DECLARE_ENUM_CLASS_METHODS (WrapMode)
 

Static Public Member Functions

static const char * toString (int i, Value &v)
 

Public Attributes

enum G3D::WrapMode::Value value
 

Detailed Description

Describes the behavior of G3D::Texture, G3D::Map2D, G3D::Image3, etc. when accessing an out-of-bounds pixel. Not all classes support all modes.

Refer to these as scoped enums, e.g., WrapMode m = WrapMode::CLAMP;.

WrapMode::IGNORE silently discards attempts to write to out of bounds locations and returns an undefined value for reading from out of bounds locations.

WrapMode::ERROR generates an error when the pixel indices are out of bounds

WrapMode::CLAMP makes out of bounds pixels equal to the last in-range pixel along that dimension.

WrapMode::TILE computes out of bounds pixels modulo the dimension

WrapMode::ZERO treats out of bounds values as the zero value, which varies in definition according to the class used. For example, with a G3D::Texture, ZERO = Color4(0,0,0,0).

Uses the "Intelligent Enum" design pattern http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4001/

Member Enumeration Documentation

Don't use this enum; use WrapMode instances instead.

Enumerator
CLAMP 
TILE 
ZERO 
IGNORE 
ERROR 
58  {
59  CLAMP,
60  TILE,
61  ZERO,
62  IGNORE,
63  ERROR
64  } value;
Definition: WrapMode.h:60
Definition: WrapMode.h:61
Definition: WrapMode.h:63
Definition: WrapMode.h:59
Definition: WrapMode.h:62
enum G3D::WrapMode::Value value

Member Function Documentation

G3D::WrapMode::G3D_DECLARE_ENUM_CLASS_METHODS ( WrapMode  )
static const char* G3D::WrapMode::toString ( int  i,
Value v 
)
inlinestatic
66  {
67  static const char* str[] = {"CLAMP", "TILE", "ZERO", "IGNORE", "ERROR", NULL};
68  static const Value val[] = {CLAMP, TILE, ZERO, IGNORE, ERROR};
69  const char* s = str[i];
70  if (s) {
71  v = val[i];
72  }
73  return s;
74  }
Definition: WrapMode.h:60
Definition: WrapMode.h:61
Definition: WrapMode.h:63
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: WrapMode.h:59
Definition: WrapMode.h:62

Member Data Documentation

enum G3D::WrapMode::Value G3D::WrapMode::value

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