CopperSpice API  1.7.2
QCameraViewfinderSettings Class Reference

Provides a set of viewfinder settings. More...

Public Methods

 QCameraViewfinderSettings ()
 
 QCameraViewfinderSettings (const QCameraViewfinderSettings &other)
 
 ~QCameraViewfinderSettings ()
 
bool isNull () const
 
qreal maximumFrameRate () const
 
qreal minimumFrameRate () const
 
bool operator!= (const QCameraViewfinderSettings &other) const
 
QCameraViewfinderSettings & operator= (const QCameraViewfinderSettings &other)
 
QCameraViewfinderSettings & operator= (QCameraViewfinderSettings &&other)
 
bool operator== (const QCameraViewfinderSettings &other) 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 &)
 
void setResolution (int width, int height)
 
void swap (QCameraViewfinderSettings &other)
 

Detailed Description

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() method.

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() before calling setResolution().

See also
QCamera

Constructor & Destructor Documentation

QCameraViewfinderSettings::QCameraViewfinderSettings ( )

Constructs a null viewfinder settings object.

QCameraViewfinderSettings::QCameraViewfinderSettings ( const QCameraViewfinderSettings &  other)

Constructs a copy of the viewfinder settings object other.

QCameraViewfinderSettings::~QCameraViewfinderSettings ( )

Destroys a viewfinder settings object.

Method Documentation

bool QCameraViewfinderSettings::isNull ( ) const

Identifies if a viewfinder settings object is uninitalized.

Returns true if the settings are null, and false if they are not.

qreal QCameraViewfinderSettings::maximumFrameRate ( ) const

Returns the viewfinder maximum frame rate in frames per second.

See also
setMaximumFrameRate(), minimumFrameRate()
qreal QCameraViewfinderSettings::minimumFrameRate ( ) const

Returns the viewfinder minimum frame rate in frames per second.

See also
setMinimumFrameRate(), maximumFrameRate()
bool QCameraViewfinderSettings::operator!= ( const QCameraViewfinderSettings &  other) const
inline

Returns true if this object is not equal to other, otherwise returns false.

QCameraViewfinderSettings & QCameraViewfinderSettings::operator= ( const QCameraViewfinderSettings &  other)

Copy assigns from other and returns a reference to this object.

QCameraViewfinderSettings & QCameraViewfinderSettings::operator= ( QCameraViewfinderSettings &&  other)
inline

Move assigns from other and returns a reference to this object.

bool QCameraViewfinderSettings::operator== ( const QCameraViewfinderSettings &  other) const

Returns true if this object is equal to other, otherwise returns false.

QSize QCameraViewfinderSettings::pixelAspectRatio ( ) const

Returns the viewfinder pixel aspect ratio.

See also
setPixelAspectRatio()
QVideoFrame::PixelFormat QCameraViewfinderSettings::pixelFormat ( ) const

Returns the viewfinder pixel format.

See also
setPixelFormat()
QSize QCameraViewfinderSettings::resolution ( ) const

Returns the viewfinder resolution.

See also
setResolution()
void QCameraViewfinderSettings::setMaximumFrameRate ( qreal  rate)

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.

If the given rate equals to 0, the backend makes an optimal choice based on the supported frame rates and the other viewfinder settings.

See also
maximumFrameRate(), setMinimumFrameRate(), QCamera::supportedViewfinderFrameRateRanges()
void QCameraViewfinderSettings::setMinimumFrameRate ( qreal  rate)

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.

If the given rate equals to 0, the backend makes an optimal choice based on the supported frame rates and the other viewfinder settings.

See also
minimumFrameRate(), setMaximumFrameRate(), QCamera::supportedViewfinderFrameRateRanges()
void QCameraViewfinderSettings::setPixelAspectRatio ( const QSize ratio)

Sets the viewfinder pixel aspect ratio.

See also
pixelAspectRatio()
void QCameraViewfinderSettings::setPixelAspectRatio ( int  horizontal,
int  vertical 
)
inline

Sets the horizontal and vertical elements of the viewfinder's pixel aspect ratio.

void QCameraViewfinderSettings::setPixelFormat ( QVideoFrame::PixelFormat  format)

Sets the viewfinder pixel format.

If the given format is equal to QVideoFrame::Format_Invalid, the backend uses the default format.

See also
pixelFormat(), QCamera::supportedViewfinderPixelFormats()
void QCameraViewfinderSettings::setResolution ( const QSize resolution)

Sets the viewfinder resolution.

If the given 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.

See also
resolution(), QVideoEncoderSettings::setResolution(), QImageEncoderSettings::setResolution(), QCamera::supportedViewfinderResolutions()
void QCameraViewfinderSettings::setResolution ( int  width,
int  height 
)
inline

Sets the width and height of the viewfinder resolution.

void QCameraViewfinderSettings::swap ( QCameraViewfinderSettings &  other)
inline

Swaps this viewfinder settings object with other. This function is very fast and never fails.