2015-07-11 18:56:02 +08:00
/*
2019-01-12 23:01:55 +08:00
Copyright ( c ) 2008 - 2019 Jan W . Krieger & Sebastian Isbaner ( contour plot )
2015-07-11 18:56:02 +08:00
2015-07-12 22:34:27 +08:00
2015-07-11 18:56:02 +08:00
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 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/>.
*/
2018-12-19 00:13:18 +08:00
# ifndef jkqtpgraphsimage_H
# define jkqtpgraphsimage_H
2015-07-11 18:56:02 +08:00
2018-12-19 00:13:18 +08:00
/** \file jkqtpgraphsimage.h
2019-01-13 01:53:16 +08:00
* \ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
*/
# include <QString>
# include <QPainter>
# include <QImage>
# include <QIcon>
2018-12-19 00:13:18 +08:00
# include "jkqtplotter/jkqtpgraphs.h"
2018-11-26 03:25:44 +08:00
# include "jkqtplottertools/jkqtptools.h"
# include "jkqtplotter/jkqtpbaseelements.h"
# include "jkqtplottertools/jkqtp_imexport.h"
2018-12-19 00:13:18 +08:00
# include "jkqtplottertools/jkqtpimagetools.h"
2015-07-11 18:56:02 +08:00
/*! \brief base class for plotting an image
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
*/
2019-01-20 17:49:29 +08:00
class LIB_EXPORT JKQTPImageBase : public JKQTPGraph {
2015-07-11 18:56:02 +08:00
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPImageBase ( JKQTBasePlotter * parent = nullptr ) ;
2015-07-11 18:56:02 +08:00
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPImageBase ( double x , double y , double width , double height , JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPImageBase ( JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPImageBase ( double x , double y , double width , double height , JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots a key marker inside the specified rectangle \a rect */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
/** \brief get the maximum and minimum x-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +08:00
/** \brief get the maximum and minimum y-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
2018-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2015-07-11 18:56:02 +08:00
/** \brief returns the color to be used for the key label */
2018-12-28 05:52:00 +08:00
virtual QColor getKeyLabelColor ( ) override ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property x to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter x is : < BLOCKQUOTE > \ copydoc x < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see x for more information */
inline virtual void set_x ( double __value )
{
this - > x = __value ;
}
/*! \brief returns the property x.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter x is : < BLOCKQUOTE > \ copydoc x < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see x for more information */
inline virtual double get_x ( ) const
{
return this - > x ;
}
/*! \brief sets the property y to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter y is : < BLOCKQUOTE > \ copydoc y < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see y for more information */
inline virtual void set_y ( double __value )
{
this - > y = __value ;
}
/*! \brief returns the property y.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter y is : < BLOCKQUOTE > \ copydoc y < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see y for more information */
inline virtual double get_y ( ) const
{
return this - > y ;
}
/*! \brief sets the property width to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter width is : < BLOCKQUOTE > \ copydoc width < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see width for more information */
inline virtual void set_width ( double __value )
{
this - > width = __value ;
}
/*! \brief returns the property width.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter width is : < BLOCKQUOTE > \ copydoc width < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see width for more information */
inline virtual double get_width ( ) const
{
return this - > width ;
}
/*! \brief sets the property height to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter height is : < BLOCKQUOTE > \ copydoc height < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see height for more information */
inline virtual void set_height ( double __value )
{
this - > height = __value ;
}
/*! \brief returns the property height.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter height is : < BLOCKQUOTE > \ copydoc height < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see height for more information */
inline virtual double get_height ( ) const
{
return this - > height ;
}
2015-07-11 18:56:02 +08:00
protected :
/** \brief x coordinate of lower left corner */
double x ;
/** \brief y coordinate of lower left corner */
double y ;
/** \brief width of image */
double width ;
/** \brief height of image */
double height ;
/*! \brief plot the given QImage onto the widget where the QImage fills the area defined by x, y (lower left corner) and width, height
in the simplest case your implementation of draw ( ) will call
< code > plotImage ( painter , image , this - > x , this - > y , this - > width , this - > height ) ; < / code >
*/
virtual void plotImage ( JKQTPEnhancedPainter & painter , QImage & image , double x , double y , double width , double height ) ;
} ;
/*! \brief base class to hold an image from an 2-dimensional array of values
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
\ image html jkqtplotter_simpletest_imageplot . png
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPMathImageBase : public JKQTPImageBase {
Q_OBJECT
public :
/** \brief possible datatypes of the data array, plotted by this class. */
enum DataType {
FloatArray ,
DoubleArray ,
UInt8Array ,
UInt16Array ,
UInt32Array ,
UInt64Array ,
Int8Array ,
Int16Array ,
Int32Array ,
Int64Array
} ;
enum ModifierMode {
ModifyNone = 0 ,
ModifyValue = 1 ,
ModifySaturation = 2 ,
ModifyAlpha = 3
} ;
static ModifierMode StringToModifierMode ( const QString & mode ) {
QString m = mode . toLower ( ) ;
if ( m = = " value " ) return ModifyValue ;
if ( m = = " saturation " ) return ModifySaturation ;
if ( m = = " alpha " ) return ModifyAlpha ;
return ModifyNone ;
}
static QString ModifierModeToString ( const ModifierMode & mode ) {
if ( mode = = ModifyValue ) return " value " ;
if ( mode = = ModifySaturation ) return " saturation " ;
if ( mode = = ModifyAlpha ) return " alpha " ;
return " none " ;
}
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPMathImageBase ( JKQTBasePlotter * parent = nullptr ) ;
JKQTPMathImageBase ( double x , double y , double width , double height , JKQTBasePlotter * parent = nullptr ) ;
JKQTPMathImageBase ( double x , double y , double width , double height , DataType datatype , void * data , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
2015-07-11 18:56:02 +08:00
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPMathImageBase ( JKQTPlotter * parent ) ;
JKQTPMathImageBase ( double x , double y , double width , double height , JKQTPlotter * parent = nullptr ) ;
JKQTPMathImageBase ( double x , double y , double width , double height , DataType datatype , void * data , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
2015-07-11 18:56:02 +08:00
/** \brief plots a key marker inside the specified rectangle \a rect */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property Nx to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Nx is : < BLOCKQUOTE > \ copydoc Nx < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Nx for more information */
inline virtual void set_Nx ( uint32_t __value )
{
this - > Nx = __value ;
}
/*! \brief returns the property Nx.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Nx is : < BLOCKQUOTE > \ copydoc Nx < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Nx for more information */
inline virtual uint32_t get_Nx ( ) const
{
return this - > Nx ;
}
/*! \brief sets the property Ny to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Ny is : < BLOCKQUOTE > \ copydoc Ny < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Ny for more information */
inline virtual void set_Ny ( uint32_t __value )
{
this - > Ny = __value ;
}
/*! \brief returns the property Ny.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Ny is : < BLOCKQUOTE > \ copydoc Ny < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Ny for more information */
inline virtual uint32_t get_Ny ( ) const
{
return this - > Ny ;
}
/*! \brief sets the property data to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter data is : < BLOCKQUOTE > \ copydoc data < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see data for more information */
inline virtual void set_data ( void * __value )
{
this - > data = __value ;
}
/*! \brief returns the property data.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter data is : < BLOCKQUOTE > \ copydoc data < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see data for more information */
inline virtual void * get_data ( ) const
{
return this - > data ;
}
/*! \brief sets the property datatype to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatype is : < BLOCKQUOTE > \ copydoc datatype < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatype for more information */
inline virtual void set_datatype ( const DataType & __value )
{
this - > datatype = __value ;
}
/*! \brief returns the property datatype.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatype is : < BLOCKQUOTE > \ copydoc datatype < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatype for more information */
inline virtual DataType get_datatype ( ) const
{
return this - > datatype ;
}
/*! \brief sets the property dataModifier to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter dataModifier is : < BLOCKQUOTE > \ copydoc dataModifier < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see dataModifier for more information */
inline virtual void set_dataModifier ( void * __value )
{
this - > dataModifier = __value ;
}
/*! \brief returns the property dataModifier.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter dataModifier is : < BLOCKQUOTE > \ copydoc dataModifier < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see dataModifier for more information */
inline virtual void * get_dataModifier ( ) const
{
return this - > dataModifier ;
}
/*! \brief sets the property datatypeModifier to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatypeModifier is : < BLOCKQUOTE > \ copydoc datatypeModifier < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatypeModifier for more information */
inline virtual void set_datatypeModifier ( const DataType & __value )
{
this - > datatypeModifier = __value ;
}
/*! \brief returns the property datatypeModifier.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatypeModifier is : < BLOCKQUOTE > \ copydoc datatypeModifier < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatypeModifier for more information */
inline virtual DataType get_datatypeModifier ( ) const
{
return this - > datatypeModifier ;
}
/*! \brief sets the property modifierMode to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierMode is : < BLOCKQUOTE > \ copydoc modifierMode < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierMode for more information */
inline virtual void set_modifierMode ( const ModifierMode & __value )
{
this - > modifierMode = __value ;
}
/*! \brief returns the property modifierMode.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierMode is : < BLOCKQUOTE > \ copydoc modifierMode < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierMode for more information */
inline virtual ModifierMode get_modifierMode ( ) const
{
return this - > modifierMode ;
}
2015-07-11 18:56:02 +08:00
virtual void set_dataModifier ( void * data , DataType datatype ) ;
virtual void set_data ( void * data , uint32_t Nx , uint32_t Ny , DataType datatype ) ;
virtual void set_data ( void * data , uint32_t Nx , uint32_t Ny ) ;
/** \brief determine min/max data value of the image */
virtual void getDataMinMax ( double & imin , double & imax ) ;
/** \brief determine min/max data value of the image */
virtual void getModifierMinMax ( double & imin , double & imax ) ;
QVector < double > getDataAsDoubleVector ( ) const ;
QVector < double > getDataModifierAsDoubleVector ( ) const ;
protected :
/** \brief points to the data array, holding the image */
void * data ;
/** \brief datatype of the data array data */
DataType datatype ;
2019-01-20 23:15:10 +08:00
/** \brief width of the data array data in pt */
2015-07-11 18:56:02 +08:00
uint32_t Nx ;
2019-01-20 23:15:10 +08:00
/** \brief height of the data array data in pt */
2015-07-11 18:56:02 +08:00
uint32_t Ny ;
/** \brief points to the data array, holding the modifier image */
void * dataModifier ;
/** \brief datatype of the data array data */
DataType datatypeModifier ;
ModifierMode modifierMode ;
double internalDataMin ;
double internalDataMax ;
double internalModifierMin ;
double internalModifierMax ;
/** \brief overwrite this to fill the data poiters before they are accessed (e.g. to load data from a column in the datastore */
virtual void ensureImageData ( ) ;
void modifyImage ( QImage & img ) ;
void modifyImage ( QImage & img , void * dataModifier , DataType datatypeModifier , uint32_t Nx , uint32_t Ny , double internalModifierMin , double internalModifierMax ) ;
} ;
/*! \brief class to plot an image from a QImage object
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
2019-01-13 01:53:16 +08:00
\ image html jkqtplotter_simpletest_rgbimageplot_qt
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPImage : public JKQTPImageBase {
Q_OBJECT
public :
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPImage ( JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPImage ( JKQTPlotter * parent ) ;
2018-12-07 01:19:02 +08:00
/** \brief class constructor, which points to an external image (not owned by this object!!!) */
2019-01-20 17:49:29 +08:00
JKQTPImage ( double x , double y , double width , double height , QImage * image , JKQTBasePlotter * parent = nullptr ) ;
2018-12-07 01:19:02 +08:00
/** \brief class constructor, which points to an external image (not owned by this object!!!) */
2019-01-20 23:15:10 +08:00
JKQTPImage ( double x , double y , double width , double height , QImage * image , JKQTPlotter * parent ) ;
2018-12-07 01:19:02 +08:00
/** \brief class constructor, which generates an internal image object, by copying \a image */
2019-01-20 17:49:29 +08:00
JKQTPImage ( double x , double y , double width , double height , const QImage & image , JKQTBasePlotter * parent = nullptr ) ;
2018-12-07 01:19:02 +08:00
/** \brief class constructor, which generates an internal image object, by copying \a image */
2019-01-20 23:15:10 +08:00
JKQTPImage ( double x , double y , double width , double height , const QImage & image , JKQTPlotter * parent ) ;
2018-12-07 01:19:02 +08:00
2018-12-28 05:52:00 +08:00
virtual ~ JKQTPImage ( ) override ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief plots a key marker inside the specified rectangle \a rect */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
2018-12-07 01:19:02 +08:00
/** \brief copy an external image into an internally owned copy */
virtual void set_image ( const QImage & image ) ;
/** \brief set an external image to be plotted, the image will NOT BE OWNED by the graph-object */
virtual void set_image ( QImage * image ) ;
2015-07-11 18:56:02 +08:00
2018-12-07 01:19:02 +08:00
/** \brief deletes the internal image */
void clear_image ( ) ;
2015-07-11 18:56:02 +08:00
2019-01-25 05:49:10 +08:00
/*! \brief returns the property image. \details Description of the parameter image is: <BLOCKQUOTE>\copydoc image </BLOCKQUOTE>. \see image for more information */
2019-01-09 04:00:25 +08:00
inline QImage * get_image ( ) const { return this - > image ; }
2015-07-11 18:56:02 +08:00
protected :
2018-12-07 01:19:02 +08:00
/** \brief the image to be plotted. This is freed by the destructor, iff \a image_owned is set to \c true (.e.g by QImage-copy-constructors) */
2015-07-11 18:56:02 +08:00
QImage * image ;
2018-12-07 01:19:02 +08:00
/** \brief indicates that the image \a image is owned by this object (i.e. freed, when the object is destroyed) */
bool image_owned ;
2015-07-11 18:56:02 +08:00
2015-08-02 19:36:54 +08:00
void createImageActions ( ) ;
2015-07-11 18:56:02 +08:00
protected :
QAction * actSaveImage ;
QAction * actCopyImage ;
public :
2019-01-20 17:49:29 +08:00
virtual void setParent ( JKQTBasePlotter * parent ) override ;
2019-01-10 04:23:24 +08:00
virtual void set_title ( const QString & title ) override ;
2015-07-11 18:56:02 +08:00
public slots :
void saveImagePlotAsImage ( const QString & filename = QString ( " " ) , const QByteArray & outputFormat = QByteArray ( ) ) ;
void copyImagePlotAsImage ( ) ;
} ;
/*! \brief class to plot an image from an 2-dimensional array of values
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
2019-01-13 01:53:16 +08:00
\ image html jkqtplotter_simpletest_imageplot . png
\ image html jkqtplotter_simpletest_imageplot_modifier . png
\ image html jkqtplotter_simpletest_imageplot__smallscaletransparent . png
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPMathImage : public JKQTPMathImageBase {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPMathImage ( double x , double y , double width , double height , DataType datatype , void * data , uint32_t Nx , uint32_t Ny , JKQTPMathImageColorPalette palette = JKQTPMathImageGRAY , JKQTBasePlotter * parent = nullptr ) ;
JKQTPMathImage ( JKQTBasePlotter * parent = nullptr ) ;
2019-01-20 23:15:10 +08:00
JKQTPMathImage ( double x , double y , double width , double height , DataType datatype , void * data , uint32_t Nx , uint32_t Ny , JKQTPMathImageColorPalette palette , JKQTPlotter * parent ) ;
JKQTPMathImage ( JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
virtual void setParent ( JKQTBasePlotter * parent ) override ;
2015-07-11 18:56:02 +08:00
/*! \brief get list with all available palettes */
static QStringList getPalettes ( ) ;
/*! \brief get list with all available palettes */
static int getPalettesCount ( ) ;
/*! \brief get QIcon representing the given palette */
static QIcon getPaletteIcon ( int i ) ;
/*! \brief get QIcon representing the given palette */
static QIcon getPaletteIcon ( JKQTPMathImageColorPalette palette ) ;
2018-11-29 06:10:14 +08:00
/*! \brief get QImage representing the given palette */
2015-08-05 20:27:09 +08:00
static QImage getPaletteImage ( int i , int width , int height = 1 ) ;
2018-11-29 06:10:14 +08:00
/*! \brief get QImage representing the given palette */
2015-08-05 20:27:09 +08:00
static QImage getPaletteImage ( JKQTPMathImageColorPalette palette , int width , int height = 1 ) ;
2015-07-11 18:56:02 +08:00
/*! \brief get QIcon representing the given palette */
static QIcon getPaletteKeyIcon ( int i ) ;
/*! \brief get QIcon representing the given palette */
static QIcon getPaletteKeyIcon ( JKQTPMathImageColorPalette palette ) ;
2018-11-29 06:10:14 +08:00
/*! \brief get QImage representing the given palette */
2015-07-11 18:56:02 +08:00
static QImage getPaletteKeyImage ( int i , int width , int height ) ;
2018-11-29 06:10:14 +08:00
/*! \brief get QImage representing the given palette */
2015-07-11 18:56:02 +08:00
static QImage getPaletteKeyImage ( JKQTPMathImageColorPalette palette , int width , int height ) ;
2019-01-10 04:23:24 +08:00
/*! \brief sets the property palette to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter palette is : < BLOCKQUOTE > \ copydoc palette < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see palette for more information */
inline virtual void set_palette ( const JKQTPMathImageColorPalette & __value )
{
this - > palette = __value ;
}
/*! \brief returns the property palette.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter palette is : < BLOCKQUOTE > \ copydoc palette < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see palette for more information */
inline virtual JKQTPMathImageColorPalette get_palette ( ) const
{
return this - > palette ;
}
/*! \brief sets the property rangeMinFailAction to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMinFailAction is : < BLOCKQUOTE > \ copydoc rangeMinFailAction < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMinFailAction for more information */
inline virtual void set_rangeMinFailAction ( const JKQTPMathImageColorRangeFailAction & __value )
{
this - > rangeMinFailAction = __value ;
}
/*! \brief returns the property rangeMinFailAction.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMinFailAction is : < BLOCKQUOTE > \ copydoc rangeMinFailAction < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMinFailAction for more information */
2019-01-26 03:16:04 +08:00
inline virtual JKQTPMathImageColorRangeFailAction getAction_rangeMinFail ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > rangeMinFailAction ;
}
/*! \brief sets the property rangeMaxFailAction to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMaxFailAction is : < BLOCKQUOTE > \ copydoc rangeMaxFailAction < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMaxFailAction for more information */
inline virtual void set_rangeMaxFailAction ( const JKQTPMathImageColorRangeFailAction & __value )
{
this - > rangeMaxFailAction = __value ;
}
/*! \brief returns the property rangeMaxFailAction.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMaxFailAction is : < BLOCKQUOTE > \ copydoc rangeMaxFailAction < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMaxFailAction for more information */
2019-01-26 03:16:04 +08:00
inline virtual JKQTPMathImageColorRangeFailAction getAction_rangeMaxFail ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > rangeMaxFailAction ;
}
/*! \brief sets the property rangeMinFailColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMinFailColor is : < BLOCKQUOTE > \ copydoc rangeMinFailColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMinFailColor for more information */
inline virtual void set_rangeMinFailColor ( const QColor & __value )
{
this - > rangeMinFailColor = __value ;
}
/*! \brief returns the property rangeMinFailColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMinFailColor is : < BLOCKQUOTE > \ copydoc rangeMinFailColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMinFailColor for more information */
inline virtual QColor get_rangeMinFailColor ( ) const
{
return this - > rangeMinFailColor ;
}
/*! \brief sets the property rangeMaxFailColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMaxFailColor is : < BLOCKQUOTE > \ copydoc rangeMaxFailColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMaxFailColor for more information */
inline virtual void set_rangeMaxFailColor ( const QColor & __value )
{
this - > rangeMaxFailColor = __value ;
}
/*! \brief returns the property rangeMaxFailColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rangeMaxFailColor is : < BLOCKQUOTE > \ copydoc rangeMaxFailColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rangeMaxFailColor for more information */
inline virtual QColor get_rangeMaxFailColor ( ) const
{
return this - > rangeMaxFailColor ;
}
/*! \brief sets the property nanColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter nanColor is : < BLOCKQUOTE > \ copydoc nanColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see nanColor for more information */
inline virtual void set_nanColor ( const QColor & __value )
{
this - > nanColor = __value ;
}
/*! \brief returns the property nanColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter nanColor is : < BLOCKQUOTE > \ copydoc nanColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see nanColor for more information */
inline virtual QColor get_nanColor ( ) const
{
return this - > nanColor ;
}
/*! \brief sets the property infColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter infColor is : < BLOCKQUOTE > \ copydoc infColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see infColor for more information */
inline virtual void set_infColor ( const QColor & __value )
{
this - > infColor = __value ;
}
/*! \brief returns the property infColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter infColor is : < BLOCKQUOTE > \ copydoc infColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see infColor for more information */
inline virtual QColor get_infColor ( ) const
{
return this - > infColor ;
}
/*! \brief sets the property showColorBar to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter showColorBar is : < BLOCKQUOTE > \ copydoc showColorBar < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see showColorBar for more information */
2019-01-26 03:16:04 +08:00
inline virtual void setShowColorBar ( bool __value )
2019-01-10 04:23:24 +08:00
{
this - > showColorBar = __value ;
}
/*! \brief returns the property showColorBar.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter showColorBar is : < BLOCKQUOTE > \ copydoc showColorBar < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see showColorBar for more information */
2019-01-26 03:16:04 +08:00
inline virtual bool getShowColorBar ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > showColorBar ;
}
/*! \brief sets the property colorBarWidth to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarWidth is : < BLOCKQUOTE > \ copydoc colorBarWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarWidth for more information */
inline virtual void set_colorBarWidth ( int __value )
{
this - > colorBarWidth = __value ;
}
/*! \brief returns the property colorBarWidth.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarWidth is : < BLOCKQUOTE > \ copydoc colorBarWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarWidth for more information */
inline virtual int get_colorBarWidth ( ) const
{
return this - > colorBarWidth ;
}
/*! \brief sets the property colorBarModifiedWidth to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarModifiedWidth is : < BLOCKQUOTE > \ copydoc colorBarModifiedWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarModifiedWidth for more information */
inline virtual void set_colorBarModifiedWidth ( int __value )
{
this - > colorBarModifiedWidth = __value ;
}
/*! \brief returns the property colorBarModifiedWidth.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarModifiedWidth is : < BLOCKQUOTE > \ copydoc colorBarModifiedWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarModifiedWidth for more information */
inline virtual int get_colorBarModifiedWidth ( ) const
{
return this - > colorBarModifiedWidth ;
}
/*! \brief sets the property colorBarOffset to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarOffset is : < BLOCKQUOTE > \ copydoc colorBarOffset < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarOffset for more information */
inline virtual void set_colorBarOffset ( int __value )
{
this - > colorBarOffset = __value ;
}
/*! \brief returns the property colorBarOffset.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarOffset is : < BLOCKQUOTE > \ copydoc colorBarOffset < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarOffset for more information */
inline virtual int get_colorBarOffset ( ) const
{
return this - > colorBarOffset ;
}
/*! \brief sets the property colorBarRelativeHeight to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRelativeHeight is : < BLOCKQUOTE > \ copydoc colorBarRelativeHeight < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRelativeHeight for more information */
inline virtual void set_colorBarRelativeHeight ( double __value )
{
this - > colorBarRelativeHeight = __value ;
}
/*! \brief returns the property colorBarRelativeHeight.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRelativeHeight is : < BLOCKQUOTE > \ copydoc colorBarRelativeHeight < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRelativeHeight for more information */
inline virtual double get_colorBarRelativeHeight ( ) const
{
return this - > colorBarRelativeHeight ;
}
/*! \brief sets the property imageMin to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMin is : < BLOCKQUOTE > \ copydoc imageMin < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMin for more information */
inline virtual void set_imageMin ( double __value )
{
this - > imageMin = __value ;
}
/*! \brief returns the property imageMin.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMin is : < BLOCKQUOTE > \ copydoc imageMin < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMin for more information */
inline virtual double get_imageMin ( ) const
{
return this - > imageMin ;
}
/*! \brief sets the property imageMax to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMax is : < BLOCKQUOTE > \ copydoc imageMax < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMax for more information */
inline virtual void set_imageMax ( double __value )
{
this - > imageMax = __value ;
}
/*! \brief returns the property imageMax.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMax is : < BLOCKQUOTE > \ copydoc imageMax < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMax for more information */
inline virtual double get_imageMax ( ) const
{
return this - > imageMax ;
}
/*! \brief sets the property autoImageRange to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoImageRange is : < BLOCKQUOTE > \ copydoc autoImageRange < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoImageRange for more information */
inline virtual void set_autoImageRange ( bool __value )
{
this - > autoImageRange = __value ;
}
/*! \brief returns the property autoImageRange.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoImageRange is : < BLOCKQUOTE > \ copydoc autoImageRange < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoImageRange for more information */
inline virtual bool get_autoImageRange ( ) const
{
return this - > autoImageRange ;
}
/*! \brief sets the property imageName to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageName is : < BLOCKQUOTE > \ copydoc imageName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageName for more information */
inline virtual void set_imageName ( const QString & __value )
{
this - > imageName = __value ;
}
/*! \brief returns the property imageName.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageName is : < BLOCKQUOTE > \ copydoc imageName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageName for more information */
inline virtual QString get_imageName ( ) const
{
return this - > imageName ;
}
/*! \brief sets the property imageNameFontName to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontName is : < BLOCKQUOTE > \ copydoc imageNameFontName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontName for more information */
inline virtual void set_imageNameFontName ( const QString & __value )
{
this - > imageNameFontName = __value ;
}
/*! \brief returns the property imageNameFontName.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontName is : < BLOCKQUOTE > \ copydoc imageNameFontName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontName for more information */
inline virtual QString get_imageNameFontName ( ) const
{
return this - > imageNameFontName ;
}
/*! \brief sets the property imageNameFontSize to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontSize is : < BLOCKQUOTE > \ copydoc imageNameFontSize < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontSize for more information */
inline virtual void set_imageNameFontSize ( double __value )
{
this - > imageNameFontSize = __value ;
}
/*! \brief returns the property imageNameFontSize.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontSize is : < BLOCKQUOTE > \ copydoc imageNameFontSize < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontSize for more information */
inline virtual double get_imageNameFontSize ( ) const
{
return this - > imageNameFontSize ;
}
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarRightAxis. \details Description of the parameter colorBarRightAxis is: <BLOCKQUOTE>\copydoc colorBarRightAxis </BLOCKQUOTE>. \see colorBarRightAxis for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPVerticalIndependentAxis * get_colorBarRightAxis ( ) const { return this - > colorBarRightAxis ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarTopAxis. \details Description of the parameter colorBarTopAxis is: <BLOCKQUOTE>\copydoc colorBarTopAxis </BLOCKQUOTE>. \see colorBarTopAxis for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPHorizontalIndependentAxis * get_colorBarTopAxis ( ) const { return this - > colorBarTopAxis ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property modifierColorBarTopAxis. \details Description of the parameter modifierColorBarTopAxis is: <BLOCKQUOTE>\copydoc modifierColorBarTopAxis </BLOCKQUOTE>. \see modifierColorBarTopAxis for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPVerticalIndependentAxis * get_modifierColorBarTopAxis ( ) const { return this - > modifierColorBarTopAxis ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property modifierColorBarRightAxis . \details Description of the parameter modifierColorBarRightAxis is: <BLOCKQUOTE>\copydoc modifierColorBarRightAxis </BLOCKQUOTE>. \see modifierColorBarRightAxis for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPHorizontalIndependentAxis * get_modifierColorBarRightAxis ( ) const { return this - > modifierColorBarRightAxis ; }
2019-01-10 04:23:24 +08:00
/*! \brief sets the property colorBarTopVisible to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarTopVisible is : < BLOCKQUOTE > \ copydoc colorBarTopVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarTopVisible for more information */
inline virtual void set_colorBarTopVisible ( bool __value )
{
this - > colorBarTopVisible = __value ;
}
/*! \brief returns the property colorBarTopVisible.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarTopVisible is : < BLOCKQUOTE > \ copydoc colorBarTopVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarTopVisible for more information */
inline virtual bool get_colorBarTopVisible ( ) const
{
return this - > colorBarTopVisible ;
}
/*! \brief sets the property colorBarRightVisible to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRightVisible is : < BLOCKQUOTE > \ copydoc colorBarRightVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRightVisible for more information */
inline virtual void set_colorBarRightVisible ( bool __value )
{
this - > colorBarRightVisible = __value ;
}
/*! \brief returns the property colorBarRightVisible.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRightVisible is : < BLOCKQUOTE > \ copydoc colorBarRightVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRightVisible for more information */
inline virtual bool get_colorBarRightVisible ( ) const
{
return this - > colorBarRightVisible ;
}
/*! \brief sets the property autoModifierRange to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoModifierRange is : < BLOCKQUOTE > \ copydoc autoModifierRange < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoModifierRange for more information */
inline virtual void set_autoModifierRange ( bool __value )
{
this - > autoModifierRange = __value ;
}
/*! \brief returns the property autoModifierRange.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoModifierRange is : < BLOCKQUOTE > \ copydoc autoModifierRange < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoModifierRange for more information */
inline virtual bool get_autoModifierRange ( ) const
{
return this - > autoModifierRange ;
}
/*! \brief sets the property modifierMin to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierMin is : < BLOCKQUOTE > \ copydoc modifierMin < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierMin for more information */
inline virtual void set_modifierMin ( double __value )
{
this - > modifierMin = __value ;
}
/*! \brief returns the property modifierMin.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierMin is : < BLOCKQUOTE > \ copydoc modifierMin < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierMin for more information */
inline virtual double get_modifierMin ( ) const
{
return this - > modifierMin ;
}
/*! \brief sets the property modifierMax to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierMax is : < BLOCKQUOTE > \ copydoc modifierMax < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierMax for more information */
inline virtual void set_modifierMax ( double __value )
{
this - > modifierMax = __value ;
}
/*! \brief returns the property modifierMax.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierMax is : < BLOCKQUOTE > \ copydoc modifierMax < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierMax for more information */
inline virtual double get_modifierMax ( ) const
{
return this - > modifierMax ;
}
2015-07-11 18:56:02 +08:00
void set_palette ( int pal ) ;
/*! \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 ( )
*/
2018-12-28 05:52:00 +08:00
virtual void getOutsideSize ( JKQTPEnhancedPainter & painter , int & leftSpace , int & rightSpace , int & topSpace , int & bottomSpace ) override ;
2015-07-11 18:56:02 +08:00
/*! \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 ) .
*/
2018-12-28 05:52:00 +08:00
virtual void drawOutside ( JKQTPEnhancedPainter & painter , QRect leftSpace , QRect rightSpace , QRect topSpace , QRect bottomSpace ) override ;
2015-07-11 18:56:02 +08:00
2015-08-05 20:27:09 +08:00
/*! \brief returns a QImage, which contains the plaette drawn outside the plot. \a steps is the number of data-setps (and the size of the output image) used for the palette image. */
virtual QImage drawOutsidePalette ( int steps = 200 ) ;
2015-07-11 18:56:02 +08:00
/*! \brief return the plotted image only as a QImage */
virtual QImage drawImage ( ) ;
/** \brief determine min/max data value of the image */
2018-12-28 05:52:00 +08:00
virtual void getDataMinMax ( double & imin , double & imax ) override ;
2015-07-11 18:56:02 +08:00
/** \brief determine min/max data value of the image */
2018-12-28 05:52:00 +08:00
virtual void getModifierMinMax ( double & imin , double & imax ) override ;
2015-07-11 18:56:02 +08:00
/** \brief return the value (raw data!) of the contained image at the given coordinate */
double getValueAt ( double x , double y ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
protected :
2015-08-02 19:36:54 +08:00
void initJKQTPMathImage ( ) ;
2015-07-11 18:56:02 +08:00
/** \brief top color bar visible */
bool colorBarTopVisible ;
/** \brief right color bar visible */
bool colorBarRightVisible ;
/** \brief name of the image displayed above color bar (may contain LaTeX markup!) */
QString imageName ;
/** \brief font name when displaying imageName */
QString imageNameFontName ;
/** \brief font size in points when displaying imageName */
double imageNameFontSize ;
/** \brief palette for plotting an image */
JKQTPMathImageColorPalette palette ;
/** \brief indicate whether to display a color bar */
bool showColorBar ;
/** \brief width of the color bar */
int colorBarWidth ;
/** \brief width of the color bar when modifier is on */
int colorBarModifiedWidth ;
/** \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 ;
/** \brief image value range minimum */
double imageMin ;
/** \brief image value range maximum */
double imageMax ;
/** \brief indicates whether to estimate min/max of the modifier automatically */
bool autoModifierRange ;
/** \brief modifier value range minimum */
double modifierMin ;
/** \brief modifier value range maximum */
double modifierMax ;
/** \brief offset between outside space border and color bar */
int colorBarOffset ;
/** \brief which action to take if a color is below \a imageMin and \a autoImageRange \c ==false */
JKQTPMathImageColorRangeFailAction rangeMinFailAction ;
/** \brief which action to take if a color is above \a imageMax and \a autoImageRange \c ==false */
JKQTPMathImageColorRangeFailAction rangeMaxFailAction ;
/** \brief color to use for some settings of \a rangeMinFailAction */
QColor rangeMinFailColor ;
/** \brief color to use for some settings of \a rangeMaxFailAction */
QColor rangeMaxFailColor ;
/** \brief color to use for a not-a-number value */
QColor nanColor ;
/** \brief color to use for an infinity value */
QColor infColor ;
/** \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
*/
2019-01-20 17:49:29 +08:00
JKQTPVerticalIndependentAxis * colorBarRightAxis ;
JKQTPHorizontalIndependentAxis * colorBarTopAxis ;
JKQTPVerticalIndependentAxis * modifierColorBarTopAxis ;
JKQTPHorizontalIndependentAxis * modifierColorBarRightAxis ;
2015-07-11 18:56:02 +08:00
protected :
QAction * actSaveImage ;
QAction * actCopyImage ;
2015-08-05 20:27:09 +08:00
QAction * actSavePalette ;
QAction * actCopyPalette ;
2015-07-11 18:56:02 +08:00
public :
2019-01-10 04:23:24 +08:00
virtual void set_title ( const QString & title ) override ;
2015-07-11 18:56:02 +08:00
public slots :
void saveImagePlotAsImage ( const QString & filename = QString ( " " ) , const QByteArray & outputFormat = QByteArray ( ) ) ;
void copyImagePlotAsImage ( ) ;
2015-08-05 20:27:09 +08:00
void saveColorbarPlotAsImage ( const QString & filename = QString ( " " ) , const QByteArray & outputFormat = QByteArray ( ) ) ;
void copyColorbarPlotAsImage ( ) ;
2015-07-11 18:56:02 +08:00
} ;
/*! \brief class to plot an image from an 2-dimensional array of values
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
2019-01-13 01:53:16 +08:00
\ image html jkqtplotter_simpletest_rgbimageplot_opencv . png
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPRGBMathImage : public JKQTPMathImageBase {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPRGBMathImage ( double x , double y , double width , double height , DataType datatype , void * data , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
2015-07-11 18:56:02 +08:00
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPRGBMathImage ( double x , double y , double width , double height , DataType datatype , void * data , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPRGBMathImage ( JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPRGBMathImage ( JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
virtual void setParent ( JKQTBasePlotter * parent ) override ;
2015-07-11 18:56:02 +08:00
virtual void set_data ( void * data , void * dataG , void * dataB , uint32_t Nx , uint32_t Ny , DataType datatype ) ;
virtual void set_data ( void * data , void * dataG , void * dataB , uint32_t Nx , uint32_t Ny ) ;
virtual void set_data ( void * data , uint32_t Nx , uint32_t Ny , DataType datatype ) ;
virtual void set_data ( void * data , uint32_t Nx , uint32_t Ny ) ;
/** \brief determine min/max data value of the image */
2018-12-28 05:52:00 +08:00
virtual void getDataMinMax ( double & imin , double & imax ) override ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property dataG to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter dataG is : < BLOCKQUOTE > \ copydoc dataG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see dataG for more information */
inline virtual void set_dataG ( void * __value )
{
this - > dataG = __value ;
}
/*! \brief returns the property dataG.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter dataG is : < BLOCKQUOTE > \ copydoc dataG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see dataG for more information */
inline virtual void * get_dataG ( ) const
{
return this - > dataG ;
}
/*! \brief sets the property datatypeG to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatypeG is : < BLOCKQUOTE > \ copydoc datatypeG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatypeG for more information */
inline virtual void set_datatypeG ( const DataType & __value )
{
this - > datatypeG = __value ;
}
/*! \brief returns the property datatypeG.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatypeG is : < BLOCKQUOTE > \ copydoc datatypeG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatypeG for more information */
inline virtual DataType get_datatypeG ( ) const
{
return this - > datatypeG ;
}
/*! \brief sets the property dataB to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter dataB is : < BLOCKQUOTE > \ copydoc dataB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see dataB for more information */
inline virtual void set_dataB ( void * __value )
{
this - > dataB = __value ;
}
/*! \brief returns the property dataB.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter dataB is : < BLOCKQUOTE > \ copydoc dataB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see dataB for more information */
inline virtual void * get_dataB ( ) const
{
return this - > dataB ;
}
/*! \brief sets the property datatypeB to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatypeB is : < BLOCKQUOTE > \ copydoc datatypeB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatypeB for more information */
inline virtual void set_datatypeB ( const DataType & __value )
{
this - > datatypeB = __value ;
}
/*! \brief returns the property datatypeB.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter datatypeB is : < BLOCKQUOTE > \ copydoc datatypeB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see datatypeB for more information */
inline virtual DataType get_datatypeB ( ) const
{
return this - > datatypeB ;
}
/*! \brief sets the property showColorBar to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter showColorBar is : < BLOCKQUOTE > \ copydoc showColorBar < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see showColorBar for more information */
2019-01-26 03:16:04 +08:00
inline virtual void setShowColorBar ( bool __value )
2019-01-10 04:23:24 +08:00
{
this - > showColorBar = __value ;
}
/*! \brief returns the property showColorBar.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter showColorBar is : < BLOCKQUOTE > \ copydoc showColorBar < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see showColorBar for more information */
2019-01-26 03:16:04 +08:00
inline virtual bool getShowColorBar ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > showColorBar ;
}
/*! \brief sets the property colorBarWidth to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarWidth is : < BLOCKQUOTE > \ copydoc colorBarWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarWidth for more information */
inline virtual void set_colorBarWidth ( int __value )
{
this - > colorBarWidth = __value ;
}
/*! \brief returns the property colorBarWidth.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarWidth is : < BLOCKQUOTE > \ copydoc colorBarWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarWidth for more information */
inline virtual int get_colorBarWidth ( ) const
{
return this - > colorBarWidth ;
}
/*! \brief sets the property colorBarOffset to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarOffset is : < BLOCKQUOTE > \ copydoc colorBarOffset < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarOffset for more information */
inline virtual void set_colorBarOffset ( int __value )
{
this - > colorBarOffset = __value ;
}
/*! \brief returns the property colorBarOffset.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarOffset is : < BLOCKQUOTE > \ copydoc colorBarOffset < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarOffset for more information */
inline virtual int get_colorBarOffset ( ) const
{
return this - > colorBarOffset ;
}
/*! \brief sets the property colorBarRelativeHeight to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRelativeHeight is : < BLOCKQUOTE > \ copydoc colorBarRelativeHeight < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRelativeHeight for more information */
inline virtual void set_colorBarRelativeHeight ( double __value )
{
this - > colorBarRelativeHeight = __value ;
}
/*! \brief returns the property colorBarRelativeHeight.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRelativeHeight is : < BLOCKQUOTE > \ copydoc colorBarRelativeHeight < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRelativeHeight for more information */
inline virtual double get_colorBarRelativeHeight ( ) const
{
return this - > colorBarRelativeHeight ;
}
/*! \brief sets the property imageMin to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMin is : < BLOCKQUOTE > \ copydoc imageMin < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMin for more information */
inline virtual void set_imageMin ( double __value )
{
this - > imageMin = __value ;
}
/*! \brief returns the property imageMin.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMin is : < BLOCKQUOTE > \ copydoc imageMin < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMin for more information */
inline virtual double get_imageMin ( ) const
{
return this - > imageMin ;
}
2018-11-28 05:49:27 +08:00
inline void set_imageMinR ( double m ) {
set_imageMin ( m ) ;
}
2019-01-10 04:23:24 +08:00
/*! \brief sets the property imageMax to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMax is : < BLOCKQUOTE > \ copydoc imageMax < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMax for more information */
inline virtual void set_imageMax ( double __value )
{
this - > imageMax = __value ;
}
/*! \brief returns the property imageMax.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMax is : < BLOCKQUOTE > \ copydoc imageMax < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMax for more information */
inline virtual double get_imageMax ( ) const
{
return this - > imageMax ;
}
2018-11-28 05:49:27 +08:00
inline void set_imageMaxR ( double m ) {
set_imageMax ( m ) ;
}
2019-01-10 04:23:24 +08:00
/*! \brief sets the property imageMinG to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMinG is : < BLOCKQUOTE > \ copydoc imageMinG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMinG for more information */
inline virtual void set_imageMinG ( double __value )
{
this - > imageMinG = __value ;
}
/*! \brief returns the property imageMinG.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMinG is : < BLOCKQUOTE > \ copydoc imageMinG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMinG for more information */
inline virtual double get_imageMinG ( ) const
{
return this - > imageMinG ;
}
/*! \brief sets the property imageMaxG to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMaxG is : < BLOCKQUOTE > \ copydoc imageMaxG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMaxG for more information */
inline virtual void set_imageMaxG ( double __value )
{
this - > imageMaxG = __value ;
}
/*! \brief returns the property imageMaxG.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMaxG is : < BLOCKQUOTE > \ copydoc imageMaxG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMaxG for more information */
inline virtual double get_imageMaxG ( ) const
{
return this - > imageMaxG ;
}
/*! \brief sets the property imageMinB to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMinB is : < BLOCKQUOTE > \ copydoc imageMinB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMinB for more information */
inline virtual void set_imageMinB ( double __value )
{
this - > imageMinB = __value ;
}
/*! \brief returns the property imageMinB.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMinB is : < BLOCKQUOTE > \ copydoc imageMinB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMinB for more information */
inline virtual double get_imageMinB ( ) const
{
return this - > imageMinB ;
}
/*! \brief sets the property imageMaxB to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMaxB is : < BLOCKQUOTE > \ copydoc imageMaxB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMaxB for more information */
inline virtual void set_imageMaxB ( double __value )
{
this - > imageMaxB = __value ;
}
/*! \brief returns the property imageMaxB.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageMaxB is : < BLOCKQUOTE > \ copydoc imageMaxB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageMaxB for more information */
inline virtual double get_imageMaxB ( ) const
{
return this - > imageMaxB ;
}
/*! \brief sets the property autoImageRange to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoImageRange is : < BLOCKQUOTE > \ copydoc autoImageRange < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoImageRange for more information */
inline virtual void set_autoImageRange ( bool __value )
{
this - > autoImageRange = __value ;
}
/*! \brief returns the property autoImageRange.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoImageRange is : < BLOCKQUOTE > \ copydoc autoImageRange < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoImageRange for more information */
inline virtual bool get_autoImageRange ( ) const
{
return this - > autoImageRange ;
}
/*! \brief sets the property imageName to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageName is : < BLOCKQUOTE > \ copydoc imageName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageName for more information */
inline virtual void set_imageName ( const QString & __value )
{
this - > imageName = __value ;
}
/*! \brief returns the property imageName.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageName is : < BLOCKQUOTE > \ copydoc imageName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageName for more information */
inline virtual QString get_imageName ( ) const
{
return this - > imageName ;
}
2018-11-28 05:49:27 +08:00
inline void set_imageNameR ( const QString & m ) {
set_imageName ( m ) ;
}
2019-01-10 04:23:24 +08:00
/*! \brief sets the property imageNameG to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameG is : < BLOCKQUOTE > \ copydoc imageNameG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameG for more information */
inline virtual void set_imageNameG ( const QString & __value )
{
this - > imageNameG = __value ;
}
/*! \brief returns the property imageNameG.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameG is : < BLOCKQUOTE > \ copydoc imageNameG < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameG for more information */
inline virtual QString get_imageNameG ( ) const
{
return this - > imageNameG ;
}
/*! \brief sets the property imageNameB to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameB is : < BLOCKQUOTE > \ copydoc imageNameB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameB for more information */
inline virtual void set_imageNameB ( const QString & __value )
{
this - > imageNameB = __value ;
}
/*! \brief returns the property imageNameB.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameB is : < BLOCKQUOTE > \ copydoc imageNameB < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameB for more information */
inline virtual QString get_imageNameB ( ) const
{
return this - > imageNameB ;
}
/*! \brief sets the property imageNameFontName to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontName is : < BLOCKQUOTE > \ copydoc imageNameFontName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontName for more information */
inline virtual void set_imageNameFontName ( const QString & __value )
{
this - > imageNameFontName = __value ;
}
/*! \brief returns the property imageNameFontName.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontName is : < BLOCKQUOTE > \ copydoc imageNameFontName < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontName for more information */
inline virtual QString get_imageNameFontName ( ) const
{
return this - > imageNameFontName ;
}
/*! \brief sets the property imageNameFontSize to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontSize is : < BLOCKQUOTE > \ copydoc imageNameFontSize < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontSize for more information */
inline virtual void set_imageNameFontSize ( double __value )
{
this - > imageNameFontSize = __value ;
}
/*! \brief returns the property imageNameFontSize.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageNameFontSize is : < BLOCKQUOTE > \ copydoc imageNameFontSize < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageNameFontSize for more information */
inline virtual double get_imageNameFontSize ( ) const
{
return this - > imageNameFontSize ;
}
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarRightAxis. \details Description of the parameter colorBarRightAxis is: <BLOCKQUOTE>\copydoc colorBarRightAxis </BLOCKQUOTE>. \see colorBarRightAxis for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPVerticalIndependentAxis * get_colorBarRightAxis ( ) const { return this - > colorBarRightAxis ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarTopAxis. \details Description of the parameter colorBarTopAxis is: <BLOCKQUOTE>\copydoc colorBarTopAxis </BLOCKQUOTE>. \see colorBarTopAxis for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPHorizontalIndependentAxis * get_colorBarTopAxis ( ) const { return this - > colorBarTopAxis ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarRightAxisG. \details Description of the parameter colorBarRightAxisG is: <BLOCKQUOTE>\copydoc colorBarRightAxisG </BLOCKQUOTE>. \see colorBarRightAxisG for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPVerticalIndependentAxis * get_colorBarRightAxisG ( ) const { return this - > colorBarRightAxisG ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarTopAxisG. \details Description of the parameter colorBarTopAxisG is: <BLOCKQUOTE>\copydoc colorBarTopAxisG </BLOCKQUOTE>. \see colorBarTopAxisG for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPHorizontalIndependentAxis * get_colorBarTopAxisG ( ) const { return this - > colorBarTopAxisG ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarRightAxisB. \details Description of the parameter colorBarRightAxisB is: <BLOCKQUOTE>\copydoc colorBarRightAxisB </BLOCKQUOTE>. \see colorBarRightAxisB for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPVerticalIndependentAxis * get_colorBarRightAxisB ( ) const { return this - > colorBarRightAxisB ; }
2019-01-25 05:49:10 +08:00
/*! \brief returns the property colorBarTopAxisB. \details Description of the parameter colorBarTopAxisB is: <BLOCKQUOTE>\copydoc colorBarTopAxisB </BLOCKQUOTE>. \see colorBarTopAxisB for more information */
2019-01-20 17:49:29 +08:00
inline JKQTPHorizontalIndependentAxis * get_colorBarTopAxisB ( ) const { return this - > colorBarTopAxisB ; }
2019-01-10 04:23:24 +08:00
/*! \brief sets the property colorBarTopVisible to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarTopVisible is : < BLOCKQUOTE > \ copydoc colorBarTopVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarTopVisible for more information */
inline virtual void set_colorBarTopVisible ( bool __value )
{
this - > colorBarTopVisible = __value ;
}
/*! \brief returns the property colorBarTopVisible.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarTopVisible is : < BLOCKQUOTE > \ copydoc colorBarTopVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarTopVisible for more information */
inline virtual bool get_colorBarTopVisible ( ) const
{
return this - > colorBarTopVisible ;
}
/*! \brief sets the property colorBarRightVisible to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRightVisible is : < BLOCKQUOTE > \ copydoc colorBarRightVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRightVisible for more information */
inline virtual void set_colorBarRightVisible ( bool __value )
{
this - > colorBarRightVisible = __value ;
}
/*! \brief returns the property colorBarRightVisible.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorBarRightVisible is : < BLOCKQUOTE > \ copydoc colorBarRightVisible < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorBarRightVisible for more information */
inline virtual bool get_colorBarRightVisible ( ) const
{
return this - > colorBarRightVisible ;
}
/*! \brief sets the property colorbarsSideBySide to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorbarsSideBySide is : < BLOCKQUOTE > \ copydoc colorbarsSideBySide < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorbarsSideBySide for more information */
inline virtual void set_colorbarsSideBySide ( bool __value )
{
this - > colorbarsSideBySide = __value ;
}
/*! \brief returns the property colorbarsSideBySide.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorbarsSideBySide is : < BLOCKQUOTE > \ copydoc colorbarsSideBySide < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorbarsSideBySide for more information */
inline virtual bool get_colorbarsSideBySide ( ) const
{
return this - > colorbarsSideBySide ;
}
/*! \brief sets the property rgbMode to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rgbMode is : < BLOCKQUOTE > \ copydoc rgbMode < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rgbMode for more information */
inline virtual void set_rgbMode ( const JKQTPRGBMathImageRGBMode & __value )
{
this - > rgbMode = __value ;
}
/*! \brief returns the property rgbMode.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rgbMode is : < BLOCKQUOTE > \ copydoc rgbMode < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rgbMode for more information */
inline virtual JKQTPRGBMathImageRGBMode get_rgbMode ( ) const
{
return this - > rgbMode ;
}
2015-07-11 18:56:02 +08:00
QVector < double > getDataGAsDoubleVector ( ) const ;
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 ( )
*/
2018-12-28 05:52:00 +08:00
virtual void getOutsideSize ( JKQTPEnhancedPainter & painter , int & leftSpace , int & rightSpace , int & topSpace , int & bottomSpace ) override ;
2015-07-11 18:56:02 +08:00
/*! \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 ) .
*/
2018-12-28 05:52:00 +08:00
virtual void drawOutside ( JKQTPEnhancedPainter & painter , QRect leftSpace , QRect rightSpace , QRect topSpace , QRect bottomSpace ) override ;
2015-07-11 18:56:02 +08:00
/*! \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 */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
protected :
2015-08-02 19:36:54 +08:00
void initObject ( ) ;
2015-07-11 18:56:02 +08:00
/** \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 ;
JKQTPRGBMathImageRGBMode rgbMode ;
/** \brief top color bar visible */
bool colorBarTopVisible ;
/** \brief right color bar visible */
bool colorBarRightVisible ;
/** \brief name of the image displayed above color bar (may contain LaTeX markup!) */
QString imageName ;
/** \brief name of the image displayed above color bar (may contain LaTeX markup!) */
QString imageNameG ;
/** \brief name of the image displayed above color bar (may contain LaTeX markup!) */
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 ;
/** \brief image value range minimum */
double imageMin ;
/** \brief image value range maximum */
double imageMax ;
/** \brief image value range minimum */
double imageMinG ;
/** \brief image value range maximum */
double imageMaxG ;
/** \brief image value range minimum */
double imageMinB ;
/** \brief image value range maximum */
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
*/
2019-01-20 17:49:29 +08:00
JKQTPVerticalIndependentAxis * colorBarRightAxis ;
JKQTPHorizontalIndependentAxis * colorBarTopAxis ;
JKQTPVerticalIndependentAxis * colorBarRightAxisG ;
JKQTPHorizontalIndependentAxis * colorBarTopAxisG ;
JKQTPVerticalIndependentAxis * colorBarRightAxisB ;
JKQTPHorizontalIndependentAxis * colorBarTopAxisB ;
2015-07-11 18:56:02 +08:00
double internalDataMinG ;
double internalDataMaxG ;
double internalDataMinB ;
double internalDataMaxB ;
protected :
QAction * actSaveImage ;
QAction * actCopyImage ;
public :
2019-01-10 04:23:24 +08:00
virtual void set_title ( const QString & title ) override ;
2015-07-11 18:56:02 +08:00
public slots :
void saveImagePlotAsImage ( const QString & filename = QString ( " " ) , const QByteArray & outputFormat = QByteArray ( ) ) ;
void copyImagePlotAsImage ( ) ;
} ;
/*! \brief class to plot an image from an 2-dimensional array of values stored in a column of the datastore
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
\ image html jkqtplotter_simpletest_imageplot . png
\ image html jkqtplotter_simpletest_imageplot_modifier . png
\ image html jkqtplotter_simpletest_imageplot__smallscaletransparent . png
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPColumnMathImage : public JKQTPMathImage {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPColumnMathImage ( JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnMathImage ( double x , double y , double width , double height , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnMathImage ( double x , double y , double width , double height , int imageColumn , uint32_t Nx , uint32_t Ny , JKQTPMathImageColorPalette palette = JKQTPMathImageGRAY , JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPColumnMathImage ( JKQTPlotter * parent ) ;
JKQTPColumnMathImage ( double x , double y , double width , double height , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
JKQTPColumnMathImage ( double x , double y , double width , double height , int imageColumn , uint32_t Nx , uint32_t Ny , JKQTPMathImageColorPalette palette , JKQTPlotter * parent ) ;
JKQTPColumnMathImage ( double x , double y , double width , double height , int imageColumn , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property imageColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageColumn is : < BLOCKQUOTE > \ copydoc imageColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageColumn for more information */
inline virtual void set_imageColumn ( int __value )
{
this - > imageColumn = __value ;
}
/*! \brief returns the property imageColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageColumn is : < BLOCKQUOTE > \ copydoc imageColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageColumn for more information */
inline virtual int get_imageColumn ( ) const
{
return this - > imageColumn ;
}
/*! \brief sets the property modifierColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierColumn is : < BLOCKQUOTE > \ copydoc modifierColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierColumn for more information */
inline virtual void set_modifierColumn ( int __value )
{
this - > modifierColumn = __value ;
}
/*! \brief returns the property modifierColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierColumn is : < BLOCKQUOTE > \ copydoc modifierColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierColumn for more information */
inline virtual int get_modifierColumn ( ) const
{
return this - > modifierColumn ;
}
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPGraph::usesColumn() */
2018-12-28 05:52:00 +08:00
virtual bool usesColumn ( int c ) const override ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief column containing the displayed image */
int imageColumn ;
/** \brief column containing the modifier image */
int modifierColumn ;
2018-12-28 05:52:00 +08:00
virtual void ensureImageData ( ) override ;
2015-07-11 18:56:02 +08:00
} ;
/*! \brief like JKQTPRGBMathImage but reads images from columns of the datastore
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
2019-01-13 01:53:16 +08:00
\ image html jkqtplotter_simpletest_rgbimageplot_opencv . png
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPColumnRGBMathImage : public JKQTPRGBMathImage {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPColumnRGBMathImage ( JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , int imageBColumn , uint32_t Nx , uint32_t Ny , JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPColumnRGBMathImage ( JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
JKQTPColumnRGBMathImage ( double x , double y , double width , double height , int imageRColumn , int imageGColumn , int imageBColumn , uint32_t Nx , uint32_t Ny , JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property imageRColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageRColumn is : < BLOCKQUOTE > \ copydoc imageRColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageRColumn for more information */
inline virtual void set_imageRColumn ( int __value )
{
this - > imageRColumn = __value ;
}
/*! \brief returns the property imageRColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageRColumn is : < BLOCKQUOTE > \ copydoc imageRColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageRColumn for more information */
inline virtual int get_imageRColumn ( ) const
{
return this - > imageRColumn ;
}
/*! \brief sets the property imageGColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageGColumn is : < BLOCKQUOTE > \ copydoc imageGColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageGColumn for more information */
inline virtual void set_imageGColumn ( int __value )
{
this - > imageGColumn = __value ;
}
/*! \brief returns the property imageGColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageGColumn is : < BLOCKQUOTE > \ copydoc imageGColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageGColumn for more information */
inline virtual int get_imageGColumn ( ) const
{
return this - > imageGColumn ;
}
/*! \brief sets the property imageBColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageBColumn is : < BLOCKQUOTE > \ copydoc imageBColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageBColumn for more information */
inline virtual void set_imageBColumn ( int __value )
{
this - > imageBColumn = __value ;
}
/*! \brief returns the property imageBColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageBColumn is : < BLOCKQUOTE > \ copydoc imageBColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageBColumn for more information */
inline virtual int get_imageBColumn ( ) const
{
return this - > imageBColumn ;
}
/*! \brief sets the property modifierColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierColumn is : < BLOCKQUOTE > \ copydoc modifierColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierColumn for more information */
inline virtual void set_modifierColumn ( int __value )
{
this - > modifierColumn = __value ;
}
/*! \brief returns the property modifierColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter modifierColumn is : < BLOCKQUOTE > \ copydoc modifierColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see modifierColumn for more information */
inline virtual int get_modifierColumn ( ) const
{
return this - > modifierColumn ;
}
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPGraph::usesColumn() */
2018-12-28 05:52:00 +08:00
virtual bool usesColumn ( int c ) const override ;
2015-07-11 18:56:02 +08:00
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 ;
2018-12-28 05:52:00 +08:00
void ensureImageData ( ) override ;
2015-07-11 18:56:02 +08:00
} ;
/*! \brief class to plot an image from an 2-dimensional array of boolean values: alle \c true values are plotted in a given color, while the \c false pixels are drawn in another (default: transparent)
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPOverlayImage : public JKQTPImageBase {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPOverlayImage ( double x , double y , double width , double height , bool * data , uint32_t Nx , uint32_t Ny , QColor colTrue , JKQTBasePlotter * parent = nullptr ) ;
JKQTPOverlayImage ( JKQTBasePlotter * parent = nullptr ) ;
2015-07-11 18:56:02 +08:00
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPOverlayImage ( double x , double y , double width , double height , bool * data , uint32_t Nx , uint32_t Ny , QColor colTrue , JKQTPlotter * parent ) ;
JKQTPOverlayImage ( JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/*! \brief return the plotted image only as a QImage */
virtual QImage drawImage ( ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
/** \brief returns the color to be used for the key label */
2018-12-28 05:52:00 +08:00
virtual QColor getKeyLabelColor ( ) override ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property trueColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter trueColor is : < BLOCKQUOTE > \ copydoc trueColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see trueColor for more information */
inline virtual void set_trueColor ( const QColor & __value )
{
this - > trueColor = __value ;
}
/*! \brief returns the property trueColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter trueColor is : < BLOCKQUOTE > \ copydoc trueColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see trueColor for more information */
inline virtual QColor get_trueColor ( ) const
{
return this - > trueColor ;
}
/*! \brief sets the property falseColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter falseColor is : < BLOCKQUOTE > \ copydoc falseColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see falseColor for more information */
inline virtual void set_falseColor ( const QColor & __value )
{
this - > falseColor = __value ;
}
/*! \brief returns the property falseColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter falseColor is : < BLOCKQUOTE > \ copydoc falseColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see falseColor for more information */
inline virtual QColor get_falseColor ( ) const
{
return this - > falseColor ;
}
/*! \brief sets the property Nx to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Nx is : < BLOCKQUOTE > \ copydoc Nx < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Nx for more information */
inline virtual void set_Nx ( uint32_t __value )
{
this - > Nx = __value ;
}
/*! \brief returns the property Nx.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Nx is : < BLOCKQUOTE > \ copydoc Nx < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Nx for more information */
inline virtual uint32_t get_Nx ( ) const
{
return this - > Nx ;
}
/*! \brief sets the property Ny to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Ny is : < BLOCKQUOTE > \ copydoc Ny < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Ny for more information */
inline virtual void set_Ny ( uint32_t __value )
{
this - > Ny = __value ;
}
/*! \brief returns the property Ny.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter Ny is : < BLOCKQUOTE > \ copydoc Ny < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see Ny for more information */
inline virtual uint32_t get_Ny ( ) const
{
return this - > Ny ;
}
/*! \brief sets the property data to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter data is : < BLOCKQUOTE > \ copydoc data < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see data for more information */
inline virtual void set_data ( bool * __value )
{
this - > data = __value ;
}
/*! \brief returns the property data.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter data is : < BLOCKQUOTE > \ copydoc data < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see data for more information */
inline virtual bool * get_data ( ) const
{
return this - > data ;
}
2015-07-11 18:56:02 +08:00
void set_data ( bool * data , uint32_t Nx , uint32_t Ny ) ;
QVector < double > getDataAsDoubleVector ( ) const ;
protected :
/** \brief points to the data array, holding the image */
bool * data ;
2019-01-20 23:15:10 +08:00
/** \brief width of the data array data in pt */
2015-07-11 18:56:02 +08:00
uint32_t Nx ;
2019-01-20 23:15:10 +08:00
/** \brief height of the data array data in pt */
2015-07-11 18:56:02 +08:00
uint32_t Ny ;
/** \brief color for \c true pixels */
QColor trueColor ;
/** \brief color for \c false pixels */
QColor falseColor ;
protected :
QAction * actSaveImage ;
QAction * actCopyImage ;
public :
2019-01-10 04:23:24 +08:00
virtual void set_title ( const QString & title ) override ;
2019-01-20 17:49:29 +08:00
virtual void setParent ( JKQTBasePlotter * parent ) override ;
2015-07-11 18:56:02 +08:00
public slots :
void saveImagePlotAsImage ( const QString & filename = QString ( " " ) , const QByteArray & outputFormat = QByteArray ( ) ) ;
void copyImagePlotAsImage ( ) ;
} ;
/*! \brief class to plot an image from an 2-dimensional array of boolean values: alle \c true values are plotted in a given color, while the \c false pixels are drawn in another (default: transparent)
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
In contrast to JKQTPOverlayImage this class draws ist contents as rectangles , not as semi - transparent image . This may lead to nicer results , but could be slower .
Also it is possible to draw other types of markers ( cross , circles , . . . )
*/
class LIB_EXPORT JKQTPOverlayImageEnhanced : public JKQTPOverlayImage {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPOverlayImageEnhanced ( double x , double y , double width , double height , bool * data , uint32_t Nx , uint32_t Ny , QColor colTrue , JKQTBasePlotter * parent = nullptr ) ;
JKQTPOverlayImageEnhanced ( JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPOverlayImageEnhanced ( double x , double y , double width , double height , bool * data , uint32_t Nx , uint32_t Ny , QColor colTrue , JKQTPlotter * parent ) ;
JKQTPOverlayImageEnhanced ( JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief plots a key marker inside the specified rectangle \a rect */
2018-12-28 05:52:00 +08:00
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) override ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property symbol to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter symbol is : < BLOCKQUOTE > \ copydoc symbol < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see symbol for more information */
2019-01-20 17:49:29 +08:00
inline virtual void set_symbol ( const JKQTPGraphSymbols & __value )
2019-01-10 04:23:24 +08:00
{
this - > symbol = __value ;
}
/*! \brief returns the property symbol.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter symbol is : < BLOCKQUOTE > \ copydoc symbol < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see symbol for more information */
2019-01-20 17:49:29 +08:00
inline virtual JKQTPGraphSymbols get_symbol ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > symbol ;
}
/*! \brief sets the property symbolWidth to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter symbolWidth is : < BLOCKQUOTE > \ copydoc symbolWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see symbolWidth for more information */
inline virtual void set_symbolWidth ( double __value )
{
this - > symbolWidth = __value ;
}
/*! \brief returns the property symbolWidth.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter symbolWidth is : < BLOCKQUOTE > \ copydoc symbolWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see symbolWidth for more information */
inline virtual double get_symbolWidth ( ) const
{
return this - > symbolWidth ;
}
/*! \brief sets the property drawAsRectangles to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter drawAsRectangles is : < BLOCKQUOTE > \ copydoc drawAsRectangles < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see drawAsRectangles for more information */
inline virtual void set_drawAsRectangles ( bool __value )
{
this - > drawAsRectangles = __value ;
}
/*! \brief returns the property drawAsRectangles.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter drawAsRectangles is : < BLOCKQUOTE > \ copydoc drawAsRectangles < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see drawAsRectangles for more information */
inline virtual bool get_drawAsRectangles ( ) const
{
return this - > drawAsRectangles ;
}
/*! \brief sets the property rectanglesAsImageOverlay to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rectanglesAsImageOverlay is : < BLOCKQUOTE > \ copydoc rectanglesAsImageOverlay < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rectanglesAsImageOverlay for more information */
inline virtual void set_rectanglesAsImageOverlay ( bool __value )
{
this - > rectanglesAsImageOverlay = __value ;
}
/*! \brief returns the property rectanglesAsImageOverlay.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter rectanglesAsImageOverlay is : < BLOCKQUOTE > \ copydoc rectanglesAsImageOverlay < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see rectanglesAsImageOverlay for more information */
inline virtual bool get_rectanglesAsImageOverlay ( ) const
{
return this - > rectanglesAsImageOverlay ;
}
/*! \brief sets the property symbolSizeFactor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter symbolSizeFactor is : < BLOCKQUOTE > \ copydoc symbolSizeFactor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see symbolSizeFactor for more information */
inline virtual void set_symbolSizeFactor ( double __value )
{
this - > symbolSizeFactor = __value ;
}
/*! \brief returns the property symbolSizeFactor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter symbolSizeFactor is : < BLOCKQUOTE > \ copydoc symbolSizeFactor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see symbolSizeFactor for more information */
inline virtual double get_symbolSizeFactor ( ) const
{
return this - > symbolSizeFactor ;
}
2015-07-11 18:56:02 +08:00
protected :
/** \brief which symbol to use for the datapoints */
2019-01-20 17:49:29 +08:00
JKQTPGraphSymbols symbol ;
2019-01-20 23:15:10 +08:00
/** \brief width (in pt) of the lines used to plot the symbol for the data points */
2015-07-11 18:56:02 +08:00
double symbolWidth ;
/** \brief indicates whether to draw filled rectangles (\c false, default) or symbols */
bool drawAsRectangles ;
/** \brief a rescaling factor for the symbols */
double symbolSizeFactor ;
/** \brief when \c drawAsRectangles==true this reactivates the drawing from JKQTPOverlayImage, i.e. the overlay is not drawn as separated rectangles, but as an overlay image */
bool rectanglesAsImageOverlay ;
} ;
/*! \brief class to plot an image from an 2-dimensional array of boolean values: alle \c true values are plotted in a given color, while the \c false pixels are drawn in another (default: transparent)
2019-01-13 01:53:16 +08:00
\ ingroup jkqtplotter_imagelots_elements
2015-07-11 18:56:02 +08:00
In contrast to JKQTPOverlayImage this class draws ist contents as rectangles , not as semi - transparent image . This may lead to nicer results , but could be slower .
Also it is possible to draw other types of markers ( cross , circles , . . . )
*/
class LIB_EXPORT JKQTPColumnOverlayImageEnhanced : public JKQTPOverlayImageEnhanced {
Q_OBJECT
public :
2019-01-20 17:49:29 +08:00
JKQTPColumnOverlayImageEnhanced ( JKQTBasePlotter * parent = nullptr ) ;
2019-01-20 23:15:10 +08:00
JKQTPColumnOverlayImageEnhanced ( JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
2019-01-10 04:23:24 +08:00
/*! \brief sets the property imageColumn to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageColumn is : < BLOCKQUOTE > \ copydoc imageColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageColumn for more information */
inline virtual void set_imageColumn ( int __value )
{
this - > imageColumn = __value ;
}
/*! \brief returns the property imageColumn.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter imageColumn is : < BLOCKQUOTE > \ copydoc imageColumn < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see imageColumn for more information */
inline virtual int get_imageColumn ( ) const
{
return this - > imageColumn ;
}
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPGraph::usesColumn() */
2018-12-28 05:52:00 +08:00
virtual bool usesColumn ( int c ) const override ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief top color bar visible */
int imageColumn ;
} ;
/*! \brief class for a contour plot
2019-01-13 01:53:16 +08:00
* \ ingroup jkqtplotter_imagelots_contour
2015-07-11 18:56:02 +08:00
* calculates the contour of a given image using the CONREC algorithm
2019-01-12 23:01:55 +08:00
* < a href = " http://paulbourke.net/papers/conrec/ " > http : //paulbourke.net/papers/conrec/</a>
2015-07-11 18:56:02 +08:00
* The implementation for Qt is adapted from Qwt
2019-01-12 23:01:55 +08:00
* < a href = " http://qwt.sourceforge.net/ " > http : //qwt.sourceforge.net/</a>
2015-07-11 18:56:02 +08:00
*
* The contour lines are calculated only once and then redrawn to save plotting time .
* Make sure you add a new graph when your data changes . The contour levels can be defined in
* contourLevels , each elemt in the list represents a contour plane . You can also create contour
* levels with createContourLevels ( ) . The levels are linearly spaced between the maximum and minimum
* value in your data . For logarithmic data , use createContourLevelsLog ( ) to create contour levels
* with logarithmic spacing .
2015-08-02 19:36:54 +08:00
*
* \ author Sebastian Isbaner , 2013 - 2014
2019-01-13 01:53:16 +08:00
*
* \ image html JKQTPContour . png
2015-07-11 18:56:02 +08:00
*/
class LIB_EXPORT JKQTPContour : public JKQTPMathImage {
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPContour ( JKQTBasePlotter * parent = nullptr ) ;
2015-07-11 18:56:02 +08:00
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPContour ( double x , double y , double width , double height , void * data , uint32_t Nx , uint32_t Ny , JKQTPMathImageColorPalette palette = JKQTPMathImageGRAY , DataType datatype = JKQTPMathImageBase : : DoubleArray , JKQTBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPContour ( JKQTPlotter * parent ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPContour ( double x , double y , double width , double height , void * data , uint32_t Nx , uint32_t Ny , JKQTPMathImageColorPalette palette , DataType datatype , JKQTPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief creates at nLevels contour levels linearly spaced between the data's minimum and maximum values */
void createContourLevels ( int nLevels = 3 ) ;
/** \brief creates at least nLevels contour levels with logarithmic spacing. FIXME: Has not been tested yet */
void createContourLevelsLog ( int nLevels = 3 , int m = 2 ) ;
2019-01-10 04:23:24 +08:00
/*! \brief sets the property lineColor to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter lineColor is : < BLOCKQUOTE > \ copydoc lineColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see lineColor for more information */
2019-01-26 03:16:04 +08:00
inline virtual void setLineColor ( const QColor & __value )
2019-01-10 04:23:24 +08:00
{
this - > lineColor = __value ;
}
/*! \brief returns the property lineColor.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter lineColor is : < BLOCKQUOTE > \ copydoc lineColor < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see lineColor for more information */
2019-01-26 03:16:04 +08:00
inline virtual QColor getLineColor ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > lineColor ;
}
/*! \brief sets the property style to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter style is : < BLOCKQUOTE > \ copydoc style < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see style for more information */
inline virtual void set_style ( const Qt : : PenStyle & __value )
{
this - > style = __value ;
}
/*! \brief returns the property style.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter style is : < BLOCKQUOTE > \ copydoc style < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see style for more information */
inline virtual Qt : : PenStyle get_style ( ) const
{
return this - > style ;
}
/*! \brief sets the property lineWidth to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter lineWidth is : < BLOCKQUOTE > \ copydoc lineWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see lineWidth for more information */
2019-01-26 03:16:04 +08:00
inline virtual void setLineWidth ( double __value )
2019-01-10 04:23:24 +08:00
{
this - > lineWidth = __value ;
}
/*! \brief returns the property lineWidth.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter lineWidth is : < BLOCKQUOTE > \ copydoc lineWidth < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see lineWidth for more information */
2019-01-26 03:16:04 +08:00
inline virtual double getLineWidth ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > lineWidth ;
}
/*! \brief sets the property ignoreOnPlane to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter ignoreOnPlane is : < BLOCKQUOTE > \ copydoc ignoreOnPlane < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see ignoreOnPlane for more information */
inline virtual void set_ignoreOnPlane ( bool __value )
{
this - > ignoreOnPlane = __value ;
}
/*! \brief returns the property ignoreOnPlane.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter ignoreOnPlane is : < BLOCKQUOTE > \ copydoc ignoreOnPlane < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see ignoreOnPlane for more information */
inline virtual bool get_ignoreOnPlane ( ) const
{
return this - > ignoreOnPlane ;
}
/*! \brief sets the property numberOfLevels to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter numberOfLevels is : < BLOCKQUOTE > \ copydoc numberOfLevels < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see numberOfLevels for more information */
inline virtual void set_numberOfLevels ( int __value )
{
this - > numberOfLevels = __value ;
}
/*! \brief returns the property numberOfLevels.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter numberOfLevels is : < BLOCKQUOTE > \ copydoc numberOfLevels < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see numberOfLevels for more information */
inline virtual int get_numberOfLevels ( ) const
{
return this - > numberOfLevels ;
}
/*! \brief sets the property colorFromPalette to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorFromPalette is : < BLOCKQUOTE > \ copydoc colorFromPalette < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorFromPalette for more information */
inline virtual void set_colorFromPalette ( bool __value )
{
this - > colorFromPalette = __value ;
}
/*! \brief returns the property colorFromPalette.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter colorFromPalette is : < BLOCKQUOTE > \ copydoc colorFromPalette < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see colorFromPalette for more information */
inline virtual bool get_colorFromPalette ( ) const
{
return this - > colorFromPalette ;
}
/*! \brief sets the property contourLevels to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter contourLevels is : < BLOCKQUOTE > \ copydoc contourLevels < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see contourLevels for more information */
inline virtual void set_contourLevels ( const QList < double > & __value )
{
this - > contourLevels = __value ;
}
/*! \brief returns the property contourLevels.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter contourLevels is : < BLOCKQUOTE > \ copydoc contourLevels < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see contourLevels for more information */
inline virtual QList < double > get_contourLevels ( ) const
{
return this - > contourLevels ;
}
/*! \brief sets the property relativeLevels to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter relativeLevels is : < BLOCKQUOTE > \ copydoc relativeLevels < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see relativeLevels for more information */
inline virtual void set_relativeLevels ( bool __value )
{
this - > relativeLevels = __value ;
}
/*! \brief returns the property relativeLevels.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter relativeLevels is : < BLOCKQUOTE > \ copydoc relativeLevels < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see relativeLevels for more information */
inline virtual bool get_relativeLevels ( ) const
{
return this - > relativeLevels ;
}
2019-01-20 17:49:29 +08:00
/** convenience function to work with JKQTPDatastore */
2015-07-11 18:56:02 +08:00
void set_imageColumn ( size_t columnID ) ;
void addContourLevel ( double & level ) ;
protected :
/** \brief color of the contour lines */
QColor lineColor ;
/** \brief linestyle of the contour lines */
Qt : : PenStyle style ;
/** \brief width (pixels) of the graph */
double lineWidth ;
/** \brief if true, vertices that all lie on the contour plane will be ignored*/
bool ignoreOnPlane ;
/** \brief if true, the colors of the \a palette are used for the contour lines */
bool colorFromPalette ;
/** \brief the number of contour levels. Is only used if contourLevels is empty*/
int numberOfLevels ;
/** \brief the list of contour levels */
QList < double > contourLevels ;
// /** \brief indicates wether the contour levels are absolute values or relative to the maximum (max-min) */
bool relativeLevels ;
2018-12-28 05:52:00 +08:00
virtual void ensureImageData ( ) override ;
2015-07-11 18:56:02 +08:00
private :
double value ( int xIdx , int yIdx ) ;
/// gives the intersection line of a plane defined by three vertices with a contour level in the x-y plane of heigth level
2019-01-10 04:23:24 +08:00
bool intersect ( QLineF & line , const QVector3D & vertex1 , const QVector3D & vertex2 , const QVector3D & vertex3 , double level ) ;
2015-07-11 18:56:02 +08:00
/**
* @ brief interpolatePoint linear interpolation of a line to the x - y plane using the z - value relative to level
* @ param point1 start point of the line
* @ param point2 end point of the line
* @ param level the heigth for the interpolation ( this z - value is projected onto the xy - plane )
* @ return the interpolated point in the x - y plane
*/
2019-01-10 04:23:24 +08:00
QPointF interpolatePoint ( const QVector3D & point1 , const QVector3D & point2 , double level ) ;
2015-07-11 18:56:02 +08:00
/**
* @ brief compare2level checks if the vertex lies above , under or on the contour plane level
* @ param vertex
* @ param level contour plane
* @ return above ( 1 ) , on the plane ( 0 ) , below ( - 1 ) ;
*/
2019-01-10 04:23:24 +08:00
int compare2level ( const QVector3D & vertex , double level ) ;
2015-07-11 18:56:02 +08:00
/**
* @ brief calcContourLines calculates the contour lines using the CONREC algorithm
*/
void calcContourLines ( QList < QVector < QLineF > > & ContourLines ) ;
/// the contour lines as vector of single lines (one for each triangle). the list index refers to the contour level.
QList < QVector < QLineF > > contourLines ; // contour levels, squares on grid, line
} ;
2018-12-19 00:13:18 +08:00
# endif // jkqtpgraphsimage_H
2015-07-11 18:56:02 +08:00