1 | // Aseprite |
2 | // Copyright (C) 2019 Igara Studio S.A. |
3 | // Copyright (C) 2001-2016 David Capello |
4 | // |
5 | // This program is distributed under the terms of |
6 | // the End-User License Agreement for Aseprite. |
7 | |
8 | #ifndef FILTERS_CONVOLUTION_MATRIX_FILTER_H_INCLUDED |
9 | #define FILTERS_CONVOLUTION_MATRIX_FILTER_H_INCLUDED |
10 | #pragma once |
11 | |
12 | #include "filters/filter.h" |
13 | #include "filters/tiled_mode.h" |
14 | |
15 | #include <memory> |
16 | |
17 | namespace filters { |
18 | |
19 | class ConvolutionMatrix; |
20 | |
21 | class ConvolutionMatrixFilter : public Filter { |
22 | public: |
23 | ConvolutionMatrixFilter(); |
24 | |
25 | void setMatrix(const std::shared_ptr<ConvolutionMatrix>& matrix); |
26 | void setTiledMode(TiledMode tiledMode); |
27 | |
28 | std::shared_ptr<ConvolutionMatrix> getMatrix() { return m_matrix; } |
29 | TiledMode getTiledMode() const { return m_tiledMode; } |
30 | |
31 | // Filter implementation |
32 | const char* getName(); |
33 | void applyToRgba(FilterManager* filterMgr); |
34 | void applyToGrayscale(FilterManager* filterMgr); |
35 | void applyToIndexed(FilterManager* filterMgr); |
36 | |
37 | private: |
38 | std::shared_ptr<ConvolutionMatrix> m_matrix; |
39 | TiledMode m_tiledMode; |
40 | }; |
41 | |
42 | } // namespace filters |
43 | |
44 | #endif |
45 | |