QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_matrix_raster_data.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
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 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_MATRIX_RASTER_DATA_H
28#define QWT_MATRIX_RASTER_DATA_H
29
30#include "qwtcore_global.h"
31#include "qwt_raster_data.h"
32
33#if QT_VERSION < 0x060000
34template< typename T >
35class QVector;
36#endif
37
45class QWTCORE_EXPORT QwtMatrixRasterData : public QwtRasterData
46{
47public:
54 {
60
66
71 BicubicInterpolation
72 };
73
74 // Constructor
76 // Destructor
77 ~QwtMatrixRasterData() override;
78
79 // Set the resampling algorithm
80 void setResampleMode(ResampleMode mode);
81 // Return the resampling algorithm
82 ResampleMode resampleMode() const;
83
84 // Assign the bounding interval for an axis
85 void setInterval(Qt::Axis, const QwtInterval&);
86 // Return bounding interval for an axis
87 virtual QwtInterval interval(Qt::Axis axis) const override final;
88
89 // Assign a value matrix
90 void setValueMatrix(const QVector< double >& values, int numColumns);
91 // Return value matrix
92 const QVector< double > valueMatrix() const;
93
94 // Change a single value in the matrix
95 void setValue(int row, int col, double value);
96
97 // Return number of columns of the value matrix
98 int numColumns() const;
99 // Return number of rows of the value matrix
100 int numRows() const;
101
102 // Calculate the pixel hint
103 virtual QRectF pixelHint(const QRectF&) const override;
104
105 // Return the value at a raster position
106 virtual double value(double x, double y) const override;
107
108private:
109 void update();
110
111 QWT_DECLARE_PRIVATE(QwtMatrixRasterData)
112};
113
114#endif
Definition qwt_clipper.h:41
A class representing an interval
Definition qwt_interval.h:39
A class representing a matrix of values as raster data.
Definition qwt_matrix_raster_data.h:46
ResampleMode
Resampling algorithm
Definition qwt_matrix_raster_data.h:54
@ BilinearInterpolation
Definition qwt_matrix_raster_data.h:65
@ NearestNeighbour
Definition qwt_matrix_raster_data.h:59
QwtRasterData defines an interface to any type of raster data.
Definition qwt_raster_data.h:63
virtual QRectF pixelHint(const QRectF &) const
Return a hint for the raster item, about how to align the pixels
Definition qwt_raster_data.cpp:283