Qwt Programmer's Manual

QwtColorFilter


NAME

QwtColorFilter - A base class for color filters

SYNOPSIS

#include <qwt_clrfltr.h>

DESCRIPTION

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.

PUBLIC MEMBERS

~QwtColorFilter
Destructor
operator()
Filter function

DERIVED CLASSES

QwtFltrDim, QwtFltrGray, QwtFltrInv

PREDEFINED FILTERS

QwtFltrDim

This color filter can be used to darken colors.

Members:

QwtFltrDim
Constructor
operator()
Filter function
dimFactor
Return dim factor

QwtFltrGray

This color filter maps colors into a grayscale with optional inversion.

Members:

QwtFltrGray
Constructor
operator()
Filter function

QwtFltrInv

This filter inverts the RGB values of colors.

Members:

operator()
Filter function

GLOBAL CONSTANTS

NoColorFilter
A color filter which returns the color without modification

MEMBER FUNCTION DESCRIPTION


QwtColorFilter::~QwtColorFilter

Destroys a QwtColorFilter instance

Syntax

QwtColorFilter::~QwtColorFilter()

QwtColorFilter::operator()

Filter function

Syntax

QColor QwtColorFilter::operator()(const QColor &c)

Access

public virtual

Parameters

const QColor &c
modified color

Description

The filter function can be redefined by derived classes. The default implementation returns its argument.

QwtFltrGray::QwtFltrGray

Construct a QwtFltrGray instance

Syntax

QwtFltrGray::QwtFltrGray(bool inv = FALSE)

Parameters

bool inv
Invert the result if TRUE

QwtFltrGray::operator()

Filter function which changes a color to grayscale

Syntax

QColor QwtFltrGray::operator()(const QColor &c)

Parameters

const QColor &c
color to be modified

QwtFltrDim::QwtFltrDim

Construct a QwtFltrDim instance

Syntax

QwtFltrDim::QwtFltrDim(int dim)

Parameters

int factor
Darkening factor. A factor greater than 100 produces a darker color, a factor smaller than 100 produces a brighter color.

Description

QwtFltrDim uses QColor::dark() (See Qt Manual)

QwtFltrDim::operator()

Filter function. Darkens or brightens a specified color.

Syntax

QColor QwtFltrDim::operator()(const QColor &c)

Parameters

const QColor &c

Description

The behaviour of the filter is influenced by the constructor argument (See QwtFltrDim

QwtFltrInv::operator()

Filter function. Inverts the RGB values of a specified color.

Syntax

QColor QwtFltrInv::operator()(const QColor &c)

Parameters

const QColor &c
Color to be modified

Qwt Widget Library 01/01/98