Qwt Programmer's Manual
QwtColorFilter
QwtColorFilter - A base class for color filters
#include <qwt_clrfltr.h>
A color filter is a class which can be used to modify colors
in a specific way. A QwtColorFilter has an operator()
which takes a reference to a QColor as its argument and returns the
result of the modification. The QwtColorFilter class itself does not
modify colors, but is intended as a base class for user-defined color
filters. Building a color filter is quite easy: Derive a class from
QwtColorFilter and redefine the operator() member. Qwt has several
pre-defined color filters (see below).
Color filters are used by QwtPlot::print.
- ~QwtColorFilter
- Destructor
- operator()
- Filter function
QwtFltrDim, QwtFltrGray, QwtFltrInv
This color filter can be used to darken colors.
Members:
- QwtFltrDim
- Constructor
- operator()
- Filter function
- dimFactor
- Return dim factor
This color filter maps colors into a grayscale with optional
inversion.
Members:
- QwtFltrGray
- Constructor
- operator()
- Filter function
This filter inverts the RGB values of colors.
Members:
- operator()
- Filter function
- NoColorFilter
- A color filter which returns the color
without modification
Destroys a QwtColorFilter instance
QwtColorFilter::~QwtColorFilter()
Filter function
QColor QwtColorFilter::operator()(const QColor &c)
public virtual
- const QColor &c
- modified color
The filter function can be redefined by derived classes.
The default implementation returns its argument.
Construct a QwtFltrGray instance
QwtFltrGray::QwtFltrGray(bool inv = FALSE)
- bool inv
- Invert the result if TRUE
Filter function which changes a color to grayscale
QColor QwtFltrGray::operator()(const QColor &c)
- const QColor &c
- color to be modified
Construct a QwtFltrDim instance
QwtFltrDim::QwtFltrDim(int dim)
- int factor
- Darkening factor. A factor greater
than 100 produces a darker color,
a factor smaller than 100 produces
a brighter color.
QwtFltrDim uses QColor::dark() (See Qt Manual)
Filter function. Darkens or brightens a specified
color.
QColor QwtFltrDim::operator()(const QColor &c)
- const QColor &c
-
The behaviour of the filter is influenced by the
constructor argument (See QwtFltrDim
Filter function. Inverts the RGB values of a
specified color.
QColor QwtFltrInv::operator()(const QColor &c)
- const QColor &c
- Color to be modified
Qwt Widget Library 01/01/98