2 * Copyright 2015 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkTableColorFilter_DEFINED
9 #define SkTableColorFilter_DEFINED
11 #include "include/core/SkColorFilter.h"
13 class SK_API SkTableColorFilter {
16 * Create a table colorfilter, copying the table into the filter, and
17 * applying it to all 4 components.
22 * Compoents are operated on in unpremultiplied space. If the incomming
23 * colors are premultiplied, they are temporarily unpremultiplied, then
24 * the table is applied, and then the result is remultiplied.
26 static sk_sp<SkColorFilter> Make(const uint8_t table[256]);
29 * Create a table colorfilter, with a different table for each
30 * component [A, R, G, B]. If a given table is NULL, then it is
31 * treated as identity, with the component left unchanged. If a table
32 * is not null, then its contents are copied into the filter.
34 static sk_sp<SkColorFilter> MakeARGB(const uint8_t tableA[256],
35 const uint8_t tableR[256],
36 const uint8_t tableG[256],
37 const uint8_t tableB[256]);
39 static void RegisterFlattenables();