| 1 | /* | 
|---|
| 2 | * Copyright 2017 Google Inc. | 
|---|
| 3 | * | 
|---|
| 4 | * Use of this source code is governed by a BSD-style license that can be | 
|---|
| 5 | * found in the LICENSE file. | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef SkottieValue_DEFINED | 
|---|
| 9 | #define SkottieValue_DEFINED | 
|---|
| 10 |  | 
|---|
| 11 | #include "include/core/SkColor.h" | 
|---|
| 12 | #include "include/core/SkM44.h" | 
|---|
| 13 | #include "include/core/SkPath.h" | 
|---|
| 14 |  | 
|---|
| 15 | #include <initializer_list> | 
|---|
| 16 | #include <vector> | 
|---|
| 17 |  | 
|---|
| 18 | namespace skjson { class Value; } | 
|---|
| 19 |  | 
|---|
| 20 | namespace skottie { | 
|---|
| 21 |  | 
|---|
| 22 | using ScalarValue = SkScalar; | 
|---|
| 23 | using   Vec2Value = SkV2; | 
|---|
| 24 |  | 
|---|
| 25 | class VectorValue final : public std::vector<float> { | 
|---|
| 26 | public: | 
|---|
| 27 | VectorValue() = default; | 
|---|
| 28 |  | 
|---|
| 29 | VectorValue(std::initializer_list<float> l) : INHERITED(l) {} | 
|---|
| 30 |  | 
|---|
| 31 | operator SkV3()      const; | 
|---|
| 32 | operator SkColor()   const; | 
|---|
| 33 | operator SkColor4f() const; | 
|---|
| 34 |  | 
|---|
| 35 | private: | 
|---|
| 36 | using INHERITED = std::vector<float>; | 
|---|
| 37 | }; | 
|---|
| 38 |  | 
|---|
| 39 | class ShapeValue final : public std::vector<float> { | 
|---|
| 40 | public: | 
|---|
| 41 | operator SkPath() const; | 
|---|
| 42 | }; | 
|---|
| 43 |  | 
|---|
| 44 | } // namespace skottie | 
|---|
| 45 |  | 
|---|
| 46 | #endif // SkottieValue_DEFINED | 
|---|
| 47 |  | 
|---|