QCameraImageCaptureclass is used for the recording of media content. 更多 …
def
availability
()
def
bufferFormat
()
def
captureDestination
()
def
encodingSettings
()
def
error
()
def
errorString
()
def
imageCodecDescription
(codecName)
def
isAvailable
()
def
isCaptureDestinationSupported
(destination)
def
isReadyForCapture
()
def
setBufferFormat
(format)
def
setCaptureDestination
(destination)
def
setEncodingSettings
(settings)
def
supportedBufferFormats
()
def
supportedImageCodecs
()
def
cancelCapture
()
def
capture
([location=””])
def
bufferFormatChanged
(format)
def
captureDestinationChanged
(destination)
def
error
(id, error, errorString)
def
imageAvailable
(id, frame)
def
imageCaptured
(id, preview)
def
imageExposed
(id)
def
imageMetadataAvailable
(id, key, value)
def
imageSaved
(id, fileName)
def
readyForCaptureChanged
(ready)
QCameraImageCaptureclass 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, likeQCamera.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();另请参阅
QCameraImageCapture
(
mediaObject
[
,
parent=None
]
)
¶
- param parent
QObject- param mediaObject
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
(
)
¶
Returns the image encoder settings being used.
PySide2.QtMultimedia.QCameraImageCapture.
error
(
)
¶
返回当前错误状态。
另请参阅
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.
另请参阅
PySide2.QtMultimedia.QCameraImageCapture.
imageAvailable
(
id
,
frame
)
¶
id
–
int
frame
–
QVideoFrame
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.