42class ShiftChannelsEffectAdapter final :
public AnimatablePropertyContainer {
46 const AnimationBuilder* abuilder) {
48 new ShiftChannelsEffectAdapter(jprops, std::move(layer), abuilder));
56 const AnimationBuilder* abuilder)
57 : fColorFilter(
sksg::ExternalColorFilter::
Make(
std::move(layer))) {
59 kTakeAlphaFrom_Index = 0,
60 kTakeRedFrom_Index = 1,
61 kTakeGreenFrom_Index = 2,
62 kTakeBlueFrom_Index = 3,
65 EffectBinder(jprops, *abuilder,
this)
66 .bind( kTakeRedFrom_Index, fR)
67 .bind(kTakeGreenFrom_Index, fG)
68 .bind( kTakeBlueFrom_Index, fB)
69 .bind(kTakeAlphaFrom_Index, fA);
72 enum class Source : uint8_t {
87 void onSync()
override {
90 static constexpr float gSourceCoeffs[][5] = {
102 static_assert(std::size(gSourceCoeffs) ==
static_cast<size_t>(Source::kMax),
"");
107 src =
SkTPin(src, 1.0f,
static_cast<float>(Source::kMax));
108 return gSourceCoeffs[
static_cast<size_t>(
src) - 1];
113 const float* bc =
coeffs(fB);
114 const float* ac =
coeffs(fA);
119 bc[0], bc[1], bc[2], bc[3], bc[4],
120 ac[0], ac[1], ac[2], ac[3], ac[4],
129 fG =
static_cast<float>(Source::kGreen),
130 fB =
static_cast<float>(Source::kBlue),
131 fA =
static_cast<float>(Source::kAlpha);
static const uint64_t kGreen
static const uint64_t kAlpha
static const uint64_t kBlue
static const uint64_t kRed
@ kSaturation
saturation of source with hue and luminosity of destination
@ kHue
hue of source with saturation and luminosity of destination
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
void attachDiscardableAdapter(sk_sp< T > adapter) const
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial gc