Field3D
SpiMathLib.h
Go to the documentation of this file.
00001 //----------------------------------------------------------------------------//
00002 
00003 /*
00004  * Copyright (c) 2009 Sony Pictures Imageworks Inc
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * Redistributions of source code must retain the above copyright
00013  * notice, this list of conditions and the following disclaimer.
00014  * Redistributions in binary form must reproduce the above copyright
00015  * notice, this list of conditions and the following disclaimer in the
00016  * documentation and/or other materials provided with the
00017  * distribution.  Neither the name of Sony Pictures Imageworks nor the
00018  * names of its contributors may be used to endorse or promote
00019  * products derived from this software without specific prior written
00020  * permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
00026  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00028  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00031  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00033  * OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 //----------------------------------------------------------------------------//
00037 
00038 #ifndef _INCLUDED_Field3D_SpiMathLib_H_
00039 #define _INCLUDED_Field3D_SpiMathLib_H_
00040 
00041 #include <OpenEXR/half.h>
00042 #include <OpenEXR/ImathHalfLimits.h>
00043 
00044 #include <OpenEXR/ImathBox.h>
00045 #include <OpenEXR/ImathBoxAlgo.h>
00046 #include <OpenEXR/ImathColor.h>
00047 #include <OpenEXR/ImathMatrix.h>
00048 #include <OpenEXR/ImathVec.h>
00049 
00050 #include <OpenEXR/ImathRoots.h>
00051 #include <OpenEXR/ImathMatrixAlgo.h>
00052 #include <OpenEXR/ImathRandom.h>
00053 #include <OpenEXR/ImathPlane.h>
00054 #include <OpenEXR/ImathQuat.h>
00055 
00056 //----------------------------------------------------------------------------//
00057 
00058 #include "ns.h"
00059 
00060 FIELD3D_NAMESPACE_OPEN
00061 
00062 #ifndef OPENEXR_VERSION_NS
00063 
00064 typedef ::half               half;
00065 typedef Imath::V2i           V2i;
00066 typedef Imath::V2f           V2f;
00067 typedef Imath::V2d           V2d;
00068 typedef Imath::C3f           C3f;
00069 typedef Imath::Color3<half>  C3h;
00070 typedef Imath::C4f           C4f;
00071 typedef Imath::V3i           V3i;
00072 typedef Imath::Vec3<half>    V3h;
00073 typedef Imath::V3f           V3f;
00074 typedef Imath::V3d           V3d;
00075 typedef Imath::Box2f         Box2f;
00076 typedef Imath::Box2i         Box2i;
00077 typedef Imath::Box3i         Box3i;
00078 typedef Imath::Box3f         Box3f;
00079 typedef Imath::Box3d         Box3d;
00080 typedef Imath::M33f          M33f;
00081 typedef Imath::M44f          M44f;
00082 typedef Imath::M44d          M44d;
00083 typedef Imath::Plane3d       Plane3d;
00084 typedef Imath::Line3d        Line3d;
00085 typedef Imath::Quatd         Quatd;
00086 
00087 
00088 #define FIELD3D_VEC3_T       Imath::Vec3
00089 
00090 #define FIELD3D_CLIP         Imath::clip
00091 #define FIELD3D_LERP         Imath::lerp
00092 #define FIELD3D_LERPFACTOR   Imath::lerpfactor
00093 #define FIELD3D_EXTRACT_SHRT Imath::extractSHRT
00094 
00095 #define FIELD3D_RAND48       Imath::Rand48
00096 #define FIELD3D_RAND32       Imath::Rand32
00097 #define FIELD3D_SOLIDSPHERERAND Imath::solidSphereRand
00098 #define FIELD3D_HALF_LIMITS Imath::limits<SPI::Field3D::half>
00099 
00100 // default random number generator
00101 #define FIELD3D_RAND         Imath::Rand48
00102 
00103 #else 
00104 
00105 
00106 
00107 typedef SPI::OpenEXR::half                            half;
00108 typedef SPI::OpenEXR::Imath::V2i                      V2i;
00109 typedef SPI::OpenEXR::Imath::V2f                      V2f;
00110 typedef SPI::OpenEXR::Imath::V2d                      V2d;
00111 typedef SPI::OpenEXR::Imath::C3f                      C3f;
00112 typedef SPI::OpenEXR::Imath::C4f                      C4f;
00113 typedef SPI::OpenEXR::Imath::Color3<SPI::OpenEXR::half> C3h;
00114 typedef SPI::OpenEXR::Imath::V3i                      V3i;
00115 typedef SPI::OpenEXR::Imath::Vec3<SPI::OpenEXR::half> V3h;
00116 typedef SPI::OpenEXR::Imath::V3f                      V3f;
00117 typedef SPI::OpenEXR::Imath::V3d                      V3d;
00118 typedef SPI::OpenEXR::Imath::Box2i                    Box2i;
00119 typedef SPI::OpenEXR::Imath::Box2f                    Box2f;
00120 typedef SPI::OpenEXR::Imath::Box3i                    Box3i;
00121 typedef SPI::OpenEXR::Imath::Box3f                    Box3f;
00122 typedef SPI::OpenEXR::Imath::Box3d                    Box3d;
00123 typedef SPI::OpenEXR::Imath::M33f                     M33f;
00124 typedef SPI::OpenEXR::Imath::M44f                     M44f;
00125 typedef SPI::OpenEXR::Imath::M44d                     M44d;
00126 typedef SPI::OpenEXR::Imath::Plane3d                  Plane3d;
00127 typedef SPI::OpenEXR::Imath::Line3d                   Line3d;
00128 typedef SPI::OpenEXR::Imath::Quatd                    Quatd;
00129 
00130 
00131 #define FIELD3D_VEC3_T       SPI::OpenEXR::Imath::Vec3
00132 
00133 #define FIELD3D_CLIP         SPI::OpenEXR::Imath::clip
00134 #define FIELD3D_LERP         SPI::OpenEXR::Imath::lerp
00135 #define FIELD3D_LERPFACTOR   SPI::OpenEXR::Imath::lerpfactor
00136 #define FIELD3D_EXTRACT_SHRT SPI::OpenEXR::Imath::extractSHRT
00137 
00138 // default random number generator
00139 #define FIELD3D_RAND         SPI::OpenEXR::Imath::Rand48
00140 
00141 #define FIELD3D_RAND48       SPI::OpenEXR::Imath::Rand48
00142 #define FIELD3D_RAND32       SPI::OpenEXR::Imath::Rand32
00143 #define FIELD3D_SOLIDSPHERERAND SPI::OpenEXR::Imath::solidSphereRand
00144 #define FIELD3D_HALF_LIMITS  SPI::OpenEXR::Imath::limits<SPI::OpenEXR::half>
00145 
00146 //----------------------------------------------------------------------------//
00147 
00148 //----------------------------------------------------------------------------//
00149 #endif // OPENEXR_VERSION
00150 FIELD3D_NAMESPACE_HEADER_CLOSE
00151 #endif // Include guard