| 1 | // Aseprite |
| 2 | // Copyright (C) 2001-2016 David Capello |
| 3 | // |
| 4 | // This program is distributed under the terms of |
| 5 | // the End-User License Agreement for Aseprite. |
| 6 | |
| 7 | #ifndef FILTERS_MEDIAN_FILTER_PROCESS_H_INCLUDED |
| 8 | #define FILTERS_MEDIAN_FILTER_PROCESS_H_INCLUDED |
| 9 | #pragma once |
| 10 | |
| 11 | #include "base/ints.h" |
| 12 | #include "filters/filter.h" |
| 13 | #include "filters/tiled_mode.h" |
| 14 | |
| 15 | #include <vector> |
| 16 | |
| 17 | namespace filters { |
| 18 | |
| 19 | class MedianFilter : public Filter { |
| 20 | public: |
| 21 | MedianFilter(); |
| 22 | |
| 23 | void setTiledMode(TiledMode tiled); |
| 24 | void setSize(int width, int height); |
| 25 | |
| 26 | TiledMode getTiledMode() const { return m_tiledMode; } |
| 27 | int getWidth() const { return m_width; } |
| 28 | int getHeight() const { return m_height; } |
| 29 | |
| 30 | // Filter implementation |
| 31 | const char* getName(); |
| 32 | void applyToRgba(FilterManager* filterMgr); |
| 33 | void applyToGrayscale(FilterManager* filterMgr); |
| 34 | void applyToIndexed(FilterManager* filterMgr); |
| 35 | |
| 36 | private: |
| 37 | TiledMode m_tiledMode; |
| 38 | int m_width; |
| 39 | int m_height; |
| 40 | int m_ncolors; |
| 41 | std::vector<std::vector<uint8_t> > m_channel; |
| 42 | }; |
| 43 | |
| 44 | } // namespace filters |
| 45 | |
| 46 | #endif |
| 47 | |