JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtpimagergb.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (jan@jkrieger.de)
3
4
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef JKQTPGRAPHSIMAGERGB_H
22#define JKQTPGRAPHSIMAGERGB_H
23
24
25#include <QString>
26#include <QPainter>
27#include <QImage>
28#include <QIcon>
29#include "jkqtplotter/graphs/jkqtpimage.h"
30#include "jkqtplotter/jkqtptools.h"
31#include "jkqtplotter/jkqtpbaseelements.h"
32#include "jkqtplotter/jkqtplotter_imexport.h"
33#include "jkqtplotter/jkqtpimagetools.h"
34
35
36
37/*! \brief class to plot an image from an 2-dimensional array of RGB values
38 \ingroup jkqtplotter_imagelots_elements
39
40 This class extends JKQTPMathImageBase and interprets the data array JKQTPMathImageBase::data as
41 the 1st (RED) color channel and adds two more channels for GREEN and BLUE.
42
43 Using setRgbMode() you can also use a different color system than RGB.
44
45 \image html rgbimageplots.png
46 \image html rgbimageplot_opencv.png
47
48 \see Examples: \ref JKQTPlotterRGBImagePlot and \ref JKQTPlotterImagePlotRGBOpenCV
49*/
51 Q_OBJECT
52 public:
54
55
56 /** \brief class constructor
57 *
58 * \param x origin of the image (x-direction) in system coordinates
59 * \param y origin of the image (y-direction) in system coordinates
60 * \param width width of the image in system coordinates
61 * \param height height of the image in system coordinates
62 * \param datatype datatype of the image given in \a data
63 * \param data points to an image to be plotted (of size \a Nx * \a Ny )
64 * \param Nx width (in number of pixels) of \a data
65 * \param Ny height (in number of pixels) of \a data
66 * \param parent parent plotter object
67 *
68 */
69 JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void* data, int Nx, int Ny, JKQTBasePlotter* parent=nullptr);
70
71 /** \brief class constructor
72 *
73 * \param x origin of the image (x-direction) in system coordinates
74 * \param y origin of the image (y-direction) in system coordinates
75 * \param width width of the image in system coordinates
76 * \param height height of the image in system coordinates
77 * \param datatype datatype of the image given in \a data
78 * \param data points to an image to be plotted (of size \a Nx * \a Ny )
79 * \param Nx width (in number of pixels) of \a data
80 * \param Ny height (in number of pixels) of \a data
81 * \param parent parent plotter object
82 *
83 */
84 JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void* data, int Nx, int Ny, JKQTPlotter* parent);
85
86 /** \brief class constructor
87 *
88 * \param parent parent plotter object
89 */
91
92 /** \brief class constructor
93 *
94 * \param parent parent plotter object
95 */
97
98 /** \brief plots the graph to the plotter object specified as parent */
99 virtual void draw(JKQTPEnhancedPainter& painter) override;
100
101 /** \copydoc JKQTPImageBase::setParent() */
102 virtual void setParent(JKQTBasePlotter* parent) override;
103
104
105
106 /** \brief set the plot-data to a given array \a data (red), \a dataG (green), \a dataB (blue) with size \a Nx * \a Ny in row-major ordering and with the given \a datatype */
107 virtual void setData(const void* dataR, const void* dataG, const void* dataB, int Nx, int Ny, JKQTPMathImageDataType datatype);
108 /** \brief set the plot-data to a given array \a data (red), \a dataG (green), \a dataB (blue) with size \a Nx * \a Ny in row-major ordering */
109 virtual void setData(const void* dataR, const void* dataG, const void* dataB, int Nx, int Ny);
110
111 /** \brief set the plot-data to a given array \a data (red) with size \a Nx * \a Ny in row-major ordering and with the given \a datatype */
112 virtual void setData(const void* dataR, int Nx, int Ny, JKQTPMathImageDataType datatype) override;
113 /** \brief set the plot-data to a given array \a data (red) with size \a Nx * \a Ny in row-major ordering */
114 virtual void setData(const void* dataR, int Nx, int Ny) override ;
115
116
117 /** \brief determine min/max data value of the image */
118 virtual void getDataMinMax(double& imin, double& imax) override;
119
120
121 /** \copydoc data */
122 virtual void setDataR(const void* __value);
123 /** \copydoc data */
124 const void* getDataR() const;
125 /** \copydoc datatype */
127 /** \copydoc datatype */
129
130 /** \copydoc dataG */
131 virtual void setDataG(const void* __value);
132 /** \copydoc dataG */
133 const void* getDataG() const;
134 /** \copydoc datatypeG */
136 /** \copydoc datatypeG */
138 /** \copydoc dataB */
139 virtual void setDataB(const void* __value);
140 /** \copydoc dataB */
141 const void* getDataB() const;
142 /** \copydoc datatypeB */
144 /** \copydoc datatypeB */
146 /** \copydoc showColorBar */
147 void setShowColorBar(bool __value);
148 /** \copydoc showColorBar */
149 bool getShowColorBar() const;
150 /** \copydoc colorBarWidth */
151 void setColorBarWidth(int __value);
152 /** \copydoc colorBarWidth */
153 int getColorBarWidth() const;
154 /** \copydoc colorBarOffset */
155 void setColorBarOffset(int __value);
156 /** \copydoc colorBarOffset */
157 int getColorBarOffset() const;
158 /** \copydoc colorBarRelativeHeight */
159 void setColorBarRelativeHeight(double __value);
160 /** \copydoc colorBarRelativeHeight */
162 /** \copydoc imageMinR */
163 void setImageMin(double __value);
164 /** \copydoc imageMinR */
165 double getImageMin() const;
166 /** \copydoc imageMinR */
167 void setImageMinR(double m);
168 /** \copydoc imageMaxR */
169 void setImageMax(double __value);
170 /** \copydoc imageMaxR */
171 double getImageMax() const;
172 /** \copydoc imageMaxR */
173 void setImageMaxR(double m);
174 /** \copydoc imageMinG */
175 void setImageMinG(double __value);
176 /** \copydoc imageMinG */
177 double getImageMinG() const;
178 /** \copydoc imageMaxG */
179 void setImageMaxG(double __value);
180 /** \copydoc imageMaxG */
181 double getImageMaxG() const;
182 /** \copydoc imageMinB */
183 void setImageMinB(double __value);
184 /** \copydoc imageMinB */
185 double getImageMinB() const;
186 /** \copydoc imageMaxB */
187 void setImageMaxB(double __value);
188 /** \copydoc imageMaxB */
189 double getImageMaxB() const;
190 /** \copydoc autoImageRange */
191 void setAutoImageRange(bool __value);
192 /** \copydoc autoImageRange */
193 bool getAutoImageRange() const;
194 /** \copydoc imageNameR */
195 void setImageName(const QString & __value);
196 /** \copydoc imageNameR */
197 QString getImageName() const;
198 /** \copydoc imageNameR */
199 QString getImageNameR() const;
200 /** \copydoc imageNameR */
201 void setImageNameR(const QString& m);
202 /** \copydoc imageNameG */
203 void setImageNameG(const QString & __value);
204 /** \copydoc imageNameG */
205 QString getImageNameG() const;
206 /** \copydoc imageNameB */
207 void setImageNameB(const QString & __value);
208 /** \copydoc imageNameB */
209 QString getImageNameB() const;
210 /** \copydoc imageNameFontName */
211 void setImageNameFontName(const QString & __value);
212 /** \copydoc imageNameFontName */
213 QString getImageNameFontName() const;
214 /** \copydoc imageNameFontSize */
215 void setImageNameFontSize(double __value);
216 /** \copydoc imageNameFontSize */
217 double getImageNameFontSize() const;
218 /** \copydoc colorBarRightAxis */
220 /** \copydoc colorBarTopAxis */
222 /** \copydoc colorBarRightAxis */
224 /** \copydoc colorBarTopAxis */
226 /** \copydoc colorBarRightAxisG */
228 /** \copydoc colorBarTopAxisG */
230 /** \copydoc colorBarRightAxisB */
232 /** \copydoc colorBarTopAxisB */
234 /** \copydoc colorBarRightAxis */
236 /** \copydoc colorBarTopAxis */
238 /** \copydoc colorBarRightAxis */
240 /** \copydoc colorBarTopAxis */
242 /** \copydoc colorBarRightAxisG */
244 /** \copydoc colorBarTopAxisG */
246 /** \copydoc colorBarRightAxisB */
248 /** \copydoc colorBarTopAxisB */
250 /** \copydoc colorBarTopVisible */
251 void setColorBarTopVisible(bool __value);
252 /** \copydoc colorBarTopVisible */
254 /** \copydoc colorBarRightVisible */
255 void setColorBarRightVisible(bool __value);
256 /** \copydoc colorBarRightVisible */
258 /** \copydoc colorbarsSideBySide */
259 void setColorbarsSideBySide(bool __value);
260 /** \copydoc colorbarsSideBySide */
262 /** \copydoc rgbMode */
264 /** \copydoc rgbMode */
266 /** \copydoc modifierMode */
268 /** \copydoc modifierMode */
270
271 /** \copydoc colorBarModifiedWidth */
272 void setColorBarModifiedWidth(double __value);
273 /** \copydoc colorBarModifiedWidth */
275 /** \copydoc modifierColorBarTopAxis */
277 /** \copydoc modifierColorBarRightAxis */
279 /** \copydoc modifierColorBarTopAxis */
281 /** \copydoc modifierColorBarRightAxis */
283 /** \copydoc autoModifierRange */
284 void setAutoModifierRange(bool __value);
285 /** \copydoc autoModifierRange */
287 /** \copydoc modifierMin */
288 void setModifierMin(double __value);
289 /** \copydoc modifierMin */
290 double getModifierMin() const;
291 /** \copydoc modifierMax */
292 void setModifierMax(double __value);
293 /** \copydoc modifierMax */
294 double getModifierMax() const;
295
296 /** \brief return the data of the green channel used for plotting as a QVector<double> in row-major data-ordering */
297 QVector<double> getDataGAsDoubleVector() const;
298 /** \brief return the data of the blue channel used for plotting as a QVector<double> in row-major data-ordering */
299 QVector<double> getDataBAsDoubleVector() const;
300
301
302 /*! \brief if the graph plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
303
304 \note If you want to draw outside, then you'll also have to implement drawOutside()
305 */
306 virtual void getOutsideSize(JKQTPEnhancedPainter& painter, int& leftSpace, int& rightSpace, int& topSpace, int& bottomSpace) override;
307
308 /*! \brief plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
309
310 \note If you want to draw outside, then you'll also have to implement getOutsideSize(), so enough space is reserved
311
312 The four value supplied tell the method where to draw (inside one of the rectangles).
313 */
314 virtual void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace) override;
315
316 /** \brief return the plotted image only as a QImage */
317 virtual QImage drawImage();
318
319 /** \brief determine min/max data value of the image */
320 virtual void getDataMinMaxG(double& imin, double& imax);
321 /** \brief determine min/max data value of the image */
322 virtual void getDataMinMaxB(double& imin, double& imax);
323
324 /** \brief return the value (raw data!) of the contained image at the given coordinate */
325 double getValueAt(double x, double y, int channel=0) ;
326
327 /** \brief plots a key marker inside the specified rectangle \a rect */
328 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
329
330 protected:
332 /** \brief points to the data array, holding the image */
333 const void* dataG;
334 /** \brief datatype of the data array data */
336 /** \brief points to the data array, holding the image */
337 const void* dataB;
338 /** \brief datatype of the data array data */
340
341 /** \brief how to interpret the three data channels red, green and blue */
343
344 /** \brief top color bar visible */
346 /** \brief right color bar visible */
348 /** \brief name of the red image channel displayed above color bar (may contain LaTeX markup!) */
349 QString imageNameR;
350 /** \brief name of the green image channel displayed above color bar (may contain LaTeX markup!) */
351 QString imageNameG;
352 /** \brief name of the blue image channel displayed above color bar (may contain LaTeX markup!) */
353 QString imageNameB;
354 /** \brief font name when displaying imageName */
356 /** \brief font size in points when displaying imageName */
358
359 /** \brief indicate whether to display a color bar */
361 /** \brief width of the color bar */
363 /** \brief height of the color bar, as multiple of plotHeight */
365 /** \brief indicates whether to estimate min/max of the image automatically */
367 /** \brief red image value range minimum */
368 double imageMinR;
369 /** \brief red image value range maximum */
370 double imageMaxR;
371 /** \brief green image value range minimum */
372 double imageMinG;
373 /** \brief green image value range maximum */
374 double imageMaxG;
375 /** \brief blue image value range minimum */
376 double imageMinB;
377 /** \brief blue image value range maximum */
378 double imageMaxB;
379 /** \brief offset between outside space border and color bar */
381 /** \brief if \c true the different color bars share the space of a single color bar, if set \c false each colorbar uses the space of a single colorbar */
383
384
385 /** \brief object used for color bar axes (right border, red image data)
386 *
387 * \note this axis has some kind of a special role. It is used to format color bar axes
388 */
390 /** \brief object used for color bar axes (top border, red image data)
391 *
392 * \note this axis has some kind of a special role. It is used to format color bar axes
393 */
395 /** \brief object used for color bar axes (right border, green image data)
396 *
397 * \note this axis has some kind of a special role. It is used to format color bar axes
398 */
400 /** \brief object used for color bar axes (top border, green image data)
401 *
402 * \note this axis has some kind of a special role. It is used to format color bar axes
403 */
405 /** \brief object used for color bar axes (right border, blue image data)
406 *
407 * \note this axis has some kind of a special role. It is used to format color bar axes
408 */
410 /** \brief object used for color bar axes (top border, blue image data)
411 *
412 * \note this axis has some kind of a special role. It is used to format color bar axes
413 */
415 /** \brief indicates whether to estimate min/max of the modifier automatically */
417 /** \brief modifier value range minimum */
419 /** \brief modifier value range maximum */
421 /** \brief width of the color bar when modifier is on */
423 /** \brief how to apply the modifier column dataModifier
424 * \see ModifierMode
425 */
427
428
429 /** \brief object used for color bar axes (right border, modifier image data)
430 *
431 * \note this axis has some kind of a special role. It is used to format color bar axes
432 */
434 /** \brief object used for color bar axes (top border, modifier image data)
435 *
436 * \note this axis has some kind of a special role. It is used to format color bar axes
437 */
439
440 /** \brief internal storage for minimum of the green image value range
441 *
442 * This is set e.g. when calling drawImage() or draw()
443 */
445 /** \brief internal storage for maximum of the green image value range
446 *
447 * This is set e.g. when calling drawImage() or draw()
448 */
450 /** \brief internal storage for minimum of the blue image value range
451 *
452 * This is set e.g. when calling drawImage() or draw()
453 */
455 /** \brief internal storage for maximum of the blue image value range
456 *
457 * This is set e.g. when calling drawImage() or draw()
458 */
460
461 protected:
462 /** \brief action that calls saveImagePlotAsImage() */
463 QAction* actSaveImage;
464 /** \brief action that calls copyImagePlotAsImage() */
465 QAction* actCopyImage;
466 public:
467 /** \copydoc JKQTPImageBase::setTitle() */
468 virtual void setTitle(const QString& title) override;
469 public Q_SLOTS:
470 /** \brief save the plotted image as a file with \a filename and format \a outputFormat */
471 void saveImagePlotAsImage(const QString &filename=QString(""), const QByteArray &outputFormat=QByteArray());
472 /** \brief copy the plotted image as an image into the clipboard */
474};
475
476
477
478/*! \brief like JKQTPRGBMathImage but reads images from columns of the datastore
479 \ingroup jkqtplotter_imagelots_elements
480
481
482 \image html rgbimageplots.png
483
484 \image html rgbimageplot_opencv.png
485
486 \image html rgbimageplot.png
487
488 \see Examples: \ref JKQTPlotterRGBImagePlot and \ref JKQTPlotterImagePlotRGBOpenCV
489 */
491 Q_OBJECT
492 public:
493
494 /** \brief class constructor
495 *
496 * \param parent parent plotter object
497 */
499 /** \brief class constructor
500 *
501 * \param x origin of the image (x-direction) in system coordinates
502 * \param y origin of the image (y-direction) in system coordinates
503 * \param width width of the image in system coordinates
504 * \param height height of the image in system coordinates
505 * \param parent parent plotter object
506 *
507 */
508 JKQTPColumnRGBMathImage(double x, double y, double width, double height, JKQTBasePlotter* parent=nullptr);
509 /** \brief class constructor
510 *
511 * \param x origin of the image (x-direction) in system coordinates
512 * \param y origin of the image (y-direction) in system coordinates
513 * \param width width of the image in system coordinates
514 * \param height height of the image in system coordinates
515 * \param imageRColumn column for red channel to be plotted
516 * \param parent parent plotter object
517 *
518 */
519 JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, JKQTBasePlotter* parent=nullptr);
520 /** \brief class constructor
521 *
522 * \param x origin of the image (x-direction) in system coordinates
523 * \param y origin of the image (y-direction) in system coordinates
524 * \param width width of the image in system coordinates
525 * \param height height of the image in system coordinates
526 * \param imageRColumn column for red channel to be plotted
527 * \param imageGColumn column for green channel to be plotted
528 * \param parent parent plotter object
529 *
530 */
531 JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, JKQTBasePlotter* parent=nullptr);
532 /** \brief class constructor
533 *
534 * \param x origin of the image (x-direction) in system coordinates
535 * \param y origin of the image (y-direction) in system coordinates
536 * \param width width of the image in system coordinates
537 * \param height height of the image in system coordinates
538 * \param imageRColumn column for red channel to be plotted
539 * \param imageGColumn column for green channel to be plotted
540 * \param imageBColumn column for blue channel to be plotted
541 * \param parent parent plotter object
542 *
543 */
544 JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, JKQTBasePlotter* parent=nullptr);
545 /** \brief class constructor
546 *
547 * \param parent parent plotter object
548 */
550 /** \brief class constructor
551 *
552 * \param x origin of the image (x-direction) in system coordinates
553 * \param y origin of the image (y-direction) in system coordinates
554 * \param width width of the image in system coordinates
555 * \param height height of the image in system coordinates
556 * \param parent parent plotter object
557 *
558 */
559 JKQTPColumnRGBMathImage(double x, double y, double width, double height, JKQTPlotter* parent);
560 /** \brief class constructor
561 *
562 * \param x origin of the image (x-direction) in system coordinates
563 * \param y origin of the image (y-direction) in system coordinates
564 * \param width width of the image in system coordinates
565 * \param height height of the image in system coordinates
566 * \param imageRColumn column for red channel to be plotted
567 * \param parent parent plotter object
568 *
569 */
570 JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, JKQTPlotter* parent);
571 /** \brief class constructor
572 *
573 * \param x origin of the image (x-direction) in system coordinates
574 * \param y origin of the image (y-direction) in system coordinates
575 * \param width width of the image in system coordinates
576 * \param height height of the image in system coordinates
577 * \param imageRColumn column for red channel to be plotted
578 * \param imageGColumn column for green channel to be plotted
579 * \param parent parent plotter object
580 *
581 */
582 JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, JKQTPlotter* parent);
583 /** \brief class constructor
584 *
585 * \param x origin of the image (x-direction) in system coordinates
586 * \param y origin of the image (y-direction) in system coordinates
587 * \param width width of the image in system coordinates
588 * \param height height of the image in system coordinates
589 * \param imageRColumn column for red channel to be plotted
590 * \param imageGColumn column for green channel to be plotted
591 * \param imageBColumn column for blue channel to be plotted
592 * \param parent parent plotter object
593 *
594 */
595 JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, JKQTPlotter* parent);
596
597 /** \copydoc imageRColumn */
598 virtual void setImageRColumn(int __value);
599 /** \copydoc imageRColumn */
600 int getImageRColumn() const;
601 /** \copydoc imageGColumn */
602 virtual void setImageGColumn(int __value);
603 /** \copydoc imageGColumn */
604 int getImageGColumn() const;
605 /** \copydoc imageBColumn */
606 virtual void setImageBColumn(int __value);
607 /** \copydoc imageBColumn */
608 int getImageBColumn() const;
609 /** \copydoc modifierColumn */
610 virtual void setModifierColumn(int __value);
611 /** \copydoc modifierColumn */
612 int getModifierColumn() const;
613 /** \copydoc JKQTPGraph::usesColumn() */
614 virtual bool usesColumn(int c) const override;
615
616 protected:
617 /** \brief image column for R channel */
619 /** \brief image column for G channel */
621 /** \brief image column for B channel */
623 /** \brief column containing the modifier image */
625 /** \copydoc JKQTPRGBMathImage::ensureImageData() */
626 void ensureImageData() override;
627
628 private:
639};
640
641
642
643#endif // JKQTPGRAPHSIMAGERGB_H
644
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
like JKQTPRGBMathImage but reads images from columns of the datastore
Definition jkqtpimagergb.h:490
virtual void setImageBColumn(int __value)
image column for B channel
int imageGColumn
image column for G channel
Definition jkqtpimagergb.h:620
int getImageRColumn() const
image column for R channel
int getImageBColumn() const
image column for B channel
int getImageGColumn() const
image column for G channel
virtual void setImageRColumn(int __value)
image column for R channel
virtual void setImageGColumn(int __value)
image column for G channel
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, JKQTPlotter *parent)
class constructor
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, JKQTBasePlotter *parent=nullptr)
class constructor
int imageBColumn
image column for B channel
Definition jkqtpimagergb.h:622
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, int imageBColumn, JKQTPlotter *parent)
class constructor
int imageRColumn
image column for R channel
Definition jkqtpimagergb.h:618
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, JKQTBasePlotter *parent=nullptr)
class constructor
void ensureImageData() override
overwrite this to fill the data poiters before they are accessed (e.g. to load data from a column in ...
JKQTPColumnRGBMathImage(double x, double y, double width, double height, JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPColumnRGBMathImage(double x, double y, double width, double height, JKQTPlotter *parent)
class constructor
JKQTPColumnRGBMathImage(JKQTBasePlotter *parent=nullptr)
class constructor
int modifierColumn
column containing the modifier image
Definition jkqtpimagergb.h:624
JKQTPColumnRGBMathImage(double x, double y, double width, double height, int imageRColumn, int imageGColumn, JKQTPlotter *parent)
class constructor
JKQTPColumnRGBMathImage(JKQTPlotter *parent)
class constructor
virtual void setModifierColumn(int __value)
column containing the modifier image
int getModifierColumn() const
column containing the modifier image
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
implements a position-indipendent horizontal axis, based on JKQTPCoordinateAxis (for most of document...
Definition jkqtpcoordinateaxes.h:1240
base class to hold an image from an 2-dimensional array of values
Definition jkqtpimage.h:134
virtual void setDatatypeModifier(JKQTPMathImageDataType __value)
datatype of the data array data
virtual void setDatatype(JKQTPMathImageDataType __value)
datatype of the data array data
virtual void setDataModifier(const void *__value)
points to the data array, holding the modifier image
virtual void setData(const void *__value)
points to the data array, holding the image
class to plot an image from an 2-dimensional array of RGB values
Definition jkqtpimagergb.h:50
double internalDataMaxB
internal storage for maximum of the blue image value range
Definition jkqtpimagergb.h:459
virtual void setData(const void *dataR, int Nx, int Ny) override
set the plot-data to a given array data (red) with size Nx * Ny in row-major ordering
QAction * actSaveImage
action that calls saveImagePlotAsImage()
Definition jkqtpimagergb.h:463
void copyImagePlotAsImage()
copy the plotted image as an image into the clipboard
QVector< double > getDataBAsDoubleVector() const
return the data of the blue channel used for plotting as a QVector<double> in row-major data-ordering
JKQTPHorizontalIndependentAxis * getModifierColorBarRightAxis()
object used for color bar axes (top border, modifier image data)
double getImageMax() const
red image value range maximum
JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void *data, int Nx, int Ny, JKQTPlotter *parent)
class constructor
QString getImageNameR() const
name of the red image channel displayed above color bar (may contain LaTeX markup!...
JKQTPRGBMathImageRGBMode rgbMode
how to interpret the three data channels red, green and blue
Definition jkqtpimagergb.h:342
virtual void drawOutside(JKQTPEnhancedPainter &painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace) override
plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
JKQTPVerticalIndependentAxis * getColorBarRightAxisR()
object used for color bar axes (right border, red image data)
JKQTPMathImageDataType getDatatypeB() const
datatype of the data array data
virtual void getOutsideSize(JKQTPEnhancedPainter &painter, int &leftSpace, int &rightSpace, int &topSpace, int &bottomSpace) override
if the graph plots outside the actual plot field of view (e.g. color bars, scale bars,...
double internalDataMinB
internal storage for minimum of the blue image value range
Definition jkqtpimagergb.h:454
bool getShowColorBar() const
indicate whether to display a color bar
virtual void setParent(JKQTBasePlotter *parent) override
sets the parent painter class
void setImageMin(double __value)
red image value range minimum
JKQTPRGBMathImage(double x, double y, double width, double height, JKQTPMathImageDataType datatype, const void *data, int Nx, int Ny, JKQTBasePlotter *parent=nullptr)
class constructor
void setImageNameR(const QString &m)
name of the red image channel displayed above color bar (may contain LaTeX markup!...
QVector< double > getDataGAsDoubleVector() const
return the data of the green channel used for plotting as a QVector<double> in row-major data-orderin...
virtual void getDataMinMaxG(double &imin, double &imax)
determine min/max data value of the image
bool getAutoImageRange() const
indicates whether to estimate min/max of the image automatically
int getColorBarOffset() const
offset between outside space border and color bar
JKQTPVerticalIndependentAxis * getColorBarRightAxisG()
object used for color bar axes (right border, green image data)
JKQTPHorizontalIndependentAxis * colorBarTopAxis
object used for color bar axes (top border, red image data)
Definition jkqtpimagergb.h:394
void setImageMaxR(double m)
red image value range maximum
void setColorBarWidth(int __value)
width of the color bar
const JKQTPVerticalIndependentAxis * getModifierColorBarTopAxis() const
object used for color bar axes (right border, modifier image data)
JKQTPVerticalIndependentAxis * colorBarRightAxisG
object used for color bar axes (right border, green image data)
Definition jkqtpimagergb.h:399
QString getImageName() const
name of the red image channel displayed above color bar (may contain LaTeX markup!...
JKQTPHorizontalIndependentAxis * colorBarTopAxisG
object used for color bar axes (top border, green image data)
Definition jkqtpimagergb.h:404
JKQTPMathImageDataType getDatatypeR() const
datatype of the data array data
void setColorBarOffset(int __value)
offset between outside space border and color bar
double imageMaxG
green image value range maximum
Definition jkqtpimagergb.h:374
double imageMaxB
blue image value range maximum
Definition jkqtpimagergb.h:378
JKQTPHorizontalIndependentAxis * modifierColorBarRightAxis
object used for color bar axes (top border, modifier image data)
Definition jkqtpimagergb.h:438
const JKQTPHorizontalIndependentAxis * getColorBarTopAxis() const
object used for color bar axes (top border, red image data)
const void * getDataB() const
points to the data array, holding the image
JKQTPHorizontalIndependentAxis * colorBarTopAxisB
object used for color bar axes (top border, blue image data)
Definition jkqtpimagergb.h:414
void setModifierMax(double __value)
modifier value range maximum
const void * dataB
points to the data array, holding the image
Definition jkqtpimagergb.h:337
JKQTPRGBMathImage(JKQTBasePlotter *parent=nullptr)
class constructor
bool autoImageRange
indicates whether to estimate min/max of the image automatically
Definition jkqtpimagergb.h:366
void setImageMax(double __value)
red image value range maximum
void setImageMaxG(double __value)
green image value range maximum
virtual void setData(const void *dataR, int Nx, int Ny, JKQTPMathImageDataType datatype) override
set the plot-data to a given array data (red) with size Nx * Ny in row-major ordering and with the gi...
double getImageMaxB() const
blue image value range maximum
JKQTPHorizontalIndependentAxis * getColorBarTopAxisR()
object used for color bar axes (top border, red image data)
JKQTPVerticalIndependentAxis * getColorBarRightAxisB()
object used for color bar axes (right border, blue image data)
const JKQTPVerticalIndependentAxis * getColorBarRightAxis() const
object used for color bar axes (right border, red image data)
JKQTPVerticalIndependentAxis * getColorBarRightAxis()
object used for color bar axes (right border, red image data)
virtual void setDataB(const void *__value)
points to the data array, holding the image
double getImageMin() const
red image value range minimum
void setColorBarModifiedWidth(double __value)
width of the color bar when modifier is on
JKQTPVerticalIndependentAxis * colorBarRightAxis
object used for color bar axes (right border, red image data)
Definition jkqtpimagergb.h:389
QString imageNameB
name of the blue image channel displayed above color bar (may contain LaTeX markup!...
Definition jkqtpimagergb.h:353
JKQTPRGBMathImageRGBMode getRgbMode() const
how to interpret the three data channels red, green and blue
bool showColorBar
indicate whether to display a color bar
Definition jkqtpimagergb.h:360
double colorBarModifiedWidth
width of the color bar when modifier is on
Definition jkqtpimagergb.h:422
virtual void setTitle(const QString &title) override
sets the title of the plot (for display in key!).
JKQTPMathImageModifierMode getModifierMode() const
how to apply the modifier column dataModifier
QString getImageNameG() const
name of the green image channel displayed above color bar (may contain LaTeX markup!...
bool getColorBarTopVisible() const
top color bar visible
virtual QImage drawImage()
return the plotted image only as a QImage
virtual void setDataG(const void *__value)
points to the data array, holding the image
void setDatatypeG(JKQTPMathImageDataType __value)
datatype of the data array data
double imageMaxR
red image value range maximum
Definition jkqtpimagergb.h:370
double getValueAt(double x, double y, int channel=0)
return the value (raw data!) of the contained image at the given coordinate
double getModifierMax() const
modifier value range maximum
void setAutoImageRange(bool __value)
indicates whether to estimate min/max of the image automatically
void setModifierMode(const JKQTPMathImageModifierMode &__value)
how to apply the modifier column dataModifier
QString getImageNameFontName() const
font name when displaying imageName
JKQTPMathImageModifierMode modifierMode
how to apply the modifier column dataModifier
Definition jkqtpimagergb.h:426
void setColorBarRightVisible(bool __value)
right color bar visible
JKQTPVerticalIndependentAxis * getModifierColorBarTopAxis()
object used for color bar axes (right border, modifier image data)
void setDatatypeR(JKQTPMathImageDataType __value)
datatype of the data array data
bool autoModifierRange
indicates whether to estimate min/max of the modifier automatically
Definition jkqtpimagergb.h:416
void setImageName(const QString &__value)
name of the red image channel displayed above color bar (may contain LaTeX markup!...
QString imageNameR
name of the red image channel displayed above color bar (may contain LaTeX markup!...
Definition jkqtpimagergb.h:349
void setImageMinB(double __value)
blue image value range minimum
double internalDataMinG
internal storage for minimum of the green image value range
Definition jkqtpimagergb.h:444
bool colorBarRightVisible
right color bar visible
Definition jkqtpimagergb.h:347
int colorBarWidth
width of the color bar
Definition jkqtpimagergb.h:362
JKQTPMathImageDataType datatypeB
datatype of the data array data
Definition jkqtpimagergb.h:339
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
double internalDataMaxG
internal storage for maximum of the green image value range
Definition jkqtpimagergb.h:449
JKQTPVerticalIndependentAxis * colorBarRightAxisB
object used for color bar axes (right border, blue image data)
Definition jkqtpimagergb.h:409
const void * getDataR() const
points to the data array, holding the image
double getColorBarModifiedWidth() const
width of the color bar when modifier is on
const JKQTPHorizontalIndependentAxis * getColorBarTopAxisR() const
object used for color bar axes (top border, red image data)
double imageMinG
green image value range minimum
Definition jkqtpimagergb.h:372
const JKQTPHorizontalIndependentAxis * getModifierColorBarRightAxis() const
object used for color bar axes (top border, modifier image data)
JKQTPRGBMathImage(JKQTPlotter *parent)
class constructor
void setDatatypeB(JKQTPMathImageDataType __value)
datatype of the data array data
bool getAutoModifierRange() const
indicates whether to estimate min/max of the modifier automatically
void setColorBarTopVisible(bool __value)
top color bar visible
void setImageNameFontName(const QString &__value)
font name when displaying imageName
virtual void getDataMinMax(double &imin, double &imax) override
determine min/max data value of the image
bool colorbarsSideBySide
if true the different color bars share the space of a single color bar, if set false each colorbar us...
Definition jkqtpimagergb.h:382
double modifierMin
modifier value range minimum
Definition jkqtpimagergb.h:418
JKQTPMathImageDataType datatypeG
datatype of the data array data
Definition jkqtpimagergb.h:335
const void * dataG
points to the data array, holding the image
Definition jkqtpimagergb.h:333
void setImageMinR(double m)
red image value range minimum
QString imageNameG
name of the green image channel displayed above color bar (may contain LaTeX markup!...
Definition jkqtpimagergb.h:351
void setImageNameG(const QString &__value)
name of the green image channel displayed above color bar (may contain LaTeX markup!...
void setShowColorBar(bool __value)
indicate whether to display a color bar
JKQTPHorizontalIndependentAxis * getColorBarTopAxis()
object used for color bar axes (top border, red image data)
const JKQTPVerticalIndependentAxis * getColorBarRightAxisR() const
object used for color bar axes (right border, red image data)
bool colorBarTopVisible
top color bar visible
Definition jkqtpimagergb.h:345
QAction * actCopyImage
action that calls copyImagePlotAsImage()
Definition jkqtpimagergb.h:465
double imageNameFontSize
font size in points when displaying imageName
Definition jkqtpimagergb.h:357
void setAutoModifierRange(bool __value)
indicates whether to estimate min/max of the modifier automatically
double modifierMax
modifier value range maximum
Definition jkqtpimagergb.h:420
double getImageNameFontSize() const
font size in points when displaying imageName
void setColorbarsSideBySide(bool __value)
if true the different color bars share the space of a single color bar, if set false each colorbar us...
double getModifierMin() const
modifier value range minimum
double getImageMinB() const
blue image value range minimum
bool getColorBarRightVisible() const
right color bar visible
const JKQTPHorizontalIndependentAxis * getColorBarTopAxisG() const
object used for color bar axes (top border, green image data)
virtual void setData(const void *dataR, const void *dataG, const void *dataB, int Nx, int Ny, JKQTPMathImageDataType datatype)
set the plot-data to a given array data (red), dataG (green), dataB (blue) with size Nx * Ny in row-m...
JKQTPMathImageDataType getDatatypeG() const
datatype of the data array data
void saveImagePlotAsImage(const QString &filename=QString(""), const QByteArray &outputFormat=QByteArray())
save the plotted image as a file with filename and format outputFormat
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
void setColorBarRelativeHeight(double __value)
height of the color bar, as multiple of plotHeight
JKQTPVerticalIndependentAxis * modifierColorBarTopAxis
object used for color bar axes (right border, modifier image data)
Definition jkqtpimagergb.h:433
const JKQTPVerticalIndependentAxis * getColorBarRightAxisB() const
object used for color bar axes (right border, blue image data)
void setImageNameB(const QString &__value)
name of the blue image channel displayed above color bar (may contain LaTeX markup!...
double colorBarRelativeHeight
height of the color bar, as multiple of plotHeight
Definition jkqtpimagergb.h:364
void setRgbMode(JKQTPRGBMathImageRGBMode __value)
how to interpret the three data channels red, green and blue
void setImageMinG(double __value)
green image value range minimum
int getColorBarWidth() const
width of the color bar
QString getImageNameB() const
name of the blue image channel displayed above color bar (may contain LaTeX markup!...
bool getColorbarsSideBySide() const
if true the different color bars share the space of a single color bar, if set false each colorbar us...
const JKQTPHorizontalIndependentAxis * getColorBarTopAxisB() const
object used for color bar axes (top border, blue image data)
double getImageMinG() const
green image value range minimum
void setModifierMin(double __value)
modifier value range minimum
const JKQTPVerticalIndependentAxis * getColorBarRightAxisG() const
object used for color bar axes (right border, green image data)
virtual void setData(const void *dataR, const void *dataG, const void *dataB, int Nx, int Ny)
set the plot-data to a given array data (red), dataG (green), dataB (blue) with size Nx * Ny in row-m...
JKQTPHorizontalIndependentAxis * getColorBarTopAxisG()
object used for color bar axes (top border, green image data)
JKQTPHorizontalIndependentAxis * getColorBarTopAxisB()
object used for color bar axes (top border, blue image data)
virtual void getDataMinMaxB(double &imin, double &imax)
determine min/max data value of the image
double imageMinB
blue image value range minimum
Definition jkqtpimagergb.h:376
double getColorBarRelativeHeight() const
height of the color bar, as multiple of plotHeight
QString imageNameFontName
font name when displaying imageName
Definition jkqtpimagergb.h:355
void setImageNameFontSize(double __value)
font size in points when displaying imageName
void setImageMaxB(double __value)
blue image value range maximum
const void * getDataG() const
points to the data array, holding the image
virtual void setDataR(const void *__value)
points to the data array, holding the image
double imageMinR
red image value range minimum
Definition jkqtpimagergb.h:368
double getImageMaxG() const
green image value range maximum
int colorBarOffset
offset between outside space border and color bar
Definition jkqtpimagergb.h:380
implements a position-indipendent vertical axis, based on JKQTPCoordinateAxis (for most of documentat...
Definition jkqtpcoordinateaxes.h:1053
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
JKQTPRGBMathImageRGBMode
modes available for RGB images
Definition jkqtpbasicimagetools.h:705
JKQTPMathImageDataType
possible datatypes of the data array, plotted by this class.
Definition jkqtpbasicimagetools.h:41
JKQTPMathImageModifierMode
describes how to modify a rendered image with a second data array
Definition jkqtpbasicimagetools.h:1445
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89