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  )
G3D::DEFINE_TEXTUREFORMAT_METHOD ( L8  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE8  ,
GL_LUMINANCE  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
CODE_L8  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( L16  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE16  ,
GL_LUMINANCE  ,
16  ,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
CODE_L16  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( L16F  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE16F_ARB  ,
GL_LUMINANCE  ,
16  ,
,
,
,
,
,
,
16  ,
16  ,
GL_HALF_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
CODE_L16F  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( L32F  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE32F_ARB  ,
GL_LUMINANCE  ,
32  ,
,
,
,
,
,
,
32  ,
32  ,
GL_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
CODE_L32F  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( A8  ,
,
UNCOMP_FORMAT  ,
GL_ALPHA8  ,
GL_ALPHA  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
CODE_A8  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( A16  ,
,
UNCOMP_FORMAT  ,
GL_ALPHA16  ,
GL_ALPHA  ,
,
16  ,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_SHORT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
CODE_A16  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( A16F  ,
,
UNCOMP_FORMAT  ,
GL_ALPHA16F_ARB  ,
GL_ALPHA  ,
,
16  ,
,
,
,
,
,
16  ,
16  ,
GL_HALF_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
CODE_A16F  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( A32F  ,
,
UNCOMP_FORMAT  ,
GL_ALPHA32F_ARB  ,
GL_ALPHA  ,
,
32  ,
,
,
,
,
,
32  ,
32  ,
GL_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
CODE_A32F  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( LA4  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE4_ALPHA4  ,
GL_LUMINANCE_ALPHA  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
CODE_LA4  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( LA8  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE8_ALPHA8  ,
GL_LUMINANCE_ALPHA  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
CODE_LA8  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( LA16  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE16_ALPHA16  ,
GL_LUMINANCE_ALPHA  ,
16  ,
16  ,
,
,
,
,
,
16 *  2,
16 *  2,
GL_UNSIGNED_SHORT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
CODE_LA16  ,
COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( LA16F  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE_ALPHA16F_ARB  ,
GL_LUMINANCE_ALPHA  ,
16  ,
16  ,
,
,
,
,
,
16 *  2,
16 *  2,
GL_HALF_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_LA16F  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( LA32F  ,
,
UNCOMP_FORMAT  ,
GL_LUMINANCE_ALPHA32F_ARB  ,
GL_LUMINANCE_ALPHA  ,
32  ,
32  ,
,
,
,
,
,
32 *  2,
32 *  2,
GL_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_LA32F  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( BGR8  ,
,
UNCOMP_FORMAT  ,
GL_RGB8  ,
GL_BGR  ,
,
,
,
,
,
,
,
32  ,
24  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_BGR8  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( BGRA8  ,
,
UNCOMP_FORMAT  ,
GL_RGBA8  ,
GL_BGRA  ,
,
,
,
,
,
,
,
32  ,
32  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_BGRA8  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R8  ,
,
UNCOMP_FORMAT  ,
GL_R8  ,
GL_RED  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_R8  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R8I  ,
,
UNCOMP_FORMAT  ,
GL_R8I  ,
GL_RED_INTEGER  ,
,
,
,
,
,
,
,
,
,
GL_BYTE  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_R8I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R8UI  ,
,
UNCOMP_FORMAT  ,
GL_R8UI  ,
GL_RED_INTEGER  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_R8UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R16  ,
,
UNCOMP_FORMAT  ,
GL_R16  ,
GL_RED  ,
,
,
16  ,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_R16  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R16I  ,
,
UNCOMP_FORMAT  ,
GL_R16I  ,
GL_RED_INTEGER  ,
,
,
16  ,
,
,
,
,
16  ,
16  ,
GL_SHORT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_R16I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R16UI  ,
,
UNCOMP_FORMAT  ,
GL_R16UI  ,
GL_RED_INTEGER  ,
,
,
16  ,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_R16UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R32I  ,
,
UNCOMP_FORMAT  ,
GL_R32I  ,
GL_RED_INTEGER  ,
,
,
32  ,
,
,
,
,
32  ,
32  ,
GL_INT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_R32I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R32UI  ,
,
UNCOMP_FORMAT  ,
GL_R32UI  ,
GL_RED_INTEGER  ,
,
,
32  ,
,
,
,
,
32  ,
32  ,
GL_UNSIGNED_INT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_R32UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG8  ,
,
UNCOMP_FORMAT  ,
GL_RG8  ,
GL_RG  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RG8  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG8I  ,
,
UNCOMP_FORMAT  ,
GL_RG8I  ,
GL_RG_INTEGER  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RG8I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG8UI  ,
,
UNCOMP_FORMAT  ,
GL_RG8UI  ,
GL_RG_INTEGER  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RG8UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG16  ,
,
UNCOMP_FORMAT  ,
GL_RG16  ,
GL_RG  ,
,
,
16  ,
16  ,
,
,
,
16 *  2,
16 *  2,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RG16  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG16I  ,
,
UNCOMP_FORMAT  ,
GL_RG16I  ,
GL_RG_INTEGER  ,
,
,
16  ,
16  ,
,
,
,
16 *  2,
16 *  2,
GL_SHORT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RG16I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG16UI  ,
,
UNCOMP_FORMAT  ,
GL_RG16UI  ,
GL_RG_INTEGER  ,
,
,
16  ,
16  ,
,
,
,
16 *  2,
16 *  2,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RG16UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R16F  ,
,
UNCOMP_FORMAT  ,
GL_R16F  ,
GL_RED  ,
,
,
16  ,
,
,
,
,
16  ,
16  ,
GL_HALF_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_R16F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG16F  ,
,
UNCOMP_FORMAT  ,
GL_RG16F  ,
GL_RG  ,
,
,
16  ,
16  ,
,
,
,
32  ,
32  ,
GL_HALF_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RG16F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG32I  ,
,
UNCOMP_FORMAT  ,
GL_RG32I  ,
GL_RG_INTEGER  ,
,
,
32  ,
32  ,
,
,
,
32 *  2,
32 *  2,
GL_INT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RG32I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG32UI  ,
,
UNCOMP_FORMAT  ,
GL_RG32UI  ,
GL_RG_INTEGER  ,
,
,
32  ,
32  ,
,
,
,
32 *  2,
32 *  2,
GL_UNSIGNED_INT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RG32UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R32F  ,
,
UNCOMP_FORMAT  ,
GL_R32F  ,
GL_RED  ,
,
,
32  ,
,
,
,
,
32  ,
32  ,
GL_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_R32F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RG32F  ,
,
UNCOMP_FORMAT  ,
GL_RG32F  ,
GL_RG  ,
,
,
32  ,
32  ,
,
,
,
64  ,
64  ,
GL_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RG32F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB5  ,
,
UNCOMP_FORMAT  ,
GL_RGB5  ,
GL_RGBA  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB5  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB5A1  ,
,
UNCOMP_FORMAT  ,
GL_RGB5_A1  ,
GL_RGBA  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB5A1  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB8  ,
,
UNCOMP_FORMAT  ,
GL_RGB8  ,
GL_RGB  ,
,
,
,
,
,
,
,
32  ,
24  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB8  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB10  ,
,
UNCOMP_FORMAT  ,
GL_RGB10  ,
GL_RGB  ,
,
,
10  ,
10  ,
10  ,
,
,
32  ,
10 *  3,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB10  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB10A2  ,
,
UNCOMP_FORMAT  ,
GL_RGB10_A2  ,
GL_RGBA  ,
,
,
10  ,
10  ,
10  ,
,
,
32  ,
32  ,
GL_UNSIGNED_INT_10_10_10_2  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB10A2  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB16  ,
,
UNCOMP_FORMAT  ,
GL_RGB16  ,
GL_RGB  ,
,
,
16  ,
16  ,
16  ,
,
,
16 *  3,
16 *  3,
GL_UNSIGNED_SHORT  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB16  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB16F  ,
,
UNCOMP_FORMAT  ,
GL_RGB16F_ARB  ,
GL_RGB  ,
,
,
16  ,
16  ,
16  ,
,
,
16 *  3,
16 *  3,
GL_HALF_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RGB16F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB32F  ,
,
UNCOMP_FORMAT  ,
GL_RGB32F_ARB  ,
GL_RGB  ,
,
,
32  ,
32  ,
32  ,
,
,
32 *  3,
32 *  3,
GL_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RGB32F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA8  ,
,
UNCOMP_FORMAT  ,
GL_RGBA8  ,
GL_RGBA  ,
,
,
,
,
,
,
,
32  ,
32  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGBA8  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA16  ,
,
UNCOMP_FORMAT  ,
GL_RGBA16  ,
GL_RGBA  ,
,
16  ,
16  ,
16  ,
16  ,
,
,
16 *  4,
16 *  4,
GL_UNSIGNED_SHORT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGBA16  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA16F  ,
,
UNCOMP_FORMAT  ,
GL_RGBA16F_ARB  ,
GL_RGBA  ,
,
16  ,
16  ,
16  ,
16  ,
,
,
16 *  4,
16 *  4,
GL_HALF_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RGBA16F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA32F  ,
,
UNCOMP_FORMAT  ,
GL_RGBA32F_ARB  ,
GL_RGBA  ,
,
32  ,
32  ,
32  ,
32  ,
,
,
32 *  4,
32 *  4,
GL_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RGBA32F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA16I  ,
,
UNCOMP_FORMAT  ,
GL_RGBA16I  ,
GL_RGBA_INTEGER  ,
,
16  ,
16  ,
16  ,
16  ,
,
,
16 *  4,
16 *  4,
GL_SHORT  ,
CLEAR_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGBA16I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA16UI  ,
,
UNCOMP_FORMAT  ,
GL_RGBA16UI  ,
GL_RGBA_INTEGER  ,
,
16  ,
16  ,
16  ,
16  ,
,
,
16 *  4,
16 *  4,
GL_UNSIGNED_SHORT  ,
CLEAR_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGBA16UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB32I  ,
,
UNCOMP_FORMAT  ,
GL_RGB32I  ,
GL_RGBA_INTEGER  ,
,
32  ,
32  ,
32  ,
,
,
,
32 *  3,
32 *  3,
GL_INT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGB32I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB32UI  ,
,
UNCOMP_FORMAT  ,
GL_RGB32UI  ,
GL_RGBA_INTEGER  ,
,
32  ,
32  ,
32  ,
,
,
,
32 *  3,
32 *  3,
GL_UNSIGNED_INT  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGB32UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA32I  ,
,
UNCOMP_FORMAT  ,
GL_RGBA32I  ,
GL_RGBA_INTEGER  ,
,
32  ,
32  ,
32  ,
32  ,
,
,
32 *  4,
32 *  4,
GL_INT  ,
CLEAR_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGBA32I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA32UI  ,
,
UNCOMP_FORMAT  ,
GL_RGBA32UI  ,
GL_RGBA_INTEGER  ,
,
32  ,
32  ,
32  ,
32  ,
,
,
32 *  4,
32 *  4,
GL_UNSIGNED_INT  ,
CLEAR_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGBA32UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( R11G11B10F  ,
,
UNCOMP_FORMAT  ,
GL_R11F_G11F_B10F_EXT  ,
GL_RGB  ,
,
,
11  ,
11  ,
10  ,
,
,
32  ,
32  ,
GL_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_R11G11B10F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB9E5F  ,
,
UNCOMP_FORMAT  ,
GL_RGB9_E5_EXT  ,
GL_RGB  ,
,
,
14  ,
14  ,
14  ,
,
,
32  ,
32  ,
GL_FLOAT  ,
OPAQUE_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_RGB9E5F  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB8I  ,
,
UNCOMP_FORMAT  ,
GL_RGB8I_EXT  ,
GL_RGB_INTEGER  ,
,
,
,
,
,
,
,
32  ,
24  ,
GL_BYTE  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGB8I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB8UI  ,
,
UNCOMP_FORMAT  ,
GL_RGB8UI_EXT  ,
GL_RGB_INTEGER  ,
,
,
,
,
,
,
,
32  ,
24  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGB8UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA8I  ,
,
UNCOMP_FORMAT  ,
GL_RGBA8I_EXT  ,
GL_RGBA_INTEGER  ,
,
,
,
,
,
,
,
32  ,
32  ,
GL_BYTE  ,
CLEAR_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGBA8I  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA8UI  ,
,
UNCOMP_FORMAT  ,
GL_RGBA8UI_EXT  ,
GL_RGBA_INTEGER  ,
,
,
,
,
,
,
,
32  ,
32  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
INTEGER_FORMAT  ,
ImageFormat::CODE_RGBA8UI  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB8_SNORM  ,
,
UNCOMP_FORMAT  ,
GL_RGB8_SNORM  ,
GL_RGB  ,
,
,
,
,
,
,
,
32  ,
32  ,
GL_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB8_SNORM  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA8_SNORM  ,
,
UNCOMP_FORMAT  ,
GL_RGBA8_SNORM  ,
GL_RGBA  ,
,
,
,
,
,
,
,
32  ,
32  ,
GL_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGBA8_SNORM  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB16_SNORM  ,
,
UNCOMP_FORMAT  ,
GL_RGB16_SNORM  ,
GL_RGB  ,
,
,
16  ,
16  ,
16  ,
,
,
64  ,
64  ,
GL_SHORT  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGB16_SNORM  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA16_SNORM  ,
,
UNCOMP_FORMAT  ,
GL_RGBA16_SNORM  ,
GL_RGB  ,
,
16  ,
16  ,
16  ,
16  ,
,
,
64  ,
64  ,
GL_SHORT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_RGBA16_SNORM  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGB_DXT1  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_RGB_S3TC_DXT1_EXT  ,
GL_RGB  ,
,
,
,
,
,
,
,
64  ,
64  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
OTHER  ,
ImageFormat::CODE_RGB_DXT1  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA_DXT1  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  ,
GL_RGBA  ,
,
,
,
,
,
,
,
64  ,
64  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
OTHER  ,
ImageFormat::CODE_RGBA_DXT1  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA_DXT3  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  ,
GL_RGBA  ,
,
,
,
,
,
,
,
128  ,
128  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
OTHER  ,
ImageFormat::CODE_RGBA_DXT3  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( RGBA_DXT5  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  ,
GL_RGBA  ,
,
,
,
,
,
,
,
128  ,
128  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
OTHER  ,
ImageFormat::CODE_RGBA_DXT5  ,
ImageFormat::COLOR_SPACE_RGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SRGB8  ,
,
UNCOMP_FORMAT  ,
GL_SRGB8  ,
GL_RGB  ,
,
,
,
,
,
,
,
32  ,
24  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_SRGB8  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SRGBA8  ,
,
UNCOMP_FORMAT  ,
GL_SRGB8_ALPHA8  ,
GL_RGBA  ,
,
,
,
,
,
,
,
32  ,
24  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_SRGBA8  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SL8  ,
,
UNCOMP_FORMAT  ,
GL_SLUMINANCE8  ,
GL_LUMINANCE  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_SL8  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SLA8  ,
,
UNCOMP_FORMAT  ,
GL_SLUMINANCE8_ALPHA8  ,
GL_LUMINANCE_ALPHA  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_SLA8  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SRGB_DXT1  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  ,
GL_RGB  ,
,
,
,
,
,
,
,
64  ,
64  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
OTHER  ,
ImageFormat::CODE_SRGB_DXT1  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SRGBA_DXT1  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT  ,
GL_RGBA  ,
,
,
,
,
,
,
,
64  ,
64  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
OTHER  ,
ImageFormat::CODE_SRGBA_DXT1  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SRGBA_DXT3  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT  ,
GL_RGBA  ,
,
,
,
,
,
,
,
128  ,
128  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
OTHER  ,
ImageFormat::CODE_SRGBA_DXT3  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( SRGBA_DXT5  ,
,
COMP_FORMAT  ,
GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT  ,
GL_RGBA  ,
,
,
,
,
,
,
,
128  ,
128  ,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
OTHER  ,
ImageFormat::CODE_SRGBA_DXT5  ,
ImageFormat::COLOR_SPACE_SRGB   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( DEPTH16  ,
,
UNCOMP_FORMAT  ,
GL_DEPTH_COMPONENT16_ARB  ,
GL_DEPTH_COMPONENT  ,
,
,
,
,
,
16  ,
,
16  ,
16  ,
GL_UNSIGNED_SHORT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_DEPTH16  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( DEPTH24  ,
,
UNCOMP_FORMAT  ,
GL_DEPTH_COMPONENT24_ARB  ,
GL_DEPTH_COMPONENT  ,
,
,
,
,
,
24  ,
,
32  ,
24  ,
GL_UNSIGNED_INT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_DEPTH24  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( DEPTH32  ,
,
UNCOMP_FORMAT  ,
GL_DEPTH_COMPONENT32_ARB  ,
GL_DEPTH_COMPONENT  ,
,
,
,
,
,
32  ,
,
32  ,
32  ,
GL_UNSIGNED_INT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_DEPTH32  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( DEPTH32F  ,
,
UNCOMP_FORMAT  ,
GL_DEPTH_COMPONENT32_ARB  ,
GL_DEPTH_COMPONENT  ,
,
,
,
,
,
32  ,
,
32  ,
32  ,
GL_FLOAT  ,
CLEAR_FORMAT  ,
FLOATING_POINT_FORMAT  ,
ImageFormat::CODE_DEPTH32F  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( STENCIL1  ,
,
UNCOMP_FORMAT  ,
GL_STENCIL_INDEX1_EXT  ,
GL_STENCIL_INDEX  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_STENCIL1  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( STENCIL4  ,
,
UNCOMP_FORMAT  ,
GL_STENCIL_INDEX4_EXT  ,
GL_STENCIL_INDEX  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_STENCIL4  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( STENCIL8  ,
,
UNCOMP_FORMAT  ,
GL_STENCIL_INDEX8_EXT  ,
GL_STENCIL_INDEX  ,
,
,
,
,
,
,
,
,
,
GL_UNSIGNED_BYTE  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_STENCIL8  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( STENCIL16  ,
,
UNCOMP_FORMAT  ,
GL_STENCIL_INDEX16_EXT  ,
GL_STENCIL_INDEX  ,
,
,
,
,
,
,
16  ,
16  ,
16  ,
GL_UNSIGNED_SHORT  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_STENCIL16  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( DEPTH24_STENCIL8  ,
,
UNCOMP_FORMAT  ,
GL_DEPTH24_STENCIL8_EXT  ,
GL_DEPTH_STENCIL_EXT  ,
,
,
,
,
,
24  ,
,
32  ,
32  ,
GL_UNSIGNED_INT_24_8  ,
CLEAR_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_DEPTH24_STENCIL8  ,
ImageFormat::COLOR_SPACE_NONE   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( YUV420_PLANAR  ,
,
UNCOMP_FORMAT  ,
GL_NONE  ,
GL_NONE  ,
,
,
,
,
,
,
,
12  ,
12  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_YUV420_PLANAR  ,
ImageFormat::COLOR_SPACE_YUV   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( YUV422  ,
,
UNCOMP_FORMAT  ,
GL_NONE  ,
GL_NONE  ,
,
,
,
,
,
,
,
16  ,
16  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_YUV422  ,
ImageFormat::COLOR_SPACE_YUV   
)
G3D::DEFINE_TEXTUREFORMAT_METHOD ( YUV444  ,
,
UNCOMP_FORMAT  ,
GL_NONE  ,
GL_NONE  ,
,
,
,
,
,
,
,
24  ,
24  ,
GL_UNSIGNED_BYTE  ,
OPAQUE_FORMAT  ,
NORMALIZED_FIXED_POINT_FORMAT  ,
ImageFormat::CODE_YUV444  ,
ImageFormat::COLOR_SPACE_YUV   
)
void G3D::deserialize ( std::string &  s,
BinaryInput &  b 
)
inline
16  {
17  s = b.readString32();
18 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::deserialize ( int32 i,
BinaryInput &  b 
)
inline
24  {
25  i = b.readInt32();
26 }

+ Here is the call graph for this function:

void G3D::deserialize ( uint32 i,
BinaryInput &  b 
)
inline
32  {
33  i = b.readUInt32();
34 }

+ Here is the call graph for this function:

void G3D::deserialize ( bool i,
BinaryInput &  b 
)
inline
40  {
41  i = b.readBool8();
42 }

+ Here is the call graph for this function:

void G3D::deserialize ( float32 &  f,
BinaryInput &  b 
)
inline
48  {
49  f = b.readFloat32();
50 }

+ Here is the call graph for this function:

void G3D::deserialize ( float64 &  f,
BinaryInput &  b 
)
inline
56  {
57  f = b.readFloat64();
58 }

+ Here is the call graph for this function:

template<typename T >
void G3D::deserialize ( Array< T > &  array,
BinaryInput &  b 
)
70  {
71  int N = b.readInt32();
72  array.resize(N);
73  for (int i = 0; i < array.size(); ++i) {
74  deserialize(array[i], b);
75  }
76 }
void resize(size_t n, bool shrinkIfNecessary=true)
Definition: Array.h:490
int size() const
Definition: Array.h:430
void deserialize(Array< T > &array, BinaryInput &b)
Definition: serialize.h:70

+ Here is the call graph for this function:

void G3D::deserialize ( class BinaryInput &  bi)
void G3D::deserialize ( Vector2 &  v,
class BinaryInput &  b 
)
221  {
222  v.deserialize(b);
223 }

+ Here is the call graph for this function:

void G3D::deserialize ( Vector3::Axis &  a,
class BinaryInput &  bo 
)
404  {
405  a = (Vector3::Axis)bi.readUInt8();
406 }

+ Here is the call graph for this function:

void G3D::deserialize ( Vector4 &  v,
class BinaryInput &  b 
)
525  {
526  v.deserialize(b);
527 }

+ Here is the call graph for this function:

void G3D::deserialize ( Vector3 &  v,
class BinaryInput &  b 
)
540  {
541  v.deserialize(b);
542 }

+ Here is the call graph for this function:

void G3D::deserialize ( bool b,
TextInput &  ti 
)
1318  {
1319  b = ti.readSymbol() == "true";
1320 }

+ Here is the call graph for this function:

void G3D::deserialize ( int &  b,
TextInput &  ti 
)
1323  {
1324  b = iRound(ti.readNumber());
1325 }
int iRound(double fValue)
Definition: g3dmath.h:226

+ Here is the call graph for this function:

void G3D::deserialize ( uint8 b,
TextInput &  ti 
)
1328  {
1329  b = (uint8)iRound(ti.readNumber());
1330 }
int iRound(double fValue)
Definition: g3dmath.h:226
uint8_t uint8
Definition: g3dmath.h:164

+ Here is the call graph for this function:

void G3D::deserialize ( double &  b,
TextInput &  ti 
)
1333  {
1334  b = ti.readNumber();
1335 }

+ Here is the call graph for this function:

void G3D::deserialize ( float &  b,
TextInput &  ti 
)
1338  {
1339  b = (float)ti.readNumber();
1340 }

+ Here is the call graph for this function:

void G3D::deserialize ( std::string &  b,
TextInput &  ti 
)
double G3D::determinant ( const Matrix3 &  m)
inline
148  {
149  return m.determinant();
150 }

+ Here is the call graph for this function:

double G3D::determinant ( const Matrix4 &  m)
inline
152  {
153  return m.determinant();
154 }

+ Here is the call graph for this function:

static void G3D::determineFileOrDirList ( const std::string &  filespec,
Array< std::string > &  files,
bool  wantFiles,
bool  includePath 
)
static
777  {
778 
779  // if it is a .zip, prefix will specify the folder within
780  // whose contents we want to see
781  std::string prefix = "";
782  std::string path = filenamePath(filespec);
783 
784  if ((path.size() > 0) && isSlash(path[path.size() - 1])) {
785  // Strip the trailing slash
786  path = path.substr(0, path.length() -1);
787  }
788 
789  if ((path == "") || FileSystem::exists(path)) {
790  if ((path != "") && FileSystem::isZipfile(path)) {
791  // .zip should only work if * is specified as the Base + Ext
792  // Here, we have been asked for the root's contents
793  debugAssertM(filenameBaseExt(filespec) == "*", "Can only call getFiles/getDirs on zipfiles using '*' wildcard");
794  getFileOrDirListZip(path, prefix, files, wantFiles, includePath);
795  } else {
796  // It is a normal directory
797  getFileOrDirListNormal(filespec, files, wantFiles, includePath);
798  }
799  } else if (zipfileExists(filenamePath(filespec), path, prefix)) {
800  // .zip should only work if * is specified as the Base + Ext
801  // Here, we have been asked for the contents of a folder within the .zip
802  debugAssertM(filenameBaseExt(filespec) == "*", "Can only call getFiles/getDirs on zipfiles using '*' wildcard");
803  getFileOrDirListZip(path, prefix, files, wantFiles, includePath);
804  }
805 }
std::string filenamePath(const std::string &filename)
Definition: fileutils.cpp:869
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
bool isZipfile(const std::string &filename)
Definition: fileutils.cpp:892
bool isSlash(const unsigned char c)
Definition: stringutils.h:175
static void getFileOrDirListNormal(const std::string &filespec, Array< std::string > &files, bool wantFiles, bool includePath)
Definition: fileutils.cpp:577
static void getFileOrDirListZip(const std::string &path, const std::string &prefix, Array< std::string > &files, bool wantFiles, bool includePath)
Definition: fileutils.cpp:742
std::string filenameBaseExt(const std::string &filename)
Definition: fileutils.cpp:825
bool zipfileExists(const std::string &filename, std::string &outZipfile, std::string &outInternalFile)
Definition: fileutils.cpp:335

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::distance ( double  x,
double  y 
)
inline
731  {
732  return sqrt(sumSquares(x, y));
733 }
G3D::int16 y
Definition: Vector2int16.h:38
float sumSquares(float x, float y, float z)
Definition: g3dmath.h:726
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::distance ( double  x,
double  y,
double  z 
)
inline
741  {
742  return sqrt(sumSquares(x, y, z));
743 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
float sumSquares(float x, float y, float z)
Definition: g3dmath.h:726
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::distance ( float  x,
float  y 
)
inline
736  {
737  return sqrt(sumSquares(x, y));
738 }
G3D::int16 y
Definition: Vector2int16.h:38
float sumSquares(float x, float y, float z)
Definition: g3dmath.h:726
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::distance ( float  x,
float  y,
float  z 
)
inline
746  {
747  return sqrt(sumSquares(x, y, z));
748 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
float sumSquares(float x, float y, float z)
Definition: g3dmath.h:726
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::dot ( const Vector2 &  a,
const Vector2 &  b 
)
inline
48  {
49  return a.dot(b);
50 }

+ Here is the call graph for this function:

float G3D::dot ( const Vector3 &  a,
const Vector3 &  b 
)
inline
52  {
53  return a.dot(b);
54 }

+ Here is the call graph for this function:

float G3D::dot ( const Vector4 &  a,
const Vector4 &  b 
)
inline
56  {
57  return a.dot(b);
58 }

+ Here is the call graph for this function:

int G3D::dot ( const Vector3int16 v) const
114  {
115  return x * v.x + y * v.y + z * v.z;
116  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
float G3D::dot ( float  a,
float  b 
)
inline

a * b (for DirectX/Cg support)

445  {
446  return a * b;
447 }

+ Here is the caller graph for this function:

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

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

129  {
130 
131  if (test.size() >= pattern.size()) {
132  size_t te = test.size() - 1;
133  size_t pe = pattern.size() - 1;
134  for (int i = (int)pattern.size() - 1; i >= 0; --i) {
135  if (pattern[pe - i] != test[te - i]) {
136  return false;
137  }
138  }
139  return true;
140  } else {
141  return false;
142  }
143 }

+ Here is the caller graph for this function:

template<class EnumClass , class EnumClassValue >
void G3D::enumToJavaScriptDeclaration ( TextOutput &  t)

Generates JavaScript source code defining an enum equivalent to EnumClass.

TextOutput t("WrapMode.js");
enumToJavaScriptDeclaration<WrapMode, WrapMode::Value>(t);
t.commit();
303  {
304  t.printf("/* BEGIN GENERATED CODE. The following was automatically generated by G3D::enumToJavaScriptDeclaration(). Do not edit it manually. */\n\n");
305  t.printf("var %s = (function (propList) {", EnumClass::classname()); t.writeNewline();
306  t.pushIndent(); {
307  t.printf("// Define immutable properties"); t.writeNewline();
308  t.printf("var en = {};"); t.writeNewline();
309  t.printf("for (var i = 0; i < propList.length; i += 2)"); t.writeNewline();
310  t.pushIndent(); {
311  t.printf("Object.defineProperty(en, propList[i], {enumerable: true, value: propList[i + 1]});"); t.writeNewline();
312  } t.popIndent();
313  t.printf("return en;");
314  t.writeNewline();
315  } t.popIndent();
316  t.printf("})([");
317  int i = 0;
318  EnumClassValue m;
319  const char* s = EnumClass::toString(i, m);
320  while (notNull(s)) {
321  t.printf("\"%s\", %d, ", s, int(m));
322  ++i;
323  s = EnumClass::toString(i, m);
324  }
325  // JavaScript allows a trailing comma
326  t.printf("]);"); t.writeNewline();
327  t.printf("/* END GENERATED CODE */"); t.writeNewline();
328 }
bool notNull(const Pointer< T > &p)
Definition: Pointer.h:350
std::string toString() const

+ Here is the call graph for this function:

double G3D::eps ( double  a,
double  b 
)
inline

Computes an appropriate epsilon for comparing a and b.

824  {
825  // For a and b to be nearly equal, they must have nearly
826  // the same magnitude. This means that we can ignore b
827  // since it either has the same magnitude or the comparison
828  // will fail anyway.
829  (void)b;
830  const double aa = abs(a) + 1.0;
831  if (aa == inf()) {
832  return fuzzyEpsilon64;
833  } else {
834  return fuzzyEpsilon64 * aa;
835  }
836 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
#define fuzzyEpsilon64
Definition: g3dmath.h:131
double inf()
Definition: g3dmath.cpp:40

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::eps ( float  a,
float  b 
)
inline
838  {
839  // For a and b to be nearly equal, they must have nearly
840  // the same magnitude. This means that we can ignore b
841  // since it either has the same magnitude or the comparison
842  // will fail anyway.
843  (void)b;
844  const float aa = (float)abs(a) + 1.0f;
845  if (aa == inf()) {
846  return fuzzyEpsilon32;
847  } else {
848  return fuzzyEpsilon32 * aa;
849  }
850 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
double inf()
Definition: g3dmath.cpp:40
#define fuzzyEpsilon32
Definition: g3dmath.h:132

+ Here is the call graph for this function:

const char* G3D::errnoToString ( )
149  {
150  switch (errno) {
151  case EBADF:
152  return "file descriptor is invalid.";
153 
154  case EINVAL:
155  return "Request or argp is not valid.";
156 
157  case ENOTTY:
158  return
159  "file descriptor is not associated with a character special device OR "
160  "The specified request does not apply to the "
161  "kind of object that the descriptor fildes references.";
162 
163  case EADDRNOTAVAIL:
164  return "Address not available.";
165 
166  default:
167  {
168  static char buffer[20];
169  sprintf(buffer, "Error %d", errno);
170  return buffer;
171  }
172  }
173 }
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096

+ Here is the call graph for this function:

static std::string G3D::escape ( const std::string &  string)
static
77  {
78  std::string result = "";
79 
80  for (std::string::size_type i = 0; i < string.length(); ++i) {
81  char c = string.at(i);
82  switch (c) {
83  case '\0':
84  result += "\\0";
85  break;
86 
87  case '\r':
88  result += "\\r";
89  break;
90 
91  case '\n':
92  result += "\\n";
93  break;
94 
95  case '\t':
96  result += "\\t";
97  break;
98 
99  case '\\':
100  result += "\\\\";
101  break;
102 
103  default:
104  result += c;
105  }
106  }
107 
108  return result;
109 }

+ Here is the caller graph for this function:

Quat G3D::exp ( const Quat &  q)
inline
729  {
730  return q.exp();
731 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::exp2 ( double  x)
inline

2^x

460  {
461  return pow(2.0, x);
462 }
G3D::Quat pow(const G3D::Quat &q, double x)
Definition: Quat.h:761
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::exp2 ( float  x)
inline
464  {
465  return powf(2.0f, x);
466 }
G3D::int16 x
Definition: Vector2int16.h:37
AssertionHook G3D::failureHook ( )
319  {
321 }
AssertionHook _failureHook
Definition: debugAssert.cpp:37
bool G3D::fileIsNewer ( const std::string &  src,
const std::string &  dst 
)
926  {
927  struct _stat sts;
928  bool sexists = _stat(src.c_str(), &sts) != -1;
929 
930  struct _stat dts;
931  bool dexists = _stat(dst.c_str(), &dts) != -1;
932 
933  return sexists && ((! dexists) || (sts.st_mtime > dts.st_mtime));
934 }
#define _stat
Definition: fileutils.cpp:37
int64 G3D::fileLength ( const std::string &  filename)
173  {
174  struct _stat st;
175  int result = _stat(filename.c_str(), &st);
176 
177  if (result == -1) {
178 #if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */
179  std::string zip, contents;
180  if(zipfileExists(filename, zip, contents)){
181  int64 requiredMem;
182 
183  struct zip *z = zip_open( zip.c_str(), ZIP_CHECKCONS, NULL );
184  debugAssertM(z != NULL, zip + ": zip open failed.");
185  {
186  struct zip_stat info;
187  zip_stat_init( &info ); // TODO: Docs unclear if zip_stat_init is required.
188  int success = zip_stat( z, contents.c_str(), ZIP_FL_NOCASE, &info );
189  (void)success;
190  debugAssertM(success == 0, zip + ": " + contents + ": zip stat failed.");
191  requiredMem = info.size;
192  }
193  zip_close( z );
194  return requiredMem;
195  } else {
196  return -1;
197  }
198 #else
199  return -1;
200 #endif
201  }
202 
203  return st.st_size;
204 }
#define _stat
Definition: fileutils.cpp:37
int64_t int64
Definition: Define.h:145
arena_t NULL
Definition: jemalloc_internal.h:624
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
G3D::int16 z
Definition: Vector3int16.h:46
bool zipfileExists(const std::string &filename, std::string &outZipfile, std::string &outInternalFile)
Definition: fileutils.cpp:335

+ Here is the call graph for this function:

std::string G3D::filenameBase ( const std::string &  filename)

Returns the portion of a filename to the left of the last period and to the right of the last slash or colon.

848  {
849  std::string drive;
850  std::string base;
851  std::string ext;
852  Array<std::string> path;
853 
854  parseFilename(s, drive, path, base, ext);
855  return base;
856 }
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::filenameBaseExt ( const std::string &  filename)

Returns the part of the filename that includes the base and ext from parseFilename (i.e. everything to the right of the path).

825  {
826  size_t i = filename.rfind("/");
827  size_t j = filename.rfind("\\");
828 
829  if ((j > i) && (j != std::string::npos)) {
830  i = j;
831  }
832 
833 # ifdef G3D_WINDOWS
834  j = filename.rfind(":");
835  if ((i == std::string::npos) && (j != std::string::npos)) {
836  i = j;
837  }
838 # endif
839 
840  if (i == std::string::npos) {
841  return filename;
842  } else {
843  return filename.substr(i + 1, filename.length() - i);
844  }
845 }

+ Here is the caller graph for this function:

bool G3D::filenameContainsWildcards ( const std::string &  filename)

Returns true if '*' or '?' appears in the string

921  {
922  return (filename.find('*') != std::string::npos) || (filename.find('?') != std::string::npos);
923 }
std::string G3D::filenameExt ( const std::string &  filename)

Returns the extension on a filename.

859  {
860  size_t i = filename.rfind(".");
861  if (i != std::string::npos) {
862  return filename.substr(i + 1, filename.length() - i);
863  } else {
864  return "";
865  }
866 }
std::string G3D::filenamePath ( const std::string &  filename)

Returns the drive (if Win32) and path from a filename, including a slash if there was one. filenamePath(f) + filenameBaseExt(f) == f

869  {
870  size_t i = filename.rfind("/");
871  size_t j = filename.rfind("\\");
872 
873  if ((j > i) && (j != std::string::npos)) {
874  i = j;
875  }
876 
877 # ifdef G3D_WINDOWS
878  j = filename.rfind(":");
879  if ((i == std::string::npos) && (j != std::string::npos)) {
880  i = j;
881  }
882 # endif
883 
884  if (i == std::string::npos) {
885  return "";
886  } else {
887  return filename.substr(0, i+1);
888  }
889 }

+ Here is the caller graph for this function:

static ConvertFunc G3D::findConverter ( TextureFormat::Code  sourceCode,
TextureFormat::Code  destCode,
bool  needsSourcePadding,
bool  needsDestPadding,
bool  needsInvertY 
)
static
115  {
116  int numRoutines = sizeof(sConvertMappings) / sizeof(ConvertAttributes);
117  for (int routineIndex = 0; routineIndex < numRoutines; ++routineIndex) {
118  int sourceIndex = 0;
119  ConvertAttributes routine = sConvertMappings[routineIndex];
120 
121  while (routine.m_sourceFormats[sourceIndex] != ImageFormat::CODE_NONE) {
122  // check for matching source
123  if (routine.m_sourceFormats[sourceIndex] == sourceCode) {
124  int destIndex = 0;
125 
126  // now check for matching dest to see if the routine fits
127  while (routine.m_destFormats[destIndex] != ImageFormat::CODE_NONE) {
128 
129  // check if dest format matches and padding + invert rules match
130  if ((routine.m_destFormats[destIndex] == destCode) &&
131  (!needsSourcePadding || (routine.m_handlesSourcePadding == needsSourcePadding)) &&
132  (!needsDestPadding || (routine.m_handlesDestPadding == needsDestPadding)) &&
133  (!needsInvertY || (routine.m_handleInvertY == needsInvertY))) {
134 
135  // found compatible converter
136  return routine.m_converter;
137  }
138  ++destIndex;
139  }
140  }
141  ++sourceIndex;
142  }
143  }
144 
145  return NULL;
146 }
arena_t NULL
Definition: jemalloc_internal.h:624
ConvertFunc m_converter
Definition: ImageFormat_convert.cpp:18
static const ConvertAttributes sConvertMappings[]
Definition: ImageFormat_convert.cpp:61

+ Here is the caller graph for this function:

size_t G3D::findLastSlash ( const std::string &  f,
size_t  start = std::string::npos 
)
inline

Finds the index of the first '\' or '/' character, starting at index start (if start is -1, starts at the end of the string).

See also
G3D::findSlash, G3D::isSlash
58  {
59  if (start == std::string::npos) {
60  start = f.length() - 1;
61  }
62 
63  size_t i = f.rfind('/', start);
64  size_t j = f.rfind('\\', start);
65  return maxNotNPOS(i, j);
66 }
size_t maxNotNPOS(size_t i, size_t j)
Returns the larger string index, ignoring std::string::npos.
Definition: stringutils.h:45

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool G3D::findRayCapsuleIntersection ( const Ray &  rkRay,
const Capsule &  rkCapsule,
int &  riQuantity,
Vector3  akPoint[2] 
)
static

Used by collisionTimeForMovingPointFixedCapsule. [From] magic software http://www.magic-software.com/Source/Intersection3D/MgcIntr3DLinCap.cpp

Parameters
rkRayThe ray
rkCapsuleThe capsule
riQuantityThe number of intersections found
akPointThe intersections found
Returns
True if there is at least one intersection
1523  {
1524 
1525  double afT[2];
1526  riQuantity = findRayCapsuleIntersectionAux(rkRay.origin(), rkRay.direction(), rkCapsule, afT);
1527 
1528  // Only return intersections that occur in the future
1529  int iClipQuantity = 0;
1530  int i;
1531  for (i = 0; i < riQuantity; ++i) {
1532  if (afT[i] >= 0.0f) {
1533  akPoint[iClipQuantity] = rkRay.origin() + afT[i] * rkRay.direction();
1534  ++iClipQuantity;
1535  }
1536  }
1537 
1538  riQuantity = iClipQuantity;
1539  return (riQuantity > 0);
1540 }
static int findRayCapsuleIntersectionAux(const Vector3 &rkOrigin, const Vector3 &rkDirection, const Capsule &rkCapsule, double afT[2])
Definition: CollisionDetection.cpp:1338

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int G3D::findRayCapsuleIntersectionAux ( const Vector3 &  rkOrigin,
const Vector3 &  rkDirection,
const Capsule &  rkCapsule,
double  afT[2] 
)
static

Used by findRayCapsuleIntersection. [From] magic software http://www.magic-software.com/Source/Intersection3D/MgcIntr3DLinCap.cpp

1342  {
1343 
1344  Vector3 capsuleDirection = rkCapsule.point(1) - rkCapsule.point(0);
1345 
1346  // set up quadratic Q(t) = a*t^2 + 2*b*t + c
1347  Vector3 kW = capsuleDirection;
1348  float fWLength = kW.length();
1349  kW = kW.direction();
1350 
1351  Vector3 kU, kV;
1352  kW.getTangents(kU, kV);
1353  Vector3 kD(kU.dot(rkDirection), kV.dot(rkDirection), kW.dot(rkDirection));
1354 
1355  float fDLength = kD.length();
1356  kD = kD.direction();
1357 
1358  float fEpsilon = 1e-6f;
1359 
1360  float fInvDLength = 1.0f/fDLength;
1361  Vector3 kDiff = rkOrigin - rkCapsule.point(0);
1362  Vector3 kP(kU.dot(kDiff),kV.dot(kDiff),kW.dot(kDiff));
1363  float fRadiusSqr = square(rkCapsule.radius());
1364 
1365  float fInv, fA, fB, fC, fDiscr, fRoot, fT, fTmp;
1366 
1367  // Is the velocity parallel to the capsule direction? (or zero)
1368  if ((abs(kD.z) >= 1.0f - fEpsilon) || (fDLength < fEpsilon)) {
1369 
1370  float fAxisDir = rkDirection.dot(capsuleDirection);
1371 
1372  fDiscr = fRadiusSqr - kP.x*kP.x - kP.y*kP.y;
1373  if ((fAxisDir < 0) && (fDiscr >= 0.0f)) {
1374  // Velocity anti-parallel to the capsule direction
1375  fRoot = sqrt(fDiscr);
1376  afT[0] = (kP.z + fRoot)*fInvDLength;
1377  afT[1] = -(fWLength - kP.z + fRoot)*fInvDLength;
1378  return 2;
1379  } else if ((fAxisDir > 0) && (fDiscr >= 0.0f)) {
1380  // Velocity parallel to the capsule direction
1381  fRoot = sqrt(fDiscr);
1382  afT[0] = -(kP.z + fRoot)*fInvDLength;
1383  afT[1] = (fWLength - kP.z + fRoot)*fInvDLength;
1384  return 2;
1385  } else {
1386  // sphere heading wrong direction, or no velocity at all
1387  return 0;
1388  }
1389  }
1390 
1391  // test intersection with infinite cylinder
1392  fA = kD.x*kD.x + kD.y*kD.y;
1393  fB = kP.x*kD.x + kP.y*kD.y;
1394  fC = kP.x*kP.x + kP.y*kP.y - fRadiusSqr;
1395  fDiscr = fB*fB - fA*fC;
1396  if (fDiscr < 0.0f) {
1397  // line does not intersect infinite cylinder
1398  return 0;
1399  }
1400 
1401  int iQuantity = 0;
1402 
1403  if (fDiscr > 0.0f) {
1404  // line intersects infinite cylinder in two places
1405  fRoot = sqrt(fDiscr);
1406  fInv = 1.0f/fA;
1407  fT = (-fB - fRoot)*fInv;
1408  fTmp = kP.z + fT*kD.z;
1409  if ((0.0f <= fTmp) && (fTmp <= fWLength)) {
1410  afT[iQuantity] = fT * fInvDLength;
1411  ++iQuantity;
1412  }
1413 
1414  fT = (-fB + fRoot)*fInv;
1415  fTmp = kP.z + fT*kD.z;
1416 
1417  if ((0.0f <= fTmp) && (fTmp <= fWLength)) {
1418  afT[iQuantity++] = fT*fInvDLength;
1419  }
1420 
1421  if (iQuantity == 2) {
1422  // line intersects capsule wall in two places
1423  return 2;
1424  }
1425  } else {
1426  // line is tangent to infinite cylinder
1427  fT = -fB/fA;
1428  fTmp = kP.z + fT*kD.z;
1429  if ((0.0f <= fTmp) && (fTmp <= fWLength)) {
1430  afT[0] = fT*fInvDLength;
1431  return 1;
1432  }
1433  }
1434 
1435  // test intersection with bottom hemisphere
1436  // fA = 1
1437  fB += kP.z*kD.z;
1438  fC += kP.z*kP.z;
1439  fDiscr = fB*fB - fC;
1440  if (fDiscr > 0.0f) {
1441  fRoot = sqrt(fDiscr);
1442  fT = -fB - fRoot;
1443  fTmp = kP.z + fT*kD.z;
1444  if (fTmp <= 0.0f) {
1445  afT[iQuantity++] = fT*fInvDLength;
1446  if (iQuantity == 2) {
1447  return 2;
1448  }
1449  }
1450 
1451  fT = -fB + fRoot;
1452  fTmp = kP.z + fT*kD.z;
1453  if (fTmp <= 0.0f) {
1454  afT[iQuantity++] = fT*fInvDLength;
1455  if (iQuantity == 2) {
1456  return 2;
1457  }
1458  }
1459  } else if (fDiscr == 0.0f) {
1460  fT = -fB;
1461  fTmp = kP.z + fT*kD.z;
1462  if (fTmp <= 0.0f) {
1463  afT[iQuantity++] = fT*fInvDLength;
1464  if (iQuantity == 2) {
1465  return 2;
1466  }
1467  }
1468  }
1469 
1470  // test intersection with top hemisphere
1471  // fA = 1
1472  fB -= kD.z*fWLength;
1473  fC += fWLength*(fWLength - 2.0f*kP.z);
1474 
1475  fDiscr = fB*fB - fC;
1476  if (fDiscr > 0.0f) {
1477  fRoot = sqrt(fDiscr);
1478  fT = -fB - fRoot;
1479  fTmp = kP.z + fT*kD.z;
1480  if (fTmp >= fWLength) {
1481  afT[iQuantity++] = fT*fInvDLength;
1482  if (iQuantity == 2) {
1483  return 2;
1484  }
1485  }
1486 
1487  fT = -fB + fRoot;
1488  fTmp = kP.z + fT*kD.z;
1489  if (fTmp >= fWLength) {
1490  afT[iQuantity++] = fT*fInvDLength;
1491  if (iQuantity == 2) {
1492  return 2;
1493  }
1494  }
1495  } else if (fDiscr == 0.0f) {
1496  fT = -fB;
1497  fTmp = kP.z + fT*kD.z;
1498  if (fTmp >= fWLength) {
1499  afT[iQuantity++] = fT*fInvDLength;
1500  if (iQuantity == 2) {
1501  return 2;
1502  }
1503  }
1504  }
1505 
1506  return iQuantity;
1507 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
double square(double fValue)
Definition: g3dmath.h:698

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t G3D::findSlash ( const std::string &  f,
size_t  start = 0 
)
inline

Finds the index of the first '\' or '/' character, starting at index start.

See also
G3D::findLastSlash, G3D::isSlash
34  {
35  size_t i = f.find('/', start);
36  size_t j = f.find('\\', start);
37  if ((i != std::string::npos) && (i < j)) {
38  return i;
39  } else {
40  return j;
41  }
42 }

+ Here is the caller graph for this function:

static Any::Type G3D::findType ( TextInput &  ti,
const char  closeSymbol 
)
static

Determines the type [TABLE, ARRAY, or EMPTY_CONTAINER] from the given TextInput TextInput is the same at the end as it was beofr

1420  {
1421  Any::Type type = Any::NIL;
1422  std::vector<Token> tokens;
1423  // consumes the open symbol
1424  Token token = ti.read();
1425  tokens.push_back(token);
1426 
1427  bool hasAnElement = false;
1428  while (type == Any::NIL) {
1429  if (token.type() == Token::COMMENT) {
1430  // consumes tokens and prepares to push them back onto the TextInput
1431  token = ti.read();
1432  tokens.push_back(token);
1433  } else if ((token.type() == Token::SYMBOL) && ((token.string() == "=") || (token.string() == ":"))) {
1434  // an '=' indicates a key = value pairing, and thus a table
1435  type = Any::TABLE;
1436  } else if (hasAnElement) {
1437  // any non-comment, non-'=' token after any element indicates an array
1438  type = Any::ARRAY;
1439  } else if ((token.type() == Token::SYMBOL) && (token.string()[0] == closeSymbol)) {
1440  // catches no previous element and a closing symbol (e.g [])
1441  type = Any::EMPTY_CONTAINER;
1442  } else {
1443  // consumes elements, indicating one has been seen, and prepares to push them back onto TextInput
1444  hasAnElement = true;
1445  token = ti.read();
1446  tokens.push_back(token);
1447  }
1448  }
1449  // pushes everything back to the TextInput
1450  while (!tokens.empty()) {
1451  token = tokens.back();
1452  ti.push(token);
1453  tokens.pop_back();
1454  }
1455  return type;
1456 }
Definition: inflate.h:28
Definition: inflate.h:37
Type
Type of JSON value.
Definition: rapidjson.h:642

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::finf ( )

This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results.

71  {
72  return std::numeric_limits<float>::infinity();
73 }

+ Here is the caller graph for this function:

static int G3D::fixslash ( int  c)
static
827  {
828  return (c == '\\') ? '/' : c;
829 }

+ Here is the caller graph for this function:

uint16 G3D::flipEndian16 ( const uint16  x)
inline

Given a 16-bit integer, returns the integer with the bytes in the opposite order.

896  {
897  return (x << 8) | ((x & 0xFF00) >> 8);
898 }
G3D::int16 x
Definition: Vector2int16.h:37
uint32 G3D::flipEndian32 ( const uint32  x)
inline

Given a 32-bit integer, returns the integer with the bytes in the opposite order.

888  {
889  return (x << 24) | ((x & 0xFF00) << 8) |
890  ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24);
891 }
G3D::int16 x
Definition: Vector2int16.h:37
static Vector3int16 G3D::floor ( const Vector3 &  v)
static

+ Here is the caller graph for this function:

float G3D::fnan ( )
82  {
83  // double is a standard type and should have quiet NaN
84  return std::numeric_limits<float>::quiet_NaN();
85 }

+ Here is the caller graph for this function:

std::string __cdecl G3D::format ( const char *  fmt,
  ... 
)
25  {
26  va_list argList;
27  va_start(argList,fmt);
28  std::string result = vformat(fmt, argList);
29  va_end(argList);
30 
31  return result;
32 }
std::string vformat(const char *fmt, va_list argPtr) G3D_CHECK_VPRINTF_ARGS
Definition: format.cpp:122
Definition: format.h:285

+ Here is the call graph for this function:

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

Produces a string from arguments of the style of printf. This avoids problems with buffer overflows when using sprintf and makes it easy to use the result functionally. This function is fast when the resulting string is under 160 characters (not including terminator) and slower when the string is longer.

+ Here is the caller graph for this function:

double G3D::frand ( )
170  {
171  return rand() / (double) RAND_MAX;
172 }

+ Here is the caller graph for this function:

static unorm16 G3D::fromBits ( uint16  b)
static

Equivalent to:

unorm16 u = reinterpret_cast<const unorm16&>(255);
43  {
44  return unorm16(b);
45  }
unorm16(double f)
Definition: unorm16.h:65

+ Here is the caller graph for this function:

static unorm8 G3D::fromBits ( uint8  b)
static

Equivalent to:

unorm8 u = reinterpret_cast<const unorm8&>(255);
44  {
45  return unorm8(b);
46  }
unorm8(double f)
Definition: unorm8.h:62
bool G3D::fuzzyEq ( double  a,
double  b 
)
inline

Note that fuzzyEq(a, b) && fuzzyEq(b, c) does not imply fuzzyEq(a, c), although that will be the case on some occasions.

857  {
858  return (a == b) || (abs(a - b) <= eps(a, b));
859 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
float eps(float a, float b)
Definition: g3dmath.h:838

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::fuzzyEq ( float  a,
float  b 
)
inline
853  {
854  return (a == b) || (abs(a - b) <= eps(a, b));
855 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
float eps(float a, float b)
Definition: g3dmath.h:838

+ Here is the call graph for this function:

bool G3D::fuzzyGe ( double  a,
double  b 
)
inline

Is a near or greater than b?

869  {
870  return a > b - eps(a, b);
871 }
float eps(float a, float b)
Definition: g3dmath.h:838

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::fuzzyGt ( double  a,
double  b 
)
inline

Is a strictly greater than b? (Guaranteed false if a <= b). (Possibly false if a > b)

865  {
866  return a > b + eps(a, b);
867 }
float eps(float a, float b)
Definition: g3dmath.h:838

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::fuzzyLe ( double  a,
double  b 
)
inline

Is a near or less than b?

877  {
878  return a < b + eps(a, b);
879 }
float eps(float a, float b)
Definition: g3dmath.h:838

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::fuzzyLt ( double  a,
double  b 
)
inline

Is a strictly less than b? (Guaranteed false if a >= b)

873  {
874  return a < b - eps(a, b);
875 }
float eps(float a, float b)
Definition: g3dmath.h:838

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::fuzzyNe ( double  a,
double  b 
)
inline

True if a is definitely not equal to b. Guaranteed false if a == b. Possibly false when a != b.

861  {
862  return ! fuzzyEq(a, b);
863 }
bool fuzzyEq(float a, float b)
Definition: g3dmath.h:853

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::g3dfnmatch ( const char *  pattern,
const char *  string,
int  flags 
)

Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. Compares a filename or pathname to a pattern.

The fnmatch() function checks whether the string argument matches the pattern argument, which is a shell wildcard pattern. The flags argument modifies the behaviour; it is the bitwise OR of zero or more of the following flags:

  • FNM_NOESCAPE If this flag is set, treat backslash as an ordinary character, instead of an escape character.
  • FNM_PATHNAME If this flag is set, match a slash in string only with a slash in pattern and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash.
  • FNM_PERIOD If this flag is set, a leading period in string has to be matched exactly by a period in pattern. A period is considered to be leading if it is the first character in string, or if both FNM_PATHNAME is set and the period immediately follows a slash.
  • FNM_FILE_NAME This is a GNU synonym for FNM_PATHNAME.
  • FNM_LEADING_DIR If this flag (a GNU extension) is set, the pattern is considered to be matched if it matches an initial segment of string which is followed by a slash. This flag is mainly for the internal use of glibc and is only implemented in certain cases.
  • FNM_CASEFOLD If this flag (a GNU extension) is set, the pattern is matched case-insensitively.
Returns
Zero if string matches pattern, FNM_NOMATCH if there is no match or another non-zero value if there is an error
217  {
218  return fnmatch(a, b, c);
219 }

+ Here is the caller graph for this function:

void G3D::gaussian1D ( Array< float > &  coeff,
int  N = 5,
float  std = 0.5f 
)

Generates a set of 1D gaussian filter coefficients of size N. The coefficients are centered on element (N-1)/2 and have standard deviation given by std. The coefficients are normalized such that the sum across coeff is 1.0.

Matches the results returned by Matlab fspecial('gaussian', [1, N], std)

15  {
16  coeff.resize(N);
17  float sum = 0.0f;
18  for (int i = 0; i < N; ++i) {
19  float x = i - (N - 1) / 2.0f;
20  float p = -square(x / std) / 2.0f;
21  float y = exp(p);
22  coeff[i] = y;
23  sum += y;
24  }
25 
26  for (int i = 0; i < N; ++i) {
27  coeff[i] /= sum;
28  }
29 }
Quat exp(const Quat &q)
Definition: Quat.h:729
void resize(size_t n, bool shrinkIfNecessary=true)
Definition: Array.h:490
STL namespace.
G3D::int16 y
Definition: Vector2int16.h:38
double square(double fValue)
Definition: g3dmath.h:698
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::gaussRandom ( float  mean = 0.0f,
float  stdev = 1.0f 
)

Normally distributed random number.

Deprecated:
See also
Random::gaussian
18  {
19 
20  // Using Box-Mueller method from http://www.taygeta.com/random/gaussian.html
21  // Modified to specify standard deviation and mean of distribution
22  float w, x1, x2;
23 
24  // Loop until w is less than 1 so that log(w) is negative
25  do {
26  x1 = uniformRandom(-1.0, 1.0);
27  x2 = uniformRandom(-1.0, 1.0);
28 
29  w = float(square(x1) + square(x2));
30  } while (w > 1.0f);
31 
32  // Transform to gassian distribution
33  // Multiply by sigma (stdev ^ 2) and add mean.
34  return x2 * (float)square(stdev) * sqrtf((-2.0f * logf(w) ) / w) + mean;
35 }
float uniformRandom(float low=0.0f, float hi=1.0f)
Definition: g3dmath.h:694
double square(double fValue)
Definition: g3dmath.h:698

+ Here is the call graph for this function:

std::string G3D::generateFilenameBase ( const std::string &  prefix = "",
const std::string &  suffix = "" 
)

Creates a unique filename base in the current directory using the specified prefix and suffix.

411  {
412  Array<std::string> exist;
413 
414  // Note "template" is a reserved word in C++
415  std::string templat = prefix + System::currentDateString() + "_";
416  FileSystem::getFiles(templat + "*", exist, true);
417 
418  // Remove extensions
419  for (int i = 0; i < exist.size(); ++i) {
420  const std::string ext = FilePath::ext(exist[i]);
421  if (ext.length() > 0) {
422  exist[i] = exist[i].substr(0, exist[i].length() - ext.length() - 1);
423  }
424  }
425 
426  int num = 0;
427  std::string result;
428  templat += "%03d" + suffix;
429  do {
430  result = format(templat.c_str(), num);
431  ++num;
432  } while (exist.contains(result));
433 
434  return result;
435 }
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
void getFiles(const std::string &filespec, Array< std::string > &files, bool includePath)
Definition: fileutils.cpp:808
float length(float v)
Definition: vectorMath.h:208

+ Here is the call graph for this function:

static void G3D::getDeserializeSettings ( TextInput::Settings &  settings)
static
862  {
863  settings.cppBlockComments = true;
864  settings.cppLineComments = true;
865  settings.otherLineComments = false;
866  settings.generateCommentTokens = true;
867  settings.singleQuotedStrings = false;
868  settings.msvcFloatSpecials = true;
869  settings.caseSensitive = false;
870 }

+ Here is the caller graph for this function:

void G3D::getDirs ( const std::string &  filespec,
Array< std::string > &  files,
bool  includePath 
)
819  {
820 
821  determineFileOrDirList(filespec, files, false, includePath);
822 }
static void determineFileOrDirList(const std::string &filespec, Array< std::string > &files, bool wantFiles, bool includePath)
Definition: fileutils.cpp:773

+ Here is the call graph for this function:

static void G3D::getFileOrDirListNormal ( const std::string &  filespec,
Array< std::string > &  files,
bool  wantFiles,
bool  includePath 
)
static

Helper for getFileList and getDirectoryList.

Parameters
wantFilesIf false, returns the directories, otherwise returns the files.
includePathIf true, the names include paths
580  {
581 
582  bool test = wantFiles ? true : false;
583 
584  std::string path = "";
585 
586  // Find the place where the path ends and the file-spec begins
587  size_t i = filespec.rfind('/');
588  size_t j = filespec.rfind('\\');
589 
590  // Drive letters on Windows can separate a path
591  size_t k = filespec.rfind(':');
592 
593  if (((j != std::string::npos) && (j > i)) ||
594  (i == std::string::npos)) {
595  i = j;
596  }
597 
598  if (((k != std::string::npos) && (k > i)) ||
599  (i == std::string::npos)) {
600  i = k;
601  }
602 
603  // If there is a path, pull it off
604  if (i != std::string::npos) {
605  path = filespec.substr(0, i + 1);
606  }
607 
608  std::string prefix = path;
609 
610  if (path.size() > 0) {
611  // Strip the trailing character
612  path = path.substr(0, path.size() - 1);
613  }
614 
615 # ifdef G3D_WINDOWS
616  {
617  struct _finddata_t fileinfo;
618 
619  long handle = (long)_findfirst(filespec.c_str(), &fileinfo);
620  int result = handle;
621 
622  while (result != -1) {
623  if ((((fileinfo.attrib & _A_SUBDIR) == 0) == test) &&
624  strcmp(fileinfo.name, ".") &&
625  strcmp(fileinfo.name, "..")) {
626 
627  if (includePath) {
628  files.append(prefix + fileinfo.name);
629  } else {
630  files.append(fileinfo.name);
631  }
632  }
633 
634  result = _findnext(handle, &fileinfo);
635  }
636  }
637 # else
638  {
639  if (path == "") {
640  // Empty paths don't work on Unix
641  path = ".";
642  }
643 
644  // Unix implementation
645  DIR* dir = opendir(path.c_str());
646 
647  if (dir != NULL) {
648  struct dirent* entry = readdir(dir);
649 
650  while (entry != NULL) {
651 
652  // Exclude '.' and '..'
653  if ((strcmp(entry->d_name, ".") != 0) &&
654  (strcmp(entry->d_name, "..") != 0)) {
655 
656  // Form a name with a path
657  std::string filename = prefix + entry->d_name;
658  // See if this is a file or a directory
659  struct _stat st;
660  bool exists = _stat(filename.c_str(), &st) != -1;
661 
662  if (exists &&
663 
664  // Make sure it has the correct type
665  (((st.st_mode & S_IFDIR) == 0) == test) &&
666 
667  // Make sure it matches the wildcard
668  (fnmatch(filespec.c_str(),
669  filename.c_str(),
670  FNM_PATHNAME) == 0)) {
671 
672  if (includePath) {
673  files.append(filename);
674  } else {
675  files.append(entry->d_name);
676  }
677  }
678  }
679 
680  entry = readdir(dir);
681  }
682  closedir(dir);
683  }
684  }
685 # endif
686 }
#define _stat
Definition: fileutils.cpp:37
arena_t NULL
Definition: jemalloc_internal.h:624
void append(const T &value)
Definition: Array.h:583

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::getFileOrDirListZip ( const std::string &  path,
const std::string &  prefix,
Array< std::string > &  files,
bool  wantFiles,
bool  includePath 
)
static
746  {
747 #if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */
748  struct zip *z = zip_open( path.c_str(), ZIP_CHECKCONS, NULL );
749 
750  Set<std::string> fileSet;
751 
752  int count = zip_get_num_files( z );
753  for( int i = 0; i < count; ++i ) {
754  struct zip_stat info;
755  zip_stat_init( &info ); // TODO: Docs unclear if zip_stat_init is required.
756  zip_stat_index( z, i, ZIP_FL_NOCASE, &info );
757  _zip_addEntry(path, prefix, info.name, fileSet, wantFiles, includePath);
758  }
759 
760  zip_close( z );
761 
762  fileSet.getMembers(files);
763 #else
764  (void)path;
765  (void)prefix;
766  (void)files;
767  (void)wantFiles;
768  (void)includePath;
769 #endif
770 }
arena_t NULL
Definition: jemalloc_internal.h:624
G3D::int16 z
Definition: Vector3int16.h:46

+ Here is the caller graph for this function:

void G3D::getFiles ( const std::string &  filespec,
Array< std::string > &  files,
bool  includePath 
)
810  {
811 
812  determineFileOrDirList(filespec, files, true, includePath);
813 }
static void determineFileOrDirList(const std::string &filespec, Array< std::string > &files, bool wantFiles, bool includePath)
Definition: fileutils.cpp:773

+ Here is the call graph for this function:

void G3D::getG3DVersion ( std::string &  s)
static

Called from init

320  {
321 
322  const char* build =
323 # ifdef G3D_64BIT
324  "64-bit";
325 # else
326  "32-bit";
327 # endif
328 
329  const char* debug =
330 # ifdef G3D_DEBUG
331  " (Debug)";
332 # else
333  "";
334 # endif
335 
336  char cstr[100];
337  if ((G3D_VER % 100) != 0) {
338  sprintf(cstr, "G3D Innovation Engine %d.%02d beta %d, %s%s",
339  G3D_VER / 10000,
340  (G3D_VER / 100) % 100,
341  G3D_VER % 100,
342  build,
343  debug);
344  } else {
345  sprintf(cstr, "G3D Innovation Engine %d.%02d, %s%s",
346  G3D_VER / 10000,
347  (G3D_VER / 100) % 100,
348  build,
349  debug);
350  }
351 
352  s = cstr;
353 }
#define G3D_VER
Definition: platform.h:23
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::halfPi ( )
inline
155  {
156  return 1.57079633;
157 }

+ Here is the caller graph for this function:

size_t G3D::hashCode ( ) const
76  {
77  return static_cast<size_t>(x.bits() + ((int)y.bits() << 16));
78  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

int G3D::highestBit ( uint32  x)

Returnes the 0-based index of the highest 1 bit from the left. -1 means the number was 0.

[Based] on code by jukka.nosp@m.@lii.nosp@m.matta.nosp@m..org

88  {
89  // Binary search.
90  int base = 0;
91 
92  if (x & 0xffff0000) {
93  base = 16;
94  x >>= 16;
95  }
96  if (x & 0x0000ff00) {
97  base += 8;
98  x >>= 8;
99  }
100  if (x & 0x000000f0) {
101  base += 4;
102  x >>= 4;
103  }
104 
105  static const int lut[] = {-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3};
106  return base + lut[x];
107 }
G3D::int16 x
Definition: Vector2int16.h:37
int G3D::iAbs ( int  iValue)
inline
534  {
535  return ( iValue >= 0 ? iValue : -iValue );
536 }
int G3D::iCeil ( double  fValue)
inline
539  {
540  return int(::ceil(fValue));
541 }
static Vector3int16 ceil(const Vector3 &v)
Definition: Vector3int16.cpp:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::iClamp ( int  val,
int  low,
int  hi 
)
inline

Clamps the value to the range [low, hi] (inclusive)

545  {
546  debugAssert(low <= hi);
547  if (val <= low) {
548  return low;
549  } else if (val >= hi) {
550  return hi;
551  } else {
552  return val;
553  }
554 }
#define debugAssert(exp)
Definition: debugAssert.h:160

+ Here is the caller graph for this function:

int16 G3D::iClamp ( int16  val,
int16  low,
int16  hi 
)
inline
558  {
559  debugAssert(low <= hi);
560  if (val <= low) {
561  return low;
562  } else if (val >= hi) {
563  return hi;
564  } else {
565  return val;
566  }
567 }
#define debugAssert(exp)
Definition: debugAssert.h:160
Vector3int32 G3D::iFloor ( const Vector3 &  v)
23  {
24  return Vector3int32(iFloor(v.x), iFloor(v.y), iFloor(v.z));
25 }
Vector3int32
Definition: Vector3int32.h:29
int iFloor(double fValue)
Definition: g3dmath.h:603

+ Here is the call graph for this function:

int G3D::iFloor ( double  fValue)
inline
603  {
604  return int(::floor(fValue));
605 }
static Vector3int16 floor(const Vector3 &v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::iMax ( int  x,
int  y 
)
inline
Deprecated:
use G3D::min
759  {
760  return (x >= y) ? x : y;
761 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

int G3D::iMin ( int  x,
int  y 
)
inline
Deprecated:
use G3D::min
753  {
754  return (x >= y) ? y : x;
755 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

int G3D::iMod3 ( int  x)
inline

Computes x % 3.

881  {
882  return x % 3;
883 }
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::increaseBufferSize ( SOCKET  sock)
static

Increases the send and receive sizes of a socket to 2 MB from 8k

587  {
588 
589  // Increase the buffer size; the default (8192) is too easy to
590  // overflow when the network latency is high.
591  {
592  uint32 val = 1024 * 1024 * 2;
593  if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
594  (char*)&val, sizeof(val)) == SOCKET_ERROR) {
595  Log::common()->printf("WARNING: Increasing socket "
596  "receive buffer to %d failed.\n", val);
597  Log::common()->println(socketErrorCode());
598  }
599 
600  if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF,
601  (char*)&val, sizeof(val)) == SOCKET_ERROR) {
602  Log::common()->printf("WARNING: Increasing socket "
603  "send buffer to %d failed.\n", val);
604  Log::common()->println(socketErrorCode());
605  }
606  }
607 }
static std::string socketErrorCode(int code)
Definition: networkHelpers.h:64
static FileSystem * common
Definition: FileSystem.cpp:45
uint32_t uint32
Definition: Define.h:150

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::inf ( )

This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results.

40  {
41  return std::numeric_limits<double>::infinity();
42 }

+ Here is the caller graph for this function:

void G3D::initG3D ( const G3DSpecification &  spec = G3DSpecification())

Call from main() to initialize the G3D library state and register shutdown memory managers. This does not initialize OpenGL.

If you invoke initGLG3D, then it will automatically call initG3D. It is safe to call this function more than once–it simply ignores multiple calls.

See also
System, GLCaps, OSWindow, RenderDevice, initGLG3D.
void G3D::initMem ( )
inline
1429  {
1430  // Putting the test here ensures that the system is always
1431  // initialized, even when globals are being allocated.
1432  static bool initialized = false;
1433  if (! initialized) {
1434  bufferpool = new BufferPool();
1435  initialized = true;
1436  }
1437 }
static BufferPool * bufferpool
Definition: System.cpp:1399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::iRandom ( int  low,
int  hi 
)

Returns a random number uniformly at random between low and hi (inclusive).

Deprecated:
Use Random::integer
110  {
111  int r = iFloor(low + (high - low + 1) * (double)rand() / RAND_MAX);
112 
113  // There is a *very small* chance of generating
114  // a number larger than high.
115  if (r > high) {
116  return high;
117  } else {
118  return r;
119  }
120 }
int iFloor(double fValue)
Definition: g3dmath.h:603

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::iRound ( double  fValue)
inline

Fast round to integer using the lrint routine. Typically 6x faster than casting to integer.

226  {
227  return lrint(fValue);
228 }

+ Here is the caller graph for this function:

int G3D::iRound ( float  f)
inline

Fast round to integer using the lrint routine. Typically 6x faster than casting to integer.

234  {
235  return lrintf(f);
236 }
static bool G3D::isClose ( const char  c)
static

True if c is an open paren of some form

1201  {
1202  return c == ')' || c == ']' || c == '}';
1203 }

+ Here is the caller graph for this function:

static bool G3D::isContainerType ( Any::Type t)
static
30  {
31  return (t == Any::ARRAY) || (t == Any::TABLE) || (t == Any::EMPTY_CONTAINER);
32 }
Definition: inflate.h:37

+ Here is the caller graph for this function:

bool G3D::isDigit ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

164  {
165  return isdigit(c) != 0;
166 }

+ Here is the caller graph for this function:

bool G3D::isDirectory ( const std::string &  filename)
914  {
915  struct _stat st;
916  bool exists = _stat(filename.c_str(), &st) != -1;
917  return exists && ((st.st_mode & S_IFDIR) != 0);
918 }
#define _stat
Definition: fileutils.cpp:37

+ Here is the caller graph for this function:

bool G3D::isEven ( int  num)
inline
794  {
795  return (num & 1) == 0;
796 }

+ Here is the caller graph for this function:

bool G3D::isFinite ( double  x)
inline

Returns true if the argument is a finite real number.

525  {
526  return ! isNaN(x) && (x < G3D::inf()) && (x > -G3D::inf());
527 }
double inf()
Definition: g3dmath.cpp:40
bool isNaN(uint64 x)
Definition: g3dmath.h:270
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::isFinite ( float  x)
inline
529  {
530  return ! isNaN(x) && (x < G3D::finf()) && (x > -G3D::finf());
531 }
float finf()
Definition: g3dmath.cpp:71
bool isNaN(uint64 x)
Definition: g3dmath.h:270
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

int G3D::iSign ( int  iValue)
inline
608  {
609  return ( iValue > 0 ? + 1 : ( iValue < 0 ? -1 : 0 ) );
610 }

+ Here is the caller graph for this function:

int G3D::iSign ( double  fValue)
inline
612  {
613  return ( fValue > 0.0 ? + 1 : ( fValue < 0.0 ? -1 : 0 ) );
614 }
int G3D::iSign ( float  f)
inline
210  {
211  return iSign((double)f);
212 }
int iSign(float f)
Definition: g3dmath.h:210

+ Here is the call graph for this function:

bool G3D::isLetter ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

171  {
172  return isalpha(c) != 0;
173 }

+ Here is the caller graph for this function:

bool G3D::isNaN ( double  x)

Returns true if the argument is NaN (not a number). You can't use x == nan to test this because all comparisons against nan return false.

56  {
57  // Wipe out the sign bit
58  const uint64 y = *(uint64*)(&x) &
59  ((uint64(BIN32(01111111,11111111,11111111,11111111)) << 32) +
60  0xFFFFFFFF);
61 
62  // If the remaining number has all of the exponent bits set and atleast one
63  // fraction bit set, then it is NaN
64  return (y > (uint64(BIN32(01111111,11110000,00000000,00000000)) << 32));
65 }
uint64_t uint64
Definition: g3dmath.h:170
#define BIN32(dmsb, db2, db3, dlsb)
Generate a 32-bit constant in binary notation, in 8-bit strings.
Definition: BIN.h:86
uint64_t uint64
Definition: Define.h:149
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

bool G3D::isNaN ( float  x)
47  {
48  // Wipe out the sign bit
49  const uint32 y = *(uint32*)(&x) & BIN32(01111111,11111111,11111111,11111111);
50 
51  // If the remaining number has all of the exponent bits set and atleast one
52  // fraction bit set, then it is NaN
53  return (y > 0x7F800000);
54 }
#define BIN32(dmsb, db2, db3, dlsb)
Generate a 32-bit constant in binary notation, in 8-bit strings.
Definition: BIN.h:86
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::isNaN ( int  x)
inline
265  {
266  (void)x;
267  return false;
268 }
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::isNaN ( uint64  x)
inline
270  {
271  (void)x;
272  return false;
273 }
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::isNewline ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

157  {
158  return (c == '\n') || (c == '\r');
159 }

+ Here is the caller graph for this function:

static bool G3D::isNewline ( char  c)
static
411  {
412  return c == '\n' || c == '\r';
413 }
template<class T >
bool G3D::isNull ( const ReferenceCountedPointer< T > &  ptr)
34  {
35  return ! ptr;
36 }
template<class T >
bool G3D::isNull ( const T *  ptr)
44  {
45  return ptr == NULL;
46 }
arena_t NULL
Definition: jemalloc_internal.h:624
template<class T >
bool G3D::isNull ( const Pointer< T > &  p)
345  {
346  return p.isNull();
347 }

+ Here is the call graph for this function:

bool G3D::isOdd ( int  num)
inline
790  {
791  return (num & 1) == 1;
792 }

+ Here is the caller graph for this function:

static bool G3D::isOpen ( const char  c)
static

True if c is an open paren of some form

1195  {
1196  return c == '(' || c == '[' || c == '{';
1197 }

+ Here is the caller graph for this function:

bool G3D::isPow2 ( int  num)
inline

True if num is a power of two.

776  {
777  return ((num & -num) == num);
778 }

+ Here is the caller graph for this function:

bool G3D::isPow2 ( uint64  num)
inline
780  {
781  // See http://www.exploringbinary.com/ten-ways-to-check-if-an-integer-is-a-power-of-two-in-c/, method #9
782  return ((x != 0) && !(x & (x - 1)));
783 }
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::isPow2 ( uint32  x)
inline
785  {
786  // See http://www.exploringbinary.com/ten-ways-to-check-if-an-integer-is-a-power-of-two-in-c/, method #9
787  return ((x != 0) && !(x & (x - 1)));
788 }
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::isQuote ( const unsigned char  c)
inline
179  {
180  return (c == '\'') || (c == '\"');
181 }
static bool G3D::isSeparator ( char  c)
static
1388  {
1389  return c == ',' || c == ';';
1390 }

+ Here is the caller graph for this function:

bool G3D::isSlash ( const unsigned char  c)
inline
175  {
176  return (c == '\\') || (c == '/');
177 }

+ Here is the caller graph for this function:

bool G3D::isValidHeapPointer ( const void *  x)
inline

Useful for debugging purposes.

38  {
39  #ifdef _MSC_VER
40  return
41  (x != NULL) &&
42  (x != (void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee) &&
43  (x != (void*)0xcdcdcdcd) && (x != (void*)0xabababab) && (x != (void*)0xfdfdfdfd);
44  #else
45  return x != NULL;
46  #endif
47 }
arena_t NULL
Definition: jemalloc_internal.h:624
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

bool G3D::isValidIdentifier ( const std::string &  s)

Returns true if s is a valid C++ identifier

115  {
116  if (s.length() > 0 && (isLetter(s[0]) || s[0] == '_')) {
117  for (size_t i = 1; i < s.length() ; ++i) {
118  if (!( isLetter(s[i]) || (s[i] == '_') || isDigit(s[i]) )) {
119  return false;
120  }
121  }
122  return true;
123  }
124  return false;
125 }
bool isDigit(const unsigned char c)
Definition: stringutils.h:164
bool isLetter(const unsigned char c)
Definition: stringutils.h:171

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::isValidPointer ( const void *  x)
inline

Returns true if the pointer is likely to be a valid pointer (instead of an arbitrary number). Useful for debugging purposes.

54  {
55  #ifdef _MSC_VER
56  return (x != NULL) &&
57  (x != (void*)0xcccccccc) && (x != (void*)0xdeadbeef) && (x != (void*)0xfeeefeee) &&
58  (x != (void*)0xcdcdcdcd) && (x != (void*)0xabababab) && (x != (void*)0xfdfdfdfd);
59  #else
60  return x != NULL;
61  #endif
62 }
arena_t NULL
Definition: jemalloc_internal.h:624
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

bool G3D::isWhiteSpace ( const unsigned char  c)
inline

These standard C functions are renamed for clarity/naming conventions and to return bool, not int.

150  {
151  return isspace(c) != 0;
152 }

+ Here is the caller graph for this function:

static bool G3D::iswspace ( int  ch)
static
34 { return (ch==' ' || ch=='\t' || ch=='\n' || ch=='\r'); }

+ Here is the caller graph for this function:

bool G3D::isZero ( ) const
87  {
88  return (x == 0) && (y == 0);
89  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::isZipfile ( const std::string &  filename)
892  {
893 
894  FILE* f = fopen(filename.c_str(), "r");
895  if (f == NULL) {
896  return false;
897  }
898  uint8 header[4];
899  (void)fread(header, 4, 1, f);
900 
901  const uint8 zipHeader[4] = {0x50, 0x4b, 0x03, 0x04};
902  for (int i = 0; i < 4; ++i) {
903  if (header[i] != zipHeader[i]) {
904  fclose(f);
905  return false;
906  }
907  }
908 
909  fclose(f);
910  return true;
911 }
arena_t NULL
Definition: jemalloc_internal.h:624
uint8_t uint8
Definition: Define.h:152
int G3D::iWrap ( int  val,
int  hi 
)
inline

Wraps the value to the range [0, hi) (exclusive on the high end). This is like the clock arithmetic produced by % (modulo) except the result is guaranteed to be positive.

594  {
595  if (val < 0) {
596  return ((val % hi) + hi) % hi;
597  } else {
598  return val % hi;
599  }
600 }

+ Here is the caller graph for this function:

static void G3D::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
230  {
231  int srcIndex = 0;
232  int dstByteOffset = 0;
233  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
234  const float* src = static_cast<const float*>(srcBytes[0]);
235 
236  for (int y = 0; y < srcHeight; ++y) {
237  if (invertY) {
238  srcIndex = srcWidth * (srcHeight - y - 1);
239  }
240 
241  for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) {
242  Color3unorm8& d = *reinterpret_cast<Color3unorm8*>(dst + dstByteOffset);
243  const float s = src[srcIndex];
244  const unorm8 c(s);
245  d = Color3unorm8(c, c, c);
246  }
247  }
248 }
unorm8
Definition: unorm8.h:33
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::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
212  {
213  (void)bayerAlg;
214  (void)dstRowPadBits;
215  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
216  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
217  for (int y = 0; y < srcHeight; ++y) {
218  for (int x = 0; x < srcWidth; ++x) {
219  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
220  int i3 = i * 3;
221 
222  dst[i3 + 0] = src[i];
223  dst[i3 + 1] = src[i];
224  dst[i3 + 2] = src[i];
225  }
226  }
227 }
unorm8
Definition: unorm8.h:33
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
float G3D::length ( float  v)
inline
208  {
209  return ::fabsf(v);
210 }

+ Here is the caller graph for this function:

float G3D::length ( const Vector2 &  v)
inline
212  {
213  return v.length();
214 }

+ Here is the call graph for this function:

float G3D::length ( const Vector3 &  v)
inline
216  {
217  return v.magnitude();
218 }

+ Here is the call graph for this function:

float G3D::length ( const Vector4 &  v)
inline
220  {
221  return v.length();
222 }

+ Here is the call graph for this function:

Vector2 G3D::lerp ( const Vector2 &  v1,
const Vector2 &  v2,
float  f 
)
inline
120  {
121  return v1.lerp(v2, f);
122 }

+ Here is the call graph for this function:

Vector3 G3D::lerp ( const Vector3 &  v1,
const Vector3 &  v2,
float  f 
)
inline
124  {
125  return v1.lerp(v2, f);
126 }

+ Here is the call graph for this function:

Vector4 G3D::lerp ( const Vector4 &  v1,
const Vector4 &  v2,
float  f 
)
inline
128  {
129  return v1.lerp(v2, f);
130 }

+ Here is the call graph for this function:

Color1 G3D::lerp ( const Color1 &  v1,
const Color1 &  v2,
float  f 
)
inline
132  {
133  return v1.lerp(v2, f);
134 }

+ Here is the call graph for this function:

Color3 G3D::lerp ( const Color3 &  v1,
const Color3 &  v2,
float  f 
)
inline
136  {
137  return v1.lerp(v2, f);
138 }

+ Here is the call graph for this function:

Color4 G3D::lerp ( const Color4 &  v1,
const Color4 &  v2,
float  f 
)
inline
140  {
141  return v1.lerp(v2, f);
142 }

+ Here is the call graph for this function:

double G3D::lerp ( double  a,
double  b,
double  f 
)
inline

Returns a + (b - a) * f;

189  {
190  return a + (b - a) * f;
191 }

+ Here is the caller graph for this function:

float G3D::lerp ( float  a,
float  b,
float  f 
)
inline
193  {
194  return a + (b - a) * f;
195 }
std::string G3D::license ( )

G3D, SDL, and IJG libraries require license documentation to be distributed with your program. This generates the string that must appear in your documentation. Your program can be commercial, closed-source under any license you want.

Deprecated:
Use System::license
15  {
16  return format(
17 
18 "This software is based in part on the PNG Reference Library which is\n"
19 "Copyright (c) 2004 Glenn Randers-Pehrson\n\n"
20 "This software is based in part on the work of the Independent JPEG Group.\n\n"
21 "This software is based on part on the FFmpeg libavformat and libavcodec libraries\n"
22 "(\"FFmpeg\", http://ffmpeg.mplayerhq.hu), which are included under the terms of the\n"
23 "GNU Lesser General Public License (LGPL), (http://www.gnu.org/copyleft/lesser.html).\n\n"
24 "%s"
25 "This program uses the G3D Library (http://g3d.sf.net), which\n"
26 "is licensed under the \"Modified BSD\" Open Source license. The G3D library\n"
27 "source code is Copyright � 2000-2011, Morgan McGuire, All rights reserved.\n"
28 "This program uses The OpenGL Extension Wrangler Library, which \n"
29 "is licensed under the \"Modified BSD\" Open Source license. \n"
30 "The OpenGL Extension Wrangler Library source code is\n"
31 "Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\n"
32 "Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\n"
33 "Copyright (C) 2002, Lev Povalahev\n"
34 "All rights reserved.\n\n"
35 "The Modified BSD license is below, and requires the following statement:\n"
36 "\n"
37 "Redistribution and use in source and binary forms, with or without \n"
38 "modification, are permitted provided that the following conditions are met:\n"
39 "\n"
40 "* Redistributions of source code must retain the above copyright notice, \n"
41 " this list of conditions and the following disclaimer.\n"
42 "* Redistributions in binary form must reproduce the above copyright notice, \n"
43 " this list of conditions and the following disclaimer in the documentation \n"
44 " and/or other materials provided with the distribution.\n"
45 "* The name of the author may be used to endorse or promote products \n"
46 " derived from this software without specific prior written permission.\n"
47 "\n"
48 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n"
49 "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n"
50 "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n"
51 "ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n"
52 "LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n"
53 "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n"
54 "SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n"
55 "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n"
56 "CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n"
57 "ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n"
58 "THE POSSIBILITY OF SUCH DAMAGE.\n"
59 "\n\n"
60 "G3D VERSION %d\n",
61 
62 #ifdef G3D_WINDOWS
63  "" // Win32 doesn't use SDL
64 #else
65  "This software uses the Simple DirectMedia Layer library (\"SDL\",\n"
66  "http://www.libsdl.org), which is included under the terms of the\n"
67  "GNU Lesser General Public License, (http://www.gnu.org/copyleft/lesser.html).\n\n"
68 #endif
69 ,
70 G3D_VER);
71 }
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
#define G3D_VER
Definition: platform.h:23

+ Here is the call graph for this function:

template<class XType , class YType >
YType G3D::linearSpline ( double  x,
const XType *  controlX,
const YType *  controlY,
int  numControl 
)

Interpolates a property according to a piecewise linear spline. This provides C0 continuity but the derivatives are not smooth.

Example: const double times[] = {MIDNIGHT, SUNRISE - HOUR, SUNRISE, SUNRISE + sunRiseAndSetTime / 4, SUNRISE + sunRiseAndSetTime, SUNSET - sunRiseAndSetTime, SUNSET - sunRiseAndSetTime / 2, SUNSET, SUNSET + HOUR/2, DAY}; const Color3 color[] = {Color3(0, .0, .1), Color3(0, .0, .1), Color3::black(), Color3::black(), Color3::white() * .25, Color3::white() * .25, Color3(.5, .2, .2), Color3(.05, .05, .1), Color3(0, .0, .1), Color3(0, .0, .1)}; ambient = linearSpline(time, times, color, 10);

See also G3D::Spline

Parameters
xThe spline is a function of x; this is the sample to choose.
controlXcontrolX[i], controlY[i] is a control points. It is assumed that controlX are strictly increasing. XType must support the "<" operator and a subtraction operator that returns a number.
controlYYType must support multiplication and addition.
numControlThe number of control points.
42  {
43  debugAssert(numControl >= 1);
44 
45  // Off the beginning
46  if ((numControl == 1) || (x < controlX[0])) {
47  return controlY[0];
48  }
49 
50  for (int i = 1; i < numControl; ++i) {
51  if (x < controlX[i]) {
52  const double alpha = (double)(controlX[i] - x) / (controlX[i] - controlX[i - 1]);
53  return controlY[i] * (1 - alpha) + controlY[i - 1] * alpha;
54  }
55  }
56 
57  // Off the end
58  return controlY[numControl - 1];
59 }
#define debugAssert(exp)
Definition: debugAssert.h:160
G3D::int16 x
Definition: Vector2int16.h:37
Color3 G3D::log ( const Color3 &  c)
inline

Computes the log of each component. Useful for inverting the monitor gamma function or simulating perceptual response.

229  {
230  return Color3(::logf(c.r), ::logf(c.g), ::logf(c.b));
231 }
Quat G3D::log ( const Quat &  q)
inline
733  {
734  return q.log();
735 }

+ Here is the call graph for this function:

double G3D::log2 ( double  x)
inline
396  {
397  return ::log(x) * 1.442695;
398 }
TC_SHARED_API::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions,::google::protobuf::internal::EnumTypeTraits< ::bgs::protocol::LogOption,::bgs::protocol::LogOption_IsValid >, 14, false > log
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

float G3D::log2 ( float  x)
inline
400  {
401  return ::logf(x) * 1.442695f;
402 }
G3D::int16 x
Definition: Vector2int16.h:37
double G3D::log2 ( int  x)
inline
404  {
405  return log2((double)x);
406 }
double log2(int x)
Definition: g3dmath.h:404
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

void G3D::logLazyPrintf ( const char *  fmt,
  ... 
)

Does not flush the buffer; follow up with a logPrintf to force the flush.

33  {
34  va_list arg_list;
35  va_start(arg_list, fmt);
36  Log::common()->lazyvprintf(fmt, arg_list);
37  va_end(arg_list);
38 }
static FileSystem * common
Definition: FileSystem.cpp:45
Definition: format.h:285

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::logPrintf ( const char *  fmt,
  ... 
)

Prints to the common system log, log.txt, which is usually in the working directory of the program. If your disk is not writable or is slow, it will attempt to write to "c:/tmp/log.txt" or "c:/temp/log.txt" on Windows systems instead.

Unlike printf or debugPrintf, this function guarantees that all output is committed before it returns. This is very useful for debugging a crash, which might hide the last few buffered print statements otherwise.

Many G3D routines write useful warnings and debugging information to the system log, which makes it a good first place to go when tracking down a problem.

25  {
26  va_list arg_list;
27  va_start(arg_list, fmt);
28  Log::common()->vprintf(fmt, arg_list);
29  va_end(arg_list);
30 }
static FileSystem * common
Definition: FileSystem.cpp:45
Definition: format.h:285

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::logSocketInfo ( const SOCKET sock)
static
31  {
32  uint32 val;
33  socklen_t sz = 4;
34 
35  getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&val, (socklen_t*)&sz);
36  logPrintf("SOL_SOCKET/SO_RCVBUF = %d\n", val);
37 
38  getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&val, (socklen_t*)&sz);
39  logPrintf("SOL_SOCKET/SO_SNDBUF = %d\n", val);
40 
41  // Note: timeout = 0 means no timeout
42  getsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&val, (socklen_t*)&sz);
43  logPrintf("SOL_SOCKET/SO_RCVTIMEO = %d\n", val);
44 
45  getsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char*)&val, (socklen_t*)&sz);
46  logPrintf("SOL_SOCKET/SO_SNDTIMEO = %d\n", val);
47 }
uint32_t uint32
Definition: Define.h:150
void logPrintf(const char *fmt,...)
Definition: Log.cpp:25

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Vector2int32 G3D::max ( const Vector2int32 v) const
113  {
114  return Vector2int32(iMax(x, v.x), iMax(y, v.y));
115  }
Vector2int32(const class Vector2int16 &v)
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
int iMax(int x, int y)
Definition: g3dmath.h:759

+ Here is the call graph for this function:

Vector3int16 G3D::max ( const Vector3int16 v) const
118  {
119  return Vector3int16(std::max(x, v.x), std::max(y, v.y), std::max(z, v.z));
120  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
Vector3int16 max(const Vector3int16 &v) const
Definition: Vector3int16.h:118
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16 G3D::max ( const Vector2int16 v) const
123  {
124  return Vector2int16(iMax(x, v.x), iMax(y, v.y));
125  }
G3D::int16 y
Definition: Vector2int16.h:38
Vector2int16(const class Vector2int32 &v)
G3D::int16 x
Definition: Vector2int16.h:37
int iMax(int x, int y)
Definition: g3dmath.h:759

+ Here is the call graph for this function:

Vector3int32 G3D::max ( const Vector3int32 &  v) const
128  {
129  return Vector3int32(iMax(x, v.x), iMax(y, v.y), iMax(z, v.z));
130  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
int iMax(int x, int y)
Definition: g3dmath.h:759
Vector3int32(class BinaryInput &bi)

+ Here is the call graph for this function:

Vector2 G3D::max ( const Vector2 &  v1,
const Vector2 &  v2 
)
inline
176  {
177  return v1.max(v2);
178 }

+ Here is the call graph for this function:

Vector3 G3D::max ( const Vector3 &  v1,
const Vector3 &  v2 
)
inline
180  {
181  return v1.max(v2);
182 }

+ Here is the call graph for this function:

Vector4 G3D::max ( const Vector4 &  v1,
const Vector4 &  v2 
)
inline
184  {
185  return v1.max(v2);
186 }

+ Here is the call graph for this function:

Color3 G3D::max ( const Color3 &  v1,
const Color3 &  v2 
)
inline
188  {
189  return v1.max(v2);
190 }

+ Here is the call graph for this function:

Color4 G3D::max ( const Color4 &  v1,
const Color4 &  v2 
)
inline
192  {
193  return v1.max(v2);
194 }

+ Here is the call graph for this function:

template<class T >
T G3D::max ( const T &  x,
const T &  y 
)
inline
320  {
321  return std::max<T>(x, y);
322 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
template<class T >
T G3D::max ( const T &  x,
const T &  y,
const T &  z 
)
inline
325  {
326  return std::max<T>(std::max<T>(x, y), z);
327 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
template<class T >
T G3D::max ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline
330  {
331  return std::max<T>(std::max<T>(x, y), std::max<T>(z, w));
332 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
size_t G3D::maxNotNPOS ( size_t  i,
size_t  j 
)
inline

Returns the larger string index, ignoring std::string::npos.

45  {
46  if (i == std::string::npos) {
47  return j;
48  } else if (j == std::string::npos) {
49  return i;
50  } else {
51  return max(i, j);
52  }
53 }
T max(const T &x, const T &y)
Definition: g3dmath.h:320

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::md5_append ( md5_state_t *  pms,
const md5_byte_t *  data,
int  nbytes 
)
static
412 {
413  const md5_byte_t *p = data;
414  int left = nbytes;
415  int offset = (pms->count[0] >> 3) & 63;
416  md5_word_t nbits = (md5_word_t)(nbytes << 3);
417 
418  if (nbytes <= 0)
419  return;
420 
421  /* Update the message length. */
422  pms->count[1] += nbytes >> 29;
423  pms->count[0] += nbits;
424  if (pms->count[0] < nbits)
425  pms->count[1]++;
426 
427  /* Process an initial partial block. */
428  if (offset) {
429  int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
430 
431  memcpy(pms->buf + offset, p, copy);
432  if (offset + copy < 64)
433  return;
434  p += copy;
435  left -= copy;
436  md5_process(pms, pms->buf);
437  }
438 
439  /* Process full blocks. */
440  for (; left >= 64; p += 64, left -= 64)
441  md5_process(pms, p);
442 
443  /* Process a final partial block. */
444  if (left)
445  memcpy(pms->buf, p, left);
446 }
static void md5_process(md5_state_t *pms, const md5_byte_t *data)
Definition: Crypto_md5.cpp:220
bool left(const int *a, const int *b, const int *c)
Definition: RecastContour.cpp:487
unsigned char md5_byte_t
Definition: Crypto_md5.cpp:36
unsigned int md5_word_t
Definition: Crypto_md5.cpp:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::md5_finish ( md5_state_t *  pms,
md5_byte_t  digest[16] 
)
static
450 {
451  static const md5_byte_t pad[64] = {
452  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
453  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
454  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
455  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
456  };
457  md5_byte_t data[8];
458  int i;
459 
460  /* Save the length before padding. */
461  for (i = 0; i < 8; ++i)
462  data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
463  /* Pad to 56 bytes mod 64. */
464  md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
465  /* Append the length. */
466  md5_append(pms, data, 8);
467  for (i = 0; i < 16; ++i)
468  digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
469 }
IntFormatSpec< int, AlignTypeSpec< TYPE_CODE >, Char > pad(int value, unsigned width, Char fill= ' ')
static void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
Definition: Crypto_md5.cpp:411
unsigned char md5_byte_t
Definition: Crypto_md5.cpp:36

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::md5_init ( md5_state_t *  pms)
static
402 {
403  pms->count[0] = pms->count[1] = 0;
404  pms->abcd[0] = 0x67452301;
405  pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
406  pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
407  pms->abcd[3] = 0x10325476;
408 }
#define T_MASK
Definition: Crypto_md5.cpp:152

+ Here is the caller graph for this function:

static void G3D::md5_process ( md5_state_t *  pms,
const md5_byte_t *  data 
)
static
221 {
222  md5_word_t
223  a = pms->abcd[0], b = pms->abcd[1],
224  c = pms->abcd[2], d = pms->abcd[3];
225  md5_word_t t;
226 #if BYTE_ORDER > 0
227  /* Define storage only for big-endian CPUs. */
228  md5_word_t X[16];
229 #else
230  /* Define storage for little-endian or both types of CPUs. */
231  md5_word_t xbuf[16];
232  const md5_word_t *X;
233 #endif
234 
235  {
236 #if BYTE_ORDER == 0
237  /*
238  * Determine dynamically whether this is a big-endian or
239  * little-endian machine, since we can use a more efficient
240  * algorithm on the latter.
241  */
242  static const int w = 1;
243 
244  if (*((const md5_byte_t *)&w)) /* dynamic little-endian */
245 #endif
246 #if BYTE_ORDER <= 0 /* little-endian */
247  {
248  /*
249  * On little-endian machines, we can process properly aligned
250  * data without copying it.
251  */
252  if (!((data - (const md5_byte_t *)0) & 3)) {
253  /* data are properly aligned */
254  X = (const md5_word_t *)data;
255  } else {
256  /* not aligned */
257  memcpy(xbuf, data, 64);
258  X = xbuf;
259  }
260  }
261 #endif
262 #if BYTE_ORDER == 0
263  else /* dynamic big-endian */
264 #endif
265 #if BYTE_ORDER >= 0 /* big-endian */
266  {
267  /*
268  * On big-endian machines, we must arrange the bytes in the
269  * right order.
270  */
271  const md5_byte_t *xp = data;
272  int i;
273 
274 # if BYTE_ORDER == 0
275  X = xbuf; /* (dynamic only) */
276 # else
277 # define xbuf X /* (static only) */
278 # endif
279  for (i = 0; i < 16; ++i, xp += 4)
280  xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
281  }
282 #endif
283  }
284 
285 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
286 
287  /* Round 1. */
288  /* Let [abcd k s i] denote the operation
289  a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
290 #define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
291 #define SET(a, b, c, d, k, s, Ti)\
292  t = a + F(b,c,d) + X[k] + Ti;\
293  a = ROTATE_LEFT(t, s) + b
294  /* Do the following 16 operations. */
295  SET(a, b, c, d, 0, 7, T1);
296  SET(d, a, b, c, 1, 12, T2);
297  SET(c, d, a, b, 2, 17, T3);
298  SET(b, c, d, a, 3, 22, T4);
299  SET(a, b, c, d, 4, 7, T5);
300  SET(d, a, b, c, 5, 12, T6);
301  SET(c, d, a, b, 6, 17, T7);
302  SET(b, c, d, a, 7, 22, T8);
303  SET(a, b, c, d, 8, 7, T9);
304  SET(d, a, b, c, 9, 12, T10);
305  SET(c, d, a, b, 10, 17, T11);
306  SET(b, c, d, a, 11, 22, T12);
307  SET(a, b, c, d, 12, 7, T13);
308  SET(d, a, b, c, 13, 12, T14);
309  SET(c, d, a, b, 14, 17, T15);
310  SET(b, c, d, a, 15, 22, T16);
311 #undef SET
312 
313  /* Round 2. */
314  /* Let [abcd k s i] denote the operation
315  a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
316 #define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
317 #define SET(a, b, c, d, k, s, Ti)\
318  t = a + G(b,c,d) + X[k] + Ti;\
319  a = ROTATE_LEFT(t, s) + b
320  /* Do the following 16 operations. */
321  SET(a, b, c, d, 1, 5, T17);
322  SET(d, a, b, c, 6, 9, T18);
323  SET(c, d, a, b, 11, 14, T19);
324  SET(b, c, d, a, 0, 20, T20);
325  SET(a, b, c, d, 5, 5, T21);
326  SET(d, a, b, c, 10, 9, T22);
327  SET(c, d, a, b, 15, 14, T23);
328  SET(b, c, d, a, 4, 20, T24);
329  SET(a, b, c, d, 9, 5, T25);
330  SET(d, a, b, c, 14, 9, T26);
331  SET(c, d, a, b, 3, 14, T27);
332  SET(b, c, d, a, 8, 20, T28);
333  SET(a, b, c, d, 13, 5, T29);
334  SET(d, a, b, c, 2, 9, T30);
335  SET(c, d, a, b, 7, 14, T31);
336  SET(b, c, d, a, 12, 20, T32);
337 #undef SET
338 
339  /* Round 3. */
340  /* Let [abcd k s t] denote the operation
341  a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
342 #define H(x, y, z) ((x) ^ (y) ^ (z))
343 #define SET(a, b, c, d, k, s, Ti)\
344  t = a + H(b,c,d) + X[k] + Ti;\
345  a = ROTATE_LEFT(t, s) + b
346  /* Do the following 16 operations. */
347  SET(a, b, c, d, 5, 4, T33);
348  SET(d, a, b, c, 8, 11, T34);
349  SET(c, d, a, b, 11, 16, T35);
350  SET(b, c, d, a, 14, 23, T36);
351  SET(a, b, c, d, 1, 4, T37);
352  SET(d, a, b, c, 4, 11, T38);
353  SET(c, d, a, b, 7, 16, T39);
354  SET(b, c, d, a, 10, 23, T40);
355  SET(a, b, c, d, 13, 4, T41);
356  SET(d, a, b, c, 0, 11, T42);
357  SET(c, d, a, b, 3, 16, T43);
358  SET(b, c, d, a, 6, 23, T44);
359  SET(a, b, c, d, 9, 4, T45);
360  SET(d, a, b, c, 12, 11, T46);
361  SET(c, d, a, b, 15, 16, T47);
362  SET(b, c, d, a, 2, 23, T48);
363 #undef SET
364 
365  /* Round 4. */
366  /* Let [abcd k s t] denote the operation
367  a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
368 #define I(x, y, z) ((y) ^ ((x) | ~(z)))
369 #define SET(a, b, c, d, k, s, Ti)\
370  t = a + I(b,c,d) + X[k] + Ti;\
371  a = ROTATE_LEFT(t, s) + b
372  /* Do the following 16 operations. */
373  SET(a, b, c, d, 0, 6, T49);
374  SET(d, a, b, c, 7, 10, T50);
375  SET(c, d, a, b, 14, 15, T51);
376  SET(b, c, d, a, 5, 21, T52);
377  SET(a, b, c, d, 12, 6, T53);
378  SET(d, a, b, c, 3, 10, T54);
379  SET(c, d, a, b, 10, 15, T55);
380  SET(b, c, d, a, 1, 21, T56);
381  SET(a, b, c, d, 8, 6, T57);
382  SET(d, a, b, c, 15, 10, T58);
383  SET(c, d, a, b, 6, 15, T59);
384  SET(b, c, d, a, 13, 21, T60);
385  SET(a, b, c, d, 4, 6, T61);
386  SET(d, a, b, c, 11, 10, T62);
387  SET(c, d, a, b, 2, 15, T63);
388  SET(b, c, d, a, 9, 21, T64);
389 #undef SET
390 
391  /* Then perform the following additions. (That is increment each
392  of the four registers by the value it had before this block
393  was started.) */
394  pms->abcd[0] += a;
395  pms->abcd[1] += b;
396  pms->abcd[2] += c;
397  pms->abcd[3] += d;
398 }
#define T14
Definition: Crypto_md5.cpp:166
#define T22
Definition: Crypto_md5.cpp:174
#define T9
Definition: Crypto_md5.cpp:161
#define SET(a, b, c, d, k, s, Ti)
#define T38
Definition: Crypto_md5.cpp:190
#define T16
Definition: Crypto_md5.cpp:168
#define T4
Definition: Crypto_md5.cpp:156
#define T45
Definition: Crypto_md5.cpp:197
#define T6
Definition: Crypto_md5.cpp:158
#define T29
Definition: Crypto_md5.cpp:181
#define X
Definition: CollisionDetection.cpp:2281
#define T25
Definition: Crypto_md5.cpp:177
#define T27
Definition: Crypto_md5.cpp:179
#define T24
Definition: Crypto_md5.cpp:176
#define T33
Definition: Crypto_md5.cpp:185
#define T51
Definition: Crypto_md5.cpp:203
#define T15
Definition: Crypto_md5.cpp:167
#define T49
Definition: Crypto_md5.cpp:201
#define T34
Definition: Crypto_md5.cpp:186
#define T1
Definition: Crypto_md5.cpp:153
#define T26
Definition: Crypto_md5.cpp:178
#define T55
Definition: Crypto_md5.cpp:207
#define T57
Definition: Crypto_md5.cpp:209
#define T61
Definition: Crypto_md5.cpp:213
#define T41
Definition: Crypto_md5.cpp:193
#define T21
Definition: Crypto_md5.cpp:173
#define T59
Definition: Crypto_md5.cpp:211
#define T10
Definition: Crypto_md5.cpp:162
#define T54
Definition: Crypto_md5.cpp:206
#define T11
Definition: Crypto_md5.cpp:163
#define T3
Definition: Crypto_md5.cpp:155
#define T60
Definition: Crypto_md5.cpp:212
#define T56
Definition: Crypto_md5.cpp:208
#define T2
Definition: Crypto_md5.cpp:154
#define T18
Definition: Crypto_md5.cpp:170
#define T64
Definition: Crypto_md5.cpp:216
#define T36
Definition: Crypto_md5.cpp:188
#define T44
Definition: Crypto_md5.cpp:196
#define T7
Definition: Crypto_md5.cpp:159
#define T32
Definition: Crypto_md5.cpp:184
#define T31
Definition: Crypto_md5.cpp:183
#define T23
Definition: Crypto_md5.cpp:175
#define T62
Definition: Crypto_md5.cpp:214
#define T43
Definition: Crypto_md5.cpp:195
#define T5
Definition: Crypto_md5.cpp:157
unsigned char md5_byte_t
Definition: Crypto_md5.cpp:36
#define T35
Definition: Crypto_md5.cpp:187
#define T19
Definition: Crypto_md5.cpp:171
#define T8
Definition: Crypto_md5.cpp:160
#define T47
Definition: Crypto_md5.cpp:199
#define T46
Definition: Crypto_md5.cpp:198
#define T50
Definition: Crypto_md5.cpp:202
#define T17
Definition: Crypto_md5.cpp:169
#define T20
Definition: Crypto_md5.cpp:172
#define T63
Definition: Crypto_md5.cpp:215
unsigned int md5_word_t
Definition: Crypto_md5.cpp:37
#define T52
Definition: Crypto_md5.cpp:204
#define T42
Definition: Crypto_md5.cpp:194
#define T48
Definition: Crypto_md5.cpp:200
#define T58
Definition: Crypto_md5.cpp:210
#define T30
Definition: Crypto_md5.cpp:182
#define T40
Definition: Crypto_md5.cpp:192
#define T53
Definition: Crypto_md5.cpp:205
#define T28
Definition: Crypto_md5.cpp:180
#define T39
Definition: Crypto_md5.cpp:191
#define T37
Definition: Crypto_md5.cpp:189
#define T13
Definition: Crypto_md5.cpp:165
#define T12
Definition: Crypto_md5.cpp:164

+ Here is the caller graph for this function:

Vector2int32 G3D::min ( const Vector2int32 v) const
117  {
118  return Vector2int32(iMin(x, v.x), iMin(y, v.y));
119  }
Vector2int32(const class Vector2int16 &v)
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
int iMin(int x, int y)
Definition: g3dmath.h:753

+ Here is the call graph for this function:

Vector3int16 G3D::min ( const Vector3int16 v) const
122  {
123  return Vector3int16(std::min(x, v.x), std::min(y, v.y), std::min(z, v.z));
124  }
Vector3int16(class BinaryInput &bi)
Vector3int16 min(const Vector3int16 &v) const
Definition: Vector3int16.h:122
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16 G3D::min ( const Vector2int16 v) const
127  {
128  return Vector2int16(iMin(x, v.x), iMin(y, v.y));
129  }
G3D::int16 y
Definition: Vector2int16.h:38
Vector2int16(const class Vector2int32 &v)
G3D::int16 x
Definition: Vector2int16.h:37
int iMin(int x, int y)
Definition: g3dmath.h:753

+ Here is the call graph for this function:

Vector3int32 G3D::min ( const Vector3int32 &  v) const
132  {
133  return Vector3int32(iMin(x, v.x), iMin(y, v.y), iMin(z, v.z));
134  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
int iMin(int x, int y)
Definition: g3dmath.h:753

+ Here is the call graph for this function:

Vector2 G3D::min ( const Vector2 &  v1,
const Vector2 &  v2 
)
inline
156  {
157  return v1.min(v2);
158 }

+ Here is the call graph for this function:

Vector3 G3D::min ( const Vector3 &  v1,
const Vector3 &  v2 
)
inline
160  {
161  return v1.min(v2);
162 }

+ Here is the call graph for this function:

Vector4 G3D::min ( const Vector4 &  v1,
const Vector4 &  v2 
)
inline
164  {
165  return v1.min(v2);
166 }

+ Here is the call graph for this function:

Color3 G3D::min ( const Color3 &  v1,
const Color3 &  v2 
)
inline
168  {
169  return v1.min(v2);
170 }

+ Here is the call graph for this function:

Color4 G3D::min ( const Color4 &  v1,
const Color4 &  v2 
)
inline
172  {
173  return v1.min(v2);
174 }

+ Here is the call graph for this function:

template<class T >
T G3D::min ( const T &  x,
const T &  y 
)
inline
305  {
306  return std::min<T>(x, y);
307 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
template<class T >
T G3D::min ( const T &  x,
const T &  y,
const T &  z 
)
inline
310  {
311  return std::min<T>(std::min<T>(x, y), z);
312 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
template<class T >
T G3D::min ( const T &  x,
const T &  y,
const T &  z,
const T &  w 
)
inline
315  {
316  return std::min<T>(std::min<T>(x, y), std::min<T>(z, w));
317 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
void G3D::msgBox ( const std::string &  message,
const std::string &  title = "Message" 
)

Displays a GUI prompt with "Ok" as the only choice.

584  {
585 
586  const char *choice[] = {"Ok"};
587  prompt(title.c_str(), message.c_str(), choice, 1, true);
588 }
int prompt(const char *windowTitle, const char *promptx, const char **choice, int numChoices, bool useGui)
Definition: prompt.cpp:553

+ Here is the call graph for this function:

Matrix4 G3D::mul ( const Matrix4 &  a,
const Matrix4 &  b 
)
inline
32  {
33  return a * b;
34 }
Vector4 G3D::mul ( const Matrix4 &  m,
const Vector4 &  v 
)
inline
36  {
37  return m * v;
38 }
Vector3 G3D::mul ( const Matrix3 &  m,
const Vector3 &  v 
)
inline
40  {
41  return m * v;
42 }
Matrix3 G3D::mul ( const Matrix3 &  a,
const Matrix3 &  b 
)
inline
44  {
45  return a * b;
46 }
float G3D::mul ( float  a,
float  b 
)
inline

a * b (for DirectX/Cg support)

453  {
454  return a * b;
455 }

+ Here is the caller graph for this function:

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

Multiplies two unsigned 64-bit integers, placing the result into one 64-bit int and the overflow into another.

34  {
35 
36  // Break each number into 4 32-bit chunks. Since we are using uints, right-shifting will fill with zeros.
37  // This eliminates the need to and with 0xFFFFFFFF.
38  uint32 a [2] = {static_cast<uint32>(_a & 0xFFFFFFFF), static_cast<uint32>(_a >> 32)};
39  uint32 b [2] = {static_cast<uint32>(_b & 0xFFFFFFFF), static_cast<uint32>(_b >> 32)};
40 
41  uint64 prod [2][2];
42  for(int i = 0; i < 2; ++i) {
43  for(int j = 0; j < 2; ++j) {
44  prod[i][j] = uint64(a[i]) * b[j];
45  }
46  }
47 
48  // The product of the low bits of a and b will always fit into the result
49  result = prod[0][0];
50 
51  // The product of the high bits of a and b will never fit into the result
52  carry = prod[1][1];
53 
54  // The high 32 bits of prod[0][1] and prod[1][0] will never fit into the result
55  carry += prod[0][1] >> 32;
56  carry += prod[1][0] >> 32;
57 
58  uint64 tmp;
59  addAndCarry(result, (prod[0][1] << 32), tmp, result);
60  carry += tmp;
61  addAndCarry(result, (prod[1][0] << 32), tmp, result);
62  carry += tmp;
63 }
static void addAndCarry(const uint64 &_a, const uint64 &_b, uint64 &carry, uint64 &result)
Definition: uint128.cpp:16
uint64_t uint64
Definition: g3dmath.h:170
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::nan ( )

This value should not be tested against directly, instead G3D::isNan() and G3D::isFinite() will return reliable results.

77  {
78  // double is a standard type and should have quiet NaN
79  return std::numeric_limits<double>::quiet_NaN();
80 }

+ Here is the caller graph for this function:

static bool G3D::needsQuotes ( const std::string &  s)
static
927  {
928  if (! isLetter(s[0]) && (s[0] != '_')) {
929  return true;
930  }
931 
932  for (int i = 0; i < (int)s.length(); ++i) {
933  char c = s[i];
934 
935  // peek character
936  char p = (i == (int)s.length() - 1) ? '_' : s[i + 1];
937 
938  // Identify separators
939  if ((c == '-' && p == '>') ||
940  (c == ':' && p == ':')) {
941  // Skip over this symbol
942  ++i;
943  continue;
944  }
945 
946  if (! isDigit(c) && ! isLetter(c) & (c != '.')) {
947  // This is an illegal character for an identifier, so we need quotes
948  return true;
949  }
950  }
951 
952  return false;
953 }
bool isDigit(const unsigned char c)
Definition: stringutils.h:164
bool isLetter(const unsigned char c)
Definition: stringutils.h:171

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool G3D::nonZero ( ) const
56  {
57  return (x != 0) || (y != 0) || (z != 0);
58  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2 G3D::normalize ( const Vector2 &  v)
inline
60  {
61  return v / v.length();
62 }

+ Here is the call graph for this function:

Vector3 G3D::normalize ( const Vector3 &  v)
inline
64  {
65  return v / v.magnitude();
66 }

+ Here is the call graph for this function:

Vector4 G3D::normalize ( const Vector4 &  v)
inline
68  {
69  return v / v.length();
70 }

+ Here is the call graph for this function:

float G3D::normalize ( float  v)
inline

v / v (for DirectX/Cg support)

438  {
439  return v / v;
440 }
template<class T >
bool G3D::notNull ( const ReferenceCountedPointer< T > &  ptr)
39  {
40  return (bool)ptr;
41 }
template<class T >
bool G3D::notNull ( const T *  ptr)
49  {
50  return ptr != NULL;
51 }
arena_t NULL
Definition: jemalloc_internal.h:624
template<class T >
bool G3D::notNull ( const Pointer< T > &  p)
350  {
351  return ! p.isNull();
352 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static unorm8 G3D::one ( )
static
75  {
76  return fromBits(255);
77  }
static unorm8 fromBits(uint8 b)
Definition: unorm8.h:44

+ Here is the call graph for this function:

static unorm16 G3D::one ( )
static
78  {
79  return fromBits(65535);
80  }
static unorm16 fromBits(uint16 b)
Definition: unorm16.h:43

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G3D::operator double ( ) const
74  {
75  return double(m_bits) * (1.0 / 65535.0);
76  }
G3D::operator float ( ) const

Returns a number on [0.0f, 1.0f]

70  {
71  return float(m_bits) * (1.0f / 65535.0f);
72  }
bool G3D::operator!= ( const Vector2unorm16 rkVector) const
inline
70  {
71  return ((int32*)this)[0] != ((int32*)&rkVector)[0];
72  }
int32_t int32
Definition: Define.h:146
bool G3D::operator!= ( const Vector2int32 other) const
inline
109  {
110  return !(*this == other);
111  }
bool G3D::operator!= ( const Vector3int16 rkVector) const
inline
110  {
111  return ( x != rkVector.x || y != rkVector.y || z != rkVector.z );
112  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::operator!= ( const unorm8  other) const
115  {
116  return m_bits != other.m_bits;
117  }
bool G3D::operator!= ( const unorm16  other) const
118  {
119  return m_bits != other.m_bits;
120  }
bool G3D::operator!= ( const Vector2int16 rkVector) const
inline
119  {
120  return ((int32*)this)[0] != ((int32*)&rkVector)[0];
121  }
int32_t int32
Definition: Define.h:146
bool G3D::operator!= ( const Vector3int32 &  rkVector) const
124  {
125  return ( x != rkVector.x || y != rkVector.y || z != rkVector.z );
126  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::operator!= ( const NetAddress &  a,
const NetAddress &  b 
)
inline
128  {
129  return !(a == b);
130 }
Vector3int32 G3D::operator& ( int16  i) const
149  {
150  return Vector3int16(x & i, y & i, z & i);
151  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int16 G3D::operator& ( const Vector3int16 v) const
153  {
154  return Vector3int16(x & v.x, y & v.y, z & v.z);
155  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int32 G3D::operator* ( const Vector2int32 other) const
inline
67  {
68  return Vector2int32(x * other.x, y * other.y);
69  }
Vector2int32(const class Vector2int16 &v)
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16 G3D::operator* ( const Vector2int16 other) const
inline
69  {
70  return Vector2int16(x * other.x, y * other.y);
71  }
G3D::int16 y
Definition: Vector2int16.h:38
Vector2int16(const class Vector2int32 &v)
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int16 G3D::operator* ( const Vector3int16 other) const
inline
74  {
75  return Vector3int16(x * other.x, y * other.y, z * other.z);
76  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32 G3D::operator* ( const Vector3int32 &  other) const
inline
81  {
82  return Vector3int32(x * other.x, y * other.y, z * other.z);
83  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
Vector3int32 G3D::operator* ( const int  i) const
inline
140  {
141  return unorm16(uint16(m_bits * i));
142  }
uint16_t uint16
Definition: g3dmath.h:166
unorm16(double f)
Definition: unorm16.h:65
Color4 G3D::operator* ( const Color3 &  c3,
const Color4 &  c4 
)
inline

Extends the c3 with alpha = 1.0

188  {
189  return Color4(c3.r * c4.r, c3.g * c4.g, c3.b * c4.b, c4.a);
190 }
Vector2 G3D::operator* ( double  s,
const Vector2 &  v 
)
inline
269  {
270  return v * (float)s;
271 }
Vector2 G3D::operator* ( float  s,
const Vector2 &  v 
)
inline
273  {
274  return v * s;
275 }
G3D::Color3 G3D::operator* ( float  s,
const G3D::Color3 c 
)
inline
275  {
276  return c * s;
277 }
Vector2 G3D::operator* ( int  s,
const Vector2 &  v 
)
inline
277  {
278  return v * (float)s;
279 }
G3D::Color3 G3D::operator* ( G3D::Color1 s,
const G3D::Color3 c 
)
inline
279  {
280  return c * s.value;
281 }
float value
Definition: Color1.h:37
G3D::Color3 G3D::operator* ( const G3D::Color3 c,
G3D::Color1 s 
)
inline
283  {
284  return c * s.value;
285 }
float value
Definition: Color1.h:37
Color4 G3D::operator* ( float  fScalar,
const Color4 &  other 
)
inline
297  {
298  return Color4(fScalar * other.r, fScalar * other.g,
299  fScalar * other.b, fScalar * other.a);
300 }
Matrix3 G3D::operator* ( double  fScalar,
const Matrix3 &  rkMatrix 
)

scalar * matrix

370  {
371  Matrix3 kProd;
372 
373  for (int iRow = 0; iRow < 3; ++iRow) {
374  for (int iCol = 0; iCol < 3; ++iCol) {
375  kProd[iRow][iCol] = (float)fScalar * rkMatrix.elt[iRow][iCol];
376  }
377  }
378 
379  return kProd;
380 }
Matrix3 G3D::operator* ( float  fScalar,
const Matrix3 &  rkMatrix 
)
382  {
383  return (double)fScalar * rkMatrix;
384 }
Vector3 G3D::operator* ( const Vector3 &  rkPoint,
const Matrix3 &  rkMatrix 
)
inline

v * M == M.transpose() * v

386  {
387  Vector3 kProd;
388 
389  for (int r = 0; r < 3; ++r) {
390  kProd[r] =
391  rkPoint[0] * rkMatrix.elt[0][r] +
392  rkPoint[1] * rkMatrix.elt[1][r] +
393  rkPoint[2] * rkMatrix.elt[2][r];
394  }
395 
396  return kProd;
397 }
Matrix3 G3D::operator* ( int  fScalar,
const Matrix3 &  rkMatrix 
)
387  {
388  return (double)fScalar * rkMatrix;
389 }
G3D::Vector3 G3D::operator* ( float  s,
const G3D::Vector3 v 
)
inline
584  {
585  return v * s;
586 }
G3D::Vector3 G3D::operator* ( double  s,
const G3D::Vector3 v 
)
inline
588  {
589  return v * (float)s;
590 }
G3D::Vector3 G3D::operator* ( int  s,
const G3D::Vector3 v 
)
inline
592  {
593  return v * (float)s;
594 }
G3D::Quat G3D::operator* ( double  s,
const G3D::Quat q 
)
inline
737  {
738  return q * (float)s;
739 }
G3D::Quat G3D::operator* ( float  s,
const G3D::Quat q 
)
inline

[Based] on Watt & Watt, page 360

741  {
742  return q * s;
743 }
Vector3int16& G3D::operator*= ( const Vector3int16 other)
inline
96  {
97  x *= other.x;
98  y *= other.y;
99  z *= other.z;
100  return *this;
101  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int32& G3D::operator*= ( const Vector2int32 other)
inline
97  {
98  x *= other.x;
99  y *= other.y;
100  return *this;
101  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16& G3D::operator*= ( const Vector2int16 other)
inline
107  {
108  x *= other.x;
109  y *= other.y;
110  return *this;
111  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32& G3D::operator*= ( const Vector3int32 &  other)
113  {
114  x *= other.x;
115  y *= other.y;
116  z *= other.z;
117  return *this;
118  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
unorm8 & G3D::operator*= ( const int  i)
144  {
145  m_bits *= i;
146  return *this;
147  }
Vector2int32 G3D::operator+ ( const Vector2int32 other) const
inline
55  {
56  return Vector2int32(x + other.x, y + other.y);
57  }
Vector2int32(const class Vector2int16 &v)
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16 G3D::operator+ ( const Vector2int16 other) const
inline
61  {
62  return Vector2int16(x + other.x, y + other.y);
63  }
G3D::int16 y
Definition: Vector2int16.h:38
Vector2int16(const class Vector2int32 &v)
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int16 G3D::operator+ ( const Vector3int16 other) const
inline
66  {
67  return Vector3int16(x + other.x, y + other.y, z + other.z);
68  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32 G3D::operator+ ( const Vector3int32 &  other) const
inline
73  {
74  return Vector3int32(x + other.x, y + other.y, z + other.z);
75  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
unorm8 G3D::operator+ ( const unorm8  other) const
119  {
120  return unorm8(uint8(m_bits + other.m_bits));
121  }
unorm8(double f)
Definition: unorm8.h:62
uint8_t uint8
Definition: g3dmath.h:164
unorm16 G3D::operator+ ( const unorm16  other) const
122  {
123  return unorm16(uint16(m_bits + other.m_bits));
124  }
uint16_t uint16
Definition: g3dmath.h:166
unorm16(double f)
Definition: unorm16.h:65
Vector2int32& G3D::operator+= ( const Vector2int32 other)
inline
75  {
76  x += other.x;
77  y += other.y;
78  return *this;
79  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16& G3D::operator+= ( const Vector2int16 other)
inline
81  {
82  x += other.x;
83  y += other.y;
84  return *this;
85  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int16& G3D::operator+= ( const Vector3int16 other)
inline
82  {
83  x += other.x;
84  y += other.y;
85  z += other.z;
86  return *this;
87  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32& G3D::operator+= ( const Vector3int32 &  other)
99  {
100  x += other.x;
101  y += other.y;
102  z += other.z;
103  return *this;
104  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
unorm8& G3D::operator+= ( const unorm8  other)
123  {
124  m_bits += other.m_bits;
125  return *this;
126  }
unorm16& G3D::operator+= ( const unorm16  other)
126  {
127  m_bits += other.m_bits;
128  return *this;
129  }
Vector2int32 G3D::operator- ( const Vector2int32 other) const
inline
59  {
60  return Vector2int32(x - other.x, y - other.y);
61  }
Vector2int32(const class Vector2int16 &v)
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16 G3D::operator- ( const Vector2int16 other) const
inline
65  {
66  return Vector2int16(x - other.x, y - other.y);
67  }
G3D::int16 y
Definition: Vector2int16.h:38
Vector2int16(const class Vector2int32 &v)
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int16 G3D::operator- ( const Vector3int16 other) const
inline
70  {
71  return Vector3int16(x - other.x, y - other.y, z - other.z);
72  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32 G3D::operator- ( ) const
inline
73  {
74  return Vector2int16(-x, -y);
75  }
G3D::int16 y
Definition: Vector2int16.h:38
Vector2int16(const class Vector2int32 &v)
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32 G3D::operator- ( const Vector3int32 &  other) const
inline
77  {
78  return Vector3int32(x - other.x, y - other.y, z - other.z);
79  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
unorm8 G3D::operator- ( const unorm8  other) const
128  {
129  return unorm8(uint8(m_bits - other.m_bits));
130  }
unorm8(double f)
Definition: unorm8.h:62
uint8_t uint8
Definition: g3dmath.h:164
unorm16 G3D::operator- ( const unorm16  other) const
131  {
132  return unorm16(uint16(m_bits - other.m_bits));
133  }
uint16_t uint16
Definition: g3dmath.h:166
unorm16(double f)
Definition: unorm16.h:65
Vector3int16& G3D::operator-= ( const Vector3int16 other)
inline
89  {
90  x -= other.x;
91  y -= other.y;
92  z -= other.z;
93  return *this;
94  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int32& G3D::operator-= ( const Vector2int32 other)
inline
91  {
92  x -= other.x;
93  y -= other.y;
94  return *this;
95  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector2int16& G3D::operator-= ( const Vector2int16 other)
inline
101  {
102  x -= other.x;
103  y -= other.y;
104  return *this;
105  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32& G3D::operator-= ( const Vector3int32 &  other)
106  {
107  x -= other.x;
108  y -= other.y;
109  z -= other.z;
110  return *this;
111  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
unorm8& G3D::operator-= ( const unorm8  other)
132  {
133  m_bits -= other.m_bits;
134  return *this;
135  }
unorm16& G3D::operator-= ( const unorm16  other)
135  {
136  m_bits -= other.m_bits;
137  return *this;
138  }
Vector3int32 G3D::operator/ ( const Vector3int32 &  other) const
inline

Integer division

90  {
91  return Vector3int32(x / other.x, y / other.y, z / other.z);
92  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
Vector3int32 G3D::operator/ ( const int  s) const
inline

Integer division

149  {
150  return unorm16(uint16(m_bits / i));
151  }
uint16_t uint16
Definition: g3dmath.h:166
unorm16(double f)
Definition: unorm16.h:65
G3D::Color3 G3D::operator/ ( float  s,
const G3D::Color3 c 
)
inline
287  {
288  return c * (1.0f/s);
289 }
unorm8 & G3D::operator/= ( const int  i)
153  {
154  m_bits /= i;
155  return *this;
156  }
bool G3D::operator< ( const unorm8  other) const
99  {
100  return m_bits < other.m_bits;
101  }
bool G3D::operator< ( const unorm16  other) const
102  {
103  return m_bits < other.m_bits;
104  }
std::ostream & G3D::operator<< ( std::ostream &  os,
const NetAddress &  a 
)
26  {
27  return os << a.toString();
28 }

+ Here is the call graph for this function:

Vector3int16 G3D::operator<< ( const Vector3int16 v) const
145  {
146  return Vector3int16(x << v.x, y << v.y, z << v.z);
147  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32 G3D::operator<< ( const Vector3int32 &  v) const
154  {
155  return Vector3int32(x << v.x, y << v.y, z << v.z);
156  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
Vector3int32 G3D::operator<< ( const int  s) const
inline

Shifts both x and y

158  {
159  return unorm16((uint16)(m_bits << i));
160  }
unorm16(double f)
Definition: unorm16.h:65
uint16_t uint16
Definition: Define.h:151
std::ostream & G3D::operator<< ( std::ostream &  os,
const Vector3 &  v 
)
163  {
164  return os << v.toString();
165 }

+ Here is the call graph for this function:

unorm8 & G3D::operator<<= ( const int  i)
162  {
163  m_bits <<= i;
164  return *this;
165  }
bool G3D::operator<= ( const Vector2int32 ) const
bool G3D::operator<= ( const Vector2int16 ) const
bool G3D::operator<= ( const Vector3int32 &  ) const
bool G3D::operator<= ( const Vector2unorm16 ) const
bool G3D::operator<= ( const Vector3int16 ) const
bool G3D::operator<= ( const unorm8  other) const
107  {
108  return m_bits <= other.m_bits;
109  }
bool G3D::operator<= ( const unorm16  other) const
110  {
111  return m_bits <= other.m_bits;
112  }
Vector2unorm16 & G3D::operator= ( const Any &  a)
bool G3D::operator== ( const Vector2unorm16 rkVector) const
inline
66  {
67  return ((int32*)this)[0] == ((int32*)&rkVector)[0];
68  }
int32_t int32
Definition: Define.h:146
bool G3D::operator== ( const Vector2int32 other) const
inline
105  {
106  return (x == other.x) && (y == other.y);
107  }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::operator== ( const Vector3int16 rkVector) const
inline
106  {
107  return ( x == rkVector.x && y == rkVector.y && z == rkVector.z );
108  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::operator== ( const unorm8  other) const
111  {
112  return m_bits <= other.m_bits;
113  }
bool G3D::operator== ( const unorm16  other) const
114  {
115  return m_bits <= other.m_bits;
116  }
bool G3D::operator== ( const Vector2int16 rkVector) const
inline
115  {
116  return ((int32*)this)[0] == ((int32*)&rkVector)[0];
117  }
int32_t int32
Definition: Define.h:146
bool G3D::operator== ( const Vector3int32 &  rkVector) const
120  {
121  return ( x == rkVector.x && y == rkVector.y && z == rkVector.z );
122  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
bool G3D::operator== ( const NetAddress &  a,
const NetAddress &  b 
)
inline

Two addresses may point to the same computer but be != because they have different IP's.

123  {
124  return (a.ip() == b.ip()) && (a.port() == b.port());
125 }

+ Here is the call graph for this function:

bool G3D::operator> ( const Vector2int32 ) const
bool G3D::operator> ( const Vector2int16 ) const
bool G3D::operator> ( const Vector3int32 &  ) const
bool G3D::operator> ( const Vector2unorm16 ) const
bool G3D::operator> ( const Vector3int16 ) const
bool G3D::operator> ( const unorm8  other) const
95  {
96  return m_bits > other.m_bits;
97  }
bool G3D::operator> ( const unorm16  other) const
98  {
99  return m_bits > other.m_bits;
100  }
bool G3D::operator>= ( const Vector2int32 ) const
bool G3D::operator>= ( const Vector2int16 ) const
bool G3D::operator>= ( const Vector3int32 &  ) const
bool G3D::operator>= ( const Vector2unorm16 ) const
bool G3D::operator>= ( const Vector3int16 ) const
bool G3D::operator>= ( const unorm8  other) const
103  {
104  return m_bits >= other.m_bits;
105  }
bool G3D::operator>= ( const unorm16  other) const
106  {
107  return m_bits >= other.m_bits;
108  }
Vector3int16 G3D::operator>> ( const Vector3int16 v) const
141  {
142  return Vector3int16(x >> v.x, y >> v.y, z >> v.z);
143  }
Vector3int16(class BinaryInput &bi)
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32 G3D::operator>> ( const Vector3int32 &  v) const
150  {
151  return Vector3int32(x >> v.x, y >> v.y, z >> v.z);
152  }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
Vector3int32(class BinaryInput &bi)
Vector3int32 G3D::operator>> ( const int  s) const
inline

Shifts both x and y

167  {
168  return unorm16(uint16(m_bits >> i));
169  }
uint16_t uint16
Definition: g3dmath.h:166
unorm16(double f)
Definition: unorm16.h:65
unorm8 & G3D::operator>>= ( const int  i)
171  {
172  m_bits >>= i;
173  return *this;
174  }
const G3D::int32 & G3D::operator[] ( int  i)
inline
51  {
52  debugAssert(((unsigned int)i) <= 1);
53  return ((G3D::int16*)this)[i];
54  }
int16_t int16
Definition: g3dmath.h:165
#define debugAssert(exp)
Definition: debugAssert.h:160
void G3D::parseCommaSeparated ( const std::string  s,
Array< std::string > &  array,
bool  stripQuotes = true 
)

Separates a comma-separated line, properly escaping commas within double quotes (") and super quotes ("""). This matches Microsoft Excel's CSV output.

Parameters
stripQuotesIf true, strips leading and trailing " and """
See also
G3D::stringSplit, G3D::TextInput, G3D::readWholeFile
37  {
38  array.fastClear();
39  if (s == "") {
40  return;
41  }
42 
43  size_t begin = 0;
44  const char delimiter = ',';
45  const char quote = '\"';
46  do {
47  size_t end = begin;
48  // Find the next comma, or the end of the string
49  bool inQuotes = false;
50  while ((end < s.length()) && (inQuotes || (s[end] != delimiter))) {
51  if (s[end] == quote) {
52  if ((end < s.length() - 2) && (s[end + 1] == quote) && (s[end + 2]) == quote) {
53  // Skip over the superquote
54  end += 2;
55  }
56  inQuotes = ! inQuotes;
57  }
58  ++end;
59  }
60  array.append(s.substr(begin, end - begin));
61  begin = end + 1;
62  } while (begin < s.length());
63 
64  if (stripQuotes) {
65  for (int i = 0; i < array.length(); ++i) {
66  std::string& t = array[i];
67  size_t L = t.length();
68  if ((L > 1) && (t[0] == quote) && (t[L - 1] == quote)) {
69  if ((L > 6) && (t[1] == quote) && (t[2] == quote) && (t[L - 3] == quote) && (t[L - 2] == quote)) {
70  // Triple-quote
71  t = t.substr(3, L - 6);
72  } else {
73  // Double-quote
74  t = t.substr(1, L - 2);
75  }
76  }
77  }
78  }
79 }
void fastClear()
Definition: Array.h:419
int length() const
Definition: Array.h:438
void append(const T &value)
Definition: Array.h:583

+ Here is the call graph for this function:

void G3D::parseFilename ( const std::string &  filename,
std::string &  drive,
Array< std::string > &  path,
std::string &  base,
std::string &  ext 
)

Parses a filename into four useful pieces.

Examples:

c:\a\b\d.e root = "c:\\" path = "a" "b" base = "d" ext = "e"

/a/b/d.e root = "/" path = "a" "b" base = "d" ext = "e"

/a/b root = "/" path = "a" base = "b" ext = "e"

462  {
463 
464  std::string f = filename;
465 
466  root = "";
467  path.clear();
468  base = "";
469  ext = "";
470 
471  if (f == "") {
472  // Empty filename
473  return;
474  }
475 
476  // See if there is a root/drive spec.
477  if ((f.size() >= 2) && (f[1] == ':')) {
478 
479  if ((f.size() > 2) && isSlash(f[2])) {
480 
481  // e.g. c:\foo
482  root = f.substr(0, 3);
483  f = f.substr(3, f.size() - 3);
484 
485  } else {
486 
487  // e.g. c:foo
488  root = f.substr(2);
489  f = f.substr(2, f.size() - 2);
490 
491  }
492 
493  } else if ((f.size() >= 2) & isSlash(f[0]) && isSlash(f[1])) {
494 
495  // e.g. //foo
496  root = f.substr(0, 2);
497  f = f.substr(2, f.size() - 2);
498 
499  } else if (isSlash(f[0])) {
500 
501  root = f.substr(0, 1);
502  f = f.substr(1, f.size() - 1);
503 
504  }
505 
506  // Pull the extension off
507  {
508  // Find the period
509  size_t i = f.rfind('.');
510 
511  if (i != std::string::npos) {
512  // Make sure it is after the last slash!
513  size_t j = maxNotNPOS(f.rfind('/'), f.rfind('\\'));
514  if ((j == std::string::npos) || (i > j)) {
515  ext = f.substr(i + 1, f.size() - i - 1);
516  f = f.substr(0, i);
517  }
518  }
519  }
520 
521  // Pull the basename off
522  {
523  // Find the last slash
524  size_t i = maxNotNPOS(f.rfind('/'), f.rfind('\\'));
525 
526  if (i == std::string::npos) {
527 
528  // There is no slash; the basename is the whole thing
529  base = f;
530  f = "";
531 
532  } else if ((i != std::string::npos) && (i < f.size() - 1)) {
533 
534  base = f.substr(i + 1, f.size() - i - 1);
535  f = f.substr(0, i);
536 
537  }
538  }
539 
540  // Parse what remains into path.
541  size_t prev, cur = 0;
542 
543  while (cur < f.size()) {
544  prev = cur;
545 
546  // Allow either slash
547  size_t i = f.find('/', prev + 1);
548  size_t j = f.find('\\', prev + 1);
549  if (i == std::string::npos) {
550  i = f.size();
551  }
552 
553  if (j == std::string::npos) {
554  j = f.size();
555  }
556 
557  cur = min(i, j);
558 
559  if (cur == std::string::npos) {
560  cur = f.size();
561  }
562 
563  path.append(f.substr(prev, cur - prev));
564  ++cur;
565  }
566 }
T min(const T &x, const T &y)
Definition: g3dmath.h:305
bool isSlash(const unsigned char c)
Definition: stringutils.h:175
size_t maxNotNPOS(size_t i, size_t j)
Returns the larger string index, ignoring std::string::npos.
Definition: stringutils.h:45
void clear(bool shrink=true)
Definition: Array.h:407
int prev(int i, int n)
Definition: RecastContour.cpp:468
void append(const T &value)
Definition: Array.h:583

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string G3D::pathConcat ( const std::string &  dirname,
const std::string &  file 
)

Appends file onto dirname, ensuring a / if needed.

Deprecated:
Use FilePath::concat
47  {
48  // Ensure that the directory ends in a slash
49  if ((dirname.size() != 0) &&
50  (dirname[dirname.size() - 1] != '/') &&
51  (dirname[dirname.size() - 1] != '\\') &&
52  (dirname[dirname.size() - 1] != ':')) {
53  return dirname + '/' + file;
54  } else {
55  return dirname + file;
56  }
57 }

+ Here is the caller graph for this function:

double G3D::pi ( )
inline
147  {
148  return 3.1415926535898;
149 }

+ Here is the caller graph for this function:

float G3D::pif ( )
inline
151  {
152  return 3.1415926535898f;
153 }

+ Here is the caller graph for this function:

static bool G3D::planeBoxOverlap ( const Vector3 &  normal,
const Vector3 &  vert,
const Vector3 &  maxbox 
)
static
2292  {
2293  Vector3 vmin, vmax;
2294  float v;
2295 
2296  // for each axis
2297  for(int a = 0; a < 3; ++a) {
2298  v = vert[a];
2299 
2300  if (normal[a] > 0.0f) {
2301  vmin[a] = -maxbox[a] - v;
2302  vmax[a] = maxbox[a] - v;
2303  } else {
2304  vmin[a] = maxbox[a] - v;
2305  vmax[a] = -maxbox[a] - v;
2306  }
2307  }
2308 
2309  if (normal.dot(vmin) > 0.0f) {
2310  return false;
2311  } else if (normal.dot(vmax) >= 0.0f) {
2312  return true;
2313  } else {
2314  return false;
2315  }
2316 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::pow2 ( unsigned int  x)
inline

Returns 2^x

392  {
393  return 1 << x;
394 }
G3D::int16 x
Definition: Vector2int16.h:37
template<class T >
T G3D::pow5 ( x)
inline

Returns x5

298  {
299  const T y = x * x;
300  return y * y * x;
301 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
int G3D::prompt ( const char *  windowTitle,
const char *  promptx,
const char **  choice,
int  numChoices,
bool  useGui 
)

Prints a prompt to stdout and waits for user input. The return value is the number of the user's choice (the first is 0, if there are no choices, returns 0).

Parameters
useGuiUnder Win32, use a GUI, not stdout prompt.
windowTitleThe title for the prompt window
promptxThe text string to prompt the user with
choiceAn array of strings that are the choices the user may make
numChoicesThe length of choice.

[Windows] dialog interface by Max McGuire, mmcgu.nosp@m.ire@.nosp@m.ironl.nosp@m.ore..nosp@m.com [Font] setting code by Kurt Miller, kurt@.nosp@m.flip.nosp@m.code..nosp@m.com

558  {
559 #if 0 /* G3DFIX: exclude GUI prompt code */
560  #ifdef G3D_WINDOWS
561  if (useGui) {
562  // Build the message box
563  return guiPrompt(windowTitle, prompt, choice, numChoices);
564  }
565  #endif
566 
567  #ifdef G3D_OSX
568  if (useGui){
569  //Will default to text prompt if numChoices > 4
570  int result = guiPrompt(windowTitle, prompt, choice, numChoices);
571  fprintf(stderr, "%d\n", result);
572  return result;
573  }
574  #endif
575 #else
576  (void)useGui;
577 #endif /* G3DFIX: exclude GUI prompt code */
578  return textPrompt(windowTitle, prompt, choice, numChoices);
579 }
FMT_API int fprintf(std::FILE *f, CStringRef format, ArgList args)
static int textPrompt(const char *windowTitle, const char *prompt, const char **choice, int numChoices)
Definition: prompt.cpp:481
int prompt(const char *windowTitle, const char *promptx, const char **choice, int numChoices, bool useGui)
Definition: prompt.cpp:553

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int G3D::prompt ( const char *  windowTitle,
const char *  promptx,
const char **  choice,
int  numChoices 
)
inline

Prints a prompt and waits for user input. The return value is the number of the user's choice (the first is 0, if there are no choices, returns 0).

Uses GUI under Win32, stdout prompt otherwise.

50  {
51 
52  return prompt(windowTitle, promptx, choice, numChoices, true);
53 }
int prompt(const char *windowTitle, const char *promptx, const char **choice, int numChoices)
Definition: prompt.h:46

+ Here is the call graph for this function:

static double G3D::pythag ( double  a,
double  b 
)
static

Helper for svdCore

1486  {
1487 
1488  double at = fabs(a), bt = fabs(b), ct, result;
1489 
1490  if (at > bt) {
1491  ct = bt / at;
1492  result = at * sqrt(1.0 + square(ct));
1493  } else if (bt > 0.0) {
1494  ct = at / bt;
1495  result = bt * sqrt(1.0 + square(ct));
1496  } else {
1497  result = 0.0;
1498  }
1499 
1500  return result;
1501 }
double square(double fValue)
Definition: g3dmath.h:698

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uint32 G3D::readUInt32FromBuffer ( const uint8 data,
bool  swapBytes 
)
static

Helper used by the constructors for decompression

53  {
54  if (swapBytes) {
55  uint8 out[4];
56  out[0] = data[3];
57  out[1] = data[2];
58  out[2] = data[1];
59  out[3] = data[0];
60  return *((uint32*)out);
61  } else {
62  return *((uint32*)data);
63  }
64 }
uint32_t uint32
Definition: Define.h:150
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

static bool G3D::readWaiting ( const SOCKET sock)
static

Returns true if the socket has a read pending

72  {
73  int ret = selectOneReadSocket(sock);
74 
75  switch (ret) {
76  case SOCKET_ERROR:
77  logPrintf("ERROR: selectOneReadSocket returned "
78  "SOCKET_ERROR in readWaiting(). %s", socketErrorCode().c_str());
79  // Return true so that we'll force an error on read and close
80  // the socket.
81  return true;
82 
83  case 0:
84  return false;
85 
86  default:
87  return true;
88  }
89 }
static int selectOneReadSocket(const SOCKET &sock)
Definition: NetworkDevice.cpp:54
static std::string socketErrorCode(int code)
Definition: networkHelpers.h:64
void logPrintf(const char *fmt,...)
Definition: Log.cpp:25

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string G3D::readWholeFile ( const std::string &  filename)

Returns the contents of a text file as a single string

101  {
102 
103  std::string s;
104 
105  debugAssert(filename != "");
106  if (! FileSystem::exists(filename)) {
107  throw (filename + " not found");
108  }
109  FileSystem::markFileUsed(filename);
110  std::string zipfile;
111 
112  if (! FileSystem::inZipfile(filename, zipfile)) {
113  // Not in zipfile
114  if (! FileSystem::exists(filename)) {
115  throw FileNotFound(filename, std::string("File not found in readWholeFile: ") + filename);
116  }
117 
118  int64 length = FileSystem::size(filename);
119 
120  char* buffer = (char*)System::alignedMalloc(length + 1, 16);
121  debugAssert(buffer);
122  FILE* f = FileSystem::fopen(filename.c_str(), "rb");
123  debugAssert(f);
124  int64 ret = fread(buffer, 1, length, f);
125  debugAssert(ret == length);(void)ret;
126  FileSystem::fclose(f);
127 
128  buffer[length] = '\0';
129  s = std::string(buffer);
130 
131  System::alignedFree(buffer);
132 
133  } else {
134 
135  // In zipfile
136  FileSystem::markFileUsed(zipfile);
137 
138 #if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */
139  // Zipfiles require Unix-style slashes
140  std::string internalFile = FilePath::canonicalize(filename.substr(zipfile.length() + 1));
141  struct zip* z = zip_open(zipfile.c_str(), ZIP_CHECKCONS, NULL);
142  {
143  struct zip_stat info;
144  zip_stat_init( &info ); // TODO: Docs unclear if zip_stat_init is required.
145  zip_stat(z, internalFile.c_str(), ZIP_FL_NOCASE, &info);
146 
147  // Add NULL termination
148  char* buffer = reinterpret_cast<char*>(System::alignedMalloc(info.size + 1, 16));
149  buffer[info.size] = '\0';
150 
151  struct zip_file* zf = zip_fopen( z, internalFile.c_str(), ZIP_FL_NOCASE );
152  if (zf == NULL) {
153  throw std::string("\"") + internalFile + "\" inside \"" + zipfile + "\" could not be opened.";
154  } else {
155  const int64 bytesRead = zip_fread( zf, buffer, (info.size));
156  debugAssertM((int64)bytesRead == (int64)info.size,
157  internalFile + " was corrupt because it unzipped to the wrong size.");
158  (void)bytesRead;
159  zip_fclose( zf );
160  }
161  // Copy the string
162  s = buffer;
163  System::alignedFree(buffer);
164  }
165  zip_close( z );
166 #endif
167  }
168 
169  return s;
170 }
int64_t int64
Definition: Define.h:145
arena_t NULL
Definition: jemalloc_internal.h:624
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
#define debugAssert(exp)
Definition: debugAssert.h:160
G3D::int16 z
Definition: Vector3int16.h:46
float length(float v)
Definition: vectorMath.h:208

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint16 G3D::reinterpretAsUInt16 ( ) const

Returns the underlying bits in this representation. Equivalent to:

uint16 i = reinterpret_cast<const uint16&>(u);
uint8 i = reinterpret_cast<const uint8&>(u);
94  {
95  return m_bits;
96  }
uint8 G3D::reinterpretAsUInt8 ( ) const

Returns the underlying bits in this representation. Equivalent to:

uint16 i = reinterpret_cast<const uint16&>(u);
uint8 i = reinterpret_cast<const uint8&>(u);
91  {
92  return m_bits;
93  }
static unorm16 G3D::reinterpretFrom ( uint16  b)
static

Equivalent to:

unorm16 u = reinterpret_cast<const unorm16&>(255);
48  {
49  return unorm16(b);
50  }
unorm16(double f)
Definition: unorm16.h:65
static unorm8 G3D::reinterpretFrom ( uint8  b)
static

Equivalent to:

unorm16 u = reinterpret_cast<const unorm16&>(255);
49  {
50  return unorm8(b);
51  }
unorm8(double f)
Definition: unorm8.h:62
std::string G3D::replace ( const std::string &  s,
const std::string &  pattern,
const std::string &  replacement 
)

Returns a string which is s, with all instances of pattern replaced

97  {
98  if (pattern.length() == 0) {
99  return s;
100  }
101  std::string temp = "";
102  size_t lastindex = 0;
103  size_t nextindex = 0;
104  do {
105  nextindex = s.find(pattern, lastindex);
106  if (nextindex == std::string::npos) {
107  break;
108  }
109  temp += s.substr(lastindex, nextindex - lastindex) + replacement;
110  lastindex = nextindex + pattern.length();
111  } while (lastindex + pattern.length() <= s.length());
112  return temp + (lastindex < s.length() ? s.substr(lastindex) : "");
113 }

+ Here is the caller graph for this function:

std::string G3D::resolveFilename ( const std::string &  filename)
59  {
60  if (filename.size() >= 1) {
61  if ((filename[0] == '/') || (filename[0] == '\\')) {
62  // Already resolved
63  return filename;
64  } else {
65 
66  #ifdef G3D_WINDOWS
67  if ((filename.size() >= 2) && (filename[1] == ':')) {
68  // There is a drive spec on the front.
69  if ((filename.size() >= 3) && ((filename[2] == '\\') ||
70  (filename[2] == '/'))) {
71  // Already fully qualified
72  return filename;
73  } else {
74  // The drive spec is relative to the
75  // working directory on that drive.
76  debugAssertM(false, "Files of the form d:path are"
77  " not supported (use a fully qualified"
78  " name).");
79  return filename;
80  }
81  }
82  #endif
83  }
84  }
85 
86  char buffer[1024];
87 
88  // Prepend the working directory.
89  (void)_getcwd(buffer, 1024);
90 
91  return format("%s/%s", buffer, filename.c_str());
92 }
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
#define _getcwd
Definition: fileutils.cpp:36

+ Here is the call graph for this function:

static void G3D::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
413  {
414  debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format");
415 
416  int dstIndex = 0;
417  int srcByteOffset = 0;
418  int srcRowPadBytes = srcRowPadBits / 8;
419  Color4* dst = static_cast<Color4*>(dstBytes[0]);
420  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
421 
422  for (int y = 0; y < srcHeight; ++y) {
423  if (invertY) {
424  dstIndex = srcWidth * (srcHeight - 1 - y);
425  }
426 
427  for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3 * sizeof(float)) {
428  const Color3& s = *reinterpret_cast<const Color3*>(src + srcByteOffset);
429  dst[dstIndex] = Color4(Color3(s), 1.0f);
430  }
431  srcByteOffset += srcRowPadBytes;
432  }
433 }
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::rgb8_to_bayer_bggr8 ( const int  w,
const int  h,
const unorm8 *  src,
unorm8 *  dst 
)
static
917  {
918  Color3unorm8* srcColor = (Color3unorm8*)src;
919  Color1unorm8* dstColor = (Color1unorm8*)dst;
920 
921  // Top row pixels
922  for (int y = 0; y < h - 1; y += 2) {
923  int offset = y * w;
924 
925  // Top left pixels
926  for (int x = 0; x < w - 1; x += 2) {
927  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].b);
928  }
929 
930  // Top right pixels
931  for (int x = 1; x < w - 1; x += 2) {
932  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
933  }
934  }
935 
936  // Bottom row pixels
937  for (int y = 1; y < h - 1; y += 2) {
938  int offset = y * w;
939 
940  // Bottom left pixels
941  for(int x = 0; x < w - 1; x += 2) {
942  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
943  }
944 
945  // Bottom right pixels
946  for(int x = 1; x < w - 1; x += 2) {
947  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].r);
948  }
949  }
950 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static void G3D::rgb8_to_bayer_gbrg8 ( const int  w,
const int  h,
const unorm8 *  src,
unorm8 *  dst 
)
static
954  {
955  Color3unorm8* srcColor = (Color3unorm8*)src;
956  Color1unorm8* dstColor = (Color1unorm8*)dst;
957 
958  // Top row pixels
959  for(int y = 0; y < h - 1; y += 2) {
960  int offset = y * w;
961 
962  // Top left pixels
963  for(int x = 0; x < w - 1; x += 2) {
964  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
965  }
966 
967  // Top right pixels
968  for(int x = 1; x < w - 1; x += 2) {
969  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].b);
970  }
971  }
972 
973  // Bottom row pixels
974  for(int y = 1; y < h - 1; y += 2) {
975  int offset = y * w;
976 
977  // Bottom left pixels
978  for(int x = 0; x < w - 1; x += 2) {
979  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].r);
980  }
981 
982  // Bottom right pixels
983  for(int x = 1; x < w - 1; x += 2) {
984  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
985  }
986  }
987 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static void G3D::rgb8_to_bayer_grbg8 ( const int  w,
const int  h,
const unorm8 *  src,
unorm8 *  dst 
)
static
880  {
881  Color3unorm8* srcColor = (Color3unorm8*)src;
882  Color1unorm8* dstColor = (Color1unorm8*)dst;
883 
884  // Top row pixels
885  for (int y = 0; y < h - 1; y += 2) {
886  int offset = y * w;
887 
888  // Top left pixels
889  for (int x = 0; x < w - 1; x += 2) {
890  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
891  }
892 
893  // Top right pixels
894  for (int x = 1; x < w - 1; x += 2) {
895  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].r);
896  }
897  }
898 
899  // Bottom row pixels
900  for (int y = 1; y < h - 1; y += 2) {
901  int offset = y * w;
902 
903  // Bottom left pixels
904  for (int x = 0; x < w - 1; x += 2) {
905  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].b);
906  }
907 
908  // Bottom right pixels
909  for (int x = 1; x < w - 1; x += 2) {
910  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
911  }
912  }
913 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static void G3D::rgb8_to_bayer_rggb8 ( const int  w,
const int  h,
const unorm8 *  src,
unorm8 *  dst 
)
static
843  {
844  Color3unorm8* srcColor = (Color3unorm8*)src;
845  Color1unorm8* dstColor = (Color1unorm8*)dst;
846 
847  // Top row pixels
848  for (int y = 0; y < h - 1; y += 2) {
849  int offset = y * w;
850 
851  // Top left pixels
852  for(int x = 0; x < w - 1; x += 2) {
853  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].r);
854  }
855 
856  // Top right pixels
857  for(int x = 1; x < w - 1; x += 2) {
858  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
859  }
860  }
861 
862  // Bottom row pixels
863  for (int y = 1; y < h - 1; y += 2) {
864  int offset = y * w;
865 
866  // Bottom left pixels
867  for (int x = 0; x < w - 1; x += 2) {
868  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].g);
869  }
870 
871  // Bottom right pixels
872  for (int x = 1; x < w - 1; x += 2) {
873  dstColor[x + offset] = Color1unorm8(srcColor[x + offset].b);
874  }
875  }
876 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static void G3D::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
268  {
269  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
270  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
271  for (int y = 0; y < srcHeight; ++y) {
272  for (int x = 0; x < srcWidth; ++x) {
273  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
274  int i3 = i * 3;
275  dst[i3 + 0] = src[i3 + 2];
276  dst[i3 + 1] = src[i3 + 1];
277  dst[i3 + 2] = src[i3 + 0];
278  }
279  }
280 }
unorm8
Definition: unorm8.h:33
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::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
282  {
283  debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format");
284 
285  int dstIndex = 0;
286  int srcByteOffset = 0;
287  int srcRowPadBytes = srcRowPadBits / 8;
288  Color4* dst = static_cast<Color4*>(dstBytes[0]);
289  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
290 
291  for (int y = 0; y < srcHeight; ++y) {
292  if (invertY) {
293  dstIndex = srcWidth * (srcHeight - 1 - y);
294  }
295  for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 3) {
296  const Color3unorm8& s = *reinterpret_cast<const Color3unorm8*>(src + srcByteOffset);
297  dst[dstIndex] = Color4(Color3(s), 1.0f);
298  }
299  srcByteOffset += srcRowPadBytes;
300  }
301 }
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

+ Here is the caller graph for this function:

static void G3D::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
251  {
252  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
253  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
254  for (int y = 0; y < srcHeight; ++y) {
255  for (int x = 0; x < srcWidth; ++x) {
256  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
257  int i3 = i * 3;
258  int i4 = i3 + i;
259 
260  dst[i4 + 0] = src[i3 + 0];
261  dst[i4 + 1] = src[i3 + 1];
262  dst[i4 + 2] = src[i3 + 2];
263  dst[i4 + 3] = unorm8::one();
264  }
265  }
266 }
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:

static void G3D::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
551  {
552  debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format");
553  debugAssertM((srcWidth % 2 == 0) && (srcHeight % 2 == 0), "Source width and height must be a multiple of two");
554 
555  const Color3unorm8* src = static_cast<const Color3unorm8*>(srcBytes[0]);
556 
557  unorm8* dstY = static_cast<unorm8*>(dstBytes[0]);
558  unorm8* dstU = static_cast<unorm8*>(dstBytes[1]);
559  unorm8* dstV = static_cast<unorm8*>(dstBytes[2]);
560 
561  for (int y = 0; y < srcHeight; y += 2) {
562  for (int x = 0; x < srcWidth; x += 2) {
563 
564  // convert 4-pixel block at a time
565  int srcPixelOffset0 = y * srcWidth + x;
566  int srcPixelOffset1 = srcPixelOffset0 + 1;
567  int srcPixelOffset2 = srcPixelOffset0 + srcWidth;
568  int srcPixelOffset3 = srcPixelOffset2 + 1;
569 
570  int yIndex = y * srcWidth + x;
571 
572  dstY[yIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset0].r, src[srcPixelOffset0].g, src[srcPixelOffset0].b);
573  dstY[yIndex + 1] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset1].r, src[srcPixelOffset1].g, src[srcPixelOffset1].b);
574 
575  yIndex += srcWidth;
576  dstY[yIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset2].r, src[srcPixelOffset2].g, src[srcPixelOffset2].b);
577  dstY[yIndex + 1] = PIXEL_RGB8_TO_YUV_Y(src[srcPixelOffset3].r, src[srcPixelOffset3].g, src[srcPixelOffset3].b);
578 
579  uint32 blendedPixel = blendPixels(src[srcPixelOffset0].asUInt32(), src[srcPixelOffset2].asUInt32());
580  Color3unorm8 uvSrcColor = Color3unorm8::fromARGB(blendedPixel);
581 
582  int uvIndex = y / 2 * srcWidth / 2 + x / 2;
583  dstU[uvIndex] = PIXEL_RGB8_TO_YUV_U(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b);
584  dstV[uvIndex] = PIXEL_RGB8_TO_YUV_V(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b);
585  }
586  }
587 }
unorm8
Definition: unorm8.h:33
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
static uint32 blendPixels(uint32 pixel1, uint32 pixel2)
Definition: ImageFormat_convert.cpp:533
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
#define PIXEL_RGB8_TO_YUV_V(r, g, b)
Definition: ImageFormat_convert.cpp:549
#define PIXEL_RGB8_TO_YUV_U(r, g, b)
Definition: ImageFormat_convert.cpp:548
G3D::int16 x
Definition: Vector2int16.h:37
#define PIXEL_RGB8_TO_YUV_Y(r, g, b)
Definition: ImageFormat_convert.cpp:547

+ Here is the call graph for this function:

static void G3D::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
589  {
590  debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format");
591  debugAssertM((srcWidth % 2 == 0), "Source width must be a multiple of two");
592 
593  const Color3unorm8* src = static_cast<const Color3unorm8*>(srcBytes[0]);
594 
595  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
596 
597  for (int y = 0; y < srcHeight; ++y) {
598  for (int x = 0; x < srcWidth; x += 2) {
599 
600  // convert 2-pixel horizontal block at a time
601  int srcIndex = y * srcWidth + x;
602  int dstIndex = srcIndex * 2;
603 
604  uint32 blendedPixel = blendPixels(src[srcIndex].asUInt32(), src[srcIndex + 1].asUInt32());
605  Color3unorm8 uvSrcColor = Color3unorm8::fromARGB(blendedPixel);
606 
607  dst[dstIndex] = PIXEL_RGB8_TO_YUV_Y(src[srcIndex].r, src[srcIndex].g, src[srcIndex].b);
608 
609  dst[dstIndex + 1] = PIXEL_RGB8_TO_YUV_U(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b);
610 
611  dst[dstIndex + 2] = PIXEL_RGB8_TO_YUV_Y(src[srcIndex + 1].r, src[srcIndex + 1].g, src[srcIndex + 1].b);
612 
613  dst[dstIndex + 3] = PIXEL_RGB8_TO_YUV_V(uvSrcColor.r, uvSrcColor.g, uvSrcColor.b);
614 
615  }
616  }
617 }
unorm8
Definition: unorm8.h:33
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
static uint32 blendPixels(uint32 pixel1, uint32 pixel2)
Definition: ImageFormat_convert.cpp:533
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
#define PIXEL_RGB8_TO_YUV_V(r, g, b)
Definition: ImageFormat_convert.cpp:549
#define PIXEL_RGB8_TO_YUV_U(r, g, b)
Definition: ImageFormat_convert.cpp:548
G3D::int16 x
Definition: Vector2int16.h:37
#define PIXEL_RGB8_TO_YUV_Y(r, g, b)
Definition: ImageFormat_convert.cpp:547

+ Here is the call graph for this function:

static void G3D::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
619  {
620  debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format");
621 
622  const Color3unorm8* src = static_cast<const Color3unorm8*>(srcBytes[0]);
623 
624  Color3unorm8* dst = static_cast<Color3unorm8*>(dstBytes[0]);
625 
626  for (int y = 0; y < srcHeight; ++y) {
627  for (int x = 0; x < srcWidth; ++x) {
628 
629  // convert 1-pixels at a time
630  int index = y * srcWidth + x;
631  unorm8 y = PIXEL_RGB8_TO_YUV_Y(src[index].r, src[index].g, src[index].b);
632  unorm8 u = PIXEL_RGB8_TO_YUV_U(src[index].r, src[index].g, src[index].b);
633  unorm8 v = PIXEL_RGB8_TO_YUV_V(src[index].r, src[index].g, src[index].b);
634 
635  dst[index].r = y;
636  dst[index].g = u;
637  dst[index].b = v;
638  }
639  }
640 }
unorm8
Definition: unorm8.h:33
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
G3D::int16 y
Definition: Vector2int16.h:38
#define PIXEL_RGB8_TO_YUV_V(r, g, b)
Definition: ImageFormat_convert.cpp:549
#define PIXEL_RGB8_TO_YUV_U(r, g, b)
Definition: ImageFormat_convert.cpp:548
G3D::int16 x
Definition: Vector2int16.h:37
#define PIXEL_RGB8_TO_YUV_Y(r, g, b)
Definition: ImageFormat_convert.cpp:547
static void G3D::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
1022  {
1023  Array<void*> tmp;
1024  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1025 
1026  rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg);
1027  rgb8_to_bayer_bggr8(srcWidth, srcHeight, static_cast<unorm8*>(tmp[0]), static_cast<unorm8*>(dstBytes[0]));
1028 
1029  System::free(tmp[0]);
1030 }
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)
Definition: ImageFormat_convert.cpp:436
static void rgb8_to_bayer_bggr8(const int w, const int h, const unorm8 *src, unorm8 *dst)
Definition: ImageFormat_convert.cpp:916

+ Here is the call graph for this function:

static void G3D::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
1002  {
1003  Array<void*> tmp;
1004  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1005 
1006  rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg);
1007  rgb8_to_bayer_grbg8(srcWidth, srcHeight, static_cast<unorm8*>(tmp[0]), static_cast<unorm8*>(dstBytes[0]));
1008 
1009  System::free(tmp[0]);
1010 }
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)
Definition: ImageFormat_convert.cpp:436
static void rgb8_to_bayer_grbg8(const int w, const int h, const unorm8 *src, unorm8 *dst)
Definition: ImageFormat_convert.cpp:879

+ Here is the call graph for this function:

static void G3D::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
1012  {
1013  Array<void*> tmp;
1014  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
1015 
1016  rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg);
1017  rgb8_to_bayer_gbrg8(srcWidth, srcHeight, static_cast<unorm8*>(tmp[0]), static_cast<unorm8*>(dstBytes[0]));
1018 
1019  System::free(tmp[0]);
1020 }
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)
Definition: ImageFormat_convert.cpp:436
static void rgb8_to_bayer_gbrg8(const int w, const int h, const unorm8 *src, unorm8 *dst)
Definition: ImageFormat_convert.cpp:953

+ Here is the call graph for this function:

static void G3D::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
992  {
993  Array<void*> tmp;
994  tmp.append(System::malloc(srcWidth * srcHeight * sizeof(Color3unorm8)));
995 
996  rgba32f_to_rgb8(srcBytes, srcWidth, srcHeight, ImageFormat::RGBA32F(), 0, tmp, ImageFormat::RGB8(), 0, invertY, bayerAlg);
997  rgb8_to_bayer_rggb8(srcWidth, srcHeight, static_cast<unorm8*>(tmp[0]), static_cast<unorm8*>(dstBytes[0]));
998 
999  System::free(tmp[0]);
1000 }
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)
Definition: ImageFormat_convert.cpp:436
static void rgb8_to_bayer_rggb8(const int w, const int h, const unorm8 *src, unorm8 *dst)
Definition: ImageFormat_convert.cpp:842

+ Here is the call graph for this function:

static void G3D::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
483  {
484  debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format");
485 
486  int srcIndex = 0;
487  int dstByteOffset = 0;
488  int dstRowPadBytes = dstRowPadBits / 8;
489  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
490  const Color4* src = static_cast<const Color4*>(srcBytes[0]);
491 
492  for (int y = 0; y < srcHeight; ++y) {
493  if (invertY) {
494  srcIndex = srcWidth * (srcHeight - y - 1);
495  }
496 
497  for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) {
498  Color3unorm8& d = *reinterpret_cast<Color3unorm8*>(dst + dstByteOffset);
499  const Color4& s = src[srcIndex];
500 
501  d = Color3unorm8(s.rgb()).bgr();
502  }
503  dstByteOffset += dstRowPadBytes;
504  }
505 }
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

+ Here is the call graph for this function:

static void G3D::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
507  {
508  debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format");
509 
510  int srcIndex = 0;
511  int dstByteOffset = 0;
512  int dstRowPadBytes = dstRowPadBits / 8;
513  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
514  const Color4* src = static_cast<const Color4*>(srcBytes[0]);
515 
516  for (int y = 0; y < srcHeight; ++y) {
517  if (invertY) {
518  srcIndex = srcWidth * (srcHeight - 1 - y);
519  }
520  for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3 * sizeof(float)) {
521  Color3& d = *reinterpret_cast<Color3*>(dst + dstByteOffset);
522  const Color4& s = src[srcIndex];
523  d = s.rgb();
524  }
525  dstByteOffset += dstRowPadBytes;
526  }
527 }
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

+ Here is the call graph for this function:

static void G3D::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
436  {
437  debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format");
438 
439  int srcIndex = 0;
440  int dstByteOffset = 0;
441  int dstRowPadBytes = dstRowPadBits / 8;
442  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
443  const Color4* src = static_cast<const Color4*>(srcBytes[0]);
444 
445  for (int y = 0; y < srcHeight; ++y) {
446  if (invertY) {
447  srcIndex = srcWidth * (srcHeight - y - 1);
448  }
449 
450  for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 3) {
451  Color3unorm8& d = *reinterpret_cast<Color3unorm8*>(dst + dstByteOffset);
452  const Color4& s = src[srcIndex];
453 
454  d = Color3unorm8(s.rgb());
455  }
456  dstByteOffset += dstRowPadBytes;
457  }
458 }
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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::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
460  {
461  debugAssertM(dstRowPadBits % 8 == 0, "Destination row padding must be a multiple of 8 bits for this format");
462 
463  int srcIndex = 0;
464  int dstByteOffset = 0;
465  int dstRowPadBytes = dstRowPadBits / 8;
466  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
467  const Color4* src = static_cast<const Color4*>(srcBytes[0]);
468 
469  for (int y = 0; y < srcHeight; ++y) {
470  if (invertY) {
471  srcIndex = srcWidth * (srcHeight - 1 - y);
472  }
473  for (int x = 0; x < srcWidth; ++x, ++srcIndex, dstByteOffset += 4) {
474  Color4unorm8& d = *reinterpret_cast<Color4unorm8*>(dst + dstByteOffset);
475  const Color4& s = src[srcIndex];
476 
477  d = Color4unorm8(s);
478  }
479  dstByteOffset += dstRowPadBytes;
480  }
481 }
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::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
374  {
375  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
376  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
377  for (int y = 0; y < srcHeight; ++y) {
378  for (int x = 0; x < srcWidth; ++x) {
379  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
380  int i3 = i * 3;
381  int i4 = i3 + i;
382 
383  dst[i3 + 0] = src[i4 + 2];
384  dst[i3 + 1] = src[i4 + 1];
385  dst[i3 + 2] = src[i4 + 0];
386  }
387  }
388 }
unorm8
Definition: unorm8.h:33
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::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
358  {
359  unorm8* dst = static_cast<unorm8*>(dstBytes[0]);
360  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
361  for (int y = 0; y < srcHeight; ++y) {
362  for (int x = 0; x < srcWidth; ++x) {
363  int i = (invertY) ? ((srcHeight-1-y) * srcWidth +x) : (y * srcWidth + x);
364  int i3 = i * 3;
365  int i4 = i3 + i;
366 
367  dst[i3 + 0] = src[i4 + 0];
368  dst[i3 + 1] = src[i4 + 1];
369  dst[i3 + 2] = src[i4 + 2];
370  }
371  }
372 }
unorm8
Definition: unorm8.h:33
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
static void G3D::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
390  {
391  debugAssertM(srcRowPadBits % 8 == 0, "Source row padding must be a multiple of 8 bits for this format");
392 
393  int dstIndex = 0;
394  int srcByteOffset = 0;
395  int srcRowPadBytes = srcRowPadBits / 8;
396  Color4* dst = static_cast<Color4*>(dstBytes[0]);
397  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
398 
399  for (int y = 0; y < srcHeight; ++y) {
400  if (invertY) {
401  dstIndex = srcWidth * (srcHeight - 1 - y);
402  }
403 
404  for (int x = 0; x < srcWidth; ++x, ++dstIndex, srcByteOffset += 4) {
405  const Color4unorm8& s = *reinterpret_cast<const Color4unorm8*>(src + srcByteOffset);
406  dst[dstIndex] = Color4(s);
407  }
408  srcByteOffset += srcRowPadBytes;
409  }
410 }
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
double G3D::round ( double  f)
inline
214  {
215  return floor(f + 0.5f);
216 }
static Vector3int16 floor(const Vector3 &v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::round ( float  f)
inline
218  {
219  return floor(f + 0.5f);
220 }
static Vector3int16 floor(const Vector3 &v)

+ Here is the call graph for this function:

float G3D::rsq ( float  x)
inline

Computes 1 / sqrt(x).

380  {
381  return 1.0f / sqrtf(x);
382 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

double G3D::rsqrt ( double  x)
inline
Deprecated:
Use rsq
469  {
470  return 1.0 / sqrt(x);
471 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

float G3D::rsqrt ( float  x)
inline
Deprecated:
Use rsq
474  {
475  // TODO: default this to using the SSE2 instruction
476  return 1.0f / sqrtf(x);
477 }
G3D::int16 x
Definition: Vector2int16.h:37
static int G3D::selectOneReadSocket ( const SOCKET sock)
static

Invokes select on one socket. Returns SOCKET_ERROR on error, 0 if there is no read pending, sock if there a read pending.

54  {
55  // 0 time timeout is specified to poll and return immediately
56  struct timeval timeout;
57  timeout.tv_sec = 0;
58  timeout.tv_usec = 0;
59 
60  // Create a set that contains just this one socket
61  fd_set socketSet;
62  FD_ZERO(&socketSet);
63  FD_SET(sock, &socketSet);
64 
65  int ret = select((int)sock + 1, &socketSet, NULL, NULL, &timeout);
66 
67  return ret;
68 }
arena_t NULL
Definition: jemalloc_internal.h:624

+ Here is the caller graph for this function:

static int G3D::selectOneWriteSocket ( const SOCKET sock)
static

Invokes select on one socket.

93  {
94  // 0 time timeout is specified to poll and return immediately
95  struct timeval timeout;
96  timeout.tv_sec = 0;
97  timeout.tv_usec = 0;
98 
99  // Create a set that contains just this one socket
100  fd_set socketSet;
101  FD_ZERO(&socketSet);
102  FD_SET(sock, &socketSet);
103 
104  return select((int)sock + 1, NULL, &socketSet, NULL, &timeout);
105 }
arena_t NULL
Definition: jemalloc_internal.h:624

+ Here is the caller graph for this function:

void G3D::serialize ( const std::string &  s,
BinaryOutput &  b 
)
inline
12  {
13  b.writeString32(s);
14 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G3D::serialize ( const int32 i,
BinaryOutput &  b 
)
inline
20  {
21  b.writeInt32(i);
22 }

+ Here is the call graph for this function:

void G3D::serialize ( const uint32 i,
BinaryOutput &  b 
)
inline
28  {
29  b.writeUInt32(i);
30 }

+ Here is the call graph for this function:

void G3D::serialize ( const bool i,
BinaryOutput &  b 
)
inline
36  {
37  b.writeBool8(i);
38 }

+ Here is the call graph for this function:

void G3D::serialize ( const float32 &  f,
BinaryOutput &  b 
)
inline
44  {
45  b.writeFloat32(f);
46 }

+ Here is the call graph for this function:

void G3D::serialize ( const float64 &  f,
BinaryOutput &  b 
)
inline
52  {
53  b.writeFloat64(f);
54 }

+ Here is the call graph for this function:

template<typename T >
void G3D::serialize ( const Array< T > &  array,
BinaryOutput &  b 
)

serialize(const T&, BinaryOutput&) must have been overridden as well

62  {
63  b.writeInt32(array.size());
64  for (int i = 0; i < array.size(); ++i) {
65  serialize(array[i], b);
66  }
67 }
void serialize(const Array< T > &array, BinaryOutput &b)
Definition: serialize.h:62
int size() const
Definition: Array.h:430

+ Here is the call graph for this function:

void G3D::serialize ( class BinaryOutput &  bo) const
void G3D::serialize ( const bool b,
TextOutput &  to 
)
458  {
459  to.writeSymbol(b ? "true" : "false");
460 }

+ Here is the call graph for this function:

void G3D::serialize ( const int &  b,
TextOutput &  to 
)
463  {
464  to.writeNumber(b);
465 }

+ Here is the call graph for this function:

void G3D::serialize ( const uint8 b,
TextOutput &  to 
)
468  {
469  to.writeNumber(b);
470 }

+ Here is the call graph for this function:

void G3D::serialize ( const double &  b,
TextOutput &  to 
)
473  {
474  to.writeNumber(b);
475 }

+ Here is the call graph for this function:

void G3D::serialize ( const float &  b,
TextOutput &  to 
)
453  {
454  to.writeNumber(b);
455 }

+ Here is the call graph for this function:

void G3D::serialize ( const std::string &  b,
TextOutput &  to 
)
void G3D::serialize ( const char *  b,
TextOutput &  to 
)
void G3D::serialize ( const Vector2 &  v,
class BinaryOutput &  b 
)
217  {
218  v.serialize(b);
219 }

+ Here is the call graph for this function:

void G3D::serialize ( const Vector3::Axis &  a,
class BinaryOutput &  bo 
)
400  {
401  bo.writeUInt8((uint8)a);
402 }
uint8_t uint8
Definition: Define.h:152

+ Here is the call graph for this function:

void G3D::serialize ( const Vector4 &  v,
class BinaryOutput &  b 
)
521  {
522  v.serialize(b);
523 }

+ Here is the call graph for this function:

void G3D::serialize ( const Vector3 &  v,
class BinaryOutput &  b 
)
536  {
537  v.serialize(b);
538 }

+ Here is the call graph for this function:

void G3D::setAssertionHook ( AssertionHook  hook)

Allows customization of the global function invoked when a debugAssert fails. The initial value is G3D::internal::_handleDebugAssert. G3D will invoke rawBreak if the hook returns true. If NULL, assertions are not handled.

307  {
309 }
AssertionHook _debugHook
Definition: debugAssert.cpp:36
void G3D::setConsolePrintHook ( ConsolePrintHook  h)

Called by consolePrintf after the log and terminal have been written to. Used by GConsole to intercept printing routines.

324  {
326 }
ConsolePrintHook _consolePrintHook
Definition: debugAssert.cpp:35
void G3D::setFailureHook ( AssertionHook  hook)

Called by alwaysAssertM in case of failure in release mode. If returns true then the program exits with -1 (you can replace this with your own version that throws an exception or has other failure modes).

315  {
317 }
AssertionHook _failureHook
Definition: debugAssert.cpp:37
Vector2 G3D::sign ( const Vector2 &  v)
inline
196  {
197  return Vector2((float)sign(v.x), (float)sign(v.y));
198 }
Vector4 sign(const Vector4 &v)
Definition: vectorMath.h:204

+ Here is the call graph for this function:

Vector3 G3D::sign ( const Vector3 &  v)
inline
200  {
201  return Vector3((float)sign(v.x), (float)sign(v.y), (float)sign(v.z));
202 }
Vector4 sign(const Vector4 &v)
Definition: vectorMath.h:204

+ Here is the call graph for this function:

Vector4 G3D::sign ( const Vector4 &  v)
inline
204  {
205  return Vector4((float)sign(v.x), (float)sign(v.y), (float)sign(v.z), (float)sign(v.w));
206 }
Vector4 sign(const Vector4 &v)
Definition: vectorMath.h:204

+ Here is the call graph for this function:

double G3D::sign ( double  fValue)
inline
669  {
670  if (fValue > 0.0) {
671  return 1.0;
672  }
673 
674  if (fValue < 0.0) {
675  return -1.0;
676  }
677 
678  return 0.0;
679 }

+ Here is the caller graph for this function:

float G3D::sign ( float  fValue)
inline
681  {
682  if (fValue > 0.0f) {
683  return 1.0f;
684  }
685 
686  if (fValue < 0.0f) {
687  return -1.0f;
688  }
689 
690  return 0.0f;
691 }
float G3D::signedPow ( float  b,
float  e 
)
inline

Computes |b|^e * sign(b)

922  {
923  return sign(b) * powf(fabsf(b), e);
924 }
float sign(float fValue)
Definition: g3dmath.h:681

+ Here is the call graph for this function:

double G3D::signedPow ( double  b,
double  e 
)
inline

Computes |b|^e * sign(b)

928  {
929  return sign(b) * pow(abs(b), e);
930 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
G3D::Quat pow(const G3D::Quat &q, double x)
Definition: Quat.h:761
float sign(float fValue)
Definition: g3dmath.h:681

+ Here is the call graph for this function:

double G3D::sinc ( double  x)
inline

sin(x)/x

482  {
483  double r = sin(x) / x;
484 
485  if (isNaN(r)) {
486  return 1.0;
487  } else {
488  return r;
489  }
490 }
bool isNaN(uint64 x)
Definition: g3dmath.h:270
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::smootherstep ( float  edge0,
float  edge1,
float  x 
)
inline

Perlin's C2 continous variation on smoothstep()

911  {
912 
913  // Scale, and saturate x to 0..1 range
914  x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f);
915 
916  // Evaluate polynomial
917  return x * x * x * (x * (x * 6 - 15) + 10);
918 }
float clamp(float val, float low, float hi)
Definition: g3dmath.h:582
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

float G3D::smoothstep ( float  edge0,
float  edge1,
float  x 
)
inline

The GLSL smoothstep function

901  {
902  // Scale, bias and saturate x to 0..1 range
903  x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f);
904 
905  // Evaluate polynomial
906  return x * x * (3 - 2 * x);
907 }
float clamp(float val, float low, float hi)
Definition: g3dmath.h:582
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

double G3D::square ( double  fValue)
inline
698  {
699  return x * x;
700 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

float G3D::square ( float  x)
inline
702  {
703  return x * x;
704 }
G3D::int16 x
Definition: Vector2int16.h:37
int G3D::square ( int  x)
inline
706  {
707  return x * x;
708 }
G3D::int16 x
Definition: Vector2int16.h:37
int G3D::stringCompare ( const std::string &  s1,
const std::string &  s2 
)

A comparison function for passing to Array::sort.

202  {
203 
204  return stringPtrCompare(&s1, &s2);
205 }
int stringPtrCompare(const std::string *s1, const std::string *s2)
Definition: stringutils.cpp:208

+ Here is the call graph for this function:

std::string G3D::stringJoin ( const G3D::Array< std::string > &  a,
char  joinChar 
)

joinChar is not inserted at the beginning or end, just in between elements.

254  {
255 
256  std::string out;
257 
258  for (int i = 0; i < (int)a.size() - 1; ++i) {
259  out += a[i] + joinChar;
260  }
261 
262  if (a.size() > 0) {
263  return out + a.last();
264  } else {
265  return out;
266  }
267 }
const T & last() const
Definition: Array.h:923
int size() const
Definition: Array.h:430

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string G3D::stringJoin ( const G3D::Array< std::string > &  a,
const std::string &  joinStr 
)
272  {
273 
274  std::string out;
275 
276  for (int i = 0; i < (int)a.size() - 1; ++i) {
277  out += a[i] + joinStr;
278  }
279 
280  if (a.size() > 0) {
281  return out + a.last();
282  } else {
283  return out;
284  }
285 }
const T & last() const
Definition: Array.h:923
int size() const
Definition: Array.h:430

+ Here is the call graph for this function:

int G3D::stringPtrCompare ( const std::string *  s1,
const std::string *  s2 
)
210  {
211 
212  return s1->compare(*s2);
213 }

+ Here is the caller graph for this function:

Array< std::string > G3D::stringSplit ( const std::string &  x,
char  splitChar 
)

Splits x at each occurance of splitChar.

232  {
233 
234  Array<std::string> out;
235 
236  // Pointers to the beginning and end of the substring
237  const char* start = x.c_str();
238  const char* stop = start;
239 
240  while ((stop = strchr(start, splitChar))) {
241  out.append(std::string(start, stop - start));
242  start = stop + 1;
243  }
244 
245  // Append the last one
246  out.append(std::string(start));
247 
248  return out;
249 }
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::sumSquares ( double  x,
double  y 
)
inline
711  {
712  return x*x + y*y;
713 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

double G3D::sumSquares ( double  x,
double  y,
double  z 
)
inline
721  {
722  return x*x + y*y + z*z;
723 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
float G3D::sumSquares ( float  x,
float  y 
)
inline
716  {
717  return x*x + y*y;
718 }
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
float G3D::sumSquares ( float  x,
float  y,
float  z 
)
inline
726  {
727  return x*x + y*y + z*z;
728 }
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
uint32_t G3D::superFastHash ( const void *  _data,
size_t  numBytes 
)
inline

A hash function that is faster than CRC32 for arbitrary long strings [From] http://www.azillionmonkeys.com/qed/hash.html by Paul Hsieh.

35  {
36  const char* data = (const char*)_data;
37  uint32_t hash = (uint32_t)numBytes;
38  uint32_t tmp;
39  int rem;
40 
41  if ((numBytes <= 0) || (data == NULL)) {
42  return 0;
43  }
44 
45  rem = numBytes & 3;
46  numBytes >>= 2;
47 
48  /* Main loop */
49  for (;numBytes > 0; --numBytes) {
50  hash += get16bits (data);
51  tmp = (get16bits (data+2) << 11) ^ hash;
52  hash = (hash << 16) ^ tmp;
53  data += 2*sizeof (uint16_t);
54  hash += hash >> 11;
55  }
56 
57  /* Handle end cases */
58  switch (rem) {
59  case 3: hash += get16bits (data);
60  hash ^= hash << 16;
61  hash ^= data[sizeof (uint16_t)] << 18;
62  hash += hash >> 11;
63  break;
64  case 2: hash += get16bits (data);
65  hash ^= hash << 11;
66  hash += hash >> 17;
67  break;
68  case 1: hash += *data;
69  hash ^= hash << 10;
70  hash += hash >> 1;
71  }
72 
73  /* Force "avalanching" of final 127 bits */
74  hash ^= hash << 3;
75  hash += hash >> 5;
76  hash ^= hash << 4;
77  hash += hash >> 17;
78  hash ^= hash << 25;
79  hash += hash >> 6;
80 
81  return hash;
82 }
#define hash
Definition: private_namespace.h:186
arena_t NULL
Definition: jemalloc_internal.h:624
unsigned int uint32_t
Definition: stdint.h:80
#define get16bits(d)
Definition: HashTrait.h:29
unsigned short uint16_t
Definition: stdint.h:79

+ Here is the caller graph for this function:

static void G3D::swapRedAndBlue ( int  N,
Color3unorm8 *  out 
)
static

Helper method for Bayer grbg and bggr –> rgb8

829  {
830  for (int i = N - 1; i >= 0; --i) {
831  unorm8 tmp = out[i].r;
832  out[i].r = out[i].b;
833  out[i].b = tmp;
834  }
835 }
unorm8
Definition: unorm8.h:33

+ Here is the caller graph for this function:

static int G3D::textPrompt ( const char *  windowTitle,
const char *  prompt,
const char **  choice,
int  numChoices 
)
static

Show a prompt on stdout

485  {
486 
487  printf("\n___________________________________________________\n");
488  printf("%s\n", windowTitle);
489  printf("%s", prompt);
490 
491  if (numChoices > 10) {
492  numChoices = 10;
493  }
494 
495  int c = -1;
496  if (numChoices > 1) {
497  printf("\n");
498  printf("Choose an option by number:");
499 
500  while ((c < 0) || (c >= numChoices)) {
501  printf("\n");
502 
503  for (int i = 0; i < numChoices; ++i) {
504  if (numChoices <= 3) {
505  printf(" (%d) %s ", i, choice[i]);
506  } else {
507  printf(" (%d) %s\n", i, choice[i]);
508  }
509  }
510 
511  printf("\n> ");
512  c = _getch() - '0';
513 
514  if ((c < 0) || (c >= numChoices)) {
515  printf("'%d' is not a valid choice.", c);
516  } else {
517  printf("%d", c);
518  }
519  }
520 
521  } else if (numChoices == 1) {
522 
523  printf("\nPress any key for '%s'...", choice[0]);
524  _getch();
525  c = 0;
526 
527  } else {
528 
529  printf("\nPress any key...");
530  _getch();
531  c = 0;
532  }
533 
534  printf("\n___________________________________________________\n");
535  return c;
536 }
int prompt(const char *windowTitle, const char *promptx, const char **choice, int numChoices, bool useGui)
Definition: prompt.cpp:553
#define _getch
Definition: prompt.cpp:21
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Any G3D::toAny ( ) const
double G3D::toDegrees ( double  rad)
inline
802  {
803  return rad * 180.0 / pi();
804 }
double pi()
Definition: g3dmath.h:147

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::toDegrees ( float  rad)
inline
810  {
811  return rad * 180.0f / (float)pi();
812 }
double pi()
Definition: g3dmath.h:147

+ Here is the call graph for this function:

float G3D::toDegrees ( int  rad)
inline
818  {
819  return rad * 180.0f / (float)pi();
820 }
double pi()
Definition: g3dmath.h:147

+ Here is the call graph for this function:

static const char* G3D::tokenTypeToString ( Token::Type  t)
static
1253  {
1254  switch (t) {
1255  case Token::SYMBOL:
1256  return "Token::SYMBOL";
1257  case Token::STRING:
1258  return "Token::STRING";
1259  case Token::NUMBER:
1260  return "Token::NUMBER";
1261  case Token::END:
1262  return "Token::END";
1263  case Token::NEWLINE:
1264  return "Token::NEWLINE";
1265  default:
1266  debugAssertM(false, "Fell through switch");
1267  return "?";
1268  }
1269 }
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
const char * NEWLINE
Definition: stringutils.cpp:33

+ Here is the caller graph for this function:

std::string G3D::toLower ( const std::string &  x)
223  {
224  std::string result = x;
225  std::transform(result.begin(), result.end(), result.begin(), tolower);
226  return result;
227 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static char G3D::toLower ( char  c)
inlinestatic
121  {
122  return ((c >= 'A') && (c <= 'Z')) ? (c - 'A' + 'a') : c;
123 }
double G3D::toRadians ( double  deg)
inline
798  {
799  return deg * pi() / 180.0;
800 }
double pi()
Definition: g3dmath.h:147

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float G3D::toRadians ( float  deg)
inline
806  {
807  return deg * (float)pi() / 180.0f;
808 }
double pi()
Definition: g3dmath.h:147

+ Here is the call graph for this function:

float G3D::toRadians ( int  deg)
inline
814  {
815  return deg * (float)pi() / 180.0f;
816 }
double pi()
Definition: g3dmath.h:147

+ Here is the call graph for this function:

SimTime G3D::toSeconds ( int  hour,
int  minute,
double  seconds,
AMPM  ap 
)

Converts a 12 hour clock time into the number of seconds since midnight. Note that 12:00 PM is noon and 12:00 AM is midnight.

Example: toSeconds(10, 00, AM)

SimTime G3D::toSeconds ( int  hour,
int  minute,
AMPM  ap 
)
std::string G3D::toString ( ) const

+ Here is the caller graph for this function:

std::string G3D::toUpper ( const std::string &  x)

Returns a new string that is an uppercase version of x.

216  {
217  std::string result = x;
218  std::transform(result.begin(), result.end(), result.begin(), toupper);
219  return result;
220 }
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the caller graph for this function:

static void G3D::toUpper ( Set< std::string > &  set)
static
185  {
186  Array<std::string> symbols;
187  set.getMembers(symbols);
188  set.clear();
189  for (int i = 0; i < symbols.size(); ++i) {
190  set.insert(toUpper(symbols[i]));
191  }
192 }
void clear()
Definition: Set.h:101
bool insert(const T &member)
Definition: Set.h:62
Array< T > getMembers() const
Definition: Set.h:93
static void toUpper(Set< std::string > &set)
Definition: TextInput.cpp:185

+ Here is the call graph for this function:

std::string G3D::trimWhitespace ( const std::string &  s)

Strips whitespace from both ends of the string.

288  {
289 
290  if (s.length() == 0) {
291  return s;
292  }
293  size_t left = 0;
294 
295  // Trim from left
296  while ((left < s.length()) && iswspace(s[left])) {
297  ++left;
298  }
299 
300  size_t right = s.length() - 1;
301  // Trim from right
302  while ((right > left) && iswspace(s[right])) {
303  --right;
304  }
305 
306  return s.substr(left, right - left + 1);
307 }
static bool iswspace(int ch)
Definition: stringutils.cpp:34
bool left(const int *a, const int *b, const int *c)
Definition: RecastContour.cpp:487

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Vector3int32 G3D::Vector3int32::truncate ( const class Vector3 &  v)
static
86  {
87  return Vector3int32(int32(v.x), int32(v.y), int32(v.z));
88 }
Vector3int32
Definition: Vector3int32.h:29
int32_t int32
Definition: Define.h:146
int32_t int32
Definition: g3dmath.h:167
double G3D::twoPi ( )
inline
159  {
160  return 6.28318531;
161 }

+ Here is the caller graph for this function:

float G3D::uniformRandom ( float  low = 0.0f,
float  hi = 1.0f 
)
inline

Uniform random number between low and hi, inclusive. [low, hi]

Deprecated:
See also
Random::uniform
694  {
695  return (hi - low) * float(::rand()) / float(RAND_MAX) + low;
696 }

+ Here is the caller graph for this function:

G3D::unorm16 ( uint16  b)
explicit

Private to prevent illogical conversions without explicitly stating that the input should be treated as bits; see fromBits.

38 : m_bits(b) {}
G3D::unorm16 ( )
52 : m_bits(0) {}
G3D::unorm16 ( const unorm16 &  other)
54 : m_bits(other.m_bits) {}
G3D::unorm16 ( const class Any &  a)
explicit
G3D::unorm16 ( float  f)
explicit

Maps f to round(f * 65535).

61  {
62  m_bits = uint16(clamp(f, 0.0f, 1.0f) * 65535.0f + 0.5f);
63  }
double clamp(double val, double low, double hi)
Definition: g3dmath.h:571
uint16_t uint16
Definition: g3dmath.h:166

+ Here is the call graph for this function:

G3D::unorm16 ( double  f)
explicit
65  {
66  m_bits = uint16(clamp(f, 0.0, 1.0) * 65535.0 + 0.5);
67  }
double clamp(double val, double low, double hi)
Definition: g3dmath.h:571
uint16_t uint16
Definition: g3dmath.h:166

+ Here is the call graph for this function:

G3D::unorm8 ( uint8  b)
explicit

Private to prevent illogical conversions without explicitly stating that the input should be treated as bits; see fromBits.

39 : m_bits(b) {}
G3D::unorm8 ( )
53 : m_bits(0) {}
G3D::unorm8 ( const unorm8 &  other)
55 : m_bits(other.m_bits) {}
G3D::unorm8 ( float  f)
explicit

Maps f to round(f * 255).

58  {
59  m_bits = (uint8)(clamp(f, 0.0f, 1.0f) * 255.0f + 0.5f);
60  }
double clamp(double val, double low, double hi)
Definition: g3dmath.h:571
uint8_t uint8
Definition: g3dmath.h:164

+ Here is the call graph for this function:

G3D::unorm8 ( double  f)
explicit
62  {
63  m_bits = iClamp(int(f * 255.0f + 0.5f), 0, 255);
64  }
int iClamp(int val, int low, int hi)
Definition: g3dmath.h:545

+ Here is the call graph for this function:

static void G3D::var ( TextOutput &  t,
const std::string &  name,
const std::string &  val 
)
static
1582  {
1583  t.writeSymbols(name,"=");
1584  t.writeString(val);
1585  t.writeNewline();
1586 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void G3D::var ( TextOutput &  t,
const std::string &  name,
const bool  val 
)
static
1589  {
1590  t.writeSymbols(name, "=", val ? "Yes" : "No");
1591  t.writeNewline();
1592 }

+ Here is the call graph for this function:

static void G3D::var ( TextOutput &  t,
const std::string &  name,
const int  val 
)
static
1595  {
1596  t.writeSymbols(name,"=");
1597  t.writeNumber(val);
1598  t.writeNewline();
1599 }

+ Here is the call graph for this function:

G3D::Vector2int16 ( )
40 : x(0), y(0) {}
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector2int16 ( G3D::int16  _x,
G3D::int16  _y 
)
41 : x(_x), y(_y){}
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector2int16 ( const class Vector2 &  v)
explicit
G3D::Vector2int16 ( class BinaryInput &  bi)
explicit
G3D::Vector2int16 ( const class Any &  a)
explicit
G3D::Vector2int16 ( const class Vector2int32 v)
explicit
G3D::Vector2int32 ( )
39 : x(0), y(0) {}
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector2int32 ( G3D::int32  _x,
G3D::int32  _y 
)
40 : x(_x), y(_y){}
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector2int32 ( const class Vector2 &  v)
explicit
G3D::Vector2int32 ( class BinaryInput &  bi)
explicit
G3D::Vector2int32 ( const class Vector2int16 v)
G3D::Vector2unorm16 ( )
45 {}
G3D::Vector2unorm16 ( G3D::unorm16  _x,
G3D::unorm16  _y 
)
46 : x(_x), y(_y){}
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector2unorm16 ( float  _x,
float  _y 
)
47 : x(_x), y(_y){}
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector2unorm16 ( const class Vector2 &  v)
explicit
G3D::Vector2unorm16 ( class BinaryInput &  bi)
explicit
G3D::Vector2unorm16 ( const class Any &  a)
explicit
G3D::Vector3int16 ( )
48 : x(0), y(0), z(0) {}
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector3int16 ( G3D::int16  _x,
G3D::int16  _y,
G3D::int16  _z 
)
49 : x(_x), y(_y), z(_z) {}
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector3int16 ( const class Vector3 &  v)
explicit
G3D::Vector3int16 ( class BinaryInput &  bi)
explicit
G3D::Vector3int32 ( )
42 : x(0), y(0), z(0) {}
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector3int32 ( int  _x,
int  _y,
int  _z 
)
43 : x(_x), y(_y), z(_z) {}
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
G3D::int16 x
Definition: Vector2int16.h:37
G3D::Vector3int32 ( const class Vector2int32 v,
int  _z 
)
G3D::Vector3int32 ( const class Vector2int16 v,
int  _z 
)
G3D::Vector3int32 ( const class Vector3int16 v)
G3D::Vector3int32 ( const Any &  any)
G3D::Vector3int32 ( const class Vector3 &  v)
explicit

Rounds to the nearest int

G3D::Vector3int32 ( class BinaryInput &  bi)
explicit
std::string G3D::vformat ( const char *  fmt,
va_list  argPtr 
)

Like format, but can be called with the argument list from a ... function.

122  {
123  // If the string is less than 161 characters,
124  // allocate it on the stack because this saves
125  // the malloc/free time. The number 161 is chosen
126  // to support two lines of text on an 80 character
127  // console (plus the null terminator).
128  const int bufSize = 161;
129  char stackBuffer[bufSize];
130 
131  va_list argPtrCopy;
132  va_copy(argPtrCopy, argPtr);
133  int numChars = vsnprintf(stackBuffer, bufSize, fmt, argPtrCopy);
134  va_end(argPtrCopy);
135 
136  if (numChars >= bufSize) {
137  // We didn't allocate a big enough string.
138  char* heapBuffer = (char*)System::malloc((numChars + 1) * sizeof(char));
139 
140  debugAssert(heapBuffer);
141  int numChars2 = vsnprintf(heapBuffer, numChars + 1, fmt, argPtr);
142  debugAssert(numChars2 == numChars);
143  (void)numChars2;
144 
145  std::string result(heapBuffer);
146 
147  System::free(heapBuffer);
148 
149  return result;
150 
151  } else {
152 
153  return std::string(stackBuffer);
154 
155  }
156 }
#define debugAssert(exp)
Definition: debugAssert.h:160
#define vsnprintf
Definition: Common.h:78
Definition: format.h:285

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t G3D::wangHash6432Shift ( int64  key)
inline

Thomas Wang's 64-to-32-bit mix hash based on Robert Jenkin's hash http://www.concentric.net/~ttwang/tech/inthash.htm

Found by Morgan to produce the best net performance for building tables from Vector4int16

90  {
91  key = (~key) + (key << 18); // key = (key << 18) - key - 1;
92  key = key ^ (key >> 31);
93  key = key * 21; // key = (key + (key << 2)) + (key << 4);
94  key = key ^ (key >> 11);
95  key = key + (key << 6);
96  return uint32_t(key) ^ uint32_t(key >> 22);
97 }
unsigned int uint32_t
Definition: stdint.h:80
std::string G3D::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.

See also
G3D::GFont::wordWrapCut, G3D::TextOutput::Settings::WordWrapMode
148  {
149 
150  std::string output;
151  size_t c = 0;
152  int len;
153 
154  // Don't make lines less than this length
155  int minLength = numCols / 4;
156  size_t inLen = input.size();
157 
158  bool first = true;
159  while (c < inLen) {
160  if (first) {
161  first = false;
162  } else {
163  output += NEWLINE;
164  }
165 
166  if ((int)inLen - (int)c - 1 < numCols) {
167  // The end
168  output += input.substr(c, inLen - c);
169  break;
170  }
171 
172  len = numCols;
173 
174  // Look at character c + numCols, see if it is a space.
175  while ((len > minLength) &&
176  (input[c + len] != ' ')) {
177  len--;
178  }
179 
180  if (len == minLength) {
181  // Just crop
182  len = numCols;
183 
184  }
185 
186  output += input.substr(c, len);
187  c += len;
188  if (c < input.size()) {
189  // Collapse multiple spaces.
190  while ((input[c] == ' ') && (c < input.size())) {
191  ++c;
192  }
193  }
194  }
195 
196  return output;
197 }
#define output
Definition: wire_format_lite.h:381
const char * NEWLINE
Definition: stringutils.cpp:33
#define input
Definition: wire_format_lite.h:242
float G3D::wrap ( float  t,
float  lo,
float  hi 
)
inline

Computes a floating point modulo; the result is t wrapped to the range [lo, hi).

495  {
496  if ((t >= lo) && (t < hi)) {
497  return t;
498  }
499 
500  debugAssert(hi > lo);
501 
502  float interval = hi - lo;
503 
504  return t - interval * iFloor((t - lo) / interval);
505 }
int iFloor(double fValue)
Definition: g3dmath.h:603
#define debugAssert(exp)
Definition: debugAssert.h:160

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double G3D::wrap ( double  t,
double  lo,
double  hi 
)
inline
508  {
509  if ((t >= lo) && (t < hi)) {
510  return t;
511  }
512 
513  debugAssert(hi > lo);
514 
515  double interval = hi - lo;
516 
517  return t - interval * iFloor((t - lo) / interval);
518 }
int iFloor(double fValue)
Definition: g3dmath.h:603
#define debugAssert(exp)
Definition: debugAssert.h:160

+ Here is the call graph for this function:

double G3D::wrap ( double  t,
double  hi 
)
inline
520  {
521  return wrap(t, 0.0, hi);
522 }
double wrap(double t, double hi)
Definition: g3dmath.h:520

+ Here is the call graph for this function:

void G3D::writeWholeFile ( const std::string &  filename,
const std::string &  str,
bool  flush = true 
)
Parameters
flushIf true (default), the file is ready for reading as soon as the function returns. If false, the function returns immediately and writes the file in the background.
210  {
211 
212  // Make sure the directory exists.
213  std::string root, base, ext, path;
214  Array<std::string> pathArray;
215  parseFilename(filename, root, pathArray, base, ext);
216 
217  path = root + stringJoin(pathArray, '/');
218  if (! FileSystem::exists(path, false)) {
220  }
221 
222  FILE* file = FileSystem::fopen(filename.c_str(), "wb");
223 
224  debugAssert(file);
225 
226  fwrite(str.c_str(), str.size(), 1, file);
227 
228  if (flush) {
229  fflush(file);
230  }
231 
232  FileSystem::fclose(file);
233 }
std::string stringJoin(const G3D::Array< std::string > &a, char joinChar)
Definition: stringutils.cpp:252
void createDirectory(const std::string &dir)
Definition: fileutils.cpp:241
#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:

+ Here is the caller graph for this function:

Vector2int32 G3D::xx ( ) const
Vector2int32 G3D::xy ( ) const
Vector2int32 G3D::xz ( ) const
static void G3D::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
647  {
648  debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format");
649  debugAssertM((srcWidth % 2 == 0) && (srcHeight % 2 == 0), "Source width and height must be a multiple of two");
650 
651  const unorm8* srcY = static_cast<const unorm8*>(srcBytes[0]);
652  const unorm8* srcU = static_cast<const unorm8*>(srcBytes[1]);
653  const unorm8* srcV = static_cast<const unorm8*>(srcBytes[2]);
654 
655  Color3unorm8* dst = static_cast<Color3unorm8*>(dstBytes[0]);
656 
657  for (int y = 0; y < srcHeight; ++y) {
658  for (int x = 0; x < srcWidth; x += 2) {
659 
660  // convert to two rgb pixels in a row
661  Color3unorm8* rgb = &dst[y * srcWidth + x];
662 
663  int yOffset = y * srcWidth + x;
664  int uvOffset = y / 2 * srcWidth / 2 + x / 2;
665 
666  rgb->r = PIXEL_YUV_TO_RGB8_R(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]);
667  rgb->g = PIXEL_YUV_TO_RGB8_G(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]);
668  rgb->b = PIXEL_YUV_TO_RGB8_B(srcY[yOffset], srcU[uvOffset], srcV[uvOffset]);
669 
670  rgb += 1;
671  rgb->r = PIXEL_YUV_TO_RGB8_R(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]);
672  rgb->g = PIXEL_YUV_TO_RGB8_G(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]);
673  rgb->b = PIXEL_YUV_TO_RGB8_B(srcY[yOffset + 1], srcU[uvOffset], srcV[uvOffset]);
674  }
675  }
676 }
unorm8
Definition: unorm8.h:33
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
G3D::int16 y
Definition: Vector2int16.h:38
#define PIXEL_YUV_TO_RGB8_R(y, u, v)
Definition: ImageFormat_convert.cpp:643
G3D::int16 x
Definition: Vector2int16.h:37
#define PIXEL_YUV_TO_RGB8_B(y, u, v)
Definition: ImageFormat_convert.cpp:645
#define PIXEL_YUV_TO_RGB8_G(y, u, v)
Definition: ImageFormat_convert.cpp:644
static void G3D::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
678  {
679  debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format");
680  debugAssertM((srcWidth % 2 == 0), "Source width must be a multiple of two");
681 
682  const unorm8* src = static_cast<const unorm8*>(srcBytes[0]);
683 
684  Color3unorm8* dst = static_cast<Color3unorm8*>(dstBytes[0]);
685 
686  for (int y = 0; y < srcHeight; ++y) {
687  for (int x = 0; x < srcWidth; x += 2) {
688 
689  // convert to two rgb pixels in a row
690  Color3unorm8* rgb = &dst[y * srcWidth + x];
691 
692  const int srcIndex = (y * srcWidth + x) * 2;
693  const unorm8 y = src[srcIndex];
694  const unorm8 u = src[srcIndex + 1];
695  const unorm8 y2 = src[srcIndex + 2];
696  const unorm8 v = src[srcIndex + 3];
697 
698  rgb->r = PIXEL_YUV_TO_RGB8_R(y, u, v);
699  rgb->g = PIXEL_YUV_TO_RGB8_G(y, u, v);
700  rgb->b = PIXEL_YUV_TO_RGB8_B(y, u, v);
701 
702  rgb += 1;
703  rgb->r = PIXEL_YUV_TO_RGB8_R(y2, u, v);
704  rgb->g = PIXEL_YUV_TO_RGB8_G(y2, u, v);
705  rgb->b = PIXEL_YUV_TO_RGB8_B(y2, u, v);
706  }
707  }
708 }
unorm8
Definition: unorm8.h:33
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
G3D::int16 y
Definition: Vector2int16.h:38
#define PIXEL_YUV_TO_RGB8_R(y, u, v)
Definition: ImageFormat_convert.cpp:643
G3D::int16 x
Definition: Vector2int16.h:37
#define PIXEL_YUV_TO_RGB8_B(y, u, v)
Definition: ImageFormat_convert.cpp:645
#define PIXEL_YUV_TO_RGB8_G(y, u, v)
Definition: ImageFormat_convert.cpp:644
static void G3D::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
710  {
711  debugAssertM(srcRowPadBits == 0, "Source row padding must be 0 for this format");
712 
713  const Color3unorm8* src = static_cast<const Color3unorm8*>(srcBytes[0]);
714 
715  Color3unorm8* dst = static_cast<Color3unorm8*>(dstBytes[0]);
716 
717  for (int y = 0; y < srcHeight; ++y) {
718  for (int x = 0; x < srcWidth; ++x) {
719 
720  // convert to one rgb pixels at a time
721  const int index = y * srcWidth + x;
722  const Color3unorm8 s = src[index];
723 
724  Color3unorm8& rgb = dst[index];
725  rgb.r = PIXEL_YUV_TO_RGB8_R(s.r, s.g, s.b);
726  rgb.g = PIXEL_YUV_TO_RGB8_G(s.r, s.g, s.b);
727  rgb.b = PIXEL_YUV_TO_RGB8_B(s.r, s.g, s.b);
728  }
729  }
730 }
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
G3D::int16 y
Definition: Vector2int16.h:38
#define PIXEL_YUV_TO_RGB8_R(y, u, v)
Definition: ImageFormat_convert.cpp:643
G3D::int16 x
Definition: Vector2int16.h:37
#define PIXEL_YUV_TO_RGB8_B(y, u, v)
Definition: ImageFormat_convert.cpp:645
#define PIXEL_YUV_TO_RGB8_G(y, u, v)
Definition: ImageFormat_convert.cpp:644
Vector2int32 G3D::yx ( ) const
Vector2int32 G3D::yy ( ) const
Vector2int32 G3D::yz ( ) const
static unorm8 G3D::zero ( )
static
79  {
80  return fromBits(0);
81  }
static unorm8 fromBits(uint8 b)
Definition: unorm8.h:44

+ Here is the call graph for this function:

static unorm16 G3D::zero ( )
static
82  {
83  return fromBits(0);
84  }
static unorm16 fromBits(uint16 b)
Definition: unorm16.h:43

+ Here is the call graph for this function:

bool G3D::zipfileExists ( const std::string &  filename,
std::string &  outZipfile,
std::string &  outInternalFile 
)

Returns true if the given file (or directory) exists within a zipfile. Called if fileExists initially returns false and the lookInZipfiles flag has been set. Must not end in a trailing slash. Does not work for recursive zipfiles (.zips within another .zip)

Parameters
filenamethe path to test
outZipfilethe path to the .zip file
outInternalFilethe path (within the .zip) where the desired file is located, if valid

If no zipfile exists, outZipfile and outInternalFile are unchanged

336  {
337 #if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */
338  Array<std::string> path;
339  std::string drive, base, ext, zipfile, infile;
340  parseFilename(filename, drive, path, base, ext);
341 
342  // Put the filename back together
343  if ((base != "") && (ext != "")) {
344  infile = base + "." + ext;
345  } else {
346  infile = base + ext;
347  }
348 
349  // Remove all standalone single dots (".") from path
350  for (int i = 0; i < path.length(); ++i) {
351  if (path[i] == ".") {
352  path.remove(i);
353  --i;
354  }
355  }
356 
357  // Remove non-leading ".." from path
358  for (int i = 1; i < path.length(); ++i) {
359  if ((path[i] == "..") && (i > 0) && (path[i - 1] != "..")) {
360  // Remove both i and i - 1
361  path.remove(i - 1, 2);
362  i -= 2;
363  }
364  }
365 
366  // Walk the path backwards, accumulating pieces onto the infile until
367  // we find a zipfile that contains it
368  for (int t = 0; t < path.length(); ++t){
369  _zip_resolveDirectory(zipfile, drive, path, path.length() - t);
370  if (t > 0) {
371  infile = path[path.length() - t] + "/" + infile;
372  }
373 
374  if (endsWith(zipfile, "..")) {
375  return false;
376  }
377 
378  if (FileSystem::exists(zipfile)) {
379  // test if it actually is a zipfile
380  // if not, return false, a bad
381  // directory structure has been given,
382  // not a .zip
383  if (FileSystem::isZipfile(zipfile)){
384 
385  if (_zip_zipContains(zipfile, infile)){
386  outZipfile = zipfile;
387  outInternalFile = infile;
388  return true;
389  } else {
390  return false;
391  }
392  } else {
393  // the directory structure was valid but did not point to a .zip
394  return false;
395  }
396  }
397 
398  }
399 #else
400  (void)filename;
401  (void)outZipfile;
402  (void)outInternalFile;
403 #endif
404  // not a valid directory structure ever,
405  // obviously no .zip was found within the path
406  return false;
407 }
bool isZipfile(const std::string &filename)
Definition: fileutils.cpp:892
bool endsWith(const std::string &test, const std::string &pattern)
Returns true if the test string ends with the pattern string.
Definition: stringutils.cpp:127
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:

bool G3D::zipfileExists ( const std::string &  filename)
94  {
95  std::string outZipfile;
96  std::string outInternalFile;
97  return zipfileExists(filename, outZipfile, outInternalFile);
98 }
bool zipfileExists(const std::string &filename, std::string &outZipfile, std::string &outInternalFile)
Definition: fileutils.cpp:335

+ Here is the call graph for this function:

Vector2int32 G3D::zx ( ) const
Vector2int32 G3D::zy ( ) const
Vector2int32 G3D::zz ( ) const

Variable Documentation

Set<std::string> G3D::_filesUsed
static
BufferPool* G3D::bufferpool = NULL
static
const bool G3D::CLEAR_FORMAT = false
static
FileSystem* G3D::common = NULL
static
const bool G3D::COMP_FORMAT = true
static
Array<std::string> G3D::directoryArray
static
const bool G3D::DONT_SHRINK_UNDERLYING_ARRAY = false

Constant for passing to Array::resize

const float G3D::G_BGB[5][5]
static
Initial value:
=
{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f},
{ -1.0f, 2.0f, 4.0f, 2.0f, -1.0f},
{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}
const float G3D::G_GRR[5][5]
static
Initial value:
=
{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f},
{ -1.0f, 2.0f, 4.0f, 2.0f, -1.0f},
{ 0.0f, 0.0f, 2.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}
Table<std::string, std::string> G3D::lastFound
static
const std::string G3D::nameArray[ImageFormat::CODE_NUM]
static
const char * G3D::NEWLINE = "\n"
const int G3D::NUM_CONVERT_IMAGE_FORMATS = 5
static
const bool G3D::OPAQUE_FORMAT = true
static
const float G3D::R_BGB[5][5]
static
Initial value:
=
{{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f},
{ 0.0f, 2.0f, 0.0f, 2.0f, 0.0f},
{-3.0f/2.0f, 0.0f, 6.0f, 0.0f, -3.0f/2.0f},
{ 0.0f, 2.0f, 0.0f, 2.0f, 0.0f},
{ 0.0f, 0.0f, -3.0f/2.0f, 0.0f, 0.0f}}
const float G3D::R_BGG[5][5]
static
Initial value:
=
{{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f},
{ 0.0f, -1.0f, 4.0f, -1.0f, 0.0f},
{ 0.5f, 0.0f, 5.0f, 0.0f, 0.5f},
{ 0.0f, -1.0f, 4.0f, -1.0f, 0.0f},
{ 0.0f, 0.0f, -1.0f, 0.0f, 0.0f}}
const float G3D::R_GRG[5][5]
static
Initial value:
=
{{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f},
{ 0.0f, -1.0f, 0.0f, -1.0f, 0.0f},
{ -1.0f, 4.0f, 5.0f, 4.0f, -1.0f},
{ 0.0f, -1.0f, 0.0f, -1.0f, 0.0f},
{ 0.0f, 0.0f, 0.5f, 0.0f, 0.0f}}
const ConvertAttributes G3D::sConvertMappings[]
static
const int G3D::SORT_DECREASING = -1

Constant for Array::sort

const int G3D::SORT_INCREASING = 1

Constant for Array::sort

const bool G3D::UNCOMP_FORMAT = false
static
G3D::unorm16
Initial value:
{
private:
uint16 m_bits
uint16_t uint16
Definition: Define.h:151

Represents numbers on [0, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.

Note that arithmetic operations may over and under-flow, just like uint16 arithmetic.

OpenGL specifications can be found here: http://www.opengl.org/registry/specs/ARB/shading_language_packing.txt

G3D::unorm8
Initial value:
{
private:
uint8 m_bits
uint8_t uint8
Definition: Define.h:152

Represents numbers on [0, 1] in 8 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.

OpenGL specifications can be found here: <www.opengl.org/registry/specs/ARB/shading_language_packing.txt>

Note that arithmetic operations may over and under-flow, just like uint8 arithmetic.

Vector2int16::Vector2int16
Initial value:
{
private:
bool operator<(const String &left, const String &right)
Definition: String.cpp:785
#define const
Definition: zconf.h:217
Definition: Vector2int16.h:22
G3D::Vector2int32
Initial value:
{
private:
bool operator<(const String &left, const String &right)
Definition: String.cpp:785
#define const
Definition: zconf.h:217
G3D::Vector2unorm16
Initial value:
{
private:
bool operator<(const String &left, const String &right)
Definition: String.cpp:785
Definition: Vector2unorm16.h:23
#define const
Definition: zconf.h:217
Vector3int16::Vector3int16
Initial value:
{
private:
bool operator<(const String &left, const String &right)
Definition: String.cpp:785
#define const
Definition: zconf.h:217
G3D::Vector3int32::Vector3int32
Initial value:
{
private:
bool operator<(const String &left, const String &right)
Definition: String.cpp:785
#define const
Definition: zconf.h:217
Vector3int32(class BinaryInput &bi)

\ Vector3int32 A Vector3 that packs its fields into uint32s.

G3D::int32 G3D::x
G3D::int32 G3D::y
G3D::int32 G3D::z