QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_colormap_compat.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
10#ifndef QWT_COLORMAP_COMPAT_H
11#define QWT_COLORMAP_COMPAT_H
12
13#include "qwt_colormap.h"
14#include "qwt_interval.h"
15
23{
24
26inline QRgb rgb(const QwtColorMap& map, const QwtInterval& interval, double value)
27{
28 return map.rgb(interval.minValue(), interval.maxValue(), value);
29}
30
32inline uint colorIndex(const QwtColorMap& map, int numColors, const QwtInterval& interval, double value)
33{
34 return map.colorIndex(numColors, interval.minValue(), interval.maxValue(), value);
35}
36
38inline QColor color(const QwtColorMap& map, const QwtInterval& interval, double value)
39{
40 return map.color(interval.minValue(), interval.maxValue(), value);
41}
42
43} // namespace QwtColorMapCompat
44
45#endif
QwtColorMap is used to map values into colors.
Definition qwt_colormap.h:33
virtual QRgb rgb(double vMin, double vMax, double value) const =0
Map a value of a given interval into a RGB value.
virtual uint colorIndex(int numColors, double vMin, double vMax, double value) const
Map a value of a given interval into a color index.
Definition qwt_colormap.cpp:252
A class representing an interval
Definition qwt_interval.h:39
constexpr double minValue() const noexcept
Definition qwt_interval.h:214
constexpr double maxValue() const noexcept
Definition qwt_interval.h:223
QwtInterval-based convenience wrappers for QwtColorMap.
Definition qwt_colormap_compat.h:23
QColor color(const QwtColorMap &map, const QwtInterval &interval, double value)
Map a value of a given interval into a QColor.
Definition qwt_colormap_compat.h:38
uint colorIndex(const QwtColorMap &map, int numColors, const QwtInterval &interval, double value)
Map a value of a given interval into a color index.
Definition qwt_colormap_compat.h:32
QRgb rgb(const QwtColorMap &map, const QwtInterval &interval, double value)
Map a value of a given interval into a RGB value.
Definition qwt_colormap_compat.h:26