File indexing completed on 2024-10-13 04:15:11

0001 /*
0002  * SPDX-FileCopyrightText: (C) 2020 Carl Schwan <carl@carlschwan.eu>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #pragma once
0008 
0009 #include "undocommand.h"
0010 
0011 #include <QImage>
0012 #include <QRect>
0013 
0014 /**
0015  * @brief CropCommand that crop the current image.
0016  */
0017 class CropCommand : public UndoCommand
0018 {
0019 public:
0020     /**
0021      * Contructor
0022      */
0023     CropCommand(const QRect &cropRect);
0024     ~CropCommand() override = default;
0025 
0026     virtual QImage redo(QImage image) override;
0027 
0028     virtual QImage undo(QImage image) override;
0029 
0030 private:
0031     QImage m_image;
0032     QRect m_cropRect;
0033 };