![]() |
Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QPixmapConvolutionFilter class provides convolution filtering for pixmaps. More...
#include <QPixmapConvolutionFilter>
Inherits QPixmapFilter.
This class was introduced in Qt 4.5.
The QPixmapConvolutionFilter class provides convolution filtering for pixmaps.
QPixmapConvolutionFilter implements a convolution pixmap filter, which is applied when draw() is called. A convolution filter lets you distort an image by setting the values of a matrix of qreal values called its kernel. The matrix's values are usually between -1.0 and 1.0.
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);
See also Pixmap Filters Example, QPixmapColorizeFilter, and QPixmapDropShadowFilter.
Constructs a pixmap convolution filter.
By default there is no convolution kernel.
Destructor of pixmap convolution filter.
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 © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt 4.5.0-rc1 |