Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions

QPixmapConvolutionFilter Class Reference
[
QtGui module]

The QPixmapConvolutionFilter class provides convolution filtering for the pixmap. More...

 #include <QPixmapConvolutionFilter>

Inherits QPixmapFilter.

This class was introduced in Qt 4.5.

Public Functions


Detailed Description

The QPixmapConvolutionFilter class provides convolution filtering for the pixmap.

When QPixmapConvolutionFilter is applied the effective area is processed with convolution filter. In convolution the pixel value is calculated from the neighboring pixels based on the weightening convolution kernel.

Example:

 QPixmapConvolutionFilter *myFilter = new QPixmapConvolutionFilter;
 qreal kernel[] = {
      0.0,-1.0, 0.0,
     -1.0, 5.0,-1.0,
      0.0,-1.0, 0.0
     };
 myFilter->setConvolutionKernel(kernel, 3, 3);
 myFilter->draw(painter, QPoint(0, 0), originalPixmap);

Member Function Documentation

QPixmapConvolutionFilter::QPixmapConvolutionFilter ()

Constructs a pixmap convolution filter.

By default there is no convolution kernel.

QPixmapConvolutionFilter::~QPixmapConvolutionFilter ()

Destructor of pixmap convolution filter.

void QPixmapConvolutionFilter::setConvolutionKernel ( const qreal * kernel, int rows, int columns )

Sets convolution kernel with the given number of rows and columns. Values from kernel are copied to internal data structure.

To preserve the intensity of the pixmap, the sum of all the values in the convolution kernel should add up to 1.0. A sum greater than 1.0 produces a lighter result and a sum less than 1.0 produces a darker and transparent result.


Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.5.0-beta1