ddt  0.1
ddtCPLInversGraphicsItem.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file ddtCPLInversGraphicsItem.hpp
8 // @brief Example for a histogram graphics item
9 //
10 // This is an example for a different rendering engine. It will use CPL images
11 // and render them while inverting the pixels.
12 
13 // @author Carsten Mannel, CGI
14 // @since 2021/09/08
15 
16 #ifndef DATAVISUALISATION_TESTVIEWER_SRC_INCLUDE_DDT_DDTCPLINVGRAPHITEM_HPP_
17 #define DATAVISUALISATION_TESTVIEWER_SRC_INCLUDE_DDT_DDTCPLINVGRAPHITEM_HPP_
18 
20 #include "ddt/imageColor.hpp"
21 
22 #include <cpl.h>
23 
28  public:
37  explicit DdtCPLInversGraphicsItem(cpl_image* const in_image);
38 
45  DdtCPLInversGraphicsItem(cpl_image* const in_image,
46  ddt::colorMap_t* const color_map,
47  ddt::scalingLut_t* scaling_lut);
48 
56  DdtCPLInversGraphicsItem(cpl_image* const in_image,
57  ddt::colorMapARGB_t* const color_map,
58  ddt::scalingLut_t* scaling_lut);
59 
63  ~DdtCPLInversGraphicsItem() override;
64 
69  QRectF boundingRect() const override;
76  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
77  QWidget* widget) override;
78 
83  QImage* GetImage() override;
84 
90  enum { ITEM_TYPE = 66036 };
91 
96  int type() const override;
97 
98  protected:
102  cpl_image* cimage;
106  QImage* qimage;
107 
108  private:
109  int width;
110  int height;
111 
115  void Init();
116 
121  void loadImageGrayColor(cpl_image* const in_image);
122 
128  void loadImageGrayColorInt(cpl_image* const in_image);
129 
135  void loadImageGrayColorFloat(cpl_image* const in_image);
136 
142  void loadImageGrayColorDouble(cpl_image* const in_image);
143 
150  void loadImageColor(const cpl_image* const in_image,
151  ddt::colorMap_t* color_map,
152  ddt::scalingLut_t* scaling_lut);
153 
160  void loadImageColor(const cpl_image* const in_image,
161  ddt::colorMapARGB_t* const color_map,
162  ddt::scalingLut_t* const scaling_lut);
163 
171  void loadImageColorInt(cpl_image* const in_image,
172  ddt::colorMap_t* const color_map,
173  ddt::scalingLut_t* const scaling_lut);
174 
182  void loadImageColorInt(cpl_image* const in_image,
183  ddt::colorMapARGB_t* const color_map,
184  ddt::scalingLut_t* const scaling_lut);
185 
193  void loadImageColorFloat(cpl_image* const in_image,
194  ddt::colorMap_t* const color_map,
195  ddt::scalingLut_t* const scaling_lut);
196 
204  void loadImageColorFloat(cpl_image* const in_image,
205  ddt::colorMapARGB_t* const color_map,
206  ddt::scalingLut_t* const scaling_lut);
207 
215  void loadImageColorDouble(cpl_image* const in_image,
216  ddt::colorMap_t* const color_map,
217  ddt::scalingLut_t* const scaling_lut);
218 
226  void loadImageColorDouble(cpl_image* const in_image,
227  ddt::colorMapARGB_t* const color_map,
228  ddt::scalingLut_t* const scaling_lut);
229 };
230 
231 #endif /* DATAVISUALISATION_TESTVIEWER_SRC_INCLUDE_DDT_DDTCPLINVGRAPHITEM_HPP_ \
232  */
DdtCPLInversGraphicsItem::cimage
cpl_image * cimage
Definition: ddtCPLInversGraphicsItem.hpp:102
DdtCPLInversGraphicsItem
Definition: ddtCPLInversGraphicsItem.hpp:27
ddt::scalingLut_t
Definition: imageColor.hpp:76
DdtCPLInversGraphicsItem::qimage
QImage * qimage
Definition: ddtCPLInversGraphicsItem.hpp:106
DdtImageGraphicsItem
Definition: ddtImageGraphicsItem.hpp:25
ddt::colorMapARGB_t
std::array< unsigned int, MAX_COLOR_MAP_ENTRIES > colorMapARGB_t
Definition: imageColor.hpp:66
imageColor.hpp
DdtCPLInversGraphicsItem::boundingRect
QRectF boundingRect() const override
Definition: ddtCPLInversGraphicsItem.cpp:76
DdtCPLInversGraphicsItem::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Definition: ddtCPLInversGraphicsItem.cpp:86
DdtCPLInversGraphicsItem::~DdtCPLInversGraphicsItem
~DdtCPLInversGraphicsItem() override
Definition: ddtCPLInversGraphicsItem.cpp:68
DdtCPLInversGraphicsItem::DdtCPLInversGraphicsItem
DdtCPLInversGraphicsItem()
Definition: ddtCPLInversGraphicsItem.cpp:21
DdtCPLInversGraphicsItem::ITEM_TYPE
@ ITEM_TYPE
Definition: ddtCPLInversGraphicsItem.hpp:90
ddtImageGraphicsItem.hpp
DdtCPLInversGraphicsItem::type
int type() const override
Definition: ddtCPLInversGraphicsItem.cpp:81
ddt::colorMap_t
std::array< std::array< float, COLOR_MAP_ENTRY_SIZE >, MAX_COLOR_MAP_ENTRIES > colorMap_t
Definition: imageColor.hpp:56
DdtCPLInversGraphicsItem::GetImage
QImage * GetImage() override
Definition: ddtCPLInversGraphicsItem.cpp:94