forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclear_mask.h
52 lines (42 loc) · 1.05 KB
/
clear_mask.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Aseprite
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_CMD_CLEAR_MASK_H_INCLUDED
#define APP_CMD_CLEAR_MASK_H_INCLUDED
#pragma once
#include "app/cmd.h"
#include "app/cmd/with_cel.h"
#include "app/cmd/with_image.h"
#include "app/cmd_sequence.h"
#include "doc/image_ref.h"
#include <memory>
namespace app {
namespace cmd {
using namespace doc;
class ClearMask : public Cmd
, public WithCel {
public:
ClearMask(Cel* cel);
protected:
void onExecute() override;
void onUndo() override;
void onRedo() override;
size_t onMemSize() const override {
return sizeof(*this) + m_seq.memSize() +
(m_copy ? m_copy->getMemSize(): 0);
}
private:
void clear();
void restore();
CmdSequence m_seq;
std::unique_ptr<WithImage> m_dstImage;
ImageRef m_copy;
gfx::Point m_offset;
int m_boundsX, m_boundsY;
color_t m_bgcolor;
};
} // namespace cmd
} // namespace app
#endif