Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
RangeSelector.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 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 SkottieRangeSelector_DEFINED
9#define SkottieRangeSelector_DEFINED
10
13
14#include <cstddef>
15#include <cstdint>
16#include <tuple>
17namespace skjson {
18class ObjectValue;
19}
20
21namespace skottie {
22namespace internal {
23class AnimatablePropertyContainer;
24class AnimationBuilder;
25
26class RangeSelector final : public SkNVRefCnt<RangeSelector> {
27public:
29 const AnimationBuilder*,
31
32 enum class Units : uint8_t {
33 kPercentage, // values are percentages of domain size
34 kIndex, // values are direct domain indices
35 };
36
37 enum class Domain : uint8_t {
38 kChars, // domain indices map to glyph indices
39 kCharsExcludingSpaces, // domain indices map to glyph indices (ignoring spaces)
40 kWords, // domain indices map to word indices
41 kLines, // domain indices map to line indices
42 };
43
44 enum class Mode : uint8_t {
45 kAdd,
46 // kSubtract,
47 // kIntersect,
48 // kMin,
49 // kMax,
50 // kDifference,
51 };
52
53 enum class Shape : uint8_t {
54 kSquare,
55 kRampUp,
58 kRound,
59 kSmooth,
60 };
61
63
64private:
66
67 // Resolves this selector to a range in the coverage buffer index domain.
68 std::tuple<float, float> resolve(size_t domain_size) const;
69
70 const Units fUnits;
71 const Domain fDomain;
72 const Mode fMode;
73 const Shape fShape;
74
75 float fStart,
76 fEnd,
77 fOffset,
78 fAmount = 100,
79 fEaseLo = 0,
80 fEaseHi = 0,
81 fSmoothness = 100;
82};
83
84} // namespace internal
85} // namespace skottie
86
87#endif // SkottieRangeSelector_DEFINED
Shape
static sk_sp< RangeSelector > Make(const skjson::ObjectValue *, const AnimationBuilder *, AnimatablePropertyContainer *)
void modulateCoverage(const TextAnimator::DomainMaps &, TextAnimator::ModulatorBuffer &) const
std::vector< AnimatedPropsModulator > ModulatorBuffer