The QCameraViewfinderSettings class provides a set of viewfinder settings. 更多...
头: | #include <QCameraViewfinderSettings> |
qmake: | QT += multimedia |
Since: | Qt 5.5 |
QCameraViewfinderSettings () | |
QCameraViewfinderSettings (const QCameraViewfinderSettings & other ) | |
~QCameraViewfinderSettings () | |
bool | isNull () const |
qreal | maximumFrameRate () const |
qreal | minimumFrameRate () const |
QSize | pixelAspectRatio () const |
QVideoFrame::PixelFormat | pixelFormat () const |
QSize | resolution () const |
void | setMaximumFrameRate (qreal rate ) |
void | setMinimumFrameRate (qreal rate ) |
void | setPixelAspectRatio (const QSize & ratio ) |
void | setPixelAspectRatio (int horizontal , int vertical ) |
void | setPixelFormat (QVideoFrame::PixelFormat format ) |
void | setResolution (const QSize & resolution ) |
void | setResolution (int width , int height ) |
void | swap (QCameraViewfinderSettings & other ) |
QCameraViewfinderSettings & | operator= (const QCameraViewfinderSettings & other ) |
QCameraViewfinderSettings & | operator= (QCameraViewfinderSettings && other ) |
bool | operator!= (const QCameraViewfinderSettings & lhs , const QCameraViewfinderSettings & rhs ) |
The QCameraViewfinderSettings class provides a set of viewfinder settings.
A viewfinder settings object is used to specify the viewfinder settings used by QCamera . Viewfinder settings are selected by constructing a QCameraViewfinderSettings object, setting the desired properties and then passing it to a QCamera instance using the QCamera::setViewfinderSettings () 函数。
QCameraViewfinderSettings viewfinderSettings; viewfinderSettings.setResolution(640, 480); viewfinderSettings.setMinimumFrameRate(15.0); viewfinderSettings.setMaximumFrameRate(30.0); camera->setViewfinderSettings(viewfinderSettings);
Different cameras may have different capabilities. The application should query the camera capabilities before setting parameters. For example, the application should call QCamera::supportedViewfinderResolutions () 先于调用 setResolution ().
另请参阅 QCamera .
Constructs a null viewfinder settings object.
Constructs a copy of the viewfinder settings object other .
Destroys a viewfinder settings object.
Identifies if a viewfinder settings object is uninitalized.
Returns true if the settings are null, and false if they are not.
Returns the viewfinder maximum frame rate in frames per second.
另请参阅 setMaximumFrameRate () 和 minimumFrameRate ().
Returns the viewfinder minimum frame rate in frames per second.
另请参阅 setMinimumFrameRate () 和 maximumFrameRate ().
Returns the viewfinder pixel aspect ratio.
另请参阅 setPixelAspectRatio ().
Returns the viewfinder pixel format.
另请参阅 setPixelFormat ().
Returns the viewfinder resolution.
另请参阅 setResolution ().
Sets the viewfinder maximum frame rate in frames per second.
If the maximum frame rate is equal to the minimum frame rate, the frame rate is fixed. If not, the actual frame rate fluctuates between the minimum and the maximum.
若给定
rate
equals to
0
, the backend makes an optimal choice based on the supported frame rates and the other viewfinder settings.
另请参阅 maximumFrameRate (), setMinimumFrameRate (),和 QCamera::supportedViewfinderFrameRateRanges ().
Sets the viewfinder minimum frame rate in frames per second.
If the minimum frame rate is equal to the maximum frame rate, the frame rate is fixed. If not, the actual frame rate fluctuates between the minimum and the maximum.
若给定
rate
equals to
0
, the backend makes an optimal choice based on the supported frame rates and the other viewfinder settings.
另请参阅 minimumFrameRate (), setMaximumFrameRate (),和 QCamera::supportedViewfinderFrameRateRanges ().
Sets the viewfinder pixel aspect ratio .
另请参阅 pixelAspectRatio ().
这是重载函数。
设置 horizontal and vertical elements of the viewfinder's pixel aspect ratio.
Sets the viewfinder pixel format .
若给定 format 等于 QVideoFrame::Format_Invalid , the backend uses the default format.
另请参阅 pixelFormat () 和 QCamera::supportedViewfinderPixelFormats ().
Sets the viewfinder resolution .
若给定 resolution is empty, the backend makes an optimal choice based on the supported resolutions and the other viewfinder settings.
If the camera is used to capture videos or images, the viewfinder resolution might be ignored if it conflicts with the capture resolution.
另请参阅 resolution (), QVideoEncoderSettings::setResolution (), QImageEncoderSettings::setResolution (),和 QCamera::supportedViewfinderResolutions ().
这是重载函数。
设置 width and height of the viewfinder resolution.
Swaps this viewfinder settings object with other 。此函数非常快且从不失败。
Assigns the value of other to a viewfinder settings object.
移动 other to this viewfinder settings object and returns a reference to this object.
Determines if lhs is of equal value to rhs .
Returns true if the settings objects are not of equal value, and false if they are of equal value.
该函数在 Qt 5.5 引入。