The QCameraImageProcessing class provides an interface for image processing related camera settings. 更多...
头: | #include <QCameraImageProcessing> |
qmake: | QT += multimedia |
继承: | QObject |
enum | ColorFilter { ColorFilterNone, ColorFilterGrayscale, ColorFilterNegative, ColorFilterSolarize, ColorFilterSepia, …, ColorFilterVendor } |
enum | WhiteBalanceMode { WhiteBalanceAuto, WhiteBalanceManual, WhiteBalanceSunlight, WhiteBalanceCloudy, WhiteBalanceShade, …, WhiteBalanceVendor } |
qreal | brightness () const |
QCameraImageProcessing::ColorFilter | colorFilter () const |
qreal | contrast () const |
qreal | denoisingLevel () const |
bool | isAvailable () const |
bool | isColorFilterSupported (QCameraImageProcessing::ColorFilter filter ) const |
bool | isWhiteBalanceModeSupported (QCameraImageProcessing::WhiteBalanceMode mode ) const |
qreal | manualWhiteBalance () const |
qreal | saturation () const |
void | setBrightness (qreal value ) |
void | setColorFilter (QCameraImageProcessing::ColorFilter filter ) |
void | setContrast (qreal value ) |
void | setDenoisingLevel (qreal level ) |
void | setManualWhiteBalance (qreal colorTemperature ) |
void | setSaturation (qreal value ) |
void | setSharpeningLevel (qreal level ) |
void | setWhiteBalanceMode (QCameraImageProcessing::WhiteBalanceMode mode ) |
qreal | sharpeningLevel () const |
QCameraImageProcessing::WhiteBalanceMode | whiteBalanceMode () const |
virtual | ~QCameraImageProcessing () |
After capturing the data for a camera frame, the camera hardware and software performs various image processing tasks to produce a final image. This includes compensating for ambient light color, reducing noise, as well as making some other adjustments to the image.
You can retrieve this class from an instance of a QCamera 对象。
For example, you can set the white balance (or color temperature) used for processing images:
camera = new QCamera; QCameraImageProcessing *imageProcessing = camera->imageProcessing(); if (imageProcessing->isAvailable()) { imageProcessing->setWhiteBalanceMode(QCameraImageProcessing::WhiteBalanceFluorescent); }
Or adjust the amount of denoising performed:
imageProcessing->setDenoisingLevel(-0.3); //reduce the amount of denoising applied
In some cases changing these settings may result in a longer delay before an image is ready.
For more information on image processing of camera frames, see 摄像头图像处理 .
另请参阅 QCameraImageProcessingControl .
常量 | 值 | 描述 |
---|---|---|
QCameraImageProcessing::ColorFilterNone
|
0
|
No filter is applied to images. |
QCameraImageProcessing::ColorFilterGrayscale
|
1
|
A grayscale filter. |
QCameraImageProcessing::ColorFilterNegative
|
2
|
A negative filter. |
QCameraImageProcessing::ColorFilterSolarize
|
3
|
A solarize filter. |
QCameraImageProcessing::ColorFilterSepia
|
4
|
A sepia filter. |
QCameraImageProcessing::ColorFilterPosterize
|
5
|
A posterize filter. |
QCameraImageProcessing::ColorFilterWhiteboard
|
6
|
A whiteboard filter. |
QCameraImageProcessing::ColorFilterBlackboard
|
7
|
A blackboard filter. |
QCameraImageProcessing::ColorFilterAqua
|
8
|
An aqua filter. |
QCameraImageProcessing::ColorFilterVendor
|
1000
|
The base value for vendor defined filters. |
该枚举在 Qt 5.5 引入或被修改。
常量 | 值 | 描述 |
---|---|---|
QCameraImageProcessing::WhiteBalanceAuto
|
0
|
Auto white balance mode. |
QCameraImageProcessing::WhiteBalanceManual
|
1
|
Manual white balance. In this mode the white balance should be set with setManualWhiteBalance () |
QCameraImageProcessing::WhiteBalanceSunlight
|
2
|
Sunlight white balance mode. |
QCameraImageProcessing::WhiteBalanceCloudy
|
3
|
Cloudy white balance mode. |
QCameraImageProcessing::WhiteBalanceShade
|
4
|
Shade white balance mode. |
QCameraImageProcessing::WhiteBalanceTungsten
|
5
|
Tungsten (incandescent) white balance mode. |
QCameraImageProcessing::WhiteBalanceFluorescent
|
6
|
Fluorescent white balance mode. |
QCameraImageProcessing::WhiteBalanceFlash
|
7
|
Flash white balance mode. |
QCameraImageProcessing::WhiteBalanceSunset
|
8
|
Sunset white balance mode. |
QCameraImageProcessing::WhiteBalanceVendor
|
1000
|
Base value for vendor defined white balance modes. |
[virtual protected]
QCameraImageProcessing::
~QCameraImageProcessing
()
Destroys the camera focus object.
Returns the brightness adjustment setting.
另请参阅 setBrightness ().
Returns the color filter which will be applied to image data captured by the camera.
该函数在 Qt 5.5 引入。
另请参阅 setColorFilter ().
Returns the contrast adjustment setting.
另请参阅 setContrast ().
Returns the denoising adjustment level.
另请参阅 setDenoisingLevel ().
Returns true if image processing related settings are supported by this camera.
Returns true if a color filter is supported.
该函数在 Qt 5.5 引入。
Returns true if the white balance mode is supported.
Returns the current color temperature if the current white balance mode is
WhiteBalanceManual
. For other modes the return value is undefined.
另请参阅 setManualWhiteBalance ().
Returns the saturation adjustment value.
另请参阅 setSaturation ().
Set the brightness adjustment to value .
Valid brightness adjustment values range between -1.0 and 1.0, with a default of 0.
另请参阅 brightness ().
Sets the color filter which will be applied to image data captured by the camera.
该函数在 Qt 5.5 引入。
另请参阅 colorFilter ().
Set the contrast adjustment to value .
Valid contrast adjustment values range between -1.0 and 1.0, with a default of 0.
另请参阅 contrast ().
Sets the denoising adjustment level .
Valid denoising values range between -1.0 and 1.0, with a default of 0.
If the parameter value is set to 0, the amount of denoising applied is selected by camera and depends on camera capabilities and settings. Changing value in -1.0..1.0 range adjusts the amount of denoising applied within the supported range.
另请参阅 denoisingLevel ().
Sets manual white balance to
colorTemperature
. This is used when
whiteBalanceMode
() 被设为
WhiteBalanceManual
. The units are Kelvin.
另请参阅 manualWhiteBalance ().
Sets the saturation adjustment value to value .
Valid saturation values range between -1.0 and 1.0, with a default of 0.
另请参阅 saturation ().
Sets the sharpening adjustment level .
Valid sharpening values range between -1.0 and 1.0, with a default of 0.
另请参阅 sharpeningLevel ().
Sets the white balance to mode .
另请参阅 whiteBalanceMode ().
Returns the sharpening adjustment level.
另请参阅 setSharpeningLevel ().
Returns the white balance mode being used.
另请参阅 setWhiteBalanceMode ().