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
64typedef ::half half;
65typedef Imath::V2i V2i;
66typedef Imath::V2f V2f;
67typedef Imath::V2d V2d;
68typedef Imath::C3f C3f;
69typedef Imath::Color3<half> C3h;
70typedef Imath::C4f C4f;
71typedef Imath::V3i V3i;
72typedef Imath::Vec3<half> V3h;
73typedef Imath::V3f V3f;
74typedef Imath::V3d V3d;
75typedef Imath::Box2f Box2f;
76typedef Imath::Box2i Box2i;
77typedef Imath::Box3i Box3i;
78typedef Imath::Box3f Box3f;
79typedef Imath::Box3d Box3d;
80typedef Imath::M33f M33f;
81typedef Imath::M44f M44f;
82typedef Imath::M44d M44d;
83typedef Imath::Plane3d Plane3d;
84typedef Imath::Line3d Line3d;
85typedef Imath::Quatd Quatd;
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
107typedef SPI::OpenEXR::half half;
108typedef SPI::OpenEXR::Imath::V2i V2i;
109typedef SPI::OpenEXR::Imath::V2f V2f;
110typedef SPI::OpenEXR::Imath::V2d V2d;
111typedef SPI::OpenEXR::Imath::C3f C3f;
112typedef SPI::OpenEXR::Imath::C4f C4f;
113typedef SPI::OpenEXR::Imath::Color3<SPI::OpenEXR::half> C3h;
114typedef SPI::OpenEXR::Imath::V3i V3i;
115typedef SPI::OpenEXR::Imath::Vec3<SPI::OpenEXR::half> V3h;
116typedef SPI::OpenEXR::Imath::V3f V3f;
117typedef SPI::OpenEXR::Imath::V3d V3d;
118typedef SPI::OpenEXR::Imath::Box2i Box2i;
119typedef SPI::OpenEXR::Imath::Box2f Box2f;
120typedef SPI::OpenEXR::Imath::Box3i Box3i;
121typedef SPI::OpenEXR::Imath::Box3f Box3f;
122typedef SPI::OpenEXR::Imath::Box3d Box3d;
123typedef SPI::OpenEXR::Imath::M33f M33f;
124typedef SPI::OpenEXR::Imath::M44f M44f;
125typedef SPI::OpenEXR::Imath::M44d M44d;
126typedef SPI::OpenEXR::Imath::Plane3d Plane3d;
127typedef SPI::OpenEXR::Imath::Line3d Line3d;
128typedef SPI::OpenEXR::Imath::Quatd Quatd;
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
Imath::M44f M44f
Definition SpiMathLib.h:81
Imath::V2i V2i
Definition SpiMathLib.h:65
Imath::V2d V2d
Definition SpiMathLib.h:67
Imath::Box2i Box2i
Definition SpiMathLib.h:76
Imath::Box3d Box3d
Definition SpiMathLib.h:79
Imath::V3i V3i
Definition SpiMathLib.h:71
Imath::V3d V3d
Definition SpiMathLib.h:74
FIELD3D_NAMESPACE_OPENtypedef ::half half
Definition SpiMathLib.h:64
Imath::Quatd Quatd
Definition SpiMathLib.h:85
Imath::C4f C4f
Definition SpiMathLib.h:70
Imath::Color3< half > C3h
Definition SpiMathLib.h:69
Imath::Box3f Box3f
Definition SpiMathLib.h:78
Imath::Line3d Line3d
Definition SpiMathLib.h:84
Imath::V2f V2f
Definition SpiMathLib.h:66
Imath::Plane3d Plane3d
Definition SpiMathLib.h:83
Imath::Box2f Box2f
Definition SpiMathLib.h:75
Imath::Box3i Box3i
Definition SpiMathLib.h:77
Imath::Vec3< half > V3h
Definition SpiMathLib.h:72
Imath::V3f V3f
Definition SpiMathLib.h:73
Imath::M33f M33f
Definition SpiMathLib.h:80
Imath::M44d M44d
Definition SpiMathLib.h:82
Imath::C3f C3f
Definition SpiMathLib.h:68
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition ns.h:58