]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/include/boost/compute/interop/vtk/matrix4x4.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / compute / include / boost / compute / interop / vtk / matrix4x4.hpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10
11 #ifndef BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
12 #define BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP
13
14 #include <vtkMatrix4x4.h>
15
16 #include <boost/compute/types/fundamental.hpp>
17
18 namespace boost {
19 namespace compute {
20
21 /// Converts a \c vtkMatrix4x4 to a \c float16_.
22 inline float16_ vtk_matrix4x4_to_float16(const vtkMatrix4x4 *matrix)
23 {
24 float16_ result;
25
26 for(int i = 0; i < 4; i++){
27 for(int j = 0; j < 4; j++){
28 result[i*4+j] = matrix->GetElement(i, j);
29 }
30 }
31
32 return result;
33 }
34
35 /// Converts a \c vtkMatrix4x4 to a \c double16_;
36 inline double16_ vtk_matrix4x4_to_double16(const vtkMatrix4x4 *matrix)
37 {
38 double16_ result;
39 std::memcpy(&result, matrix->Element, 16 * sizeof(double));
40 return result;
41 }
42
43 } // end compute namespace
44 } // end boost namespace
45
46 #endif // BOOST_COMPUTE_INTEROP_VTK_MATRIX4X4_HPP