| Flutter Impeller |

conversions.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_SCENE_IMPORTER_CONVERSIONS_H_
6 #define FLUTTER_IMPELLER_SCENE_IMPORTER_CONVERSIONS_H_
7
8 #include <cstddef>
9 #include <map>
10 #include <vector>
11
12 #include "impeller/geometry/matrix.h"
13 #include "impeller/scene/importer/scene_flatbuffers.h"
14
15 namespace impeller {
16 namespace scene {
17 namespace importer {
18
19 Matrix ToMatrix(const std::vector<double>& m);
20
21 //-----------------------------------------------------------------------------
22 /// Flatbuffers -> Impeller
23 ///
24
25 Matrix ToMatrix(const fb::Matrix& m);
26
27 Vector2 ToVector2(const fb::Vec2& c);
28
29 Vector3 ToVector3(const fb::Vec3& c);
30
31 Vector4 ToVector4(const fb::Vec4& c);
32
33 Color ToColor(const fb::Color& c);
34
35 //-----------------------------------------------------------------------------
36 /// Impeller -> Flatbuffers
37 ///
38
39 fb::Matrix ToFBMatrix(const Matrix& m);
40
41 std::unique_ptr<fb::Matrix> ToFBMatrixUniquePtr(const Matrix& m);
42
43 fb::Vec2 ToFBVec2(const Vector2 v);
44
45 fb::Vec3 ToFBVec3(const Vector3 v);
46
47 fb::Vec4 ToFBVec4(const Vector4 v);
48
49 fb::Color ToFBColor(const Color c);
50
51 std::unique_ptr<fb::Color> ToFBColor(const std::vector<double>& c);
52
53 } // namespace importer
54 } // namespace scene
55 } // namespace impeller
56
57 #endif // FLUTTER_IMPELLER_SCENE_IMPORTER_CONVERSIONS_H_
impeller::Vector2
Point Vector2
Definition: point.h:312
impeller::scene::importer::ToVector4
Vector4 ToVector4(const fb::Vec4 &v)
Definition: conversions.cc:42
impeller::scene::importer::ToFBVec2
fb::Vec2 ToFBVec2(const Vector2 v)
Definition: conversions.cc:70
matrix.h
impeller::scene::importer::ToFBMatrix
fb::Matrix ToFBMatrix(const Matrix &m)
Definition: conversions.cc:54
impeller::scene::importer::ToColor
Color ToColor(const fb::Color &c)
Definition: conversions.cc:46
impeller::scene::importer::ToFBVec3
fb::Vec3 ToFBVec3(const Vector3 v)
Definition: conversions.cc:74
impeller::scene::importer::ToVector3
Vector3 ToVector3(const fb::Vec3 &v)
Definition: conversions.cc:38
impeller::scene::importer::ToVector2
Vector2 ToVector2(const fb::Vec2 &v)
Definition: conversions.cc:34
impeller::scene::importer::ToFBColor
fb::Color ToFBColor(const Color c)
Definition: conversions.cc:82
impeller::scene::importer::ToFBMatrixUniquePtr
std::unique_ptr< fb::Matrix > ToFBMatrixUniquePtr(const Matrix &m)
Definition: conversions.cc:62
impeller
Definition: aiks_context.cc:10
impeller::scene::importer::ToMatrix
Matrix ToMatrix(const std::vector< double > &m)
Definition: conversions.cc:15
impeller::scene::importer::ToFBVec4
fb::Vec4 ToFBVec4(const Vector4 v)
Definition: conversions.cc:78