Field3D
SpiMathLib.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------//
2 
3 /*
4  * Copyright (c) 2009 Sony Pictures Imageworks Inc
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution. Neither the name of Sony Pictures Imageworks nor the
18  * names of its contributors may be used to endorse or promote
19  * products derived from this software without specific prior written
20  * permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 //----------------------------------------------------------------------------//
37 
38 #ifndef _INCLUDED_Field3D_SpiMathLib_H_
39 #define _INCLUDED_Field3D_SpiMathLib_H_
40 
41 #include <OpenEXR/half.h>
42 #include <OpenEXR/ImathHalfLimits.h>
43 
44 #include <OpenEXR/ImathBox.h>
45 #include <OpenEXR/ImathBoxAlgo.h>
46 #include <OpenEXR/ImathColor.h>
47 #include <OpenEXR/ImathMatrix.h>
48 #include <OpenEXR/ImathVec.h>
49 
50 #include <OpenEXR/ImathRoots.h>
51 #include <OpenEXR/ImathMatrixAlgo.h>
52 #include <OpenEXR/ImathRandom.h>
53 #include <OpenEXR/ImathPlane.h>
54 #include <OpenEXR/ImathQuat.h>
55 
56 //----------------------------------------------------------------------------//
57 
58 #include "ns.h"
59 
61 
62 #ifndef OPENEXR_VERSION_NS
63 
65 typedef Imath::V2i V2i;
66 typedef Imath::V2f V2f;
67 typedef Imath::V2d V2d;
68 typedef Imath::C3f C3f;
69 typedef Imath::Color3<half> C3h;
70 typedef Imath::C4f C4f;
71 typedef Imath::V3i V3i;
72 typedef Imath::Vec3<half> V3h;
73 typedef Imath::V3f V3f;
74 typedef Imath::V3d V3d;
80 typedef Imath::M33f M33f;
81 typedef Imath::M44f M44f;
82 typedef Imath::M44d M44d;
86 
87 
88 #define FIELD3D_VEC3_T Imath::Vec3
89 
90 #define FIELD3D_CLIP Imath::clip
91 #define FIELD3D_LERP Imath::lerp
92 #define FIELD3D_LERPFACTOR Imath::lerpfactor
93 #define FIELD3D_EXTRACT_SHRT Imath::extractSHRT
94 
95 #define FIELD3D_RAND48 Imath::Rand48
96 #define FIELD3D_RAND32 Imath::Rand32
97 #define FIELD3D_SOLIDSPHERERAND Imath::solidSphereRand
98 #define FIELD3D_HALF_LIMITS Imath::limits<SPI::Field3D::half>
99 
100 // default random number generator
101 #define FIELD3D_RAND Imath::Rand48
102 
103 #else
104 
105 
106 
107 typedef SPI::OpenEXR::half half;
113 typedef SPI::OpenEXR::Imath::Color3<SPI::OpenEXR::half> C3h;
115 typedef SPI::OpenEXR::Imath::Vec3<SPI::OpenEXR::half> V3h;
129 
130 
131 #define FIELD3D_VEC3_T SPI::OpenEXR::Imath::Vec3
132 
133 #define FIELD3D_CLIP SPI::OpenEXR::Imath::clip
134 #define FIELD3D_LERP SPI::OpenEXR::Imath::lerp
135 #define FIELD3D_LERPFACTOR SPI::OpenEXR::Imath::lerpfactor
136 #define FIELD3D_EXTRACT_SHRT SPI::OpenEXR::Imath::extractSHRT
137 
138 // default random number generator
139 #define FIELD3D_RAND SPI::OpenEXR::Imath::Rand48
140 
141 #define FIELD3D_RAND48 SPI::OpenEXR::Imath::Rand48
142 #define FIELD3D_RAND32 SPI::OpenEXR::Imath::Rand32
143 #define FIELD3D_SOLIDSPHERERAND SPI::OpenEXR::Imath::solidSphereRand
144 #define FIELD3D_HALF_LIMITS SPI::OpenEXR::Imath::limits<SPI::OpenEXR::half>
145 
146 //----------------------------------------------------------------------------//
147 
148 //----------------------------------------------------------------------------//
149 #endif // OPENEXR_VERSION
151 #endif // Include guard
FIELD3D_NAMESPACE_HEADER_CLOSE
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition: ns.h:58
V3i
Imath::V3i V3i
Definition: SpiMathLib.h:71
Line3d
Imath::Line3d Line3d
Definition: SpiMathLib.h:84
V3d
Imath::V3d V3d
Definition: SpiMathLib.h:74
Box3f
Imath::Box3f Box3f
Definition: SpiMathLib.h:78
V3f
Imath::V3f V3f
Definition: SpiMathLib.h:73
V2f
Imath::V2f V2f
Definition: SpiMathLib.h:66
Box2f
Imath::Box2f Box2f
Definition: SpiMathLib.h:75
half
FIELD3D_NAMESPACE_OPEN typedef ::half half
Definition: SpiMathLib.h:64
ns.h
V2i
Imath::V2i V2i
Definition: SpiMathLib.h:65
Box3d
Imath::Box3d Box3d
Definition: SpiMathLib.h:79
V2d
Imath::V2d V2d
Definition: SpiMathLib.h:67
C3h
Imath::Color3< half > C3h
Definition: SpiMathLib.h:69
Box2i
Imath::Box2i Box2i
Definition: SpiMathLib.h:76
V3h
Imath::Vec3< half > V3h
Definition: SpiMathLib.h:72
M44d
Imath::M44d M44d
Definition: SpiMathLib.h:82
Plane3d
Imath::Plane3d Plane3d
Definition: SpiMathLib.h:83
Quatd
Imath::Quatd Quatd
Definition: SpiMathLib.h:85
FIELD3D_NAMESPACE_OPEN
Definition: FieldMapping.cpp:74
Box3i
Imath::Box3i Box3i
Definition: SpiMathLib.h:77
C3f
Imath::C3f C3f
Definition: SpiMathLib.h:68
M33f
Imath::M33f M33f
Definition: SpiMathLib.h:80
C4f
Imath::C4f C4f
Definition: SpiMathLib.h:70
M44f
Imath::M44f M44f
Definition: SpiMathLib.h:81