HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Imath.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 // clang-format off
6 
7 #pragma once
8 
10 
11 #include <OpenImageIO/half.h>
12 
13 #ifndef OIIO_IMATH_H_INCLUDED
14 #define OIIO_IMATH_H_INCLUDED 1
15 
16 // Determine which Imath we're dealing with and include the appropriate
17 // headers.
18 
19 #define OIIO_USING_IMATH 3
20 
21 #if OIIO_USING_IMATH >= 3
22 # include <Imath/ImathColor.h>
23 # include <Imath/ImathMatrix.h>
24 # include <Imath/ImathVec.h>
25 #else
26 # include <OpenEXR/ImathColor.h>
27 # include <OpenEXR/ImathMatrix.h>
28 # include <OpenEXR/ImathVec.h>
29 #endif
30 
31 
32 /// Custom fmtlib formatters for Imath types.
33 
35 template<> struct formatter<Imath::V2f>
36  : OIIO::pvt::array_formatter<Imath::V2f, float, 2> {};
37 template<> struct formatter<Imath::V3f>
38  : OIIO::pvt::array_formatter<Imath::V3f, float, 3> {};
39 template<> struct formatter<Imath::V4f>
40  : OIIO::pvt::array_formatter<Imath::V4f, float, 4> {};
41 #if OIIO_USING_IMATH >= 3
42 template<> struct formatter<Imath::M22f>
43  : OIIO::pvt::array_formatter<Imath::M22f, float, 4> {};
44 #endif
45 template<> struct formatter<Imath::M33f>
46  : OIIO::pvt::array_formatter<Imath::M33f, float, 9> {};
47 template<> struct formatter<Imath::M44f>
48  : OIIO::pvt::array_formatter<Imath::M44f, float, 16> {};
50 
51 #endif // !defined(OIIO_IMATH_H_INCLUDED)
Definition: ImathVec.h:32
#define FMT_END_NAMESPACE
Definition: core.h:179
Definition: ImathVec.h:31
#define FMT_BEGIN_NAMESPACE
Definition: core.h:176
Definition: ImathVec.h:33