aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkColorFilter.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-05 17:24:35 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-05 17:24:35 +0000
commit7191840eec5ac3b5f5814e4df3cf18264b0b0a4d (patch)
tree29f809b6c279f1c19712c8ed71c0495001d7223c /include/core/SkColorFilter.h
parentd53f7c28bf8aecd5b7f0ee2189ac97e309a1b06d (diff)
add asComponentTable() query (will impl in SkTableColorFilter next)
git-svn-id: http://skia.googlecode.com/svn/trunk@2971 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkColorFilter.h')
-rw-r--r--include/core/SkColorFilter.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index 6328e706cb..97db5cc546 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -30,6 +30,24 @@ public:
*/
virtual bool asColorMatrix(SkScalar matrix[20]);
+ /**
+ * If the filter can be represented by per-component table, return true,
+ * and if table is not null, copy the bitmap containing the table into it.
+ *
+ * The table bitmap will be in SkBitmap::kA8_Config. Each row corresponding
+ * to each component in ARGB order. e.g. row[0] == alpha, row[1] == red,
+ * etc. To transform a color, you (logically) perform the following:
+ *
+ * a' = *table.getAddr8(a, 0);
+ * r' = *table.getAddr8(r, 1);
+ * g' = *table.getAddr8(g, 2);
+ * b' = *table.getAddr8(b, 3);
+ *
+ * The original component value is the horizontal index for a given row,
+ * and the stored value at that index is the new value for that component.
+ */
+ virtual bool asComponentTable(SkBitmap* table);
+
/** Called with a scanline of colors, as if there was a shader installed.
The implementation writes out its filtered version into result[].
Note: shader and result may be the same buffer.