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

Namespaces

 _internal
 
 units
 

Classes

class  _internalGThreadWorker
 
class  AABox
 
class  AlignedMemoryManager
 
class  Any
 Easy loading and saving of human-readable configuration files. More...
 
class  AnyTableReader
 
class  AreaMemoryManager
 Allocates memory in large blocks and then frees it as an area. More...
 
class  Array
 Dynamic 1D array tuned for performance. More...
 
class  AtomicInt32
 
class  BinaryInput
 
class  BinaryOutput
 
class  Box
 An arbitrary (oriented) 3D box, useful as a bounding box. More...
 
class  Box2D
 
class  BufferPool
 
class  BumpMapPreprocess
 
class  Capsule
 
class  CollisionDetection
 
class  Color1
 
class  Color3
 
class  Color4
 
class  Conduit
 
class  Cone
 
struct  ConvertAttributes
 
class  ConvexPolygon
 
class  ConvexPolygon2D
 
class  ConvexPolyhedron
 
class  CoordinateFrame
 A rigid body RT (rotation-translation) transformation. More...
 
class  CRTMemoryManager
 
class  Crypto
 
class  Cylinder
 
class  DirectedEdge
 
class  Dummy
 
class  FileNotFound
 
class  FilePath
 Parsing of file system paths. More...
 
class  FileSystem
 
class  Frustum
 
class  G3DSpecification
 
class  GMutex
 Mutual exclusion lock used for synchronization. More...
 
class  GMutexLock
 
class  GThread
 
class  GUniqueID
 
class  Image1
 
class  Image3
 
class  Image4
 
class  ImageFormat
 
class  Intersect
 
class  KDTree
 
class  LightweightConduit
 
class  Line
 
class  LineSegment
 
class  LineSegment2D
 
class  Log
 
class  Map2D
 
class  Matrix
 
class  Matrix2
 
class  Matrix3
 
class  Matrix4
 
class  Matrix4float64
 
struct  md5_state_s
 
class  MD5Hash
 
class  MemoryManager
 
class  MeshAlg
 
class  MeshBuilder
 
class  MeshEdgeTable
 
class  MirrorQuality
 
class  NetAddress
 
class  NetListener
 
class  NetworkDevice
 Abstraction of network (socket) functionality. More...
 
class  ParseError
 
class  PhysicsFrame
 
class  PhysicsFrameSpline
 
class  Plane
 
class  Pointer
 
class  PointHashGrid
 A sparse 3D grid of point-based data. More...
 
class  PointKDTree
 
class  PrecomputedRandom
 
class  PrimitiveType
 
class  Quat
 
class  Queue
 
class  Random
 
class  Ray
 
class  Rect2D
 
class  ReferenceCountedObject
 
class  RefractionQuality
 
class  ReliableConduit
 
class  Set
 
class  SmallArray
 
class  Sphere
 
class  Spinlock
 A mutual exclusion lock that busy-waits when locking. More...
 
class  Spline
 
class  SplineBase
 
class  SplineExtrapolationMode
 
class  SplineInterpolationMode
 
class  Stopwatch
 Accurately measure durations and framerates. More...
 
class  System
 OS and processor abstraction. More...
 
class  Table
 
class  TextInput
 A simple tokenizer for parsing text files. More...
 
class  TextOutput
 
class  ThreadSet
 
class  Token
 
class  Triangle
 
class  uint128
 
class  UprightFrame
 Coordinate frame expressed in Euler angles. Unlike a G3D::Quat, UprightFrame always keeps the reference frame from rolling about its own z axis. Particularly useful for cameras. More...
 
class  UprightSpline
 Shortest-path linear velocity spline for camera positions. Always keeps the camera from rolling. More...
 
class  Vector2
 
class  Vector3
 
class  Vector4
 
class  Vector4int8
 
class  WeakCache
 
class  Welder
 
class  WrapMode
 
class  XML
 Easy loading and saving of XML and HTML files. More...
 

Typedefs

typedef AreaMemoryManager CoherentAllocator
 
typedef class CoordinateFrame CFrame
 
typedef class Rect2D AABox2D
 
typedef Color3 Biradiance3
 
typedef Color3 Radiance3
 
typedef Color3 Radiosity3
 
typedef Color3 Energy3
 
typedef Color3 Irradiance3
 
typedef Color3 Power3
 
typedef bool(* AssertionHook )(const char *_expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)
 
typedef void(* ConsolePrintHook )(const std::string &)
 
typedef double GameTime
 
typedef double SimTime
 
typedef double RealTime
 
typedef int8_t int8
 
typedef uint8_t uint8
 
typedef int16_t int16
 
typedef uint16_t uint16
 
typedef int32_t int32
 
typedef uint32_t uint32
 
typedef int64_t int64
 
typedef uint64_t uint64
 
typedef float float32
 
typedef double float64
 
typedef shared_ptr< class GThreadGThreadRef
 
typedef shared_ptr< class Image1Image1Ref
 
typedef shared_ptr< class Image3Image3Ref
 
typedef shared_ptr< class Image4Image4Ref
 
typedef ImageFormat TextureFormat
 
typedef shared_ptr< class
ReliableConduit
ReliableConduitRef
 
typedef shared_ptr< class
LightweightConduit
LightweightConduitRef
 
typedef shared_ptr< class
NetListener
NetListenerRef
 
typedef PhysicsFrame PFrame
 
typedef Stopwatch StopWatch
 
typedef Vector2 Point2
 
typedef Vector2int16 Point2int16
 
typedef Vector2int32 Point2int32
 
typedef Vector2unorm16 Point2unorm16
 
typedef Vector3 Point3
 
typedef Vector3int16 Point3int16
 
typedef Vector3int32 Point3int32
 
typedef unsigned char md5_byte_t
 
typedef unsigned int md5_word_t
 
typedef struct G3D::md5_state_s md5_state_t
 
typedef void(* ConvertFunc )(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 

Enumerations

enum  BinaryFormat {
  FIRST_BINFMT = 1000, BOOL8_BINFMT, UINT8_BINFMT, INT8_BINFMT,
  UINT16_BINFMT, INT16_BINFMT, UINT32_BINFMT, INT32_BINFMT,
  UINT64_BINFMT, INT64_BINFMT, UINT128_BINFMT, INT128_BINFMT,
  FLOAT16_BINFMT, FLOAT32_BINFMT, FLOAT64_BINFMT, VECTOR2_BINFMT,
  VECTOR2INT16_BINFMT, VECTOR3_BINFMT, VECTOR3INT16_BINFMT, VECTOR4_BINFMT,
  VECTOR4INT16_BINFMT, COLOR3_BINFMT, COLOR3UINT8_BINFMT, COLOR3INT16_BINFMT,
  COLOR4_BINFMT, COLOR4UINT8_BINFMT, COLOR4INT16_BINFMT, STRING_BINFMT,
  STRINGEVEN_BINFMT, STRING8_BINFMT, STRING16_BINFMT, STRING32_BINFMT,
  CHUNK_BINFMT, CUSTOM_BINFMT, LAST_BINFMT
}
 
enum  AMPM { AM, PM }
 
enum  {
  SECOND =1, MINUTE =60, HOUR = 60*60, DAY =24*60*60,
  SUNRISE =24*60*60/4, SUNSET =24*60*60*3/4, MIDNIGHT =0, METER =1,
  KILOMETER =1000
}
 
enum  SpawnBehavior { USE_NEW_THREAD, USE_CURRENT_THREAD }
 
enum  G3DEndian { G3D_BIG_ENDIAN, G3D_LITTLE_ENDIAN }
 The order in which the bytes of an integer are stored on a machine. More...
 

Functions

template<class T >
bool contains (const T *array, int len, const T &e)
 
int32 byteSize (BinaryFormat f)
 
G3D::Color3 operator* (float s, const G3D::Color3 &c)
 
G3D::Color3 operator* (G3D::Color1 &s, const G3D::Color3 &c)
 
G3D::Color3 operator* (const G3D::Color3 &c, G3D::Color1 &s)
 
G3D::Color3 operator/ (float s, const G3D::Color3 &c)
 
Color4 operator* (const Color3 &c3, const Color4 &c4)
 
Color4 operator* (float fScalar, const Color4 &other)
 
bool isValidHeapPointer (const void *x)
 
bool isValidPointer (const void *x)
 
void setAssertionHook (AssertionHook hook)
 
AssertionHook assertionHook ()
 
void setFailureHook (AssertionHook hook)
 
AssertionHook failureHook ()
 
void setConsolePrintHook (ConsolePrintHook h)
 
ConsolePrintHook consolePrintHook ()
 
std::string __cdecl consolePrintf (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 
std::string consolePrint (const std::string &)
 
std::string __cdecl debugPrintf (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 
std::string debugPrint (const std::string &)
 
template<class EnumClass , class EnumClassValue >
void enumToJavaScriptDeclaration (TextOutput &t)
 Generates JavaScript source code defining an enum equivalent to EnumClass. More...
 
std::string readWholeFile (const std::string &filename)
 
void writeWholeFile (const std::string &filename, const std::string &str, bool flush=true)
 
FILE * createTempFile ()
 
bool zipfileExists (const std::string &filename, std::string &outZipfile, std::string &outInternalFile)
 
bool zipfileExists (const std::string &filename)
 
void parseFilename (const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext)
 
std::string filenameBaseExt (const std::string &filename)
 
std::string filenameExt (const std::string &filename)
 
std::string filenameBase (const std::string &filename)
 
std::string generateFilenameBase (const std::string &prefix="", const std::string &suffix="")
 
std::string filenamePath (const std::string &filename)
 
bool filenameContainsWildcards (const std::string &filename)
 
std::string pathConcat (const std::string &dirname, const std::string &file)
 
void gaussian1D (Array< float > &coeff, int N=5, float std=0.5f)
 
std::string __cdecl format (const char *fmt...) G3D_CHECK_PRINTF_ARGS
 
std::string vformat (const char *fmt, va_list argPtr) G3D_CHECK_VPRINTF_ARGS
 
void initG3D (const G3DSpecification &spec=G3DSpecification())
 
int g3dfnmatch (const char *pattern, const char *string, int flags)
 
SimTime toSeconds (int hour, int minute, double seconds, AMPM ap)
 
SimTime toSeconds (int hour, int minute, AMPM ap)
 
double inf ()
 
double nan ()
 
float finf ()
 
float fnan ()
 
double pi ()
 
float pif ()
 
double halfPi ()
 
double twoPi ()
 
int iAbs (int iValue)
 
int iCeil (double fValue)
 
int iClamp (int val, int low, int hi)
 
int16 iClamp (int16 val, int16 low, int16 hi)
 
double clamp (double val, double low, double hi)
 
float clamp (float val, float low, float hi)
 
double lerp (double a, double b, double f)
 
float lerp (float a, float b, float f)
 
int iWrap (int val, int hi)
 
int iFloor (double fValue)
 
int iSign (int iValue)
 
int iSign (double fValue)
 
int iSign (float f)
 
double round (double f)
 
float round (float f)
 
int iRound (double fValue)
 
int iRound (float f)
 
int iRandom (int low, int hi)
 
double abs (double fValue)
 
double aCos (double fValue)
 
double aSin (double fValue)
 
double aTan (double fValue)
 
double aTan2 (double fY, double fX)
 
double sign (double fValue)
 
double square (double fValue)
 
bool isFinite (double x)
 
bool isNaN (double x)
 
bool isNaN (float x)
 
bool isNaN (int x)
 
bool isNaN (uint64 x)
 
int iMod3 (int x)
 
float uniformRandom (float low=0.0f, float hi=1.0f)
 
float gaussRandom (float mean=0.0f, float stdev=1.0f)
 
template<class T >
pow5 (T x)
 
template<class T >
min (const T &x, const T &y)
 
template<class T >
min (const T &x, const T &y, const T &z)
 
template<class T >
min (const T &x, const T &y, const T &z, const T &w)
 
template<class T >
max (const T &x, const T &y)
 
template<class T >
max (const T &x, const T &y, const T &z)
 
template<class T >
max (const T &x, const T &y, const T &z, const T &w)
 
int iMin (int x, int y)
 
int iMax (int x, int y)
 
double sumSquares (double x, double y)
 
double sumSquares (double x, double y, double z)
 
double distance (double x, double y)
 
double distance (double x, double y, double z)
 
int highestBit (uint32 x)
 
bool fuzzyEq (double a, double b)
 
bool fuzzyNe (double a, double b)
 
bool fuzzyGt (double a, double b)
 
bool fuzzyGe (double a, double b)
 
bool fuzzyLt (double a, double b)
 
bool fuzzyLe (double a, double b)
 
float rsq (float x)
 
int ceilPow2 (unsigned int in)
 
int pow2 (unsigned int x)
 
double log2 (double x)
 
float log2 (float x)
 
double log2 (int x)
 
bool isPow2 (int num)
 
bool isPow2 (uint64 num)
 
bool isOdd (int num)
 
bool isEven (int num)
 
double toRadians (double deg)
 
double toDegrees (double rad)
 
bool any (float x)
 
bool all (float x)
 
float normalize (float v)
 
float dot (float a, float b)
 
float mul (float a, float b)
 
double exp2 (double x)
 
float exp2 (float x)
 
double rsqrt (double x)
 
float rsqrt (float x)
 
double sinc (double x)
 
float wrap (float t, float lo, float hi)
 
double wrap (double t, double lo, double hi)
 
double wrap (double t, double hi)
 
bool isFinite (float x)
 
float acos (float fValue)
 
float sign (float fValue)
 
float square (float x)
 
int square (int x)
 
float sumSquares (float x, float y)
 
float sumSquares (float x, float y, float z)
 
float distance (float x, float y)
 
float distance (float x, float y, float z)
 
bool isPow2 (uint32 x)
 
float toRadians (float deg)
 
float toDegrees (float rad)
 
float toRadians (int deg)
 
float toDegrees (int rad)
 
double eps (double a, double b)
 
float eps (float a, float b)
 
bool fuzzyEq (float a, float b)
 
uint32 flipEndian32 (const uint32 x)
 
uint16 flipEndian16 (const uint16 x)
 
float smoothstep (float edge0, float edge1, float x)
 
float smootherstep (float edge0, float edge1, float x)
 
float signedPow (float b, float e)
 
double signedPow (double b, double e)
 
template<class Class >
void _internal_runConcurrently2DHelper (const Vector2int32 &start, const Vector2int32 &upTo, Class *object, void(Class::*method1)(int x, int y), void(Class::*method2)(int x, int y, int threadID), int maxThreads)
 
uint32_t superFastHash (const void *_data, size_t numBytes)
 A hash function that is faster than CRC32 for arbitrary long strings [From] http://www.azillionmonkeys.com/qed/hash.html by Paul Hsieh. More...
 
uint32_t wangHash6432Shift (int64 key)
 
void logPrintf (const char *fmt,...)
 
void logLazyPrintf (const char *fmt,...)
 
Vector3 operator* (const Vector3 &rkPoint, const Matrix3 &rkMatrix)
 
std::ostream & operator<< (std::ostream &os, const NetAddress &)
 
bool operator== (const NetAddress &a, const NetAddress &b)
 
bool operator!= (const NetAddress &a, const NetAddress &b)
 
template<class T >
bool isNull (const Pointer< T > &p)
 
template<class T >
bool notNull (const Pointer< T > &p)
 
int prompt (const char *windowTitle, const char *promptx, const char **choice, int numChoices, bool useGui)
 
int prompt (const char *windowTitle, const char *promptx, const char **choice, int numChoices)
 
void msgBox (const std::string &message, const std::string &title="Message")
 
Quat exp (const Quat &q)
 
Quat log (const Quat &q)
 
G3D::Quat operator* (double s, const G3D::Quat &q)
 
G3D::Quat operator* (float s, const G3D::Quat &q)
 
template<class T >
bool isNull (const ReferenceCountedPointer< T > &ptr)
 
template<class T >
bool notNull (const ReferenceCountedPointer< T > &ptr)
 
template<class T >
bool isNull (const T *ptr)
 
template<class T >
bool notNull (const T *ptr)
 
void serialize (const std::string &s, BinaryOutput &b)
 
void deserialize (std::string &s, BinaryInput &b)
 
void serialize (const int32 &i, BinaryOutput &b)
 
void deserialize (int32 &i, BinaryInput &b)
 
void serialize (const uint32 &i, BinaryOutput &b)
 
void deserialize (uint32 &i, BinaryInput &b)
 
void serialize (const bool &i, BinaryOutput &b)
 
void deserialize (bool &i, BinaryInput &b)
 
void serialize (const float32 &f, BinaryOutput &b)
 
void deserialize (float32 &f, BinaryInput &b)
 
void serialize (const float64 &f, BinaryOutput &b)
 
void deserialize (float64 &f, BinaryInput &b)
 
template<typename T >
void serialize (const Array< T > &array, BinaryOutput &b)
 
template<typename T >
void deserialize (Array< T > &array, BinaryInput &b)
 
template<class XType , class YType >
YType linearSpline (double x, const XType *controlX, const YType *controlY, int numControl)
 
template<class YType >
YType cyclicCatmullRomSpline (double t, const YType *controlY, int numPoints)
 
template<class YType >
YType cyclicCatmullRomSpline (double t, const Array< YType > &controlY)
 
void parseCommaSeparated (const std::string s, Array< std::string > &array, bool stripQuotes=true)
 
size_t findSlash (const std::string &f, size_t start=0)
 
size_t maxNotNPOS (size_t i, size_t j)
 Returns the larger string index, ignoring std::string::npos. More...
 
size_t findLastSlash (const std::string &f, size_t start=std::string::npos)
 
std::string replace (const std::string &s, const std::string &pattern, const std::string &replacement)
 
bool isValidIdentifier (const std::string &s)
 
bool beginsWith (const std::string &test, const std::string &pattern)
 Returns true if the test string begins with the pattern string. More...
 
bool endsWith (const std::string &test, const std::string &pattern)
 Returns true if the test string ends with the pattern string. More...
 
std::string wordWrap (const std::string &input, int numCols)
 Produces a new string that is the input string wrapped at a certain number of columns (where the line is broken at the latest space before the column limit.) Platform specific NEWLINEs are inserted to wrap. More...
 
int stringCompare (const std::string &s1, const std::string &s2)
 
int stringPtrCompare (const std::string *s1, const std::string *s2)
 
std::string toUpper (const std::string &x)
 
std::string toLower (const std::string &x)
 
G3D::Array< std::string > stringSplit (const std::string &x, char splitChar)
 
std::string stringJoin (const G3D::Array< std::string > &a, char joinChar)
 
std::string stringJoin (const G3D::Array< std::string > &a, const std::string &joinStr)
 
std::string trimWhitespace (const std::string &s)
 
bool isWhiteSpace (const unsigned char c)
 
bool isNewline (const unsigned char c)
 
bool isDigit (const unsigned char c)
 
bool isLetter (const unsigned char c)
 
bool isSlash (const unsigned char c)
 
bool isQuote (const unsigned char c)
 
int countNewlines (const std::string &s)
 
std::string license ()
 
void deserialize (bool &b, TextInput &ti)
 
void deserialize (int &b, TextInput &ti)
 
void deserialize (uint8 &b, TextInput &ti)
 
void deserialize (double &b, TextInput &ti)
 
void deserialize (float &b, TextInput &ti)
 
void deserialize (std::string &b, TextInput &ti)
 
void serialize (const bool &b, TextOutput &to)
 
void serialize (const int &b, TextOutput &to)
 
void serialize (const uint8 &b, TextOutput &to)
 
void serialize (const double &b, TextOutput &to)
 
void serialize (const float &b, TextOutput &to)
 
void serialize (const std::string &b, TextOutput &to)
 
void serialize (const char *b, TextOutput &to)
 
 unorm16 (uint16 b)
 
static unorm16 fromBits (uint16 b)
 
static unorm16 reinterpretFrom (uint16 b)
 
 unorm16 ()
 
 unorm16 (const unorm16 &other)
 
 unorm16 (const class Any &a)
 
class Any toAny () const
 
 unorm16 (float f)
 
 unorm16 (double f)
 
 operator float () const
 
 operator double () const
 
static unorm16 one ()
 
static unorm16 zero ()
 
uint16 bits () const
 Returns the underlying bits in this representation. Equivalent to: More...
 
uint16 reinterpretAsUInt16 () const
 Returns the underlying bits in this representation. Equivalent to: More...
 
bool operator> (const unorm16 other) const
 
bool operator< (const unorm16 other) const
 
bool operator>= (const unorm16 other) const
 
bool operator<= (const unorm16 other) const
 
bool operator== (const unorm16 other) const
 
bool operator!= (const unorm16 other) const
 
unorm16 operator+ (const unorm16 other) const
 
unorm16operator+= (const unorm16 other)
 
unorm16 operator- (const unorm16 other) const
 
unorm16operator-= (const unorm16 other)
 
unorm16 operator* (const int i) const
 
unorm16operator*= (const int i)
 
unorm16 operator/ (const int i) const
 
unorm16operator/= (const int i)
 
unorm16 operator<< (const int i) const
 
unorm16operator<<= (const int i)
 
unorm16 operator>> (const int i) const
 
unorm16operator>>= (const int i)
 
 unorm8 (uint8 b)
 
static unorm8 fromBits (uint8 b)
 
static unorm8 reinterpretFrom (uint8 b)
 
 unorm8 ()
 
 unorm8 (const unorm8 &other)
 
 unorm8 (float f)
 
 unorm8 (double f)
 
static unorm8 one ()
 
static unorm8 zero ()
 
uint8 reinterpretAsUInt8 () const
 Returns the underlying bits in this representation. Equivalent to: More...
 
bool operator> (const unorm8 other) const
 
bool operator< (const unorm8 other) const
 
bool operator>= (const unorm8 other) const
 
bool operator<= (const unorm8 other) const
 
bool operator== (const unorm8 other) const
 
bool operator!= (const unorm8 other) const
 
unorm8 operator+ (const unorm8 other) const
 
unorm8operator+= (const unorm8 other)
 
unorm8 operator- (const unorm8 other) const
 
unorm8operator-= (const unorm8 other)
 
Vector2 operator* (double s, const Vector2 &v)
 
Vector2 operator* (float s, const Vector2 &v)
 
Vector2 operator* (int s, const Vector2 &v)
 
void serialize (const Vector2 &v, class BinaryOutput &b)
 
void deserialize (Vector2 &v, class BinaryInput &b)
 
bool operator> (const Vector2int16 &) const
 
bool operator<= (const Vector2int16 &) const
 
bool operator>= (const Vector2int16 &) const
 
 Vector2int16 ()
 
 Vector2int16 (G3D::int16 _x, G3D::int16 _y)
 
 Vector2int16 (const class Vector2 &v)
 
 Vector2int16 (class BinaryInput &bi)
 
 Vector2int16 (const class Any &a)
 
 Vector2int16 (const class Vector2int32 &v)
 
Vector2int16operator= (const Any &a)
 
G3D::int16operator[] (int i)
 
Vector2int16 operator+ (const Vector2int16 &other) const
 
Vector2int16 operator- (const Vector2int16 &other) const
 
Vector2int16 operator* (const Vector2int16 &other) const
 
Vector2int16 operator- () const
 
Vector2int16operator+= (const Vector2int16 &other)
 
bool isZero () const
 
Vector2int16operator-= (const Vector2int16 &other)
 
Vector2int16operator*= (const Vector2int16 &other)
 
Vector2int16 clamp (const Vector2int16 &lo, const Vector2int16 &hi)
 
bool operator== (const Vector2int16 &rkVector) const
 
bool operator!= (const Vector2int16 &rkVector) const
 
Vector2int16 max (const Vector2int16 &v) const
 
Vector2int16 min (const Vector2int16 &v) const
 
void serialize (class BinaryOutput &bo) const
 
void deserialize (class BinaryInput &bi)
 
bool operator> (const Vector2int32 &) const
 
bool operator<= (const Vector2int32 &) const
 
bool operator>= (const Vector2int32 &) const
 
 Vector2int32 ()
 
 Vector2int32 (G3D::int32 _x, G3D::int32 _y)
 
 Vector2int32 (const class Vector2 &v)
 
 Vector2int32 (class BinaryInput &bi)
 
 Vector2int32 (const class Vector2int16 &v)
 
Vector2int32 operator+ (const Vector2int32 &other) const
 
Vector2int32 operator- (const Vector2int32 &other) const
 
Vector2int32 operator* (const Vector2int32 &other) const
 
Vector2int32operator+= (const Vector2int32 &other)
 
Vector2int32operator-= (const Vector2int32 &other)
 
Vector2int32operator*= (const Vector2int32 &other)
 
Vector2int32 clamp (const Vector2int32 &lo, const Vector2int32 &hi)
 
bool operator== (const Vector2int32 &other) const
 
bool operator!= (const Vector2int32 &other) const
 
Vector2int32 max (const Vector2int32 &v) const
 
Vector2int32 min (const Vector2int32 &v) const
 
bool operator> (const Vector2unorm16 &) const
 
bool operator<= (const Vector2unorm16 &) const
 
bool operator>= (const Vector2unorm16 &) const
 
 Vector2unorm16 ()
 
 Vector2unorm16 (G3D::unorm16 _x, G3D::unorm16 _y)
 
 Vector2unorm16 (float _x, float _y)
 
 Vector2unorm16 (const class Vector2 &v)
 
 Vector2unorm16 (class BinaryInput &bi)
 
 Vector2unorm16 (const class Any &a)
 
bool operator== (const Vector2unorm16 &rkVector) const
 
bool operator!= (const Vector2unorm16 &rkVector) const
 
size_t hashCode () const
 
G3D::Vector3 operator* (float s, const G3D::Vector3 &v)
 
G3D::Vector3 operator* (double s, const G3D::Vector3 &v)
 
G3D::Vector3 operator* (int s, const G3D::Vector3 &v)
 
std::ostream & operator<< (std::ostream &os, const Vector3 &)
 
void serialize (const Vector3::Axis &a, class BinaryOutput &bo)
 
void deserialize (Vector3::Axis &a, class BinaryInput &bo)
 
void serialize (const Vector3 &v, class BinaryOutput &b)
 
void deserialize (Vector3 &v, class BinaryInput &b)
 
bool operator> (const Vector3int16 &) const
 
bool operator<= (const Vector3int16 &) const
 
bool operator>= (const Vector3int16 &) const
 
 Vector3int16 ()
 
 Vector3int16 (G3D::int16 _x, G3D::int16 _y, G3D::int16 _z)
 
 Vector3int16 (const class Vector3 &v)
 
 Vector3int16 (class BinaryInput &bi)
 
Vector3int16 operator+ (const Vector3int16 &other) const
 
Vector3int16 operator- (const Vector3int16 &other) const
 
Vector3int16 operator* (const Vector3int16 &other) const
 
Vector3int16operator+= (const Vector3int16 &other)
 
Vector3int16operator-= (const Vector3int16 &other)
 
Vector3int16operator*= (const Vector3int16 &other)
 
static Vector3int16 floor (const Vector3 &v)
 
static Vector3int16 ceil (const Vector3 &v)
 
bool operator== (const Vector3int16 &rkVector) const
 
bool operator!= (const Vector3int16 &rkVector) const
 
int dot (const Vector3int16 &v) const
 
Vector3int16 max (const Vector3int16 &v) const
 
Vector3int16 min (const Vector3int16 &v) const
 
std::string toString () const
 
Vector3int16 operator>> (const Vector3int16 &v) const
 
Vector3int16 operator<< (const Vector3int16 &v) const
 
Vector3int16 operator& (int16 i) const
 
Vector3int16 operator& (const Vector3int16 &v) const
 
bool operator> (const Vector3int32 &) const
 
bool operator<= (const Vector3int32 &) const
 
bool operator>= (const Vector3int32 &) const
 
 Vector3int32 ()
 
 Vector3int32 (int _x, int _y, int _z)
 
 Vector3int32 (const class Vector2int32 &v, int _z)
 
 Vector3int32 (const class Vector2int16 &v, int _z)
 
 Vector3int32 (const class Vector3int16 &v)
 
 Vector3int32 (const Any &any)
 
 Vector3int32 (const class Vector3 &v)
 
 Vector3int32 (class BinaryInput &bi)
 
static Vector3int32 truncate (const class Vector3 &v)
 
bool nonZero () const
 
Vector3int32 operator+ (const Vector3int32 &other) const
 
Vector3int32 operator- (const Vector3int32 &other) const
 
Vector3int32 operator* (const Vector3int32 &other) const
 
Vector3int32 operator/ (const Vector3int32 &other) const
 
Vector3int32operator+= (const Vector3int32 &other)
 
Vector3int32operator-= (const Vector3int32 &other)
 
Vector3int32operator*= (const Vector3int32 &other)
 
bool operator== (const Vector3int32 &rkVector) const
 
bool operator!= (const Vector3int32 &rkVector) const
 
Vector3int32 max (const Vector3int32 &v) const
 
Vector3int32 min (const Vector3int32 &v) const
 
Vector3int32 operator>> (const Vector3int32 &v) const
 
Vector3int32 operator<< (const Vector3int32 &v) const
 
Vector2int32 xx () const
 
Vector2int32 yx () const
 
Vector2int32 zx () const
 
Vector2int32 xy () const
 
Vector2int32 yy () const
 
Vector2int32 zy () const
 
Vector2int32 xz () const
 
Vector2int32 yz () const
 
Vector2int32 zz () const
 
Vector3int32 iFloor (const Vector3 &)
 
void serialize (const Vector4 &v, class BinaryOutput &b)
 
void deserialize (Vector4 &v, class BinaryInput &b)
 
Matrix4 mul (const Matrix4 &a, const Matrix4 &b)
 
Vector4 mul (const Matrix4 &m, const Vector4 &v)
 
Vector3 mul (const Matrix3 &m, const Vector3 &v)
 
Matrix3 mul (const Matrix3 &a, const Matrix3 &b)
 
float dot (const Vector2 &a, const Vector2 &b)
 
float dot (const Vector3 &a, const Vector3 &b)
 
float dot (const Vector4 &a, const Vector4 &b)
 
Vector2 normalize (const Vector2 &v)
 
Vector3 normalize (const Vector3 &v)
 
Vector4 normalize (const Vector4 &v)
 
Vector2 abs (const Vector2 &v)
 
Vector3 abs (const Vector3 &v)
 
Vector4 abs (const Vector4 &v)
 
bool all (const Vector2 &v)
 
bool all (const Vector3 &v)
 
bool all (const Vector4 &v)
 
bool any (const Vector2 &v)
 
bool any (const Vector3 &v)
 
bool any (const Vector4 &v)
 
Vector2 clamp (const Vector2 &v, const Vector2 &a, const Vector2 &b)
 
Vector3 clamp (const Vector3 &v, const Vector3 &a, const Vector3 &b)
 
Vector4 clamp (const Vector4 &v, const Vector4 &a, const Vector4 &b)
 
Vector2 lerp (const Vector2 &v1, const Vector2 &v2, float f)
 
Vector3 lerp (const Vector3 &v1, const Vector3 &v2, float f)
 
Vector4 lerp (const Vector4 &v1, const Vector4 &v2, float f)
 
Color1 lerp (const Color1 &v1, const Color1 &v2, float f)
 
Color3 lerp (const Color3 &v1, const Color3 &v2, float f)
 
Color4 lerp (const Color4 &v1, const Color4 &v2, float f)
 
Vector3 cross (const Vector3 &v1, const Vector3 &v2)
 
double determinant (const Matrix3 &m)
 
double determinant (const Matrix4 &m)
 
Vector2 min (const Vector2 &v1, const Vector2 &v2)
 
Vector3 min (const Vector3 &v1, const Vector3 &v2)
 
Vector4 min (const Vector4 &v1, const Vector4 &v2)
 
Color3 min (const Color3 &v1, const Color3 &v2)
 
Color4 min (const Color4 &v1, const Color4 &v2)
 
Vector2 max (const Vector2 &v1, const Vector2 &v2)
 
Vector3 max (const Vector3 &v1, const Vector3 &v2)
 
Vector4 max (const Vector4 &v1, const Vector4 &v2)
 
Color3 max (const Color3 &v1, const Color3 &v2)
 
Color4 max (const Color4 &v1, const Color4 &v2)
 
Vector2 sign (const Vector2 &v)
 
Vector3 sign (const Vector3 &v)
 
Vector4 sign (const Vector4 &v)
 
float length (float v)
 
float length (const Vector2 &v)
 
float length (const Vector3 &v)
 
float length (const Vector4 &v)
 
Color3 log (const Color3 &c)
 
static bool isContainerType (Any::Type &t)
 
static char toLower (char c)
 
static void getDeserializeSettings (TextInput::Settings &settings)
 
static bool needsQuotes (const std::string &s)
 
static bool isOpen (const char c)
 
static bool isClose (const char c)
 
static bool isSeparator (char c)
 
static Any::Type findType (TextInput &ti, const char closeSymbol)
 
static uint32 readUInt32FromBuffer (const uint8 *data, bool swapBytes)
 
static bool isNewline (char c)
 
static int findRayCapsuleIntersectionAux (const Vector3 &rkOrigin, const Vector3 &rkDirection, const Capsule &rkCapsule, double afT[2])
 
static bool findRayCapsuleIntersection (const Ray &rkRay, const Capsule &rkCapsule, int &riQuantity, Vector3 akPoint[2])
 
static bool planeBoxOverlap (const Vector3 &normal, const Vector3 &vert, const Vector3 &maxbox)
 
static void md5_init (md5_state_t *pms)
 
static void md5_append (md5_state_t *pms, const md5_byte_t *data, int nbytes)
 
static void md5_finish (md5_state_t *pms, md5_byte_t digest[16])
 
static void md5_process (md5_state_t *pms, const md5_byte_t *data)
 
static int fixslash (int c)
 
std::string resolveFilename (const std::string &filename)
 
int64 fileLength (const std::string &filename)
 
void createDirectory (const std::string &dir)
 
void copyFile (const std::string &source, const std::string &dest)
 
static void getFileOrDirListNormal (const std::string &filespec, Array< std::string > &files, bool wantFiles, bool includePath)
 
static void getFileOrDirListZip (const std::string &path, const std::string &prefix, Array< std::string > &files, bool wantFiles, bool includePath)
 
static void determineFileOrDirList (const std::string &filespec, Array< std::string > &files, bool wantFiles, bool includePath)
 
void getFiles (const std::string &filespec, Array< std::string > &files, bool includePath)
 
void getDirs (const std::string &filespec, Array< std::string > &files, bool includePath)
 
bool isZipfile (const std::string &filename)
 
bool isDirectory (const std::string &filename)
 
bool fileIsNewer (const std::string &src, const std::string &dst)
 
std::string __cdecl format (const char *fmt,...)
 
 DEFINE_TEXTUREFORMAT_METHOD (L8, 1, UNCOMP_FORMAT, GL_LUMINANCE8, GL_LUMINANCE, 8, 0, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, CODE_L8, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (L16, 1, UNCOMP_FORMAT, GL_LUMINANCE16, GL_LUMINANCE, 16, 0, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INTEGER_FORMAT, CODE_L16, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (L16F, 1, UNCOMP_FORMAT, GL_LUMINANCE16F_ARB, GL_LUMINANCE, 16, 0, 0, 0, 0, 0, 0, 16, 16, GL_HALF_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, CODE_L16F, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (L32F, 1, UNCOMP_FORMAT, GL_LUMINANCE32F_ARB, GL_LUMINANCE, 32, 0, 0, 0, 0, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, CODE_L32F, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (A8, 1, UNCOMP_FORMAT, GL_ALPHA8, GL_ALPHA, 0, 8, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, CODE_A8, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (A16, 1, UNCOMP_FORMAT, GL_ALPHA16, GL_ALPHA, 0, 16, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, CODE_A16, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (A16F, 1, UNCOMP_FORMAT, GL_ALPHA16F_ARB, GL_ALPHA, 0, 16, 0, 0, 0, 0, 0, 16, 16, GL_HALF_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, CODE_A16F, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (A32F, 1, UNCOMP_FORMAT, GL_ALPHA32F_ARB, GL_ALPHA, 0, 32, 0, 0, 0, 0, 0, 32, 32, GL_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, CODE_A32F, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (LA4, 2, UNCOMP_FORMAT, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE_ALPHA, 4, 4, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, CODE_LA4, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (LA8, 2, UNCOMP_FORMAT, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, 8, 8, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, CODE_LA8, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (LA16, 2, UNCOMP_FORMAT, GL_LUMINANCE16_ALPHA16, GL_LUMINANCE_ALPHA, 16, 16, 0, 0, 0, 0, 0, 16 *2, 16 *2, GL_UNSIGNED_SHORT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, CODE_LA16, COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (LA16F, 2, UNCOMP_FORMAT, GL_LUMINANCE_ALPHA16F_ARB, GL_LUMINANCE_ALPHA, 16, 16, 0, 0, 0, 0, 0, 16 *2, 16 *2, GL_HALF_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_LA16F, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (LA32F, 2, UNCOMP_FORMAT, GL_LUMINANCE_ALPHA32F_ARB, GL_LUMINANCE_ALPHA, 32, 32, 0, 0, 0, 0, 0, 32 *2, 32 *2, GL_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_LA32F, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (BGR8, 3, UNCOMP_FORMAT, GL_RGB8, GL_BGR, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_BGR8, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (BGRA8, 4, UNCOMP_FORMAT, GL_RGBA8, GL_BGRA, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_BGRA8, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R8, 1, UNCOMP_FORMAT, GL_R8, GL_RED, 0, 0, 8, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_R8, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R8I, 1, UNCOMP_FORMAT, GL_R8I, GL_RED_INTEGER, 0, 0, 8, 0, 0, 0, 0, 8, 8, GL_BYTE, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_R8I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R8UI, 1, UNCOMP_FORMAT, GL_R8UI, GL_RED_INTEGER, 0, 0, 8, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_R8UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R16, 1, UNCOMP_FORMAT, GL_R16, GL_RED, 0, 0, 16, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_R16, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R16I, 1, UNCOMP_FORMAT, GL_R16I, GL_RED_INTEGER, 0, 0, 16, 0, 0, 0, 0, 16, 16, GL_SHORT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_R16I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R16UI, 1, UNCOMP_FORMAT, GL_R16UI, GL_RED_INTEGER, 0, 0, 16, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_R16UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R32I, 1, UNCOMP_FORMAT, GL_R32I, GL_RED_INTEGER, 0, 0, 32, 0, 0, 0, 0, 32, 32, GL_INT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_R32I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R32UI, 1, UNCOMP_FORMAT, GL_R32UI, GL_RED_INTEGER, 0, 0, 32, 0, 0, 0, 0, 32, 32, GL_UNSIGNED_INT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_R32UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG8, 2, UNCOMP_FORMAT, GL_RG8, GL_RG, 0, 0, 8, 8, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RG8, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG8I, 2, UNCOMP_FORMAT, GL_RG8I, GL_RG_INTEGER, 0, 0, 8, 8, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RG8I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG8UI, 2, UNCOMP_FORMAT, GL_RG8UI, GL_RG_INTEGER, 0, 0, 8, 8, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RG8UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG16, 2, UNCOMP_FORMAT, GL_RG16, GL_RG, 0, 0, 16, 16, 0, 0, 0, 16 *2, 16 *2, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RG16, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG16I, 2, UNCOMP_FORMAT, GL_RG16I, GL_RG_INTEGER, 0, 0, 16, 16, 0, 0, 0, 16 *2, 16 *2, GL_SHORT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RG16I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG16UI, 2, UNCOMP_FORMAT, GL_RG16UI, GL_RG_INTEGER, 0, 0, 16, 16, 0, 0, 0, 16 *2, 16 *2, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RG16UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R16F, 1, UNCOMP_FORMAT, GL_R16F, GL_RED, 0, 0, 16, 0, 0, 0, 0, 16, 16, GL_HALF_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_R16F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG16F, 2, UNCOMP_FORMAT, GL_RG16F, GL_RG, 0, 0, 16, 16, 0, 0, 0, 32, 32, GL_HALF_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RG16F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG32I, 2, UNCOMP_FORMAT, GL_RG32I, GL_RG_INTEGER, 0, 0, 32, 32, 0, 0, 0, 32 *2, 32 *2, GL_INT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RG32I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG32UI, 2, UNCOMP_FORMAT, GL_RG32UI, GL_RG_INTEGER, 0, 0, 32, 32, 0, 0, 0, 32 *2, 32 *2, GL_UNSIGNED_INT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RG32UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R32F, 1, UNCOMP_FORMAT, GL_R32F, GL_RED, 0, 0, 32, 0, 0, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_R32F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RG32F, 2, UNCOMP_FORMAT, GL_RG32F, GL_RG, 0, 0, 32, 32, 0, 0, 0, 64, 64, GL_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RG32F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB5, 3, UNCOMP_FORMAT, GL_RGB5, GL_RGBA, 0, 0, 5, 5, 5, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB5, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB5A1, 4, UNCOMP_FORMAT, GL_RGB5_A1, GL_RGBA, 0, 1, 5, 5, 5, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB5A1, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB8, 3, UNCOMP_FORMAT, GL_RGB8, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB8, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB10, 3, UNCOMP_FORMAT, GL_RGB10, GL_RGB, 0, 0, 10, 10, 10, 0, 0, 32, 10 *3, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB10, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB10A2, 4, UNCOMP_FORMAT, GL_RGB10_A2, GL_RGBA, 0, 2, 10, 10, 10, 0, 0, 32, 32, GL_UNSIGNED_INT_10_10_10_2, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB10A2, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB16, 3, UNCOMP_FORMAT, GL_RGB16, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 16 *3, 16 *3, GL_UNSIGNED_SHORT, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB16, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB16F, 3, UNCOMP_FORMAT, GL_RGB16F_ARB, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 16 *3, 16 *3, GL_HALF_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RGB16F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB32F, 3, UNCOMP_FORMAT, GL_RGB32F_ARB, GL_RGB, 0, 0, 32, 32, 32, 0, 0, 32 *3, 32 *3, GL_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RGB32F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA8, 4, UNCOMP_FORMAT, GL_RGBA8, GL_RGBA, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGBA8, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA16, 4, UNCOMP_FORMAT, GL_RGBA16, GL_RGBA, 0, 16, 16, 16, 16, 0, 0, 16 *4, 16 *4, GL_UNSIGNED_SHORT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGBA16, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA16F, 4, UNCOMP_FORMAT, GL_RGBA16F_ARB, GL_RGBA, 0, 16, 16, 16, 16, 0, 0, 16 *4, 16 *4, GL_HALF_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RGBA16F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA32F, 4, UNCOMP_FORMAT, GL_RGBA32F_ARB, GL_RGBA, 0, 32, 32, 32, 32, 0, 0, 32 *4, 32 *4, GL_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RGBA32F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA16I, 4, UNCOMP_FORMAT, GL_RGBA16I, GL_RGBA_INTEGER, 0, 16, 16, 16, 16, 0, 0, 16 *4, 16 *4, GL_SHORT, CLEAR_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGBA16I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA16UI, 4, UNCOMP_FORMAT, GL_RGBA16UI, GL_RGBA_INTEGER, 0, 16, 16, 16, 16, 0, 0, 16 *4, 16 *4, GL_UNSIGNED_SHORT, CLEAR_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGBA16UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB32I, 3, UNCOMP_FORMAT, GL_RGB32I, GL_RGBA_INTEGER, 0, 32, 32, 32, 0, 0, 0, 32 *3, 32 *3, GL_INT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGB32I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB32UI, 3, UNCOMP_FORMAT, GL_RGB32UI, GL_RGBA_INTEGER, 0, 32, 32, 32, 0, 0, 0, 32 *3, 32 *3, GL_UNSIGNED_INT, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGB32UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA32I, 4, UNCOMP_FORMAT, GL_RGBA32I, GL_RGBA_INTEGER, 0, 32, 32, 32, 32, 0, 0, 32 *4, 32 *4, GL_INT, CLEAR_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGBA32I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA32UI, 4, UNCOMP_FORMAT, GL_RGBA32UI, GL_RGBA_INTEGER, 0, 32, 32, 32, 32, 0, 0, 32 *4, 32 *4, GL_UNSIGNED_INT, CLEAR_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGBA32UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (R11G11B10F, 3, UNCOMP_FORMAT, GL_R11F_G11F_B10F_EXT, GL_RGB, 0, 0, 11, 11, 10, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_R11G11B10F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB9E5F, 3, UNCOMP_FORMAT, GL_RGB9_E5_EXT, GL_RGB, 0, 0, 14, 14, 14, 0, 0, 32, 32, GL_FLOAT, OPAQUE_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_RGB9E5F, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB8I, 3, UNCOMP_FORMAT, GL_RGB8I_EXT, GL_RGB_INTEGER, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_BYTE, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGB8I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB8UI, 3, UNCOMP_FORMAT, GL_RGB8UI_EXT, GL_RGB_INTEGER, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGB8UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA8I, 4, UNCOMP_FORMAT, GL_RGBA8I_EXT, GL_RGBA_INTEGER, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_BYTE, CLEAR_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGBA8I, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA8UI, 4, UNCOMP_FORMAT, GL_RGBA8UI_EXT, GL_RGBA_INTEGER, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_UNSIGNED_BYTE, CLEAR_FORMAT, INTEGER_FORMAT, ImageFormat::CODE_RGBA8UI, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB8_SNORM, 3, UNCOMP_FORMAT, GL_RGB8_SNORM, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 32, GL_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB8_SNORM, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA8_SNORM, 4, UNCOMP_FORMAT, GL_RGBA8_SNORM, GL_RGBA, 0, 8, 8, 8, 8, 0, 0, 32, 32, GL_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGBA8_SNORM, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB16_SNORM, 3, UNCOMP_FORMAT, GL_RGB16_SNORM, GL_RGB, 0, 0, 16, 16, 16, 0, 0, 64, 64, GL_SHORT, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGB16_SNORM, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA16_SNORM, 4, UNCOMP_FORMAT, GL_RGBA16_SNORM, GL_RGB, 0, 16, 16, 16, 16, 0, 0, 64, 64, GL_SHORT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_RGBA16_SNORM, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGB_DXT1, 3, COMP_FORMAT, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, OTHER, ImageFormat::CODE_RGB_DXT1, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA_DXT1, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, CLEAR_FORMAT, OTHER, ImageFormat::CODE_RGBA_DXT1, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA_DXT3, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, OTHER, ImageFormat::CODE_RGBA_DXT3, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (RGBA_DXT5, 4, COMP_FORMAT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, OTHER, ImageFormat::CODE_RGBA_DXT5, ImageFormat::COLOR_SPACE_RGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SRGB8, 3, UNCOMP_FORMAT, GL_SRGB8, GL_RGB, 0, 0, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_SRGB8, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SRGBA8, 4, UNCOMP_FORMAT, GL_SRGB8_ALPHA8, GL_RGBA, 0, 8, 8, 8, 8, 0, 0, 32, 24, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_SRGBA8, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SL8, 1, UNCOMP_FORMAT, GL_SLUMINANCE8, GL_LUMINANCE, 8, 0, 0, 0, 0, 0, 0, 8, 8, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_SL8, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SLA8, 2, UNCOMP_FORMAT, GL_SLUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA, 8, 8, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_SLA8, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SRGB_DXT1, 3, COMP_FORMAT, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RGB, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, OTHER, ImageFormat::CODE_SRGB_DXT1, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SRGBA_DXT1, 4, COMP_FORMAT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 64, 64, GL_UNSIGNED_BYTE, CLEAR_FORMAT, OTHER, ImageFormat::CODE_SRGBA_DXT1, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SRGBA_DXT3, 4, COMP_FORMAT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, OTHER, ImageFormat::CODE_SRGBA_DXT3, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (SRGBA_DXT5, 4, COMP_FORMAT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RGBA, 0, 0, 0, 0, 0, 0, 0, 128, 128, GL_UNSIGNED_BYTE, CLEAR_FORMAT, OTHER, ImageFormat::CODE_SRGBA_DXT5, ImageFormat::COLOR_SPACE_SRGB)
 
 DEFINE_TEXTUREFORMAT_METHOD (DEPTH16, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT16_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 16, 0, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_DEPTH16, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (DEPTH24, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT24_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 24, 0, 32, 24, GL_UNSIGNED_INT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_DEPTH24, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (DEPTH32, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 32, 0, 32, 32, GL_UNSIGNED_INT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_DEPTH32, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (DEPTH32F, 1, UNCOMP_FORMAT, GL_DEPTH_COMPONENT32_ARB, GL_DEPTH_COMPONENT, 0, 0, 0, 0, 0, 32, 0, 32, 32, GL_FLOAT, CLEAR_FORMAT, FLOATING_POINT_FORMAT, ImageFormat::CODE_DEPTH32F, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (STENCIL1, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX1_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 1, 1, 1, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_STENCIL1, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (STENCIL4, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX4_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 4, 4, 4, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_STENCIL4, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (STENCIL8, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX8_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 8, 8, 8, GL_UNSIGNED_BYTE, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_STENCIL8, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (STENCIL16, 1, UNCOMP_FORMAT, GL_STENCIL_INDEX16_EXT, GL_STENCIL_INDEX, 0, 0, 0, 0, 0, 0, 16, 16, 16, GL_UNSIGNED_SHORT, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_STENCIL16, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (DEPTH24_STENCIL8, 2, UNCOMP_FORMAT, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL_EXT, 0, 0, 0, 0, 0, 24, 8, 32, 32, GL_UNSIGNED_INT_24_8, CLEAR_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_DEPTH24_STENCIL8, ImageFormat::COLOR_SPACE_NONE)
 
 DEFINE_TEXTUREFORMAT_METHOD (YUV420_PLANAR, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 12, 12, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_YUV420_PLANAR, ImageFormat::COLOR_SPACE_YUV)
 
 DEFINE_TEXTUREFORMAT_METHOD (YUV422, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 16, 16, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_YUV422, ImageFormat::COLOR_SPACE_YUV)
 
 DEFINE_TEXTUREFORMAT_METHOD (YUV444, 3, UNCOMP_FORMAT, GL_NONE, GL_NONE, 0, 0, 0, 0, 0, 0, 0, 24, 24, GL_UNSIGNED_BYTE, OPAQUE_FORMAT, NORMALIZED_FIXED_POINT_FORMAT, ImageFormat::CODE_YUV444, ImageFormat::COLOR_SPACE_YUV)
 
 DECLARE_CONVERT_FUNC (l8_to_rgb8)
 
 DECLARE_CONVERT_FUNC (l32f_to_rgb8)
 
 DECLARE_CONVERT_FUNC (rgb8_to_rgba8)
 
 DECLARE_CONVERT_FUNC (rgb8_to_bgr8)
 
 DECLARE_CONVERT_FUNC (rgb8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (bgr8_to_rgb8)
 
 DECLARE_CONVERT_FUNC (bgr8_to_rgba8)
 
 DECLARE_CONVERT_FUNC (bgr8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (rgba8_to_rgb8)
 
 DECLARE_CONVERT_FUNC (rgba8_to_bgr8)
 
 DECLARE_CONVERT_FUNC (rgba8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (rgb32f_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_rgb8)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_rgba8)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_bgr8)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_rgb32f)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_bayer_rggb8)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_bayer_gbrg8)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_bayer_grbg8)
 
 DECLARE_CONVERT_FUNC (rgba32f_to_bayer_bggr8)
 
 DECLARE_CONVERT_FUNC (bayer_rggb8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (bayer_gbrg8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (bayer_grbg8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (bayer_bggr8_to_rgba32f)
 
 DECLARE_CONVERT_FUNC (rgb8_to_yuv420p)
 
 DECLARE_CONVERT_FUNC (rgb8_to_yuv422)
 
 DECLARE_CONVERT_FUNC (rgb8_to_yuv444)
 
 DECLARE_CONVERT_FUNC (yuv420p_to_rgb8)
 
 DECLARE_CONVERT_FUNC (yuv422_to_rgb8)
 
 DECLARE_CONVERT_FUNC (yuv444_to_rgb8)
 
static ConvertFunc findConverter (TextureFormat::Code sourceCode, TextureFormat::Code destCode, bool needsSourcePadding, bool needsDestPadding, bool needsInvertY)
 
bool conversionAvailable (const ImageFormat *srcFormat, int srcRowPadBits, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY=false)
 
static void l8_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void l32f_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgb8_to_rgba8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgb8_to_bgr8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgb8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bgr8_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bgr8_to_rgba8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bgr8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba8_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba8_to_bgr8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgb32f_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_rgba8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_bgr8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_rgb32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static uint32 blendPixels (uint32 pixel1, uint32 pixel2)
 
static void rgb8_to_yuv420p (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgb8_to_yuv422 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgb8_to_yuv444 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void yuv420p_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void yuv422_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void yuv444_to_rgb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static unorm8 applyFilter (const unorm8 *I, int x, int y, int w, int h, const float filter[5][5])
 
static void swapRedAndBlue (int N, Color3unorm8 *out)
 
static void rgb8_to_bayer_rggb8 (const int w, const int h, const unorm8 *src, unorm8 *dst)
 
static void rgb8_to_bayer_grbg8 (const int w, const int h, const unorm8 *src, unorm8 *dst)
 
static void rgb8_to_bayer_bggr8 (const int w, const int h, const unorm8 *src, unorm8 *dst)
 
static void rgb8_to_bayer_gbrg8 (const int w, const int h, const unorm8 *src, unorm8 *dst)
 
static void rgba32f_to_bayer_rggb8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_bayer_gbrg8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_bayer_grbg8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void rgba32f_to_bayer_bggr8 (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bayer_rggb8_to_rgb8_mhc (int w, int h, const unorm8 *in, unorm8 *_out)
 
static void bayer_gbrg8_to_rgb8_mhc (int w, int h, const unorm8 *in, unorm8 *_out)
 
static void bayer_grbg8_to_rgb8_mhc (int w, int h, const unorm8 *in, unorm8 *_out)
 
static void bayer_bggr8_to_rgb8_mhc (int w, int h, const unorm8 *in, unorm8 *_out)
 
static void bayer_rggb8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bayer_gbrg8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bayer_grbg8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static void bayer_bggr8_to_rgba32f (const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
 
static double pythag (double a, double b)
 
Matrix3 operator* (double fScalar, const Matrix3 &rkMatrix)
 
Matrix3 operator* (float fScalar, const Matrix3 &rkMatrix)
 
Matrix3 operator* (int fScalar, const Matrix3 &rkMatrix)
 
static void assignEdgeIndex (MeshAlg::Face &face, int e)
 
static void logSocketInfo (const SOCKET &sock)
 
static int selectOneReadSocket (const SOCKET &sock)
 
static bool readWaiting (const SOCKET &sock)
 
static int selectOneWriteSocket (const SOCKET &sock)
 
const char * errnoToString ()
 
static void increaseBufferSize (SOCKET sock)
 
static int textPrompt (const char *windowTitle, const char *prompt, const char **choice, int numChoices)
 
static bool iswspace (int ch)
 
static bool checkForCPUID ()
 
static void getG3DVersion (std::string &s)
 
static G3DEndian checkEndian ()
 
static std::string computeAppName (const std::string &start)
 
void initMem ()
 
static void var (TextOutput &t, const std::string &name, const std::string &val)
 
static void var (TextOutput &t, const std::string &name, const bool val)
 
static void var (TextOutput &t, const std::string &name, const int val)
 
static void toUpper (Set< std::string > &set)
 
static const char * tokenTypeToString (Token::Type t)
 
static std::string escape (const std::string &string)
 
static void addAndCarry (const uint64 &_a, const uint64 &_b, uint64 &carry, uint64 &result)
 
void multiplyAndCarry (const uint64 &_a, const uint64 &_b, uint64 &carry, uint64 &result)
 
double frand ()
 
static bool atClose (TextInput &t, const std::string name)
 

Variables

const bool DONT_SHRINK_UNDERLYING_ARRAY = false
 
const int SORT_INCREASING = 1
 
const int SORT_DECREASING = -1
 
const char * NEWLINE = "\n"
 
 unorm16
 
 unorm8
 
 Vector2int16
 
G3D::int16 x
 
G3D::int16 y
 
 Vector2int32
 
 Vector2unorm16
 
 Vector3int16
 
G3D::int16 z
 
 Vector3int32
 
static FileSystemcommon = NULL
 
static Set< std::string > _filesUsed
 
static const std::string nameArray [ImageFormat::CODE_NUM]
 
static const bool OPAQUE_FORMAT = true
 
static const bool CLEAR_FORMAT = false
 
static const bool COMP_FORMAT = true
 
static const bool UNCOMP_FORMAT = false
 
static const int NUM_CONVERT_IMAGE_FORMATS = 5
 
static const ConvertAttributes sConvertMappings []
 
static const float G_GRR [5][5]
 
static const float G_BGB [5][5]
 
static const float R_GRG [5][5]
 
static const float R_BGG [5][5]
 
static const float R_BGB [5][5]
 
static Table< std::string,
std::string > 
lastFound
 
static Array< std::string > directoryArray
 
static BufferPoolbufferpool = NULL
 

Detailed Description

This is the main Class to manage loading and unloading of maps, line of sight, height calculation and so on. For each map or map tile to load it reads a directory file that contains the ModelContainer files used by this map or map tile. Each global map or instance has its own dynamic BSP-Tree. The loaded ModelContainers are included in one of these BSP-Trees. Additionally a table to match map ids and map names is used.

Typedef Documentation

typedef bool(* G3D::AssertionHook)(const char *_expression, const std::string &message, const char *filename, int lineNumber, bool useGuiPrompt)

Radiance * measure(Solid Angle) between two points, measured at the receiver orthogonal to the axis between them; W/m^2

typedef void(* G3D::ConsolePrintHook)(const std::string &)
typedef void(* G3D::ConvertFunc)(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)

Force * distance; J

typedef float G3D::float32
typedef double G3D::float64
typedef double G3D::GameTime
Deprecated:
use SimTime
typedef shared_ptr<class GThread> G3D::GThreadRef
typedef shared_ptr<class Image1> G3D::Image1Ref
typedef shared_ptr<class Image3> G3D::Image3Ref
typedef shared_ptr<class Image4> G3D::Image4Ref
typedef int8_t G3D::int8

Incident power per area; W/m^2

typedef unsigned char G3D::md5_byte_t
typedef unsigned int G3D::md5_word_t
typedef shared_ptr<class NetListener> G3D::NetListenerRef

Points are technically distinct mathematical entities from vectors. Actually distinguishing them at the class level tends to add lots of boilerplate (e.g., (P - Point3::zero()).direction() vs. P.direction()), so many programmers prefer use a single class, as GLSL does.

G3D provides this typedef as a way of documenting arguments that are locations in space and not directions. Beware that points and vectors are interchangable from the compiler's point of view, and that the programmer must track which is really which.

Energy per time; W

Power per (measure(SolidAngle) * measure(Area)); W / (m^2 sr)

Power per area; J / m^2

typedef double G3D::RealTime

Actual wall clock time in seconds (Unix time).

typedef shared_ptr<class ReliableConduit> G3D::ReliableConduitRef
typedef double G3D::SimTime

Time, in seconds.

Because it is hard to remember the proper capitalization.

Enumeration Type Documentation

anonymous enum
Deprecated:
Enumerator
SECOND 
MINUTE 
HOUR 
DAY 
SUNRISE 
SUNSET 
MIDNIGHT 
METER 
KILOMETER 
32 {SECOND=1, MINUTE=60, HOUR = 60*60, DAY=24*60*60, SUNRISE=24*60*60/4, SUNSET=24*60*60*3/4, MIDNIGHT=0, METER=1, KILOMETER=1000};
Definition: G3DGameUnits.h:32
Definition: G3DGameUnits.h:32
Definition: Common.h:98
Definition: G3DGameUnits.h:32
Definition: Common.h:97
Definition: G3DGameUnits.h:32
Definition: Common.h:99
Definition: G3DGameUnits.h:32
Definition: G3DGameUnits.h:32
enum G3D::AMPM
Enumerator
AM 
PM 
29 {AM, PM};
Definition: G3DGameUnits.h:29
Definition: G3DGameUnits.h:29

Some values like float16 and int128 have no current CPU data structure that implements them but are useful for file formats and for GPUs.

CHUNK_BINFMT data follows the protocol.

Enumerator
FIRST_BINFMT 
BOOL8_BINFMT 
UINT8_BINFMT 
INT8_BINFMT 
UINT16_BINFMT 
INT16_BINFMT 
UINT32_BINFMT 
INT32_BINFMT 
UINT64_BINFMT 
INT64_BINFMT 
UINT128_BINFMT 
INT128_BINFMT 
FLOAT16_BINFMT 
FLOAT32_BINFMT 
FLOAT64_BINFMT 
VECTOR2_BINFMT 
VECTOR2INT16_BINFMT 
VECTOR3_BINFMT 
VECTOR3INT16_BINFMT 
VECTOR4_BINFMT 
VECTOR4INT16_BINFMT 
COLOR3_BINFMT 
COLOR3UINT8_BINFMT 
COLOR3INT16_BINFMT 
COLOR4_BINFMT 
COLOR4UINT8_BINFMT 
COLOR4INT16_BINFMT 
STRING_BINFMT 
STRINGEVEN_BINFMT 
STRING8_BINFMT 
STRING16_BINFMT 
STRING32_BINFMT 
CHUNK_BINFMT 
CUSTOM_BINFMT 
LAST_BINFMT 
39  {
40  FIRST_BINFMT = 1000,
41 
51 
53 
55 
57 };
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:48
Definition: BinaryFormat.h:47
Definition: BinaryFormat.h:47
Definition: BinaryFormat.h:44
Definition: BinaryFormat.h:48
Definition: BinaryFormat.h:50
Definition: BinaryFormat.h:50
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:46
Definition: BinaryFormat.h:44
Definition: BinaryFormat.h:44
Definition: BinaryFormat.h:48
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:50
Definition: BinaryFormat.h:40
Definition: BinaryFormat.h:50
Definition: BinaryFormat.h:46
Definition: BinaryFormat.h:49
Definition: BinaryFormat.h:45
Definition: BinaryFormat.h:56
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:54
Definition: BinaryFormat.h:49
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:45
Definition: BinaryFormat.h:50
Definition: BinaryFormat.h:49
Definition: BinaryFormat.h:52
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:42

The order in which the bytes of an integer are stored on a machine.

Intel/AMD chips tend to be G3D_LITTLE_ENDIAN, Mac PPC's and Suns are G3D_BIG_ENDIAN. However, this is primarily used to specify the byte order of file formats, which are fixed.

Enumerator
G3D_BIG_ENDIAN 
G3D_LITTLE_ENDIAN 
48  {
51 };
Definition: System.h:49
Definition: System.h:50
Enumerator
USE_NEW_THREAD 
USE_CURRENT_THREAD 
Definition: SpawnBehavior.h:4
Definition: SpawnBehavior.h:4

Function Documentation

template<class Class >
void G3D::_internal_runConcurrently2DHelper ( const Vector2int32 start,
const Vector2int32 upTo,
Class *  object,
void(Class::*)(int x, int y)  method1,
void(Class::*)(int x, int y, int threadID)  method2,
int  maxThreads 
)
246  {
247 
248  // Create a group of threads
249  if (maxThreads == GThread::NUM_CORES) {
250  maxThreads = GThread::numCores();
251  }
252 
253  const int numRows = upTo.y - start.y;
254  const int numThreads = min(maxThreads, numRows);
255  const Vector2int32 stride(1, numThreads);
256  ThreadSet threadSet;
257  for (int t = 0; t < numThreads; ++t) {
258  threadSet.insert(shared_ptr<_internalGThreadWorker<Class> >(new _internalGThreadWorker<Class>(t, start + Vector2int32(0, t), upTo, object, method1, method2, stride)));
259  }
260 
261  // Run the threads, reusing the current thread and blocking until
262  // all complete
263  threadSet.start(USE_CURRENT_THREAD);
264  threadSet.waitForCompletion();
265  }
T min(const T &x, const T &y)
Definition: g3dmath.h:305
Vector2int32
Definition: Vector2int32.h:27
Definition: SpawnBehavior.h:4

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Vector2 G3D::abs ( const Vector2 &  v)
inline
72  {
73  return Vector2(::fabsf(v.x), ::fabsf(v.y));
74 }
Vector3 G3D::abs ( const Vector3 &  v)
inline
76  {
77  return Vector3(::fabsf(v.x), ::fabsf(v.y), ::fabsf(v.z));
78 }
Vector4 G3D::abs ( const Vector4 &  v)
inline
80  {
81  return Vector4(::fabsf(v.x), ::fabsf(v.y), ::fabsf(v.z), ::fabsf(v.w));
82 }
double G3D::abs ( double  fValue)
inline
617  {
618  return double(::fabs(fValue));
619 }

+ Here is the caller graph for this function:

double G3D::aCos ( double  fValue)
inline
622  {
623  if ( -1.0 < fValue ) {
624  if ( fValue < 1.0 )
625  return double(::acos(fValue));
626  else
627  return 0.0;
628  } else {
629  return pi();
630  }
631 }
double pi()
Definition: g3dmath.h:147
float acos(float fValue)
Definition: g3dmath.h:633

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::acos ( float  fValue)
inline
633  {
634  if ( -1.0f < fValue ) {
635  if ( fValue < 1.0f ) {
636  return ::acos(fValue);
637  } else {
638  return 0.0f;
639  }
640  } else {
641  return pif();
642  }
643 }
float acos(float fValue)
Definition: g3dmath.h:633
float pif()
Definition: g3dmath.h:151

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::addAndCarry ( const uint64 _a,
const uint64 _b,
uint64 carry,
uint64 result 
)
static

Adds two 64-bit integers, placing the result and the overflow into 64-bit integers.

16  {
17 
18  // Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros.
19  // This eliminates the need to and with 0xFFFFFFFF.
20  uint32 a [2] = {static_cast<uint32>(_a & 0xFFFFFFFF), static_cast<uint32>(_a >> 32)};
21  uint32 b [2] = {static_cast<uint32>(_b & 0xFFFFFFFF), static_cast<uint32>(_b >> 32)};
22 
23  uint64 tmp = uint64(a[0]) + b[0];
24 
25  result = tmp & 0xFFFFFFFF;
26  uint32 c = tmp >> 32;
27 
28  tmp = uint64(c) + a[1] + b[1];
29  result += tmp << 32;
30  carry = (tmp >> 32);
31 }
uint64_t uint64
Definition: g3dmath.h:170
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149

+ Here is the caller graph for this function:

bool G3D::all ( const Vector2 &  v)
inline
84  {
85  return (v.x != 0) && (v.y != 0);
86 }
bool G3D::all ( const Vector3 &  v)
inline
88  {
89  return (v.x != 0) && (v.y != 0) && (v.z != 0);
90 }
bool G3D::all ( const Vector4 &  v)
inline
92  {
93  return (v.x != 0) && (v.y != 0) && (v.z != 0) && (v.w != 0);
94 }
bool G3D::all ( float  x)
inline

Returns true if x is not exactly equal to 0.0f.

431  {
432  return x != 0;
433 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

bool G3D::any ( const Vector2 &  v)
inline
96  {
97  return (v.x != 0) || (v.y != 0);
98 }
bool G3D::any ( const Vector3 &  v)
inline
100  {
101  return (v.x != 0) || (v.y != 0) || (v.z != 0);
102 }
bool G3D::any ( const Vector4 &  v)
inline
104  {
105  return (v.x != 0) || (v.y != 0) || (v.z != 0) || (v.w != 0);
106 }
bool G3D::any ( float  x)
inline

Returns true if x is not exactly equal to 0.0f.

424  {
425  return x != 0;
426 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static unorm8 G3D::applyFilter ( const unorm8 *  I,
int  x,
int  y,
int  w,
int  h,
const float  filter[5][5] 
)
static

Applies a 5x5 filter to monochrome image I (wrapping at the boundaries)

807  {
808 
809  debugAssert(isEven(w));
810  debugAssert(isEven(h));
811 
812  float sum = 0.0f;
813  float denom = 0.0f;
814 
815  for (int dy = 0; dy < 5; ++dy) {
816  int offset = ((y + dy + h - 2) % h) * w;
817 
818  for (int dx = 0; dx < 5; ++dx) {
819  float f = filter[dy][dx];
820  sum += f * (float)I[((x + dx + w - 2) % w) + offset];
821  denom += f;
822  }
823  }
824 
825  return unorm8(sum / denom);
826 }
unorm8
Definition: unorm8.h:33
#define I(x, y, z)
#define debugAssert(exp)
Definition: debugAssert.h:160
G3D::int16 y
Definition: Vector2int16.h:38
bool isEven(int num)
Definition: g3dmath.h:794
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::aSin ( double  fValue)
inline
646  {
647  if ( -1.0 < fValue ) {
648  if ( fValue < 1.0 ) {
649  return double(::asin(fValue));
650  } else {
651  return -halfPi();
652  }
653  } else {
654  return halfPi();
655  }
656 }
double halfPi()
Definition: g3dmath.h:155

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AssertionHook G3D::assertionHook ( )
311  {
313 }
AssertionHook _debugHook
Definition: debugAssert.cpp:36
static void G3D::assignEdgeIndex ( MeshAlg::Face &  face,
int  e 
)
static

Assigns the edge index into the next unassigned edge index. The edge index may be negative, indicating a reverse edge.

156  {
157  for (int i = 0; i < 3; ++i) {
158  if (face.edgeIndex[i] == MeshAlg::Face::NONE) {
159  face.edgeIndex[i] = e;
160  return;
161  }
162  }
163 
164  debugAssertM(false, "Face has already been assigned 3 edges");
165 }
#define debugAssertM(exp, message)
Definition: debugAssert.h:161

+ Here is the caller graph for this function:

double G3D::aTan ( double  fValue)
inline
659  {
660  return double(::atan(fValue));
661 }
double G3D::aTan2 ( double  fY,
double  fX 
)
inline
664  {
665  return double(::atan2(fY, fX));
666 }

+ Here is the caller graph for this function:

static bool G3D::atClose ( TextInput &  t,
const std::string  name 
)
static

True if the next token begins the close tag

98  {
99  if ((t.peek().type() == Token::SYMBOL) && (t.peek().string() == "<")) {
100  // Need to keep looking ahead
101  Token p0 = t.read();
102  if ((t.peek().type() == Token::SYMBOL) && (t.peek().string() == "/")) {
103  // Check the name on the close tag. It *must* match if
104  // this is a well-formed document, but there might be a
105  // tag error.
106  Token p1 = t.read();
107  Token p2 = t.peek();
108  std::string s = p2.string();
109  debugAssertM(beginsWith(name, s), "Mismatched close tag");
110 
111  // Put the tokens back
112  t.push(p1);
113  t.push(p0);
114  return true;
115  } else {
116  // Put the read token back
117  t.push(p0);
118  return false;
119  }
120  } else {
121  return false;
122  }
123 }
bool beginsWith(const std::string &test, const std::string &pattern)
Returns true if the test string begins with the pattern string.
Definition: stringutils.cpp:81
#define debugAssertM(exp, message)
Definition: debugAssert.h:161

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::bayer_bggr8_to_rgb8_mhc ( int  w,
int  h,
const unorm8 *  in,
unorm8 *  _out 
)
static
1135  {
1136  // Run the equivalent function for red
1137  bayer_rggb8_to_rgb8_mhc(w, h, in, _out);
1138 
1139  // Now swap red and blue
1140  swapRedAndBlue(w * h, (Color3unorm8*)_out);
1141 }
static void swapRedAndBlue(int N, Color3unorm8 *out)
Definition: ImageFormat_convert.cpp:829
static void bayer_rggb8_to_rgb8_mhc(int w, int h, const unorm8 *in, unorm8 *_out)
Definition: ImageFormat_convert.cpp:1037

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::bayer_bggr8_to_rgba32f ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
1176  {
1177  Array<void*> tmp;
1178  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1179 
1180  bayer_bggr8_to_rgb8_mhc(srcWidth, srcHeight, static_cast<const unorm8*>(srcBytes[0]), static_cast<unorm8*>(tmp[0]));
1181  rgb8_to_rgba32f(reinterpret_cast<Array<const void*>&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg);
1182 
1183  System::free(tmp[0]);
1184 }
static void bayer_bggr8_to_rgb8_mhc(int w, int h, const unorm8 *in, unorm8 *_out)
Definition: ImageFormat_convert.cpp:1134
static void rgb8_to_rgba32f(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
Definition: ImageFormat_convert.cpp:282

+ Here is the call graph for this function:

static void G3D::bayer_gbrg8_to_rgb8_mhc ( int  w,
int  h,
const unorm8 *  in,
unorm8 *  _out 
)
static
1092  {
1093 
1094  debugAssert(in != _out);
1095 
1096  Color3unorm8* out = (Color3unorm8*)_out;
1097 
1098  for (int y = 0; y < h; ++y) {
1099 
1100  // Row beginning in the input array.
1101  int offset = y * w;
1102 
1103  // GB row
1104  for (int x = 0; x < w; ++x, ++out) {
1105  // G pixel
1106  {
1107  out->r = applyFilter(in, x, y, w, h, R_BGG);
1108  out->g = in[x + offset];
1109  out->b = applyFilter(in, x, y, w, h, B_BGG);
1110  }
1111  ++x; ++out;
1112 
1113  // B pixel
1114  {
1115  out->r = applyFilter(in, x, y, w, h, R_BGB);
1116  out->g = applyFilter(in, x, y, w, h, G_BGB);
1117  out->b = in[x + offset];
1118  }
1119  }
1120  }
1121 }
static const float R_BGG[5][5]
Definition: ImageFormat_convert.cpp:774
static unorm8 applyFilter(const unorm8 *I, int x, int y, int w, int h, const float filter[5][5])
Definition: ImageFormat_convert.cpp:802
static const float G_BGB[5][5]
Definition: ImageFormat_convert.cpp:757
static const float R_BGB[5][5]
Definition: ImageFormat_convert.cpp:781
#define debugAssert(exp)
Definition: debugAssert.h:160
G3D::int16 y
Definition: Vector2int16.h:38
#define B_BGG
Definition: ImageFormat_convert.cpp:792
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::bayer_gbrg8_to_rgba32f ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
1156  {
1157  Array<void*> tmp;
1158  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1159 
1160  bayer_grbg8_to_rgb8_mhc(srcWidth, srcHeight, static_cast<const unorm8*>(srcBytes[0]), static_cast<unorm8*>(tmp[0]));
1161  rgb8_to_rgba32f(reinterpret_cast<Array<const void*>&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg);
1162 
1163  System::free(tmp[0]);
1164 }
static void bayer_grbg8_to_rgb8_mhc(int w, int h, const unorm8 *in, unorm8 *_out)
Definition: ImageFormat_convert.cpp:1124
static void rgb8_to_rgba32f(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
Definition: ImageFormat_convert.cpp:282

+ Here is the call graph for this function:

static void G3D::bayer_grbg8_to_rgb8_mhc ( int  w,
int  h,
const unorm8 *  in,
unorm8 *  _out 
)
static
1125  {
1126  // Run the equivalent function for red
1127  bayer_gbrg8_to_rgb8_mhc(w, h, in, _out);
1128 
1129  // Now swap red and blue
1130  swapRedAndBlue(w * h, (Color3unorm8*)_out);
1131 }
static void bayer_gbrg8_to_rgb8_mhc(int w, int h, const unorm8 *in, unorm8 *_out)
Definition: ImageFormat_convert.cpp:1091
static void swapRedAndBlue(int N, Color3unorm8 *out)
Definition: ImageFormat_convert.cpp:829

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::bayer_grbg8_to_rgba32f ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
1166  {
1167  Array<void*> tmp;
1168  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1169 
1170  bayer_gbrg8_to_rgb8_mhc(srcWidth, srcHeight, static_cast<const unorm8*>(srcBytes[0]), static_cast<unorm8*>(tmp[0]));
1171  rgb8_to_rgba32f(reinterpret_cast<Array<const void*>&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg);
1172 
1173  System::free(tmp[0]);
1174 }
static void rgb8_to_rgba32f(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
Definition: ImageFormat_convert.cpp:282
static void bayer_gbrg8_to_rgb8_mhc(int w, int h, const unorm8 *in, unorm8 *_out)
Definition: ImageFormat_convert.cpp:1091

+ Here is the call graph for this function:

static void G3D::bayer_rggb8_to_rgb8_mhc ( int  w,
int  h,
const unorm8 *  in,
unorm8 *  _out 
)
static
1038  {
1039  debugAssert(in != _out);
1040 
1041  Color3unorm8* out = (Color3unorm8*)_out;
1042 
1043  for (int y = 0; y < h; ++y) {
1044 
1045  // Row beginning in the input array.
1046  int offset = y * w;
1047 
1048  // RG row
1049  for (int x = 0; x < w; ++x, ++out) {
1050  // R pixel
1051  {
1052  out->r = in[x + offset];
1053  out->g = applyFilter(in, x, y, w, h, G_GRR);
1054  out->b = applyFilter(in, x, y, w, h, B_GRR);
1055  }
1056  ++x; ++out;
1057 
1058  // G pixel
1059  {
1060  out->r = applyFilter(in, x, y, w, h, R_GRG);
1061  out->g = in[x + offset];
1062  out->b = applyFilter(in, x, y, w, h, B_GRG);
1063  }
1064  }
1065 
1066  ++y;
1067  offset += w;
1068 
1069  // GB row
1070  for (int x = 0; x < w; ++x, ++out) {
1071  // G pixel
1072  {
1073  out->r = applyFilter(in, x, y, w, h, R_BGG);
1074  out->g = in[x + offset];
1075  out->b = applyFilter(in, x, y, w, h, B_BGG);
1076  }
1077  ++x; ++out;
1078 
1079  // B pixel
1080  {
1081  out->r = applyFilter(in, x, y, w, h, R_BGB);
1082  out->g = applyFilter(in, x, y, w, h, G_BGB);
1083  out->b = in[x + offset];
1084  }
1085  }
1086  }
1087 }
static const float R_BGG[5][5]
Definition: ImageFormat_convert.cpp:774
static unorm8 applyFilter(const unorm8 *I, int x, int y, int w, int h, const float filter[5][5])
Definition: ImageFormat_convert.cpp:802
static const float G_BGB[5][5]
Definition: ImageFormat_convert.cpp:757
static const float R_BGB[5][5]
Definition: ImageFormat_convert.cpp:781
#define debugAssert(exp)
Definition: debugAssert.h:160
G3D::int16 y
Definition: Vector2int16.h:38
static const float R_GRG[5][5]
Definition: ImageFormat_convert.cpp:767
#define B_GRR
Definition: ImageFormat_convert.cpp:794
#define B_GRG
Definition: ImageFormat_convert.cpp:793
#define B_BGG
Definition: ImageFormat_convert.cpp:792
G3D::int16 x
Definition: Vector2int16.h:37
static const float G_GRR[5][5]
Definition: ImageFormat_convert.cpp:750

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::bayer_rggb8_to_rgba32f ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
1146  {
1147  Array<void*> tmp;
1148  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1149 
1150  bayer_rggb8_to_rgb8_mhc(srcWidth, srcHeight, static_cast<const unorm8*>(srcBytes[0]), static_cast<unorm8*>(tmp[0]));
1151  rgb8_to_rgba32f(reinterpret_cast<Array<const void*>&>(tmp), srcWidth, srcHeight, ImageFormat::RGB8(), 0, dstBytes, ImageFormat::RGBA32F(), 0, invertY, bayerAlg);
1152 
1153  System::free(tmp[0]);
1154 }
static void rgb8_to_rgba32f(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
Definition: ImageFormat_convert.cpp:282
static void bayer_rggb8_to_rgb8_mhc(int w, int h, const unorm8 *in, unorm8 *_out)
Definition: ImageFormat_convert.cpp:1037

+ Here is the call graph for this function:

bool G3D::beginsWith ( const std::string &  test,
const std::string &  pattern 
)

Returns true if the test string begins with the pattern string.

83  {
84 
85  if (test.size() >= pattern.size()) {
86  for (int i = 0; i < (int)pattern.size(); ++i) {
87  if (pattern[i] != test[i]) {
88  return false;
89  }
90  }
91  return true;
92  } else {
93  return false;
94  }
95 }

+ Here is the caller graph for this function:

static void G3D::bgr8_to_rgb8 ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
304  {
305  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
306  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
307  for (int y = 0; y < srcHeight; ++y) {
308  for (int x = 0; x < srcWidth; ++x) {
309  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
310  int i3 = i * 3;
311  dst[i3 + 0] = src[i3 + 2];
312  dst[i3 + 1] = src[i3 + 1];
313  dst[i3 + 2] = src[i3 + 0];
314  }
315  }
316 }
unorm8
Definition: unorm8.h:33
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::bgr8_to_rgba32f ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
335  {
336  debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format");
337 
338  int dstIndex = 0;
339  int srcByteOffset = 0;
340  int srcRowPadBytes = srcRowPadBits / 8;
341  Color4* dst = static_cast<Color4*>(dstBytes[0]);
342  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
343 
344  for (int y = 0; y < srcHeight; ++y) {
345  if (invertY) {
346  dstIndex = srcWidth * (srcHeight - 1 - y);
347  }
348 
349  for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3) {
350  const Color3unorm8& s = *reinterpret_cast<const Color3unorm8*>(src + srcByteOffset);
351  dst[dstIndex] = Color4(Color3(s).bgr(), 1.0f);
352  }
353  srcByteOffset += srcRowPadBytes;
354  }
355 }
unorm8
Definition: unorm8.h:33
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::bgr8_to_rgba8 ( const Array< const void * > &  srcBytes,
int  srcWidth,
int  srcHeight,
const ImageFormat *  srcFormat,
int  srcRowPadBits,
const Array< void * > &  dstBytes,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY,
ImageFormat::BayerAlgorithm  bayerAlg 
)
static
318  {
319  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
320  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
321  for (int y = 0; y < srcHeight; ++y) {
322  for (int x = 0; x < srcWidth; ++x) {
323  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
324  int i3 = i * 3;
325  int i4 = i3 + i;
326 
327  dst[i4 + 0] = src[i3 + 2];
328  dst[i4 + 1] = src[i3 + 1];
329  dst[i4 + 2] = src[i3 + 0];
330  dst[i4 + 3] = unorm8::one();
331  }
332  }
333 }
unorm8
Definition: unorm8.h:33
static unorm16 one()
Definition: unorm16.h:78
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

uint8 G3D::bits ( ) const

Returns the underlying bits in this representation. Equivalent to:

uint16 i = reinterpret_cast<const uint16&>(u);
uint8 i = reinterpret_cast<const uint8&>(u);
89  {
90  return m_bits;
91  }

+ Here is the caller graph for this function:

static uint32 G3D::blendPixels ( uint32  pixel1,
uint32  pixel2 
)
static
533  {
534  static const uint32 rbMask = 0x00FF00FF;
535  static const uint32 agMask = 0xFF00FF00;
536 
537  // Compute two color channels at a time. Use >> 1 for fast division by two
538  // Using alternating color channels prevents overflow
539  const uint32 rb = ((pixel1 & rbMask) + (pixel2 & rbMask)) >> 1;
540 
541  // Shift first to avoid overflow in alpha channel
542  const uint32 ag = (((pixel1 & agMask) >> 1) + ((pixel2 & agMask) >> 1));
543 
544  return ((rb & rbMask) | (ag & agMask));
545 }
uint32_t uint32
Definition: Define.h:150

+ Here is the caller graph for this function:

int32 G3D::byteSize ( BinaryFormat  f)

Returns -1 if the format is custom, otherwise the byte size of a single element in this format.

13  {
14  switch (f) {
15  case BOOL8_BINFMT:
16  case UINT8_BINFMT:
17  case INT8_BINFMT:
18  return 1;
19 
20  case UINT16_BINFMT:
21  case INT16_BINFMT:
22  return 2;
23 
24  case FLOAT16_BINFMT:
25  return 2;
26 
27  case UINT32_BINFMT:
28  case INT32_BINFMT:
29  case FLOAT32_BINFMT:
30  return 4;
31 
32  case FLOAT64_BINFMT:
33  case UINT64_BINFMT:
34  case INT64_BINFMT:
35  return 8;
36 
37  case INT128_BINFMT:
38  case UINT128_BINFMT:
39  return 16;
40 
41  case VECTOR2_BINFMT:
42  return 2 * 4;
43 
45  return 2 * 2;
46 
47  case VECTOR3_BINFMT:
48  return 3 * 4;
49 
51  return 3 * 2;
52 
53  case VECTOR4_BINFMT:
54  return 4 * 4;
55 
57  return 4 * 4;
58 
59  case COLOR3_BINFMT:
60  return 3 * 4;
61 
62  case COLOR3UINT8_BINFMT:
63  return 3 * 1;
64 
65  case COLOR3INT16_BINFMT:
66  return 3 * 2;
67 
68  case COLOR4_BINFMT:
69  return 4 * 4;
70 
71  case COLOR4UINT8_BINFMT:
72  return 4 * 1;
73 
74  case COLOR4INT16_BINFMT:
75  return 4 * 2;
76 
77  default:
78  return -1;
79  }
80 }
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:48
Definition: BinaryFormat.h:47
Definition: BinaryFormat.h:47
Definition: BinaryFormat.h:44
Definition: BinaryFormat.h:48
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:46
Definition: BinaryFormat.h:44
Definition: BinaryFormat.h:44
Definition: BinaryFormat.h:48
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:46
Definition: BinaryFormat.h:49
Definition: BinaryFormat.h:45
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:49
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:45
Definition: BinaryFormat.h:49
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:43
Definition: BinaryFormat.h:42
Vector3int16 Vector3int16::ceil ( const Vector3 &  v)
static
55  {
56  return Vector3int16(iCeil(v.x), iCeil(v.y), iCeil(v.z));
57 }
Vector3int16
Definition: Vector3int16.h:35
int iCeil(double fValue)
Definition: g3dmath.h:539

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::ceilPow2 ( unsigned int  in)
inline

Return the next power of 2 higher than the input If the input is already a power of 2, the output will be the same as the input.

764  {
765  in -= 1;
766 
767  in |= in >> 16;
768  in |= in >> 8;
769  in |= in >> 4;
770  in |= in >> 2;
771  in |= in >> 1;
772 
773  return in + 1;
774 }
static G3DEndian G3D::checkEndian ( )
static

Called from init

536  {
537  int32 a = 1;
538  if (*(uint8*)&a == 1) {
539  return G3D_LITTLE_ENDIAN;
540  } else {
541  return G3D_BIG_ENDIAN;
542  }
543 }
Definition: System.h:49
int32_t int32
Definition: Define.h:146
Definition: System.h:50
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

static bool G3D::checkForCPUID ( )
static

Checks if the CPUID command is available on the processor (called from init)

546  {
547  // all known supported architectures have cpuid
548  // add cases for incompatible architectures if they are added
549  // e.g., if we ever support __powerpc__ being defined again
550 
551  return true;
552 }

+ Here is the caller graph for this function:

Vector2int32 G3D::clamp ( const Vector2int32 lo,
const Vector2int32 hi 
)
Vector2 G3D::clamp ( const Vector2 &  v,
const Vector2 &  a,
const Vector2 &  b 
)
inline
108  {
109  return v.clamp(a, b);
110 }

+ Here is the call graph for this function:

Vector3 G3D::clamp ( const Vector3 &  v,
const Vector3 &  a,
const Vector3 &  b 
)
inline
112  {
113  return v.clamp(a, b);
114 }

+ Here is the call graph for this function:

Vector2int16 G3D::clamp ( const Vector2int16 lo,
const Vector2int16 hi 
)
Vector4 G3D::clamp ( const Vector4 &  v,
const Vector4 &  a,
const Vector4 &  b 
)
inline
116  {
117  return v.clamp(a, b);
118 }

+ Here is the call graph for this function:

double G3D::clamp ( double  val,
double  low,
double  hi 
)
inline
571  {
572  debugAssert(low <= hi);
573  if (val <= low) {
574  return low;
575  } else if (val >= hi) {
576  return hi;
577  } else {
578  return val;
579  }
580 }
#define debugAssert(exp)
Definition: debugAssert.h:160

+ Here is the caller graph for this function:

float G3D::clamp ( float  val,
float  low,
float  hi 
)
inline
582  {
583  debugAssert(low <= hi);
584  if (val <= low) {
585  return low;
586  } else if (val >= hi) {
587  return hi;
588  } else {
589  return val;
590  }
591 }
#define debugAssert(exp)
Definition: debugAssert.h:160
static std::string G3D::computeAppName ( const std::string &  start)
static

Removes the 'd' that icompile / Morgan's VC convention appends.

712  {
713  if (start.size() < 2) {
714  return start;
715  }
716 
717  if (start[start.size() - 1] == 'd') {
718  // Maybe remove the 'd'; see if ../ or ../../ has the same name
719  char tmp[1024];
720  (void)getcwd(tmp, sizeof(tmp));
721  std::string drive, base, ext;
722  Array<std::string> path;
723  parseFilename(tmp, drive, path, base, ext);
724 
725  std::string shortName = start.substr(0, start.size() - 1);
726 
727  if ((path.size() > 1) && (toLower(path.last()) == toLower(shortName))) {
728  return shortName;
729  }
730 
731  if ((path.size() > 2) && (toLower(path[path.size() - 2]) == toLower(shortName))) {
732  return shortName;
733  }
734  }
735 
736  return start;
737 }
std::string toLower(const std::string &x)
Definition: stringutils.cpp:223
void parseFilename(const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext)
Definition: fileutils.cpp:457

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string G3D::consolePrint ( const std::string &  s)
365  {
366  FILE* L = Log::common()->getFile();
367  fprintf(L, "%s", s.c_str());
368 
369  if (consolePrintHook()) {
370  consolePrintHook()(s);
371  }
372 
373  fflush(L);
374  return s;
375 }
ConsolePrintHook consolePrintHook()
Definition: debugAssert.cpp:328
FMT_API int fprintf(std::FILE *f, CStringRef format, ArgList args)
static FileSystem * common
Definition: FileSystem.cpp:45

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string __cdecl G3D::consolePrintf ( const char *  fmt...)

Sends output to the log and to the last GConsole instantiated.

Guarantees that the output has been flushed by the time the routine returns.

See also
G3D::logPrintf, G3D::screenPrintf
Returns
The string that was printed
378  {
379  va_list argList;
380  va_start(argList, fmt);
381  std::string s = G3D::vformat(fmt, argList);
382  va_end(argList);
383 
384  return consolePrint(s);
385 }
std::string vformat(const char *fmt, va_list argPtr) G3D_CHECK_VPRINTF_ARGS
Definition: format.cpp:122
Definition: format.h:285
std::string consolePrint(const std::string &)
Definition: debugAssert.cpp:365

+ Here is the call graph for this function:

ConsolePrintHook G3D::consolePrintHook ( )
328  {
330 }
ConsolePrintHook _consolePrintHook
Definition: debugAssert.cpp:35

+ Here is the caller graph for this function:

template<class T >
bool G3D::contains ( const T *  array,
int  len,
const T &  e 
)

Array::contains for C-arrays

1451  {
1452  for (int i = len - 1; i >= 0; --i) {
1453  if (array[i] == e) {
1454  return true;
1455  }
1456  }
1457  return false;
1458 }

+ Here is the caller graph for this function:

bool G3D::conversionAvailable ( const ImageFormat *  srcFormat,
int  srcRowPadBits,
const ImageFormat *  dstFormat,
int  dstRowPadBits,
bool  invertY = false 
)
148  {
149  bool conversionAvailable = false;
150 
151  // check if a conversion is available
152  if ( (srcFormat->code == dstFormat->code) && (srcRowPadBits == dstRowPadBits) && !invertY) {
153  conversionAvailable = true;
154  } else {
155  ConvertFunc directConverter = findConverter(srcFormat->code, dstFormat->code, srcRowPadBits > 0, dstRowPadBits > 0, invertY);
156 
157  conversionAvailable = (directConverter != NULL);
158  }
159 
160  return conversionAvailable;
161 }
void(* ConvertFunc)(const Array< const void * > &srcBytes, int srcWidth, int srcHeight, const ImageFormat *srcFormat, int srcRowPadBits, const Array< void * > &dstBytes, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY, ImageFormat::BayerAlgorithm bayerAlg)
Definition: ImageFormat_convert.cpp:13
arena_t NULL
Definition: jemalloc_internal.h:624
static ConvertFunc findConverter(TextureFormat::Code sourceCode, TextureFormat::Code destCode, bool needsSourcePadding, bool needsDestPadding, bool needsInvertY)
Definition: ImageFormat_convert.cpp:115
bool conversionAvailable(const ImageFormat *srcFormat, int srcRowPadBits, const ImageFormat *dstFormat, int dstRowPadBits, bool invertY=false)
Definition: ImageFormat_convert.cpp:148

+ Here is the call graph for this function:

void G3D::copyFile ( const std::string &  source,
const std::string &  dest 
)
441  {
442 
443  #ifdef G3D_WINDOWS
444  CopyFileA(source.c_str(), dest.c_str(), FALSE);
445  #else
446  // TODO: don't use BinaryInput and BinaryOutput
447  // Read it all in, then dump it out
448  BinaryInput in(source, G3D_LITTLE_ENDIAN);
449  BinaryOutput out(dest, G3D_LITTLE_ENDIAN);
450  out.writeBytes(in.getCArray(), in.size());
451  out.commit(false);
452  #endif
453 }
Definition: System.h:50

+ Here is the call graph for this function:

int G3D::countNewlines ( const std::string &  s)
inline

Number of new lines in the given string

184  {
185  int c = 0;
186  for (int i = 0; i < (int)s.size(); ++i) {
187  if (s[i] == '\n') {
188  ++c;
189  }
190  }
191  return c;
192 }
void G3D::createDirectory ( const std::string &  dir)

Creates the directory (which may optionally end in a /) and any parents needed to reach it.

242  {
243 
244  if (dir == "") {
245  return;
246  }
247 
248  std::string d;
249 
250  // Add a trailing / if there isn't one.
251  switch (dir[dir.size() - 1]) {
252  case '/':
253  case '\\':
254  d = dir;
255  break;
256 
257  default:
258  d = dir + "/";
259  }
260 
261  // If it already exists, do nothing
262  if (FileSystem::exists(d.substr(0, d.size() - 1))) {
263  return;
264  }
265 
266  // Parse the name apart
267  std::string root, base, ext;
268  Array<std::string> path;
269 
270  std::string lead;
271  parseFilename(d, root, path, base, ext);
272  debugAssert(base == "");
273  debugAssert(ext == "");
274 
275  // Begin with an extra period so "c:\" becomes "c:\.\" after
276  // appending a path and "c:" becomes "c:.\", not root: "c:\"
277  std::string p = root + ".";
278 
279  // Create any intermediate that doesn't exist
280  for (int i = 0; i < path.size(); ++i) {
281  p += "/" + path[i];
282  if (! FileSystem::exists(p)) {
283  // Windows only requires one argument to mkdir,
284  // where as unix also requires the permissions.
285 # ifndef G3D_WINDOWS
286  mkdir(p.c_str(), 0777);
287 # else
288  _mkdir(p.c_str());
289 # endif
290  }
291  }
292 }
#define debugAssert(exp)
Definition: debugAssert.h:160
void parseFilename(const std::string &filename, std::string &drive, Array< std::string > &path, std::string &base, std::string &ext)
Definition: fileutils.cpp:457

+ Here is the call graph for this function:

FILE* G3D::createTempFile ( )

Returns a temporary file that is open for read/write access. This tries harder than the ANSI tmpfile, so it may succeed when that fails.

Vector3 G3D::cross ( const Vector3 &  v1,
const Vector3 &  v2 
)
inline
144  {
145  return v1.cross(v2);
146 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class YType >
YType G3D::cyclicCatmullRomSpline ( double  t,
const YType *  controlY,
int  numPoints 
)

See also G3D::Spline

66  {
67 
68  debugAssert(numPoints >= 3);
69 
70  t = wrap(t, numPoints);
71 
72  // Find the indices of adjacent control points
73  int i = iFloor(t);
74 
75  // Compute the distance from the control point
76  t = t - i;
77 
78  // Shift back one point for correct indexing
79  i += numPoints - 1;
80 
81  // Pick up four control points
82  const YType& P0 = controlY[(i + 0) % numPoints];
83  const YType& P1 = controlY[(i + 1) % numPoints];
84  const YType& P2 = controlY[(i + 2) % numPoints];
85  const YType& P3 = controlY[(i + 3) % numPoints];
86 
87  return 0.5 * ((2 * P1) +
88  (-P0 + P2) * t +
89  (2*P0 - 5*P1 + 4*P2 - P3) * t*t +
90  (-P0 + 3*P1- 3*P2 + P3) * t*t*t);
91 }
int iFloor(double fValue)
Definition: g3dmath.h:603
float wrap(float t, float lo, float hi)
Definition: g3dmath.h:495
#define debugAssert(exp)
Definition: debugAssert.h:160

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class YType >
YType G3D::cyclicCatmullRomSpline ( double  t,
const Array< YType > &  controlY 
)

A cubic spline with regularly spaced control points. The spline interpolates the control points. The spline will wrap from the last point back to the first.

The t parameter is on the range [0, controlY.size()], where integers correspond to control points exactly.

See also G3D::Spline

[http://www.mvps.org/directx/articles/catmull/]

108  {
109 
110  int numPoints = controlY.size();
111  return cyclicCatmullRomSpline(t, controlY.getCArray(), numPoints);
112 }
YType cyclicCatmullRomSpline(double t, const Array< YType > &controlY)
Definition: splinefunc.h:106

+ Here is the call graph for this function:

std::string __cdecl G3D::debugPrint ( const std::string &  s)
333  {
334 # ifdef G3D_WINDOWS
335  const int MAX_STRING_LEN = 1024;
336 
337  // Windows can't handle really long strings sent to
338  // the console, so we break the string.
339  if (s.size() < MAX_STRING_LEN) {
340  OutputDebugStringA(s.c_str());
341  } else {
342  for (unsigned int i = 0; i < s.size(); i += MAX_STRING_LEN) {
343  std::string sub = s.substr(i, MAX_STRING_LEN);
344  OutputDebugStringA(sub.c_str());
345  }
346  }
347 # else
348  fprintf(stderr, "%s", s.c_str());
349  fflush(stderr);
350 # endif
351 
352  return s;
353 }
FMT_API int fprintf(std::FILE *f, CStringRef format, ArgList args)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string __cdecl G3D::debugPrintf ( const char *  fmt...)

Under visual studio, appears in the VS debug pane. On unix-based operating systems the output is sent to stderr.

Also sends output to the console (G3D::consolePrintf) if there is a consolePrintHook, and log (G3D::logPrintf), and flushes before returning.

Returns
The string that was printed
355  {
356  va_list argList;
357  va_start(argList, fmt);
358  std::string s = G3D::vformat(fmt, argList);
359  va_end(argList);
360 
361  return debugPrint(s);
362 // return debugPrint(consolePrint(s));
363 }
std::string vformat(const char *fmt, va_list argPtr) G3D_CHECK_VPRINTF_ARGS
Definition: format.cpp:122
std::string debugPrint(const std::string &)
Definition: debugAssert.cpp:333
Definition: format.h:285

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G3D::DECLARE_CONVERT_FUNC ( l8_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( l32f_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( rgb8_to_rgba8  )
G3D::DECLARE_CONVERT_FUNC ( rgb8_to_bgr8  )
G3D::DECLARE_CONVERT_FUNC ( rgb8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( bgr8_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( bgr8_to_rgba8  )
G3D::DECLARE_CONVERT_FUNC ( bgr8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( rgba8_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( rgba8_to_bgr8  )
G3D::DECLARE_CONVERT_FUNC ( rgba8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( rgb32f_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_rgba8  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_bgr8  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_rgb32f  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_bayer_rggb8  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_bayer_gbrg8  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_bayer_grbg8  )
G3D::DECLARE_CONVERT_FUNC ( rgba32f_to_bayer_bggr8  )
G3D::DECLARE_CONVERT_FUNC ( bayer_rggb8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( bayer_gbrg8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( bayer_grbg8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( bayer_bggr8_to_rgba32f  )
G3D::DECLARE_CONVERT_FUNC ( rgb8_to_yuv420p  )
G3D::DECLARE_CONVERT_FUNC ( rgb8_to_yuv422  )
G3D::DECLARE_CONVERT_FUNC ( rgb8_to_yuv444  )
G3D::DECLARE_CONVERT_FUNC ( yuv420p_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( yuv422_to_rgb8  )
G3D::DECLARE_CONVERT_FUNC ( yuv444_to_rgb8  )