From 894aa9a7af0e5598600df694d184d3c7d2e454b0 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 23 Sep 2011 14:49:49 +0000 Subject: [PATCH] experimental git-svn-id: http://skia.googlecode.com/svn/trunk@2320 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkImageFilter.h | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 include/core/SkImageFilter.h diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h new file mode 100644 index 0000000000..945e69f7eb --- /dev/null +++ b/include/core/SkImageFilter.h @@ -0,0 +1,40 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkImageFilter_DEFINED +#define SkImageFilter_DEFINED + +#include "SkFlattenable.h" + +class SkImageFilter : public SkFlattenable { +public: + + /** + * Request a new (result) image to be created from the src image. + * If the src has no pixels (isNull()) then the request just wants to + * receive the config and width/height of the result. + * + * The matrix is the current matrix on the canvas. + * + * Offset is the amount to translate the resulting image relative to the + * src when it is drawn. + * + * If the result image cannot be created, return false, in which case both + * the result and offset parameters will be ignored by the caller. + */ + bool filterImage(const SkBitmap& src, const SkMatrix&, + SkBitmap* result, SkPoint* offset); + +protected: + virtual bool onFilterImage(const SkBitmap& src, const SkMatrix& + SkBitmap* result, SkPoint* offset) = 0; + +private: + typedef SkFlattenable INHERITED; +}; + +#endif