Flutter Engine
The Flutter Engine
third_party
skia
modules
skottie
src
text
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
11
#include "
include/core/SkRefCnt.h
"
12
#include "
modules/skottie/src/text/TextAnimator.h
"
13
14
#include <cstddef>
15
#include <cstdint>
16
#include <tuple>
17
namespace
skjson
{
18
class
ObjectValue;
19
}
20
21
namespace
skottie
{
22
namespace
internal {
23
class
AnimatablePropertyContainer;
24
class
AnimationBuilder;
25
26
class
RangeSelector
final :
public
SkNVRefCnt
<RangeSelector> {
27
public
:
28
static
sk_sp<RangeSelector>
Make
(
const
skjson::ObjectValue
*,
29
const
AnimationBuilder
*,
30
AnimatablePropertyContainer
*);
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,
56
kRampDown,
57
kTriangle,
58
kRound,
59
kSmooth,
60
};
61
62
void
modulateCoverage
(
const
TextAnimator::DomainMaps
&,
TextAnimator::ModulatorBuffer
&)
const
;
63
64
private
:
65
RangeSelector
(
Units
,
Domain
,
Mode
,
Shape
);
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
Mode
Mode
Definition:
ColorSpaceBench.cpp:18
GrGpuBufferType::kIndex
@ kIndex
GrPrimitiveType::kLines
@ kLines
SkRefCnt.h
TextAnimator.h
Shape
Shape
Definition:
aaxfermodes.cpp:43
SkNVRefCnt
Definition:
SkRefCnt.h:160
sk_sp
Definition:
SkRefCnt.h:220
skjson::ObjectValue
Definition:
SkJSON.h:337
skottie::internal::AnimatablePropertyContainer
Definition:
Animator.h:47
skottie::internal::AnimationBuilder
Definition:
SkottiePriv.h:66
skottie::internal::RangeSelector
Definition:
RangeSelector.h:26
skottie::internal::RangeSelector::Make
static sk_sp< RangeSelector > Make(const skjson::ObjectValue *, const AnimationBuilder *, AnimatablePropertyContainer *)
Definition:
RangeSelector.cpp:239
skottie::internal::RangeSelector::Domain
Domain
Definition:
RangeSelector.h:37
skottie::internal::RangeSelector::Shape
Shape
Definition:
RangeSelector.h:53
skottie::internal::RangeSelector::modulateCoverage
void modulateCoverage(const TextAnimator::DomainMaps &, TextAnimator::ModulatorBuffer &) const
Definition:
RangeSelector.cpp:355
skottie::internal::RangeSelector::Units
Units
Definition:
RangeSelector.h:32
skottie::internal::RangeSelector::Mode
Mode
Definition:
RangeSelector.h:44
skottie::internal::TextAnimator::ModulatorBuffer
std::vector< AnimatedPropsModulator > ModulatorBuffer
Definition:
TextAnimator.h:69
kAdd
@ kAdd
Definition:
embedder.h:990
skjson
Definition:
Animator.h:17
skottie
Definition:
ExternalLayer.h:16
skottie::internal::TextAnimator::DomainMaps
Definition:
TextAnimator.h:84
Generated on Sun Jun 23 2024 21:56:05 for Flutter Engine by
1.9.4