| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkMatrixConvolutionImageFilter_DEFINED | 8 #ifndef SkMatrixConvolutionImageFilter_DEFINED |
| 9 #define SkMatrixConvolutionImageFilter_DEFINED | 9 #define SkMatrixConvolutionImageFilter_DEFINED |
| 10 | 10 |
| 11 #include "SkImageFilter.h" | 11 #include "SkImageFilter.h" |
| 12 #include "SkScalar.h" | 12 #include "SkScalar.h" |
| 13 #include "SkSize.h" | 13 #include "SkSize.h" |
| 14 #include "SkPoint.h" | 14 #include "SkPoint.h" |
| 15 | 15 |
| 16 /*! \class SkMatrixConvolutionImageFilter | 16 /*! \class SkMatrixConvolutionImageFilter |
| 17 Matrix convolution image filter. This filter applies an NxM image | 17 Matrix convolution image filter. This filter applies an NxM image |
| 18 processing kernel to a given input image. This can be used to produce | 18 processing kernel to a given input image. This can be used to produce |
| 19 effects such as sharpening, blurring, edge detection, etc. | 19 effects such as sharpening, blurring, edge detection, etc. |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 class SK_API SkMatrixConvolutionImageFilter : public SkImageFilter { | 22 class SK_API SkMatrixConvolutionImageFilter : public SkImageFilter { |
| 23 public: | 23 public: |
| 24 /*! \enum TileMode */ | 24 /*! \enum TileMode */ |
| 25 enum TileMode { | 25 enum TileMode { |
| 26 kClamp_TileMode, /*!< Clamp to the image's edge pixels. */ | 26 kClamp_TileMode = 0, /*!< Clamp to the image's edge pixels. */ |
| 27 kRepeat_TileMode, /*!< Wrap around to the image's opposite edge. */ | 27 kRepeat_TileMode, /*!< Wrap around to the image's opposite edge. */ |
| 28 kClampToBlack_TileMode, /*!< Fill with transparent black. */ | 28 kClampToBlack_TileMode, /*!< Fill with transparent black. */ |
| 29 kMax_TileMode = kClampToBlack_TileMode |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 virtual ~SkMatrixConvolutionImageFilter(); | 32 virtual ~SkMatrixConvolutionImageFilter(); |
| 32 | 33 |
| 33 /** Construct a matrix convolution image filter. | 34 /** Construct a matrix convolution image filter. |
| 34 @param kernelSize The kernel size in pixels, in each dimension (N by
M). | 35 @param kernelSize The kernel size in pixels, in each dimension (N by
M). |
| 35 @param kernel The image processing kernel. Must contain N * M | 36 @param kernel The image processing kernel. Must contain N * M |
| 36 elements, in row order. | 37 elements, in row order. |
| 37 @param gain A scale factor applied to each pixel after | 38 @param gain A scale factor applied to each pixel after |
| 38 convolution. This can be used to normalize the | 39 convolution. This can be used to normalize the |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 SkBitmap* result, | 117 SkBitmap* result, |
| 117 const SkIRect& rect, | 118 const SkIRect& rect, |
| 118 const SkIRect& bounds) const; | 119 const SkIRect& bounds) const; |
| 119 void filterBorderPixels(const SkBitmap& src, | 120 void filterBorderPixels(const SkBitmap& src, |
| 120 SkBitmap* result, | 121 SkBitmap* result, |
| 121 const SkIRect& rect, | 122 const SkIRect& rect, |
| 122 const SkIRect& bounds) const; | 123 const SkIRect& bounds) const; |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 #endif | 126 #endif |
| OLD | NEW |