内容表

上一话题

QCameraFocusZone

下一话题

QCameraImageCaptureControl

QCameraImageCapture

QCameraImageCapture class is used for the recording of media content. 更多

Inheritance diagram of PySide2.QtMultimedia.QCameraImageCapture

概要

信号

详细描述

QCameraImageCapture class is a high level images recording class. It’s not intended to be used alone but for accessing the media recording functions of other media objects, like QCamera .

camera = new QCamera;
viewfinder = new QCameraViewfinder();
viewfinder->show();
camera->setViewfinder(viewfinder);
imageCapture = new QCameraImageCapture(camera);
camera->setCaptureMode(QCamera::CaptureStillImage);
camera->start();
//on half pressed shutter button
camera->searchAndLock();
//on shutter button pressed
imageCapture->capture();
//on shutter button released
camera->unlock();
											

另请参阅

QCamera

class QCameraImageCapture ( mediaObject [ , parent=None ] )
param parent

QObject

param mediaObject

QMediaObject

Constructs a media recorder which records the media produced by mediaObject .

parent 会被传递给 QMediaObject .

PySide2.QtMultimedia.QCameraImageCapture. Error

常量

描述

QCameraImageCapture.NoError

No Errors.

QCameraImageCapture.NotReadyError

The service is not ready for capture yet.

QCameraImageCapture.ResourceError

Device is not ready or not available.

QCameraImageCapture.OutOfSpaceError

No space left on device.

QCameraImageCapture.NotSupportedFeatureError

Device does not support stillimages capture.

QCameraImageCapture.FormatError

Current format is not supported.

PySide2.QtMultimedia.QCameraImageCapture. DriveMode

常量

描述

QCameraImageCapture.SingleImageCapture

Drive mode is capturing a single picture.

PySide2.QtMultimedia.QCameraImageCapture. CaptureDestination

常量

描述

QCameraImageCapture.CaptureToFile

Capture the image to a file.

QCameraImageCapture.CaptureToBuffer

Capture the image to a buffer for further processing.

PySide2.QtMultimedia.QCameraImageCapture. availability ( )
返回类型

AvailabilityStatus

Returns the availability of this functionality.

PySide2.QtMultimedia.QCameraImageCapture. bufferFormat ( )
返回类型

PixelFormat

Returns the buffer image capture format being used.

PySide2.QtMultimedia.QCameraImageCapture. bufferFormatChanged ( format )
参数

format PixelFormat

PySide2.QtMultimedia.QCameraImageCapture. cancelCapture ( )

Cancel incomplete capture requests. Already captured and queused for proicessing images may be discarded.

PySide2.QtMultimedia.QCameraImageCapture. capture ( [ location="" ] )
参数

location – unicode

返回类型

int

Capture the image and save it to file . This operation is asynchronous in majority of cases, followed by signals imageExposed() , imageCaptured() , imageSaved() or error() .

If an empty file is passed, the camera backend choses the default location and naming scheme for photos on the system, if only file name without full path is specified, the image will be saved to the default directory, with a full path reported with imageCaptured() and imageSaved() signals.

QCamera saves all the capture parameters like exposure settings or image processing parameters, so changes to camera parameters after is called do not affect previous capture requests.

returns the capture Id parameter, used with imageExposed() , imageCaptured() and imageSaved() signals.

PySide2.QtMultimedia.QCameraImageCapture. captureDestination ( )
返回类型

CaptureDestinations

Returns the image capture destination being used.

PySide2.QtMultimedia.QCameraImageCapture. captureDestinationChanged ( destination )
参数

destination CaptureDestinations

PySide2.QtMultimedia.QCameraImageCapture. encodingSettings ( )
返回类型

QImageEncoderSettings

Returns the image encoder settings being used.

PySide2.QtMultimedia.QCameraImageCapture. error ( )
返回类型

Error

返回当前错误状态。

另请参阅

errorString()

PySide2.QtMultimedia.QCameraImageCapture. error ( id , error , errorString )
参数
  • id int

  • error Error

  • errorString – unicode

PySide2.QtMultimedia.QCameraImageCapture. errorString ( )
返回类型

unicode

Returns a string describing the current error state.

另请参阅

error()

PySide2.QtMultimedia.QCameraImageCapture. imageAvailable ( id , frame )
参数
PySide2.QtMultimedia.QCameraImageCapture. imageCaptured ( id , preview )
参数
  • id int

  • preview QImage

PySide2.QtMultimedia.QCameraImageCapture. imageCodecDescription ( codecName )
参数

codecName – unicode

返回类型

unicode

Returns a description of an image codec .

PySide2.QtMultimedia.QCameraImageCapture. imageExposed ( id )
参数

id int

PySide2.QtMultimedia.QCameraImageCapture. imageMetadataAvailable ( id , key , value )
参数
  • id int

  • key – unicode

  • value – object

PySide2.QtMultimedia.QCameraImageCapture. imageSaved ( id , fileName )
参数
  • id int

  • fileName – unicode

PySide2.QtMultimedia.QCameraImageCapture. isAvailable ( )
返回类型

bool

Returns true if the images capture service ready to use.

PySide2.QtMultimedia.QCameraImageCapture. isCaptureDestinationSupported ( destination )
参数

destination CaptureDestinations

返回类型

bool

Returns true if the image capture destination is supported; otherwise returns false.

PySide2.QtMultimedia.QCameraImageCapture. isReadyForCapture ( )
返回类型

bool

PySide2.QtMultimedia.QCameraImageCapture. readyForCaptureChanged ( ready )
参数

ready bool

PySide2.QtMultimedia.QCameraImageCapture. setBufferFormat ( format )
参数

format PixelFormat

Sets the buffer image capture format to be used.

PySide2.QtMultimedia.QCameraImageCapture. setCaptureDestination ( destination )
参数

destination CaptureDestinations

Sets the capture destination to be used.

PySide2.QtMultimedia.QCameraImageCapture. setEncodingSettings ( settings )
参数

settings QImageEncoderSettings

Sets the image encoding settings .

If some parameters are not specified, or null settings are passed, the encoder choose the default encoding parameters.

PySide2.QtMultimedia.QCameraImageCapture. supportedBufferFormats ( )
返回类型

Returns the list of supported buffer image capture formats.

PySide2.QtMultimedia.QCameraImageCapture. supportedImageCodecs ( )
返回类型

字符串列表

Returns a list of supported image codecs.