1// Aseprite
2// Copyright (C) 2001-2015 David Capello
3//
4// This program is distributed under the terms of
5// the End-User License Agreement for Aseprite.
6
7#ifndef APP_CMD_CLEAR_IMAGE_H_INCLUDED
8#define APP_CMD_CLEAR_IMAGE_H_INCLUDED
9#pragma once
10
11#include "app/cmd.h"
12#include "app/cmd/with_image.h"
13#include "doc/color.h"
14#include "doc/image_ref.h"
15
16namespace app {
17namespace cmd {
18 using namespace doc;
19
20 class ClearImage : public Cmd
21 , public WithImage {
22 public:
23 ClearImage(Image* image, color_t color);
24
25 protected:
26 void onExecute() override;
27 void onUndo() override;
28 size_t onMemSize() const override {
29 return sizeof(*this) + (m_copy ? m_copy->getMemSize(): 0);
30 }
31
32 private:
33 ImageRef m_copy;
34 color_t m_color;
35 };
36
37} // namespace cmd
38} // namespace app
39
40#endif
41