QCameraImageProcessing Class

The QCameraImageProcessing class provides an interface for image processing related camera settings. 更多...

头文件: #include <QCameraImageProcessing>
qmake: QT += multimedia
基类: QObject

公有类型

enum ColorFilter { ColorFilterNone, ColorFilterGrayscale, ColorFilterNegative, ColorFilterSolarize, ..., ColorFilterVendor }
enum WhiteBalanceMode { WhiteBalanceAuto, WhiteBalanceManual, WhiteBalanceSunlight, WhiteBalanceCloudy, ..., WhiteBalanceVendor }

公有函数

qreal brightness() const
ColorFilter colorFilter() const
qreal contrast() const
qreal denoisingLevel() const
bool isAvailable() const
bool isColorFilterSupported(ColorFilter filter) const
bool isWhiteBalanceModeSupported(WhiteBalanceMode mode) const
qreal manualWhiteBalance() const
qreal saturation() const
void setBrightness(qreal value)
void setColorFilter(ColorFilter filter)
void setContrast(qreal value)
void setDenoisingLevel(qreal level)
void setManualWhiteBalance(qreal colorTemperature)
void setSaturation(qreal value)
void setSharpeningLevel(qreal level)
void setWhiteBalanceMode(WhiteBalanceMode mode)
qreal sharpeningLevel() const
WhiteBalanceMode whiteBalanceMode() const
  • 32 个公有函数继承自 QObject

其他继承的成员

  • 1 个属性继承自 QObject
  • 1 个公有槽函数继承自 QObject
  • 2 个信号继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

The QCameraImageProcessing class provides an interface for image processing related camera settings.

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 object.

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 Camera Image Processing.

参见 QCameraImageProcessingControl.

成员类型

enum QCameraImageProcessing::ColorFilter

ConstantValueDescription
QCameraImageProcessing::ColorFilterNone0No filter is applied to images.
QCameraImageProcessing::ColorFilterGrayscale1A grayscale filter.
QCameraImageProcessing::ColorFilterNegative2A negative filter.
QCameraImageProcessing::ColorFilterSolarize3A solarize filter.
QCameraImageProcessing::ColorFilterSepia4A sepia filter.
QCameraImageProcessing::ColorFilterPosterize5A posterize filter.
QCameraImageProcessing::ColorFilterWhiteboard6A whiteboard filter.
QCameraImageProcessing::ColorFilterBlackboard7A blackboard filter.
QCameraImageProcessing::ColorFilterAqua8An aqua filter.
QCameraImageProcessing::ColorFilterVendor1000The base value for vendor defined filters.

This enum was introduced or modified in Qt 5.5.

enum QCameraImageProcessing::WhiteBalanceMode

ConstantValueDescription
QCameraImageProcessing::WhiteBalanceAuto0Auto white balance mode.
QCameraImageProcessing::WhiteBalanceManual1Manual white balance. In this mode the white balance should be set with setManualWhiteBalance()
QCameraImageProcessing::WhiteBalanceSunlight2Sunlight white balance mode.
QCameraImageProcessing::WhiteBalanceCloudy3Cloudy white balance mode.
QCameraImageProcessing::WhiteBalanceShade4Shade white balance mode.
QCameraImageProcessing::WhiteBalanceTungsten5Tungsten (incandescent) white balance mode.
QCameraImageProcessing::WhiteBalanceFluorescent6Fluorescent white balance mode.
QCameraImageProcessing::WhiteBalanceFlash7Flash white balance mode.
QCameraImageProcessing::WhiteBalanceSunset8Sunset white balance mode.
QCameraImageProcessing::WhiteBalanceVendor1000Base value for vendor defined white balance modes.

成员函数

qreal QCameraImageProcessing::brightness() const

Returns the brightness adjustment setting.

参见 setBrightness().

ColorFilter QCameraImageProcessing::colorFilter() const

Returns the color filter which will be applied to image data captured by the camera.

This function was introduced in Qt 5.5.

参见 setColorFilter().

qreal QCameraImageProcessing::contrast() const

Returns the contrast adjustment setting.

参见 setContrast().

qreal QCameraImageProcessing::denoisingLevel() const

Returns the denoising adjustment level.

参见 setDenoisingLevel().

bool QCameraImageProcessing::isAvailable() const

Returns true if image processing related settings are supported by this camera.

bool QCameraImageProcessing::isColorFilterSupported(ColorFilter filter) const

Returns true if a color filter is supported.

This function was introduced in Qt 5.5.

bool QCameraImageProcessing::isWhiteBalanceModeSupported(WhiteBalanceMode mode) const

Returns true if the white balance mode is supported.

qreal QCameraImageProcessing::manualWhiteBalance() const

Returns the current color temperature if the current white balance mode is WhiteBalanceManual. For other modes the return value is undefined.

参见 setManualWhiteBalance().

qreal QCameraImageProcessing::saturation() const

Returns the saturation adjustment value.

参见 setSaturation().

void QCameraImageProcessing::setBrightness(qreal value)

Set the brightness adjustment to value.

Valid brightness adjustment values range between -1.0 and 1.0, with a default of 0.

参见 brightness().

void QCameraImageProcessing::setColorFilter(ColorFilter filter)

Sets the color filter which will be applied to image data captured by the camera.

This function was introduced in Qt 5.5.

参见 colorFilter().

void QCameraImageProcessing::setContrast(qreal value)

Set the contrast adjustment to value.

Valid contrast adjustment values range between -1.0 and 1.0, with a default of 0.

参见 contrast().

void QCameraImageProcessing::setDenoisingLevel(qreal level)

Sets the denoising adjustment level.

Valid sharpening 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().

void QCameraImageProcessing::setManualWhiteBalance(qreal colorTemperature)

Sets manual white balance to colorTemperature. This is used when whiteBalanceMode() is set to WhiteBalanceManual. The units are Kelvin.

参见 manualWhiteBalance().

void QCameraImageProcessing::setSaturation(qreal value)

Sets the saturation adjustment value to value.

Valid saturation values range between -1.0 and 1.0, with a default of 0.

参见 saturation().

void QCameraImageProcessing::setSharpeningLevel(qreal level)

Sets the sharpening adjustment level.

Valid sharpening values range between -1.0 and 1.0, with a default of 0.

参见 sharpeningLevel().

void QCameraImageProcessing::setWhiteBalanceMode(WhiteBalanceMode mode)

Sets the white balance to mode.

参见 whiteBalanceMode().

qreal QCameraImageProcessing::sharpeningLevel() const

Returns the sharpening adjustment level.

参见 setSharpeningLevel().

WhiteBalanceMode QCameraImageProcessing::whiteBalanceMode() const

Returns the white balance mode being used.

参见 setWhiteBalanceMode().