ddt 1.2.1
Loading...
Searching...
No Matches
ddtCPLImageGraphicsItem.hpp
Go to the documentation of this file.
1
21#ifndef DDT_DATAVISUALISATION_DDTWIDGETS_CPL_IMAGE_GRAPHICSITEM_HPP
22#define DDT_DATAVISUALISATION_DDTWIDGETS_CPL_IMAGE_GRAPHICSITEM_HPP
23
25#include "ddt/imageColor.hpp"
26
27#include <cpl.h>
28
33 public:
38
43 explicit DdtCPLImageGraphicsItem(cpl_image* const in_image);
44
51 DdtCPLImageGraphicsItem(cpl_image* const in_image,
52 ddt::colorMap_t* const color_map,
53 ddt::scalingLut_t* scaling_lut);
54
62 DdtCPLImageGraphicsItem(cpl_image* const in_image,
63 ddt::colorMapARGB_t* const color_map,
64 ddt::scalingLut_t* scaling_lut);
65
70
75 QRectF boundingRect() const override;
76
83 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
84 QWidget* widget) override;
85
90 virtual QImage* GetImage() override;
91
97 enum { ITEM_TYPE = 66036 };
98
103 int type() const override;
104
105 protected:
109 cpl_image* cimage;
110
114 QImage* qimage;
115
116 private:
117 int width;
118 int height;
119
123 void Init();
124
129 void LoadImageGrayColor(cpl_image* const in_image);
130
136 void LoadImageGrayColorInt(cpl_image* const in_image);
137
143 void LoadImageGrayColorFloat(cpl_image* const in_image);
144
150 void LoadImageGrayColorDouble(cpl_image* const in_image);
151
158 void LoadImageColor(const cpl_image* const in_image,
159 ddt::colorMap_t* color_map,
160 ddt::scalingLut_t* scaling_lut);
161
168 void LoadImageColor(const cpl_image* const in_image,
169 ddt::colorMapARGB_t* const color_map,
170 ddt::scalingLut_t* const scaling_lut);
171
179 void LoadImageColorInt(cpl_image* const in_image,
180 ddt::colorMap_t* const color_map,
181 ddt::scalingLut_t* const scaling_lut);
182
190 void LoadImageColorInt(cpl_image* const in_image,
191 ddt::colorMapARGB_t* const color_map,
192 ddt::scalingLut_t* const scaling_lut);
193
201 void LoadImageColorFloat(cpl_image* const in_image,
202 ddt::colorMap_t* const color_map,
203 ddt::scalingLut_t* const scaling_lut);
204
212 void LoadImageColorFloat(cpl_image* const in_image,
213 ddt::colorMapARGB_t* const color_map,
214 ddt::scalingLut_t* const scaling_lut);
215
223 void LoadImageColorDouble(cpl_image* const in_image,
224 ddt::colorMap_t* const color_map,
225 ddt::scalingLut_t* const scaling_lut);
226
234 void LoadImageColorDouble(cpl_image* const in_image,
235 ddt::colorMapARGB_t* const color_map,
236 ddt::scalingLut_t* const scaling_lut);
237
241 std::vector<unsigned int> GetRgbVectorGray() const;
242
246 std::vector<unsigned int> GetRgbVectorColor(
247 ddt::colorMap_t* const color_map) const;
248
253 void CreateImageAndPixvalRange(const cpl_image* const in_image,
254 double* const min_pixval,
255 double* const pixval_range);
256
261 void CreateImageAndScalingFactors(const cpl_image* const in_image,
262 const ddt::scalingLut_t* const scaling_lut,
263 double* const offset, double* const factor);
264
268 void CreateImage(const cpl_image* const in_image);
269};
270
271#endif // DDT_DATAVISUALISATION_DDTWIDGETS_CPL_IMAGE_GRAPHICSITEM_HPP
272
Definition ddtCPLImageGraphicsItem.hpp:32
virtual ~DdtCPLImageGraphicsItem()
Definition ddtCPLImageGraphicsItem.cpp:76
virtual QImage * GetImage() override
Definition ddtCPLImageGraphicsItem.cpp:102
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Definition ddtCPLImageGraphicsItem.cpp:94
int type() const override
Definition ddtCPLImageGraphicsItem.cpp:89
cpl_image * cimage
Definition ddtCPLImageGraphicsItem.hpp:109
@ ITEM_TYPE
Definition ddtCPLImageGraphicsItem.hpp:97
QImage * qimage
Definition ddtCPLImageGraphicsItem.hpp:114
QRectF boundingRect() const override
Definition ddtCPLImageGraphicsItem.cpp:84
DdtCPLImageGraphicsItem()
Definition ddtCPLImageGraphicsItem.cpp:29
Definition ddtImageGraphicsItem.hpp:28
DDT Widgets. Class for Image Graphics Items. Class derived from QGraphicsItem. Base class for all typ...
Image Color class, offers access to color map related functions. This file is part of the DDT Image H...
std::array< std::array< float, COLOR_MAP_ENTRY_SIZE >, MAX_COLOR_MAP_ENTRIES > colorMap_t
Definition imageColor.hpp:57
std::array< unsigned int, MAX_COLOR_MAP_ENTRIES > colorMapARGB_t
Definition imageColor.hpp:67
Definition imageColor.hpp:77