| 1 | // Aseprite |
| 2 | // Copyright (C) 2021 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 APP_TOOLS_TRACE_POLICY_H_INCLUDED |
| 9 | #define APP_TOOLS_TRACE_POLICY_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | namespace app { |
| 13 | namespace tools { |
| 14 | |
| 15 | // The trace policy indicates how pixels are updated between the |
| 16 | // source image (ToolLoop::getSrcImage) and destionation image |
| 17 | // (ToolLoop::getDstImage) in the whole ToolLoopManager life-time. |
| 18 | // Basically it says if we should accumulate the intertwined |
| 19 | // drawed points, or kept the last ones, or overlap/composite |
| 20 | // them, etc. |
| 21 | enum class TracePolicy { |
| 22 | |
| 23 | // All pixels are accumulated in the destination image. Used by |
| 24 | // freehand like tools. |
| 25 | Accumulate, |
| 26 | |
| 27 | // Only the last trace is used. It means that on each ToolLoop |
| 28 | // step, the destination image is completely invalidated and |
| 29 | // restored from the source image. Used by |
| 30 | // line/rectangle/ellipse-like tools. |
| 31 | Last, |
| 32 | |
| 33 | // Like accumulate, but the destination is copied to the source |
| 34 | // on each ToolLoop step, so the tool overlaps its own effect. |
| 35 | // Used by jumble and spray. |
| 36 | Overlap, |
| 37 | |
| 38 | }; |
| 39 | |
| 40 | } // namespace tools |
| 41 | } // namespace app |
| 42 | |
| 43 | #endif |
| 44 | |