| 1 | // Aseprite |
|---|---|
| 2 | // Copyright (C) 2018-2020 Igara Studio S.A. |
| 3 | // |
| 4 | // This program is distributed under the terms of |
| 5 | // the End-User License Agreement for Aseprite. |
| 6 | |
| 7 | #ifndef APP_CMD_ASSIGN_COLOR_PROFILE_H_INCLUDED |
| 8 | #define APP_CMD_ASSIGN_COLOR_PROFILE_H_INCLUDED |
| 9 | #pragma once |
| 10 | |
| 11 | #include "app/cmd.h" |
| 12 | #include "app/cmd/with_sprite.h" |
| 13 | #include "gfx/color_space.h" |
| 14 | |
| 15 | namespace app { |
| 16 | namespace cmd { |
| 17 | |
| 18 | class AssignColorProfile : public Cmd, |
| 19 | public WithSprite { |
| 20 | public: |
| 21 | AssignColorProfile(doc::Sprite* sprite, const gfx::ColorSpaceRef& cs); |
| 22 | |
| 23 | protected: |
| 24 | void onExecute() override; |
| 25 | void onUndo() override; |
| 26 | void onFireNotifications() override; |
| 27 | size_t onMemSize() const override { |
| 28 | return sizeof(*this) + |
| 29 | 2*sizeof(gfx::ColorSpace) + |
| 30 | m_oldCS->iccSize() + |
| 31 | m_newCS->iccSize(); |
| 32 | } |
| 33 | |
| 34 | private: |
| 35 | gfx::ColorSpaceRef m_oldCS; |
| 36 | gfx::ColorSpaceRef m_newCS; |
| 37 | }; |
| 38 | |
| 39 | } // namespace cmd |
| 40 | } // namespace app |
| 41 | |
| 42 | #endif |
| 43 |