1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
10
#ifndef QWT_PLOT_RASTERITEM_H
11
#define QWT_PLOT_RASTERITEM_H
17
#include "qwt_plot_item.h"
20
\brief A class, which displays raster data
22
Raster data is a grid of pixel values, that can be represented
23
as a QImage. It is used for many types of information like
24
spectrograms, cartograms, geographical maps ...
26
Often a plot has several types of raster data organized in layers.
27
( f.e a geographical map, with weather statistics ).
28
Using setAlpha() raster items can be stacked easily.
30
QwtPlotRasterItem is only implemented for images of the following formats:
31
QImage::Format_Indexed8, QImage::Format_ARGB32.
33
\sa QwtPlotSpectrogram
36
class QWT_EXPORT QwtPlotRasterItem: public QwtPlotItem
41
renderImage() is called, whenever the item has to be repainted
43
renderImage() is called, whenever the image cache is not valid,
44
or the scales, or the size of the canvas has changed. This type
45
of cache is only useful for improving the performance of hide/show
46
operations. All other situations are already handled by the
49
The screen cache is an image in size of the screen. As long as
50
the scales don't change the target image is scaled from the cache.
51
This might improve the performance
52
when resizing the plot widget, but suffers from scaling effects.
54
The default policy is NoCache
63
explicit QwtPlotRasterItem(const QString& title = QString::null);
64
explicit QwtPlotRasterItem(const QwtText& title);
65
virtual ~QwtPlotRasterItem();
67
void setAlpha(int alpha);
70
void setCachePolicy(CachePolicy);
71
CachePolicy cachePolicy() const;
73
void invalidateCache();
75
virtual void draw(QPainter *p,
76
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
77
const QRect &rect) const;
79
virtual QSize rasterHint(const QwtDoubleRect &) const;
84
Renders an image for an area
86
The format of the image must be QImage::Format_Indexed8,
87
QImage::Format_RGB32 or QImage::Format_ARGB32
89
\param xMap Maps x-values into pixel coordinates.
90
\param yMap Maps y-values into pixel coordinates.
91
\param area Requested area for the image in scale coordinates
93
virtual QImage renderImage(const QwtScaleMap &xMap,
94
const QwtScaleMap &yMap, const QwtDoubleRect &area
98
QwtPlotRasterItem( const QwtPlotRasterItem & );
99
QwtPlotRasterItem &operator=( const QwtPlotRasterItem & );