digiKam
imageregionitem.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2013-07-25
7  * Description : image region widget item for image editor.
8  *
9  * Copyright (C) 2013-2014 by Yiou Wang <geow812 at gmail dot com>
10  * Copyright (C) 2013-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_IMAGE_REGION_ITEM_H
26 #define DIGIKAM_IMAGE_REGION_ITEM_H
27 
28 // Qt includes
29 
30 #include <QStyleOptionGraphicsItem>
31 
32 // Local includes
33 
34 #include "graphicsdimgitem.h"
35 #include "digikam_export.h"
36 #include "dimg.h"
37 #include "imageregionwidget.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_EXPORT ImageRegionItem : public GraphicsDImgItem
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit ImageRegionItem(ImageRegionWidget* const view, bool paintExtras = true);
49  ~ImageRegionItem() override;
50 
51  void setTargetImage(const DImg& img);
52  void setHighLightPoints(const QPolygon& pointsList);
53  void setRenderingPreviewMode(int mode);
54 
55  void paintExtraData(QPainter* const painter);
56  QRect getImageRegion() const;
57 
58  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override;
59  void hoverEnterEvent(QGraphicsSceneHoverEvent*) override;
60  void hoverLeaveEvent(QGraphicsSceneHoverEvent*) override;
61 
62 private:
63 
64  class Private;
65  Private* const dd;
66 };
67 
68 } // namespace Digikam
69 
70 #endif // DIGIKAM_IMAGE_REGION_ITEM_H
Definition: dimg.h:62
Definition: dimgitems_p.h:75
Definition: imageregionitem.h:43
Definition: imageregionwidget.h:50
Definition: datefolderview.cpp:43