1 // Aseprite
2 // Copyright (C) 2001-2018  David Capello
3 //
4 // This program is distributed under the terms of
5 // the End-User License Agreement for Aseprite.
6 
7 #ifndef APP_EXTRA_CEL_H_INCLUDED
8 #define APP_EXTRA_CEL_H_INCLUDED
9 #pragma once
10 
11 #include "base/disable_copying.h"
12 #include "base/unique_ptr.h"
13 #include "doc/blend_mode.h"
14 #include "doc/cel.h"
15 #include "doc/frame.h"
16 #include "doc/image_buffer.h"
17 #include "doc/image_ref.h"
18 #include "gfx/rect.h"
19 #include "render/extra_type.h"
20 
21 namespace doc {
22   class Sprite;
23 }
24 
25 namespace app {
26 
27   class ExtraCel {
28   public:
29     ExtraCel();
30 
31     void create(doc::Sprite* sprite, const gfx::Rect& bounds, doc::frame_t frame, int opacity);
32 
type()33     render::ExtraType type() const { return m_type; }
setType(render::ExtraType type)34     void setType(render::ExtraType type) { m_type = type; }
35 
cel()36     doc::Cel* cel() const { return m_cel.get(); }
image()37     doc::Image* image() const { return m_image.get(); }
38 
blendMode()39     doc::BlendMode blendMode() const { return m_blendMode; }
setBlendMode(doc::BlendMode mode)40     void setBlendMode(doc::BlendMode mode) { m_blendMode = mode; }
41 
42   private:
43     render::ExtraType m_type;
44     base::UniquePtr<doc::Cel> m_cel;
45     doc::ImageRef m_image;
46     doc::ImageBufferPtr m_imageBuffer;
47     doc::BlendMode m_blendMode;
48 
49     DISABLE_COPYING(ExtraCel);
50   };
51 
52   typedef base::SharedPtr<ExtraCel> ExtraCelRef;
53 
54 } // namespace app
55 
56 #endif
57