1// Aseprite
2// Copyright (C) 2021 Igara Studio S.A.
3// Copyright (C) 2015 David Capello
4//
5// This program is distributed under the terms of
6// the End-User License Agreement for Aseprite.
7
8#ifndef APP_TOOLS_SYMMETRY_H_INCLUDED
9#define APP_TOOLS_SYMMETRY_H_INCLUDED
10#pragma once
11
12#include "app/tools/stroke.h"
13#include "app/pref/preferences.h"
14
15namespace app {
16namespace tools {
17
18class ToolLoop;
19
20class Symmetry {
21public:
22 Symmetry(gen::SymmetryMode symmetryMode, double x, double y)
23 : m_symmetryMode(symmetryMode)
24 , m_x(x)
25 , m_y(y) {
26 }
27
28 void generateStrokes(const Stroke& stroke, Strokes& strokes, ToolLoop* loop);
29
30 gen::SymmetryMode mode() const { return m_symmetryMode; }
31
32private:
33 void calculateSymmetricalStroke(const Stroke& refStroke, Stroke& stroke,
34 ToolLoop* loop, gen::SymmetryMode symmetryMode);
35
36 gen::SymmetryMode m_symmetryMode;
37 double m_x, m_y;
38};
39
40} // namespace tools
41} // namespace app
42
43#endif
44