Home |
The QtImageFilterFactory class is used to create and manage QtImageFilter objects. More...
#include <QtImageFilterFactory>
The QtImageFilterFactory class is used to create and manage QtImageFilter objects.
QtImageFilterFactory is part of the QtImageFilters solution, and is used to create instances of the registered image filters. The framework supports many popular image filters by default, among these are gaussian blurring, embossing (see image below), sharpening, defocus, punch/pinch and convolution filters.
The documentation for the createImageFilter() function provides a complete list of all the supported image filters.
Developers can extend the framework with their own custom image filters by deriving from the QtImageFilter class. A list of the currently registered filters, including custom filters, can be retrieved using the imageFilterList() function.
When creating a custom image filter, it must be registered using the registerImageFilter() function before instances can be created using the createImageFilter() function. For example:
qtRegisterImageFilter<MirrorFilter>(QLatin1String("MirrorFilter")); QStringList filters = QtImageFilterFactory::imageFilterList(); for (int i = 0; i < filters.count(); ++i) { m_imageFilters += QtImageFilterFactory::createImageFilter(filters[i]);
The registerImageFilter() function requires an ImageFilterFactoryFunction pointer and the name of the image filter. ImageFilterFactoryFunction is a type definition for a function that can create and return a QtImageFilter object of a given filter type.
Due to compiler limitations, the template version of the registerImageFilter() function is not available on all platforms (the related qtRegisterImageFilter() function is provided as a work-around for the MSVC 6 compiler).
See also QtImageFilter.
This is a type definition for a pointer to a function with the following signature:
QtImageFilter *myFilterFactoryFunc(void);
See also registerImageFilter().
Creates an instance of the image filter specified by the given name. Returns true if the image filter was successfully initialized; otherwise false.
The given filter must be registered using the registerImageFilter() function. The following image filters are registered by default:
Filter Name | Filter Operation | Supported Options |
---|---|---|
ConvolutionFilter | Creates a custom convolutionfilter | ConvolutionKernelMatrix, FilterChannels, FilterBorderPolicy, ConvolutionDivisor, ConvolutionBias |
GaussianBlur | Creates a gaussian blur filter. | Radius, FilterChannels, FilterBorderPolicy |
Defocus | Blurs the image. | FilterChannels, FilterBorderPolicy |
Highlight | FilterChannels, FilterBorderPolicy | |
Sharpen | Sharpens the image | FilterChannels, FilterBorderPolicy |
SharpenMore | Sharpens the image | FilterChannels, FilterBorderPolicy |
SharpenEvenMore | Sharpens the image | FilterChannels, FilterBorderPolicy |
EdgeDetect | Edge detection filter | |
BigEdge | Edge detection filter (gives thicker edges) | FilterChannels, FilterBorderPolicy |
Emboss | Embosses the image (does not preserve color information) | FilterChannels, FilterBorderPolicy |
EmbossColor | Embosses the image (tries to preserve color information) | FilterChannels, FilterBorderPolicy |
Negative | Negates a color channel. | FilterChannels, FilterBorderPolicy |
RemoveChannel | Removes a color/alpha channel | FilterChannels, FilterBorderPolicy |
Punch | Distorts an image using a pinch/punch effect | Center, Radius, Force. Force should be in the interval [-1.0, 1.0] |
See also registerImageFilter().
Returns a list of the currently registered image filters.
See also registerImageFilter().
Registers an image filter factory function, where the given name is associated with the specified factory function returning a image filter object of the specified type.
See also imageFilterList() and createImageFilter().
This is a template function, registering the image filter with the given name together with a factory function that returns a new instance of an image filter of type T. For example:
registerImageFilter<MirrorFilter>(QLatin1String("MirrorFilter"));
Warning: Due to compiler limitations, this function is not available on all platforms. In particular it is not available with MSVC 6; use qtRegisterImageFilter() instead to support that compiler version.
See also createImageFilter().
This function is equivalent to the template version of the QtImageFilterFactory::registerImageFilter() function.It registers the image filter with the given name together with a factory function that returns a new instance of the image filter.
It is provided as a work-around for the MSVC 6 compiler, which doesn't support member template functions. Note that there is no need to pass any value for the dummy parameter; it is only there because of an MSVC 6 limitation.
See also QtImageFilterFactory::registerImageFilter().
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Solutions |