KQuickImageEditor

cropcommand.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2020 Carl Schwan <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  */
6 
7 #pragma once
8 
9 #include "undocommand.h"
10 
11 #include <QImage>
12 #include <QRect>
13 
14 /**
15  * @brief CropCommand that crop the current image.
16  */
17 class CropCommand : public UndoCommand
18 {
19 public:
20  /**
21  * Contructor
22  */
23  CropCommand(const QRect &cropRect);
24  ~CropCommand() override = default;
25 
26  virtual QImage redo(QImage image) override;
27 
28  virtual QImage undo(QImage image) override;
29 
30 private:
31  QImage m_image;
32  QRect m_cropRect;
33 };
CropCommand(const QRect &cropRect)
Contructor.
Definition: cropcommand.cpp:9
virtual QImage redo(QImage image) override
Applies the change to the document.
Definition: cropcommand.cpp:20
virtual QImage undo(QImage image) override
Revert a change to the document.
Definition: cropcommand.cpp:14
CropCommand that crop the current image.
Definition: cropcommand.h:17
A class implementing the command pattern.
Definition: undocommand.h:14
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:08:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.