Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkLumaColorFilter.h
Go to the documentation of this file.
1/*
2 * Copyright 2013 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 SkLumaColorFilter_DEFINED
9#define SkLumaColorFilter_DEFINED
10
13
14class SkColorFilter;
15
16/**
17 * SkLumaColorFilter multiplies the luma of its input into the alpha channel,
18 * and sets the red, green, and blue channels to zero.
19 *
20 * SkLumaColorFilter(r,g,b,a) = {0,0,0, a * luma(r,g,b)}
21 *
22 * This is similar to a luminanceToAlpha feColorMatrix,
23 * but note how this filter folds in the previous alpha,
24 * something an feColorMatrix cannot do.
25 *
26 * feColorMatrix(luminanceToAlpha; r,g,b,a) = {0,0,0, luma(r,g,b)}
27 *
28 * (Despite its name, an feColorMatrix using luminanceToAlpha does
29 * actually compute luma, a dot-product of gamma-encoded color channels,
30 * not luminance, a dot-product of linear color channels. So at least
31 * SkLumaColorFilter and feColorMatrix+luminanceToAlpha agree there.)
32 */
36
37#endif
#define SK_API
Definition SkAPI.h:35
static std::unique_ptr< SkEncoder > Make(SkWStream *dst, const SkPixmap *src, const SkYUVAPixmaps *srcYUVA, const SkColorSpace *srcYUVAColorSpace, const SkJpegEncoder::Options &options)