*/
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.
return false;
}
+bool SkColorFilter::asComponentTable(SkBitmap*) {
+ return false;
+}
+
void SkColorFilter::filterSpan16(const uint16_t s[], int count, uint16_t d[]) {
SkASSERT(this->getFlags() & SkColorFilter::kHasFilter16_Flag);
SkDEBUGFAIL("missing implementation of SkColorFilter::filterSpan16");