~jesterking/blender/win32libs

« back to all changes in this revision

Viewing changes to osl/include/OSL/oslconfig.h

  • Committer: dingto
  • Date: 2013-12-06 17:01:28 UTC
  • Revision ID: svn-v4:954f8c5b-7b00-dc11-b283-0030488c597c:trunk/lib/windows:61249
MSVC 2008 x86
* Update OSL to 1.4.0 and OIIO to 1.3.9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al.
3
 
All Rights Reserved.
4
 
 
5
 
Redistribution and use in source and binary forms, with or without
6
 
modification, are permitted provided that the following conditions are
7
 
met:
8
 
* Redistributions of source code must retain the above copyright
9
 
  notice, this list of conditions and the following disclaimer.
10
 
* Redistributions in binary form must reproduce the above copyright
11
 
  notice, this list of conditions and the following disclaimer in the
12
 
  documentation and/or other materials provided with the distribution.
13
 
* Neither the name of Sony Pictures Imageworks nor the names of its
14
 
  contributors may be used to endorse or promote products derived from
15
 
  this software without specific prior written permission.
16
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
 
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
 
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
 
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
 
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
 
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
 
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 
*/
28
 
 
29
 
#ifndef OSLCONFIG_H
30
 
#define OSLCONFIG_H
31
 
 
32
 
/////////////////////////////////////////////////////////////////////////
33
 
/// \file
34
 
/// Various compile-time defaults are defined here that could, in
35
 
/// principle, be redefined if you are using OSL in some particular
36
 
/// renderer that wanted things a different way.
37
 
/////////////////////////////////////////////////////////////////////////
38
 
 
39
 
// Test if we are using C++11
40
 
#if (__cplusplus >= 201103L)
41
 
#define OSL_USING_CPLUSPLUS11 1
42
 
#endif
43
 
 
44
 
// Symbol export defines
45
 
#include "export.h"
46
 
 
47
 
// All the things we need from Imath
48
 
#include <OpenEXR/ImathVec.h>
49
 
#include <OpenEXR/ImathColor.h>
50
 
#include <OpenEXR/ImathMatrix.h>
51
 
 
52
 
// All the things we need from OpenImageIO
53
 
#include <OpenImageIO/version.h>
54
 
#include <OpenImageIO/errorhandler.h>
55
 
#include <OpenImageIO/texture.h>
56
 
#include <OpenImageIO/typedesc.h>
57
 
#include <OpenImageIO/ustring.h>
58
 
 
59
 
// Sort out smart pointers
60
 
#ifdef OSL_USING_CPLUSPLUS11
61
 
# include <memory>
62
 
#else
63
 
# include <boost/shared_ptr.hpp>
64
 
#endif
65
 
 
66
 
// Extensions to Imath
67
 
#include "matrix22.h"
68
 
 
69
 
#include "oslversion.h"
70
 
 
71
 
OSL_NAMESPACE_ENTER
72
 
 
73
 
 
74
 
/// By default, we operate with single precision float.  Change this
75
 
/// definition to make a shading system that fundamentally operates
76
 
/// on doubles.
77
 
/// FIXME: it's very likely that all sorts of other things will break
78
 
/// if you do this, but eventually we should make sure it works.
79
 
typedef float Float;
80
 
 
81
 
/// By default, use the excellent Imath vector, matrix, and color types
82
 
/// from the IlmBase package from: http://www.openexr.com
83
 
///
84
 
/// It's permissible to override these types with the vector, matrix,
85
 
/// and color classes of your choice, provided that (a) your vectors
86
 
/// have the same data layout as a simple Float[n]; (b) your
87
 
/// matrices have the same data layout as Float[n][n]; and (c) your
88
 
/// classes have most of the obvious constructors and overloaded
89
 
/// operators one would expect from a C++ vector/matrix/color class.
90
 
typedef Imath::Vec3<Float>     Vec3;
91
 
typedef Imath::Matrix33<Float> Matrix33;
92
 
typedef Imath::Matrix44<Float> Matrix44;
93
 
typedef Imath::Color3<Float>   Color3;
94
 
typedef Imath::Vec2<Float>     Vec2;
95
 
 
96
 
typedef Imathx::Matrix22<Float> Matrix22;
97
 
 
98
 
/// Assume that we are dealing with OpenImageIO's texture system.  It
99
 
/// doesn't literally have to be OIIO's... it just needs to have the
100
 
/// same API as OIIO's TextureSystem class, it's a purely abstract class
101
 
/// anyway.
102
 
using OIIO::TextureSystem;
103
 
using OIIO::TextureOpt;
104
 
 
105
 
// And some other things we borrow from OIIO...
106
 
using OIIO::ErrorHandler;
107
 
using OIIO::TypeDesc;
108
 
using OIIO::ustring;
109
 
using OIIO::ustringHash;
110
 
 
111
 
// Sort out smart pointers
112
 
#ifdef OSL_USING_CPLUSPLUS11
113
 
  using std::shared_ptr;
114
 
#else
115
 
  using boost::shared_ptr;
116
 
#endif
117
 
 
118
 
 
119
 
OSL_NAMESPACE_EXIT
120
 
 
121
 
#endif /* OSLCONFIG_H */
 
1
/*
 
2
Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al.
 
3
All Rights Reserved.
 
4
 
 
5
Redistribution and use in source and binary forms, with or without
 
6
modification, are permitted provided that the following conditions are
 
7
met:
 
8
* Redistributions of source code must retain the above copyright
 
9
  notice, this list of conditions and the following disclaimer.
 
10
* Redistributions in binary form must reproduce the above copyright
 
11
  notice, this list of conditions and the following disclaimer in the
 
12
  documentation and/or other materials provided with the distribution.
 
13
* Neither the name of Sony Pictures Imageworks nor the names of its
 
14
  contributors may be used to endorse or promote products derived from
 
15
  this software without specific prior written permission.
 
16
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
17
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
18
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
19
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
20
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
21
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
22
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
23
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
24
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
26
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
27
*/
 
28
 
 
29
#ifndef OSLCONFIG_H
 
30
#define OSLCONFIG_H
 
31
 
 
32
/////////////////////////////////////////////////////////////////////////
 
33
/// \file
 
34
/// Various compile-time defaults are defined here that could, in
 
35
/// principle, be redefined if you are using OSL in some particular
 
36
/// renderer that wanted things a different way.
 
37
/////////////////////////////////////////////////////////////////////////
 
38
 
 
39
// Test if we are using C++11
 
40
#if (__cplusplus >= 201103L)
 
41
#define OSL_USING_CPLUSPLUS11 1
 
42
#endif
 
43
 
 
44
// Symbol export defines
 
45
#include "export.h"
 
46
 
 
47
// All the things we need from Imath
 
48
#include <OpenEXR/ImathVec.h>
 
49
#include <OpenEXR/ImathColor.h>
 
50
#include <OpenEXR/ImathMatrix.h>
 
51
 
 
52
// All the things we need from OpenImageIO
 
53
#include <OpenImageIO/version.h>
 
54
#include <OpenImageIO/errorhandler.h>
 
55
#include <OpenImageIO/texture.h>
 
56
#include <OpenImageIO/typedesc.h>
 
57
#include <OpenImageIO/ustring.h>
 
58
 
 
59
// Sort out smart pointers
 
60
#ifdef OSL_USING_CPLUSPLUS11
 
61
# include <memory>
 
62
#else
 
63
# include <boost/shared_ptr.hpp>
 
64
#endif
 
65
 
 
66
// Extensions to Imath
 
67
#include "matrix22.h"
 
68
 
 
69
#include "oslversion.h"
 
70
 
 
71
OSL_NAMESPACE_ENTER
 
72
 
 
73
 
 
74
/// By default, we operate with single precision float.  Change this
 
75
/// definition to make a shading system that fundamentally operates
 
76
/// on doubles.
 
77
/// FIXME: it's very likely that all sorts of other things will break
 
78
/// if you do this, but eventually we should make sure it works.
 
79
typedef float Float;
 
80
 
 
81
/// By default, use the excellent Imath vector, matrix, and color types
 
82
/// from the IlmBase package from: http://www.openexr.com
 
83
///
 
84
/// It's permissible to override these types with the vector, matrix,
 
85
/// and color classes of your choice, provided that (a) your vectors
 
86
/// have the same data layout as a simple Float[n]; (b) your
 
87
/// matrices have the same data layout as Float[n][n]; and (c) your
 
88
/// classes have most of the obvious constructors and overloaded
 
89
/// operators one would expect from a C++ vector/matrix/color class.
 
90
typedef Imath::Vec3<Float>     Vec3;
 
91
typedef Imath::Matrix33<Float> Matrix33;
 
92
typedef Imath::Matrix44<Float> Matrix44;
 
93
typedef Imath::Color3<Float>   Color3;
 
94
typedef Imath::Vec2<Float>     Vec2;
 
95
 
 
96
typedef Imathx::Matrix22<Float> Matrix22;
 
97
 
 
98
/// Assume that we are dealing with OpenImageIO's texture system.  It
 
99
/// doesn't literally have to be OIIO's... it just needs to have the
 
100
/// same API as OIIO's TextureSystem class, it's a purely abstract class
 
101
/// anyway.
 
102
using OIIO::TextureSystem;
 
103
using OIIO::TextureOpt;
 
104
 
 
105
// And some other things we borrow from OIIO...
 
106
using OIIO::ErrorHandler;
 
107
using OIIO::TypeDesc;
 
108
using OIIO::ustring;
 
109
using OIIO::ustringHash;
 
110
 
 
111
// Sort out smart pointers
 
112
#ifdef OSL_USING_CPLUSPLUS11
 
113
  using std::shared_ptr;
 
114
#else
 
115
  using boost::shared_ptr;
 
116
#endif
 
117
 
 
118
 
 
119
OSL_NAMESPACE_EXIT
 
120
 
 
121
#endif /* OSLCONFIG_H */