Flutter Engine
The Flutter Engine
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
13#include "impeller/scene/importer/scene_flatbuffers.h"
14
15namespace impeller {
16namespace scene {
17namespace importer {
18
19Matrix ToMatrix(const std::vector<double>& m);
20
21//-----------------------------------------------------------------------------
22/// Flatbuffers -> Impeller
23///
24
26
27Vector2 ToVector2(const fb::Vec2& c);
28
29Vector3 ToVector3(const fb::Vec3& c);
30
31Vector4 ToVector4(const fb::Vec4& c);
32
33Color ToColor(const fb::Color& c);
34
35//-----------------------------------------------------------------------------
36/// Impeller -> Flatbuffers
37///
38
40
41std::unique_ptr<fb::Matrix> ToFBMatrixUniquePtr(const Matrix& m);
42
43fb::Vec2 ToFBVec2(const Vector2 v);
44
45fb::Vec3 ToFBVec3(const Vector3 v);
46
47fb::Vec4 ToFBVec4(const Vector4 v);
48
50
51std::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_
skvx::Vec< 4, float > Vec4
SK_API sk_sp< SkShader > Color(SkColor)
fb::Vec3 ToFBVec3(const Vector3 v)
Definition: conversions.cc:74
fb::Vec4 ToFBVec4(const Vector4 v)
Definition: conversions.cc:78
std::unique_ptr< fb::Matrix > ToFBMatrixUniquePtr(const Matrix &m)
Definition: conversions.cc:62
fb::Vec2 ToFBVec2(const Vector2 v)
Definition: conversions.cc:70
fb::Color ToFBColor(const Color c)
Definition: conversions.cc:82
Matrix ToMatrix(const std::vector< double > &m)
Definition: conversions.cc:15
Color ToColor(const fb::Color &c)
Definition: conversions.cc:46
Vector3 ToVector3(const fb::Vec3 &v)
Definition: conversions.cc:38
fb::Matrix ToFBMatrix(const Matrix &m)
Definition: conversions.cc:54
Vector4 ToVector4(const fb::Vec4 &v)
Definition: conversions.cc:42
Vector2 ToVector2(const fb::Vec2 &v)
Definition: conversions.cc:34
Point Vector2
Definition: point.h:326
SK_API sk_sp< PrecompileColorFilter > Matrix()