1// Aseprite
2// Copyright (C) 2019 Igara Studio S.A.
3//
4// This program is distributed under the terms of
5// the End-User License Agreement for Aseprite.
6
7#ifndef FILTERS_OUTLINE_FILTER_H_INCLUDED
8#define FILTERS_OUTLINE_FILTER_H_INCLUDED
9#pragma once
10
11#include "doc/color.h"
12#include "filters/filter.h"
13#include "filters/tiled_mode.h"
14
15namespace filters {
16
17 class OutlineFilter : public Filter {
18 public:
19 enum class Place { Outside, Inside };
20 enum class Matrix : int {
21 None = 0,
22 Circle = 0252,
23 Square = 0757,
24 Horizontal = 0050,
25 Vertical = 0202
26 };
27
28 OutlineFilter();
29
30 void place(const Place place) { m_place = place; }
31 void matrix(const Matrix matrix) { m_matrix = matrix; }
32 void tiledMode(const TiledMode tiledMode) { m_tiledMode = tiledMode; }
33 void color(const doc::color_t color) { m_color = color; }
34 void bgColor(const doc::color_t color) { m_bgColor = color; }
35
36 Place place() const { return m_place; }
37 Matrix matrix() const { return m_matrix; }
38 TiledMode tiledMode() const { return m_tiledMode; }
39 doc::color_t color() const { return m_color; }
40 doc::color_t bgColor() const { return m_bgColor; }
41
42 // Filter implementation
43 const char* getName();
44 void applyToRgba(FilterManager* filterMgr);
45 void applyToGrayscale(FilterManager* filterMgr);
46 void applyToIndexed(FilterManager* filterMgr);
47
48 private:
49 Place m_place;
50 Matrix m_matrix;
51 TiledMode m_tiledMode;
52 doc::color_t m_color;
53 doc::color_t m_bgColor;
54 };
55
56} // namespace filters
57
58#endif
59