2019-02-08 00:24:46 +08:00
/*
Copyright ( c ) 2008 - 2019 Jan W . Krieger
This software is free software : you can redistribute it and / or modify
it under the terms of the GNU Lesser General Public License ( LGPL ) as published by
the Free Software Foundation , either version 2.1 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU Lesser General Public License ( LGPL ) for more details .
You should have received a copy of the GNU Lesser General Public License ( LGPL )
along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef JKQTPGRAPHSIMAGERGB_H
# define JKQTPGRAPHSIMAGERGB_H
# include <QString>
# include <QPainter>
# include <QImage>
# include <QIcon>
# include "jkqtplotter/jkqtpgraphsimage.h"
# include "jkqtplottertools/jkqtptools.h"
# include "jkqtplotter/jkqtpbaseelements.h"
# include "jkqtplottertools/jkqtp_imexport.h"
# include "jkqtplottertools/jkqtpimagetools.h"
/*! \brief class to plot an image from an 2-dimensional array of values
\ ingroup jkqtplotter_imagelots_elements
\ image html rgbimageplots . png
\ image html jkqtplotter_simpletest_rgbimageplot_opencv . png
*/
class JKQTP_LIB_EXPORT JKQTPRGBMathImage : public JKQTPMathImageBase {
Q_OBJECT
public :
using JKQTPMathImageBase : : setData ;
/** \brief class constructor */
JKQTPRGBMathImage ( double x , double y , double width , double height , DataType datatype , void * data , int Nx , int Ny , JKQTBasePlotter * parent = nullptr ) ;
/** \brief class constructor */
JKQTPRGBMathImage ( double x , double y , double width , double height , DataType datatype , void * data , int Nx , int Ny , JKQTPlotter * parent ) ;
/** \brief class constructor */
JKQTPRGBMathImage ( JKQTBasePlotter * parent = nullptr ) ;
/** \brief class constructor */
JKQTPRGBMathImage ( JKQTPlotter * parent ) ;
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2019-04-22 19:27:50 +08:00
/** \copydoc JKQTPImageBase::setParent() */
2019-02-08 00:24:46 +08:00
virtual void setParent ( JKQTBasePlotter * parent ) override ;
2019-04-22 19:27:50 +08:00
/** \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 */
virtual void setData ( void * dataR , void * dataG , void * dataB , int Nx , int Ny , DataType datatype ) ;
/** \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 */
virtual void setData ( void * dataR , void * dataG , void * dataB , int Nx , int Ny ) ;
2019-02-08 00:24:46 +08:00
2019-04-22 19:27:50 +08:00
/** \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 */
virtual void setData ( void * dataR , int Nx , int Ny , DataType datatype ) override ;
/** \brief set the plot-data to a given array \a data (red) with size \a Nx * \a Ny in row-major ordering */
virtual void setData ( void * dataR , int Nx , int Ny ) override ;
2019-02-08 00:24:46 +08:00
/** \brief determine min/max data value of the image */
virtual void getDataMinMax ( double & imin , double & imax ) override ;
2019-04-22 19:27:50 +08:00
/*! \copydoc data
\ see see data for details */
virtual void setDataR ( void * __value ) ;
/*! \copydoc data
\ see see data for details */
void * getDataR ( ) const ;
/*! \copydoc datatype
\ see see datatype for details */
void setDatatypeR ( DataType __value ) ;
/*! \copydoc datatype
\ see see datatype for details */
DataType getDatatypeR ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc dataG
2019-04-22 19:27:50 +08:00
\ see see dataG for details */
virtual void setDataG ( void * __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc dataG
2019-04-22 19:27:50 +08:00
\ see see dataG for details */
void * getDataG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc datatypeG
2019-04-22 19:27:50 +08:00
\ see see datatypeG for details */
void setDatatypeG ( DataType __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc datatypeG
2019-04-22 19:27:50 +08:00
\ see see datatypeG for details */
DataType getDatatypeG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc dataB
\ see see dataB for details */
2019-04-22 19:27:50 +08:00
virtual void setDataB ( void * __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc dataB
\ see see dataB for details */
2019-04-22 19:27:50 +08:00
void * getDataB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc datatypeB
\ see see datatypeB for details */
2019-04-22 19:27:50 +08:00
void setDatatypeB ( DataType __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc datatypeB
\ see see datatypeB for details */
2019-04-22 19:27:50 +08:00
DataType getDatatypeB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc showColorBar
\ see see showColorBar for details */
2019-04-22 19:27:50 +08:00
void setShowColorBar ( bool __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc showColorBar
\ see see showColorBar for details */
2019-04-22 19:27:50 +08:00
bool getShowColorBar ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarWidth
\ see see colorBarWidth for details */
2019-04-22 19:27:50 +08:00
void setColorBarWidth ( int __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarWidth
\ see see colorBarWidth for details */
2019-04-22 19:27:50 +08:00
int getColorBarWidth ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarOffset
\ see see colorBarOffset for details */
2019-04-22 19:27:50 +08:00
void setColorBarOffset ( int __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarOffset
\ see see colorBarOffset for details */
2019-04-22 19:27:50 +08:00
int getColorBarOffset ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarRelativeHeight
\ see see colorBarRelativeHeight for details */
2019-04-22 19:27:50 +08:00
void setColorBarRelativeHeight ( double __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarRelativeHeight
\ see see colorBarRelativeHeight for details */
2019-04-22 19:27:50 +08:00
double getColorBarRelativeHeight ( ) const ;
/*! \copydoc imageMinR
\ see see imageMinR for details */
void setImageMin ( double __value ) ;
/*! \copydoc imageMinR
\ see see imageMinR for details */
double getImageMin ( ) const ;
/*! \copydoc imageMinR
\ see see imageMinR for details */
void setImageMinR ( double m ) ;
/*! \copydoc imageMaxR
\ see see imageMaxR for details */
void setImageMax ( double __value ) ;
/*! \copydoc imageMaxR
\ see see imageMaxR for details */
double getImageMax ( ) const ;
/*! \copydoc imageMaxR
\ see see imageMaxR for details */
void setImageMaxR ( double m ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMinG
\ see see imageMinG for details */
2019-04-22 19:27:50 +08:00
void setImageMinG ( double __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMinG
\ see see imageMinG for details */
2019-04-22 19:27:50 +08:00
double getImageMinG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMaxG
\ see see imageMaxG for details */
2019-04-22 19:27:50 +08:00
void setImageMaxG ( double __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMaxG
\ see see imageMaxG for details */
2019-04-22 19:27:50 +08:00
double getImageMaxG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMinB
\ see see imageMinB for details */
2019-04-22 19:27:50 +08:00
void setImageMinB ( double __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMinB
\ see see imageMinB for details */
2019-04-22 19:27:50 +08:00
double getImageMinB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMaxB
\ see see imageMaxB for details */
2019-04-22 19:27:50 +08:00
void setImageMaxB ( double __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageMaxB
2019-04-22 19:27:50 +08:00
\ see see imageMaxB for details */
double getImageMaxB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc autoImageRange
\ see see autoImageRange for details */
2019-04-22 19:27:50 +08:00
void setAutoImageRange ( bool __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc autoImageRange
\ see see autoImageRange for details */
2019-04-22 19:27:50 +08:00
bool getAutoImageRange ( ) const ;
2019-05-18 02:46:52 +08:00
/*! \copydoc imageNameR
\ see see imageNameR for details */
2019-04-22 19:27:50 +08:00
void setImageName ( const QString & __value ) ;
2019-05-18 02:46:52 +08:00
/*! \copydoc imageNameR
\ see see imageNameR for details */
2019-04-22 19:27:50 +08:00
QString getImageName ( ) const ;
2019-05-18 02:46:52 +08:00
/*! \copydoc imageNameR
\ see see imageNameR for details */
2019-04-22 19:27:50 +08:00
QString getImageNameR ( ) const ;
2019-05-18 02:46:52 +08:00
/*! \copydoc imageNameR
\ see see imageNameR for details */
2019-04-22 19:27:50 +08:00
void setImageNameR ( const QString & m ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameG
\ see see imageNameG for details */
2019-04-22 19:27:50 +08:00
void setImageNameG ( const QString & __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameG
\ see see imageNameG for details */
2019-04-22 19:27:50 +08:00
QString getImageNameG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameB
\ see see imageNameB for details */
2019-04-22 19:27:50 +08:00
void setImageNameB ( const QString & __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameB
\ see see imageNameB for details */
2019-04-22 19:27:50 +08:00
QString getImageNameB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameFontName
\ see see imageNameFontName for details */
2019-04-22 19:27:50 +08:00
void setImageNameFontName ( const QString & __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameFontName
\ see see imageNameFontName for details */
2019-04-22 19:27:50 +08:00
QString getImageNameFontName ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameFontSize
\ see see imageNameFontSize for details */
2019-04-22 19:27:50 +08:00
void setImageNameFontSize ( double __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageNameFontSize
\ see see imageNameFontSize for details */
2019-04-22 19:27:50 +08:00
double getImageNameFontSize ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarRightAxis ( \copybrief colorBarRightAxis ). \details Description of the parameter colorBarRightAxis is: <BLOCKQUOTE>\copydoc colorBarRightAxis </BLOCKQUOTE>. \see colorBarRightAxis for more information */
2019-04-22 19:27:50 +08:00
JKQTPVerticalIndependentAxis * getColorBarRightAxis ( ) ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarTopAxis ( \copybrief colorBarTopAxis ). \details Description of the parameter colorBarTopAxis is: <BLOCKQUOTE>\copydoc colorBarTopAxis </BLOCKQUOTE>. \see colorBarTopAxis for more information */
2019-04-22 19:27:50 +08:00
JKQTPHorizontalIndependentAxis * getColorBarTopAxis ( ) ;
/*! \brief returns the property colorBarRightAxis ( \copybrief colorBarRightAxis ). \details Description of the parameter colorBarRightAxis is: <BLOCKQUOTE>\copydoc colorBarRightAxis </BLOCKQUOTE>. \see colorBarRightAxis for more information */
JKQTPVerticalIndependentAxis * getColorBarRightAxisR ( ) ;
/*! \brief returns the property colorBarTopAxis ( \copybrief colorBarTopAxis ). \details Description of the parameter colorBarTopAxis is: <BLOCKQUOTE>\copydoc colorBarTopAxis </BLOCKQUOTE>. \see colorBarTopAxis for more information */
JKQTPHorizontalIndependentAxis * getColorBarTopAxisR ( ) ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarRightAxisG ( \copybrief colorBarRightAxisG ). \details Description of the parameter colorBarRightAxisG is: <BLOCKQUOTE>\copydoc colorBarRightAxisG </BLOCKQUOTE>. \see colorBarRightAxisG for more information */
2019-04-22 19:27:50 +08:00
JKQTPVerticalIndependentAxis * getColorBarRightAxisG ( ) ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarTopAxisG ( \copybrief colorBarTopAxisG ). \details Description of the parameter colorBarTopAxisG is: <BLOCKQUOTE>\copydoc colorBarTopAxisG </BLOCKQUOTE>. \see colorBarTopAxisG for more information */
2019-04-22 19:27:50 +08:00
JKQTPHorizontalIndependentAxis * getColorBarTopAxisG ( ) ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarRightAxisB ( \copybrief colorBarRightAxisB ). \details Description of the parameter colorBarRightAxisB is: <BLOCKQUOTE>\copydoc colorBarRightAxisB </BLOCKQUOTE>. \see colorBarRightAxisB for more information */
2019-04-22 19:27:50 +08:00
JKQTPVerticalIndependentAxis * getColorBarRightAxisB ( ) ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarTopAxisB ( \copybrief colorBarTopAxisB ). \details Description of the parameter colorBarTopAxisB is: <BLOCKQUOTE>\copydoc colorBarTopAxisB </BLOCKQUOTE>. \see colorBarTopAxisB for more information */
2019-04-22 19:27:50 +08:00
JKQTPHorizontalIndependentAxis * getColorBarTopAxisB ( ) ;
/*! \brief returns the property colorBarRightAxis ( \copybrief colorBarRightAxis ). \details Description of the parameter colorBarRightAxis is: <BLOCKQUOTE>\copydoc colorBarRightAxis </BLOCKQUOTE>. \see colorBarRightAxis for more information */
const JKQTPVerticalIndependentAxis * getColorBarRightAxis ( ) const ;
/*! \brief returns the property colorBarTopAxis ( \copybrief colorBarTopAxis ). \details Description of the parameter colorBarTopAxis is: <BLOCKQUOTE>\copydoc colorBarTopAxis </BLOCKQUOTE>. \see colorBarTopAxis for more information */
const JKQTPHorizontalIndependentAxis * getColorBarTopAxis ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarRightAxis ( \copybrief colorBarRightAxis ). \details Description of the parameter colorBarRightAxis is: <BLOCKQUOTE>\copydoc colorBarRightAxis </BLOCKQUOTE>. \see colorBarRightAxis for more information */
2019-04-22 19:27:50 +08:00
const JKQTPVerticalIndependentAxis * getColorBarRightAxisR ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarTopAxis ( \copybrief colorBarTopAxis ). \details Description of the parameter colorBarTopAxis is: <BLOCKQUOTE>\copydoc colorBarTopAxis </BLOCKQUOTE>. \see colorBarTopAxis for more information */
2019-04-22 19:27:50 +08:00
const JKQTPHorizontalIndependentAxis * getColorBarTopAxisR ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarRightAxisG ( \copybrief colorBarRightAxisG ). \details Description of the parameter colorBarRightAxisG is: <BLOCKQUOTE>\copydoc colorBarRightAxisG </BLOCKQUOTE>. \see colorBarRightAxisG for more information */
2019-04-22 19:27:50 +08:00
const JKQTPVerticalIndependentAxis * getColorBarRightAxisG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarTopAxisG ( \copybrief colorBarTopAxisG ). \details Description of the parameter colorBarTopAxisG is: <BLOCKQUOTE>\copydoc colorBarTopAxisG </BLOCKQUOTE>. \see colorBarTopAxisG for more information */
2019-04-22 19:27:50 +08:00
const JKQTPHorizontalIndependentAxis * getColorBarTopAxisG ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarRightAxisB ( \copybrief colorBarRightAxisB ). \details Description of the parameter colorBarRightAxisB is: <BLOCKQUOTE>\copydoc colorBarRightAxisB </BLOCKQUOTE>. \see colorBarRightAxisB for more information */
2019-04-22 19:27:50 +08:00
const JKQTPVerticalIndependentAxis * getColorBarRightAxisB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \brief returns the property colorBarTopAxisB ( \copybrief colorBarTopAxisB ). \details Description of the parameter colorBarTopAxisB is: <BLOCKQUOTE>\copydoc colorBarTopAxisB </BLOCKQUOTE>. \see colorBarTopAxisB for more information */
2019-04-22 19:27:50 +08:00
const JKQTPHorizontalIndependentAxis * getColorBarTopAxisB ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarTopVisible
\ see see colorBarTopVisible for details */
2019-04-22 19:27:50 +08:00
void setColorBarTopVisible ( bool __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarTopVisible
\ see see colorBarTopVisible for details */
2019-04-22 19:27:50 +08:00
bool getColorBarTopVisible ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarRightVisible
\ see see colorBarRightVisible for details */
2019-04-22 19:27:50 +08:00
void setColorBarRightVisible ( bool __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorBarRightVisible
\ see see colorBarRightVisible for details */
2019-04-22 19:27:50 +08:00
bool getColorBarRightVisible ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorbarsSideBySide
\ see see colorbarsSideBySide for details */
2019-04-22 19:27:50 +08:00
void setColorbarsSideBySide ( bool __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc colorbarsSideBySide
\ see see colorbarsSideBySide for details */
2019-04-22 19:27:50 +08:00
bool getColorbarsSideBySide ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc rgbMode
\ see see rgbMode for details */
2019-04-22 19:27:50 +08:00
void setRgbMode ( JKQTPRGBMathImageRGBMode __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc rgbMode
\ see see rgbMode for details */
2019-04-22 19:27:50 +08:00
JKQTPRGBMathImageRGBMode getRgbMode ( ) const ;
2019-02-08 00:24:46 +08:00
2019-04-22 19:27:50 +08:00
/** \brief return the data of the green channel used for plotting as a QVector<double> in row-major data-ordering */
2019-02-08 00:24:46 +08:00
QVector < double > getDataGAsDoubleVector ( ) const ;
2019-04-22 19:27:50 +08:00
/** \brief return the data of the blue channel used for plotting as a QVector<double> in row-major data-ordering */
2019-02-08 00:24:46 +08:00
QVector < double > getDataBAsDoubleVector ( ) const ;
/*! \brief if the graph plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
\ note If you want to draw outside , then you ' ll also have to implement drawOutside ( )
*/
virtual void getOutsideSize ( JKQTPEnhancedPainter & painter , int & leftSpace , int & rightSpace , int & topSpace , int & bottomSpace ) override ;
/*! \brief plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
\ note If you want to draw outside , then you ' ll also have to implement getOutsideSize ( ) , so enough space is reserved
The four value supplied tell the method where to draw ( inside one of the rectangles ) .
*/
virtual void drawOutside ( JKQTPEnhancedPainter & painter , QRect leftSpace , QRect rightSpace , QRect topSpace , QRect bottomSpace ) override ;
/*! \brief return the plotted image only as a QImage */
virtual QImage drawImage ( ) ;
/** \brief determine min/max data value of the image */
virtual void getDataMinMaxG ( double & imin , double & imax ) ;
/** \brief determine min/max data value of the image */
virtual void getDataMinMaxB ( double & imin , double & imax ) ;
/** \brief return the value (raw data!) of the contained image at the given coordinate */
double getValueAt ( double x , double y , int channel = 0 ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
protected :
void initObject ( ) ;
/** \brief points to the data array, holding the image */
void * dataG ;
/** \brief datatype of the data array data */
DataType datatypeG ;
/** \brief points to the data array, holding the image */
void * dataB ;
/** \brief datatype of the data array data */
DataType datatypeB ;
2019-04-22 19:27:50 +08:00
/** \brief how to interpret the three data channels red, green and blue */
2019-02-08 00:24:46 +08:00
JKQTPRGBMathImageRGBMode rgbMode ;
/** \brief top color bar visible */
bool colorBarTopVisible ;
/** \brief right color bar visible */
bool colorBarRightVisible ;
2019-04-22 19:27:50 +08:00
/** \brief name of the red image channel displayed above color bar (may contain LaTeX markup!) */
QString imageNameR ;
/** \brief name of the green image channel displayed above color bar (may contain LaTeX markup!) */
2019-02-08 00:24:46 +08:00
QString imageNameG ;
2019-04-22 19:27:50 +08:00
/** \brief name of the blue image channel displayed above color bar (may contain LaTeX markup!) */
2019-02-08 00:24:46 +08:00
QString imageNameB ;
/** \brief font name when displaying imageName */
QString imageNameFontName ;
/** \brief font size in points when displaying imageName */
double imageNameFontSize ;
/** \brief indicate whether to display a color bar */
bool showColorBar ;
/** \brief width of the color bar */
int colorBarWidth ;
/** \brief height of the color bar, as multiple of plotHeight */
double colorBarRelativeHeight ;
/** \brief indicates whether to estimate min/max of the image automatically */
bool autoImageRange ;
2019-04-22 19:27:50 +08:00
/** \brief red image value range minimum */
double imageMinR ;
/** \brief red image value range maximum */
double imageMaxR ;
/** \brief green image value range minimum */
2019-02-08 00:24:46 +08:00
double imageMinG ;
2019-04-22 19:27:50 +08:00
/** \brief green image value range maximum */
2019-02-08 00:24:46 +08:00
double imageMaxG ;
2019-04-22 19:27:50 +08:00
/** \brief blue image value range minimum */
2019-02-08 00:24:46 +08:00
double imageMinB ;
2019-04-22 19:27:50 +08:00
/** \brief blue image value range maximum */
2019-02-08 00:24:46 +08:00
double imageMaxB ;
/** \brief offset between outside space border and color bar */
int colorBarOffset ;
/** \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 */
bool colorbarsSideBySide ;
/** \brief object used for color bar axes
*
* \ note this axis has some kind of a special role . It is used to format color bar axes
*/
JKQTPVerticalIndependentAxis * colorBarRightAxis ;
JKQTPHorizontalIndependentAxis * colorBarTopAxis ;
JKQTPVerticalIndependentAxis * colorBarRightAxisG ;
JKQTPHorizontalIndependentAxis * colorBarTopAxisG ;
JKQTPVerticalIndependentAxis * colorBarRightAxisB ;
JKQTPHorizontalIndependentAxis * colorBarTopAxisB ;
double internalDataMinG ;
double internalDataMaxG ;
double internalDataMinB ;
double internalDataMaxB ;
protected :
2019-04-22 19:27:50 +08:00
/** \brief action that calls saveImagePlotAsImage() */
2019-02-08 00:24:46 +08:00
QAction * actSaveImage ;
2019-04-22 19:27:50 +08:00
/** \brief action that calls copyImagePlotAsImage() */
2019-02-08 00:24:46 +08:00
QAction * actCopyImage ;
public :
2019-04-22 19:27:50 +08:00
/** \copydoc JKQTPImageBase::setTitle() */
2019-02-08 00:24:46 +08:00
virtual void setTitle ( const QString & title ) override ;
public slots :
2019-04-22 19:27:50 +08:00
/** \brief save the plotted image as a file with \a filename and format \a outputFormat */
2019-02-08 00:24:46 +08:00
void saveImagePlotAsImage ( const QString & filename = QString ( " " ) , const QByteArray & outputFormat = QByteArray ( ) ) ;
2019-04-22 19:27:50 +08:00
/** \brief copy the plotted image as an image into the clipboard */
2019-02-08 00:24:46 +08:00
void copyImagePlotAsImage ( ) ;
} ;
/*! \brief like JKQTPRGBMathImage but reads images from columns of the datastore
\ ingroup jkqtplotter_imagelots_elements
\ image html rgbimageplots . png
2019-02-10 05:17:01 +08:00
2019-02-08 00:24:46 +08:00
\ image html jkqtplotter_simpletest_rgbimageplot_opencv . png
2019-02-10 05:17:01 +08:00
\ image html jkqtplotter_simpletest_rgbimageplot . png
\ see Examples : \ ref JKQTPlotterRGBImagePlot and \ ref JKQTPlotterImagePlotRGBOpenCV
2019-02-08 00:24:46 +08:00
*/
class JKQTP_LIB_EXPORT JKQTPColumnRGBMathImage : public JKQTPRGBMathImage {
Q_OBJECT
public :
/** \brief class constructor */
JKQTPColumnRGBMathImage ( JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int Nx , int Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int Nx , int Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , int Nx , int Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , int imageBColumn , int Nx , int Ny , JKQTBasePlotter * parent = nullptr ) ;
/** \brief class constructor */
JKQTPColumnRGBMathImage ( JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int Nx , int Ny , JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int Nx , int Ny , JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , int Nx , int Ny , JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , int imageBColumn , int Nx , int Ny , JKQTPlotter * parent ) ;
/*! \copydoc imageRColumn
\ see see imageRColumn for details */
2019-04-22 19:27:50 +08:00
virtual void setImageRColumn ( int __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageRColumn
\ see see imageRColumn for details */
2019-04-22 19:27:50 +08:00
int getImageRColumn ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageGColumn
\ see see imageGColumn for details */
2019-04-22 19:27:50 +08:00
virtual void setImageGColumn ( int __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageGColumn
\ see see imageGColumn for details */
2019-04-22 19:27:50 +08:00
int getImageGColumn ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageBColumn
\ see see imageBColumn for details */
2019-04-22 19:27:50 +08:00
virtual void setImageBColumn ( int __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc imageBColumn
\ see see imageBColumn for details */
2019-04-22 19:27:50 +08:00
int getImageBColumn ( ) const ;
2019-02-08 00:24:46 +08:00
/*! \copydoc modifierColumn
\ see see modifierColumn for details */
2019-04-22 19:27:50 +08:00
virtual void setModifierColumn ( int __value ) ;
2019-02-08 00:24:46 +08:00
/*! \copydoc modifierColumn
\ see see modifierColumn for details */
2019-04-22 19:27:50 +08:00
int getModifierColumn ( ) const ;
2019-02-08 00:24:46 +08:00
/** \copydoc JKQTPGraph::usesColumn() */
virtual bool usesColumn ( int c ) const override ;
protected :
/** \brief image column for R channel */
int imageRColumn ;
/** \brief image column for G channel */
int imageGColumn ;
/** \brief image column for B channel */
int imageBColumn ;
/** \brief column containing the modifier image */
int modifierColumn ;
void ensureImageData ( ) override ;
} ;
# endif // JKQTPGRAPHSIMAGERGB_H