OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2014 The Android Open Source Project | |
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 SkTransformImageFilter_DEFINED | |
9 #define SkTransformImageFilter_DEFINED | |
10 | |
11 #include "SkImageFilter.h" | |
12 #include "SkScalar.h" | |
13 #include "SkSize.h" | |
14 #include "SkPoint.h" | |
15 #include "SkPaint.h" | |
16 | |
17 /*! \class SkTransformImageFilter | |
18 Matrix transformation image filter. This filter draws its source | |
19 input transformed by the given matrix. | |
20 */ | |
21 | |
22 class SK_API SkTransformImageFilter : public SkImageFilter { | |
reed1
2014/03/25 16:04:04
bikeshed: SkMatrixImageFilter -- since it takes a
| |
23 public: | |
24 /** Construct a 2D transformation image filter. | |
25 * @param transform The matrix to apply when drawing the src bitmap | |
26 * @param filterLevel The quality of filtering to apply when scaling. | |
27 * @param input The input image filter. If NULL, the src bitmap | |
28 * passed to filterImage() is used instead. | |
29 */ | |
30 | |
31 static SkTransformImageFilter* Create(const SkMatrix& transform, | |
32 SkPaint::FilterLevel, | |
33 SkImageFilter* input = NULL); | |
34 virtual ~SkTransformImageFilter(); | |
35 | |
36 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; | |
37 | |
38 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransformImageFilter) | |
39 | |
40 protected: | |
41 SkTransformImageFilter(const SkMatrix& transform, | |
42 SkPaint::FilterLevel, | |
43 SkImageFilter* input = NULL); | |
44 SkTransformImageFilter(SkReadBuffer& buffer); | |
45 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | |
46 | |
47 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | |
48 SkBitmap* result, SkIPoint* loc) const SK_OVERRID E; | |
49 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, | |
50 SkIRect* dst) const SK_OVERRIDE; | |
51 | |
52 private: | |
53 SkMatrix fTransform; | |
54 SkPaint::FilterLevel fFilterLevel; | |
55 typedef SkImageFilter INHERITED; | |
56 }; | |
57 | |
58 #endif | |
OLD | NEW |