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 2008-present Contributors to the OpenImageIO project.
2 // SPDX-License-Identifier: BSD-3-Clause
3 // https://github.com/OpenImageIO/oiio
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 ("master") do not make any compatibility
43 // guarantees at all.
44 //
45 #define OIIO_VERSION_MAJOR 2
46 #define OIIO_VERSION_MINOR 3
47 #define OIIO_VERSION_PATCH 14
48 #define OIIO_VERSION_TWEAK 0
49 #define OIIO_VERSION_RELEASE_TYPE
50 
51 // Construct a single integer version number from major, minor, patch.
52 // Example of its use:
53 //
54 // #if OIIO_VERSION >= OIIO_MAKE_VERSION(2,3,0)
55 // ... use a feature introduced in version 2.3.0 ...
56 // #endif
57 //
58 #define OIIO_MAKE_VERSION(major,minor,patch) \
59  (10000 * (major) + 100 * (minor) + (patch))
60 
61 // Single version designation of this release
62 #define OIIO_VERSION OIIO_MAKE_VERSION(OIIO_VERSION_MAJOR, \
63  OIIO_VERSION_MINOR, OIIO_VERSION_PATCH)
64 
65 // Test if OIIO is >= a particular version.
66 #define OIIO_VERSION_GREATER_EQUAL(major,minor,patch) \
67  OIIO_VERSION >= OIIO_MAKE_VERSION(major,minor,patch)
68 
69 // Test if OIIO is < a particular version.
70 #define OIIO_VERSION_LESS(major,minor,patch) \
71  OIIO_VERSION < OIIO_MAKE_VERSION(major,minor,patch)
72 
73 // We also define the old name for backwards compatibility purposes.
74 #define OPENIMAGEIO_VERSION OIIO_VERSION
75 
76 // Magic macros to make OIIO_VERSION_STRING that looks like "1.2.3"
77 #define OIIO_MAKE_VERSION_STRING2(a,b,c,d) #a "." #b "." #c #d
78 #define OIIO_MAKE_VERSION_STRING(a,b,c,d) OIIO_MAKE_VERSION_STRING2(a,b,c,d)
79 #define OIIO_VERSION_STRING \
80  OIIO_MAKE_VERSION_STRING(OIIO_VERSION_MAJOR, \
81  OIIO_VERSION_MINOR, OIIO_VERSION_PATCH, \
82  OIIO_VERSION_RELEASE_TYPE)
83 #define OIIO_INTRO_STRING "OpenImageIO " OIIO_VERSION_STRING " http://www.openimageio.org"
84 
85 
86 // Establish the name spaces
87 namespace HOIIO_v2_3 { }
88 namespace OIIO = HOIIO_v2_3;
89 
90 // Macros to use in each file to enter and exit the right name spaces.
91 #define OIIO_NAMESPACE HOIIO_v2_3
92 #define OIIO_NAMESPACE_STRING "HOIIO_v2_3"
93 #define OIIO_NAMESPACE_BEGIN namespace HOIIO_v2_3 {
94 #define OIIO_NAMESPACE_END }
95 #define OIIO_NAMESPACE_USING using namespace OIIO;
96 
97 
98 /// Each imageio DSO/DLL should include this statement:
99 /// DLLPUBLIC int FORMAT_imageio_version = OPENIMAGEIO_PLUGIN_VERSION;
100 /// libOpenImageIO will check for compatibility this way.
101 /// This should get bumped any time we change the API in any way that
102 /// will make previously-compiled plugins break.
103 ///
104 /// History:
105 /// Version 3 added supports_rectangles() and write_rectangle() to
106 /// ImageOutput, and added stride parameters to the ImageInput read
107 /// routines.
108 /// Version 10 represents forking from NVIDIA's open source version,
109 /// with which we break backwards compatibility.
110 /// Version 11 teased apart subimage versus miplevel specification in
111 /// the APIs and per-channel formats (introduced in OIIO 0.9).
112 /// Version 12 added read_scanlines(), write_scanlines(), read_tiles(),
113 /// write_tiles(), and ImageInput::supports(). (OIIO 1.0)
114 /// Version 13 added ImageInput::valid_file(). (OIIO 1.1)
115 /// Version 14 added ImageOutput::open() variety for multiple subimages.
116 /// Version 15 added support for "deep" images (changing ImageSpec,
117 /// ImageInput, ImageOutput).
118 /// Version 16 changed the ImageInput functions taking channel ranges
119 /// from firstchan,nchans to chbegin,chend.
120 /// Version 17 changed to int supports(string_view) rather than
121 /// bool supports(const std::string&)). (OIIO 1.6)
122 /// Version 18 changed to add an m_threads member to ImageInput/Output.
123 /// Version 19 changed the definition of DeepData.
124 /// Version 20 added FMT_imageio_library_version() to plugins. (OIIO 1.7)
125 /// Version 21 changed the signatures of ImageInput methods: added
126 /// subimage,miplevel params to many read_*() methods; changed thread
127 /// safety expectations; removed newspec param from seek_subimage;
128 /// added spec(subimage,miplevel) and spec_dimensions(subimage,miplevel).
129 /// (OIIO 2.0)
130 /// Version 22 changed the signatures of ImageInput/ImageOutput create()
131 /// to return unique_ptr. (OIIO 2.0)
132 /// Version 23 added set_ioproxy() methods to ImageInput & ImageOutput
133 /// (OIIO 2.2).
134 /// Version 24 Added a PIMPL pointers to ImageInput and ImageOutput and
135 /// removed some unnecessary fields that were exposed.
136 /// Version 25 added the thumbnail retrieval and set. (OIIO 2.3)
137 
138 #define OIIO_PLUGIN_VERSION 25
139 
140 #define OIIO_PLUGIN_NAMESPACE_BEGIN OIIO_NAMESPACE_BEGIN
141 #define OIIO_PLUGIN_NAMESPACE_END OIIO_NAMESPACE_END
142 
143 #ifdef EMBED_PLUGINS
144 #define OIIO_PLUGIN_EXPORTS_BEGIN
145 #define OIIO_PLUGIN_EXPORTS_END
146 #else
147 #define OIIO_PLUGIN_EXPORTS_BEGIN extern "C" {
148 #define OIIO_PLUGIN_EXPORTS_END }
149 #endif
150 
151 // Which CPP standard (11, 14, etc.) was this copy of OIIO *built* with?
152 #define OIIO_BUILD_CPP 17
153 
154 // DEPRECATED(2.1): old macros separately giving compatibility.
155 #define OIIO_BUILD_CPP11 (17 >= 11)
156 #define OIIO_BUILD_CPP14 (17 >= 14)
157 #define OIIO_BUILD_CPP17 (17 >= 17)
158 #define OIIO_BUILD_CPP20 (17 >= 20)
159 
160 #endif
161