| 1 | // Aseprite Render Library |
|---|---|
| 2 | // Copyright (C) 2019 Igara Studio S.A. |
| 3 | // Copyright (C) 2018 David Capello |
| 4 | // |
| 5 | // This file is released under the terms of the MIT license. |
| 6 | // Read LICENSE.txt for more information. |
| 7 | |
| 8 | #ifndef RENDER_ONIONSKIN_OPTIONS_H_INCLUDED |
| 9 | #define RENDER_ONIONSKIN_OPTIONS_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | #include "render/onionskin_position.h" |
| 13 | #include "render/onionskin_type.h" |
| 14 | |
| 15 | namespace doc { |
| 16 | class Layer; |
| 17 | class Tag; |
| 18 | } |
| 19 | |
| 20 | namespace render { |
| 21 | |
| 22 | class OnionskinOptions { |
| 23 | public: |
| 24 | OnionskinOptions(OnionskinType type) |
| 25 | : m_type(type) |
| 26 | , m_position(OnionskinPosition::BEHIND) |
| 27 | , m_prevFrames(0) |
| 28 | , m_nextFrames(0) |
| 29 | , m_opacityBase(0) |
| 30 | , m_opacityStep(0) |
| 31 | , m_loopTag(nullptr) |
| 32 | , m_layer(nullptr) { |
| 33 | } |
| 34 | |
| 35 | OnionskinType type() const { return m_type; } |
| 36 | OnionskinPosition position() const { return m_position; } |
| 37 | int prevFrames() const { return m_prevFrames; } |
| 38 | int nextFrames() const { return m_nextFrames; } |
| 39 | int opacityBase() const { return m_opacityBase; } |
| 40 | int opacityStep() const { return m_opacityStep; } |
| 41 | doc::Tag* loopTag() const { return m_loopTag; } |
| 42 | doc::Layer* layer() const { return m_layer; } |
| 43 | |
| 44 | void type(OnionskinType type) { m_type = type; } |
| 45 | void position(OnionskinPosition position) { m_position = position; } |
| 46 | void prevFrames(int prevFrames) { m_prevFrames = prevFrames; } |
| 47 | void nextFrames(int nextFrames) { m_nextFrames = nextFrames; } |
| 48 | void opacityBase(int base) { m_opacityBase = base; } |
| 49 | void opacityStep(int step) { m_opacityStep = step; } |
| 50 | void loopTag(doc::Tag* loopTag) { m_loopTag = loopTag; } |
| 51 | void layer(doc::Layer* layer) { m_layer = layer; } |
| 52 | |
| 53 | private: |
| 54 | OnionskinType m_type; |
| 55 | OnionskinPosition m_position; |
| 56 | int m_prevFrames; |
| 57 | int m_nextFrames; |
| 58 | int m_opacityBase; |
| 59 | int m_opacityStep; |
| 60 | doc::Tag* m_loopTag; |
| 61 | doc::Layer* m_layer; |
| 62 | }; |
| 63 | |
| 64 | } // namespace render |
| 65 | |
| 66 | #endif |
| 67 |