HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
oiioversion.h
Go to the documentation of this file.
1 // Copyright Contributors to the OpenImageIO project.
2 // SPDX-License-Identifier: Apache-2.0
3 // https://github.com/AcademySoftwareFoundation/OpenImageIO
4 
5 
6 #ifndef OPENIMAGEIO_VERSION_H
7 #define OPENIMAGEIO_VERSION_H
8 
9 
10 // Versioning of the OpenImageIO software. For *releases*:
11 //
12 // MAJOR is a major architectural change or a step that does not preserve
13 // backwards compatibility of source code (an app designed for an older
14 // major version may not compile successfully against newer version of the
15 // headers and libraries, and will need to have its source modified).
16 // Examples of changes that necessitate major version changes are removal of
17 // API calls or classes, or renaming of class members.
18 //
19 // MINOR is an addition of significant new features and may change the
20 // definition of public data structures or functions in a way that is
21 // backwards compatible for source code, but is not back compatible for ABI
22 // or linkage (i.e. you don't need to modify your app's source, but you do
23 // need to recompile it). Examples of changes that necessitate a minor
24 // version change would be adding new data fields to a structure, adding new
25 // virtual member functions to a class, or adding new optional parameters to
26 // the end of a function call.
27 //
28 // PATCH is a minor change that preserves ABI and link back-compatibility,
29 // where an app built for the older version can simply have the newer
30 // library substituted without recompilation. Generally, this is only for
31 // bug fixes, though sometimes we may add new minor features if they only
32 // involve addition of static/global function calls or data (since this does
33 // not break back-compatibility).
34 //
35 // TWEAK is just a rebuild/re-version that is both forward and backward
36 // compatible. Usually this involves only a change to the build system
37 // itself (such as fixing a build break on a particular platform), a change
38 // in documentation, or fixing some other minor unintentional flaw in a
39 // prior release.
40 //
41 // Note that these designations only apply to released branches. Changes
42 // in the main development branch ("main") do not make any compatibility
43 // guarantees at all.
44 //
45 #define OIIO_VERSION_MAJOR 2
46 #define OIIO_VERSION_MINOR 5
47 #define OIIO_VERSION_PATCH 18
48 #define OIIO_VERSION_TWEAK 0
49 #define OIIO_VERSION_RELEASE_TYPE
50 
51 // Preprocessor utility: stringize
52 #define OIIO_STRINGIZE_HELPER(a) #a
53 #define OIIO_STRINGIZE(a) OIIO_STRINGIZE_HELPER(a)
54 
55 // Construct a single integer version number from major, minor, patch.
56 // Example of its use:
57 //
58 // #if OIIO_VERSION >= OIIO_MAKE_VERSION(2,3,0)
59 // ... use a feature introduced in version 2.3.0 ...
60 // #endif
61 //
62 #define OIIO_MAKE_VERSION(major,minor,patch) \
63  (10000 * (major) + 100 * (minor) + (patch))
64 
65 // Single version designation of this release
66 #define OIIO_VERSION OIIO_MAKE_VERSION(OIIO_VERSION_MAJOR, \
67  OIIO_VERSION_MINOR, OIIO_VERSION_PATCH)
68 
69 // Test if OIIO is >= a particular version.
70 #define OIIO_VERSION_GREATER_EQUAL(major,minor,patch) \
71  OIIO_VERSION >= OIIO_MAKE_VERSION(major,minor,patch)
72 
73 // Test if OIIO is < a particular version.
74 #define OIIO_VERSION_LESS(major,minor,patch) \
75  OIIO_VERSION < OIIO_MAKE_VERSION(major,minor,patch)
76 
77 // We also define the old name for backwards compatibility purposes.
78 #define OPENIMAGEIO_VERSION OIIO_VERSION
79 
80 // Magic macros to make OIIO_VERSION_STRING that looks like "1.2.3.0"
81 #define OIIO_MAKE_VERSION_STRING2(a,b,c,d,e) #a "." #b "." #c "." #d #e
82 #define OIIO_MAKE_VERSION_STRING(a,b,c,d,e) OIIO_MAKE_VERSION_STRING2(a,b,c,d,e)
83 #define OIIO_VERSION_STRING \
84  OIIO_MAKE_VERSION_STRING(OIIO_VERSION_MAJOR, \
85  OIIO_VERSION_MINOR, OIIO_VERSION_PATCH, \
86  OIIO_VERSION_TWEAK, OIIO_VERSION_RELEASE_TYPE)
87 #define OIIO_INTRO_STRING "OpenImageIO " OIIO_VERSION_STRING " http://www.openimageio.org"
88 
89 // Only major.minor.patch.tweak, omit any release type
90 #define OIIO_VERSION_STRING_MMPT \
91  OIIO_MAKE_VERSION_STRING(OIIO_VERSION_MAJOR, \
92  OIIO_VERSION_MINOR, OIIO_VERSION_PATCH, \
93  OIIO_VERSION_TWEAK, "")
94 
95 // OIIO_DISABLE_DEPRECATED encodes the version for which any declarations that
96 // were deprecated as of that version may be hidden from view of software
97 // including the OIIO headers. For example, if a downstream project says
98 //
99 // #define OIIO_DISABLE_DEPRECATED OIIO_MAKE_VERSION(2,2,0)
100 //
101 // before including any OpenImageIO header, then we will do our best to make
102 // it a compile-time error if they try to use anything that was deprecated
103 // in or before version 2.2.0. This is viewed as equivalent to the downstream
104 // package considering their minimum OIIO to be 2.2 and they want to be sure
105 // they aren't using any features that are slated for deprecation. The
106 // default, 0, will not try to hide any deprecated features.
107 //
108 // To clarify, if version 2.2 is the first to deprecate a certain definition,
109 // then it is considered good practice to guard it like this:
110 //
111 // #if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(2,2,0)
112 // ... deprecated definition here ...
113 // #endif
114 //
115 #ifndef OIIO_DISABLE_DEPRECATED
116 # define OIIO_DISABLE_DEPRECATED 0
117 #endif
118 
119 // Establish the name spaces
120 namespace HOIIO_v2_5 { }
121 namespace OIIO = HOIIO_v2_5;
122 
123 // Macros to use in each file to enter and exit the right name spaces.
124 #define OIIO_NAMESPACE HOIIO_v2_5
125 #define OIIO_NAMESPACE_STRING "HOIIO_v2_5"
126 #define OIIO_NAMESPACE_BEGIN namespace HOIIO_v2_5 {
127 #define OIIO_NAMESPACE_END }
128 #define OIIO_NAMESPACE_USING using namespace OIIO;
129 
130 
131 /// Each imageio DSO/DLL should include this statement:
132 /// DLLPUBLIC int FORMAT_imageio_version = OPENIMAGEIO_PLUGIN_VERSION;
133 /// libOpenImageIO will check for compatibility this way.
134 /// This should get bumped any time we change the API in any way that
135 /// will make previously-compiled plugins break.
136 ///
137 /// History:
138 /// Version 3 added supports_rectangles() and write_rectangle() to
139 /// ImageOutput, and added stride parameters to the ImageInput read
140 /// routines.
141 /// Version 10 represents forking from NVIDIA's open source version,
142 /// with which we break backwards compatibility.
143 /// Version 11 teased apart subimage versus miplevel specification in
144 /// the APIs and per-channel formats (introduced in OIIO 0.9).
145 /// Version 12 added read_scanlines(), write_scanlines(), read_tiles(),
146 /// write_tiles(), and ImageInput::supports(). (OIIO 1.0)
147 /// Version 13 added ImageInput::valid_file(). (OIIO 1.1)
148 /// Version 14 added ImageOutput::open() variety for multiple subimages.
149 /// Version 15 added support for "deep" images (changing ImageSpec,
150 /// ImageInput, ImageOutput).
151 /// Version 16 changed the ImageInput functions taking channel ranges
152 /// from firstchan,nchans to chbegin,chend.
153 /// Version 17 changed to int supports(string_view) rather than
154 /// bool supports(const std::string&)). (OIIO 1.6)
155 /// Version 18 changed to add an m_threads member to ImageInput/Output.
156 /// Version 19 changed the definition of DeepData.
157 /// Version 20 added FMT_imageio_library_version() to plugins. (OIIO 1.7)
158 /// Version 21 changed the signatures of ImageInput methods: added
159 /// subimage,miplevel params to many read_*() methods; changed thread
160 /// safety expectations; removed newspec param from seek_subimage;
161 /// added spec(subimage,miplevel) and spec_dimensions(subimage,miplevel).
162 /// (OIIO 2.0)
163 /// Version 22 changed the signatures of ImageInput/ImageOutput create()
164 /// to return unique_ptr. (OIIO 2.0)
165 /// Version 23 added set_ioproxy() methods to ImageInput & ImageOutput
166 /// (OIIO 2.2).
167 /// Version 24 Added a PIMPL pointers to ImageInput and ImageOutput and
168 /// removed some unnecessary fields that were exposed.
169 /// Version 25 added the thumbnail retrieval and set. (OIIO 2.3)
170 
171 #define OIIO_PLUGIN_VERSION 25
172 
173 #define OIIO_PLUGIN_NAMESPACE_BEGIN OIIO_NAMESPACE_BEGIN
174 #define OIIO_PLUGIN_NAMESPACE_END OIIO_NAMESPACE_END
175 
176 #ifdef EMBED_PLUGINS
177 #define OIIO_PLUGIN_EXPORTS_BEGIN
178 #define OIIO_PLUGIN_EXPORTS_END
179 #else
180 #define OIIO_PLUGIN_EXPORTS_BEGIN extern "C" {
181 #define OIIO_PLUGIN_EXPORTS_END }
182 #endif
183 
184 // Which version of Imath is used in the OIIO API?
185 #define OIIO_USING_IMATH_VERSION_MAJOR 3
186 #define OIIO_USING_IMATH_VERSION_MINOR 1
187 
188 // Which CPP standard (11, 14, etc.) was this copy of OIIO *built* with?
189 #define OIIO_BUILD_CPP 17
190 
191 // DEPRECATED(2.1): old macros separately giving compatibility.
192 #define OIIO_BUILD_CPP11 (17 >= 11)
193 #define OIIO_BUILD_CPP14 (17 >= 14)
194 #define OIIO_BUILD_CPP17 (17 >= 17)
195 #define OIIO_BUILD_CPP20 (17 >= 20)
196 
197 
198 // Was the project built with TBB support?
199 #define OIIO_TBB 0
200 
201 
202 #endif /* defined(OPENIMAGEIO_VERSION_H) */