Home · All Classes · All Functions ·

QStillImageCapture Class Reference

The QStillImageCapture class is used for the recording of media content. More...

    #include <QStillImageCapture>

This class is under development and is subject to change.

Inherits QMediaObject.


Public Types

enum Error { NoError, NotReadyError, ResourceError, NotSupportedFeatureError, FormatError }

Properties


Public Functions

QStillImageCapture ( QMediaObject * mediaObject, QObject * parent = 0 )
~QStillImageCapture ()
QImageEncoderSettings encodingSettings () const
Error error () const
QString errorString () const
QString imageCodecDescription ( const QString & codec ) const
bool isReadyForCapture () const
void setEncodingSettings ( const QImageEncoderSettings & settings )
QStringList supportedImageCodecs () const
QList<QSize> supportedResolutions ( const QImageEncoderSettings & settings = QImageEncoderSettings(), bool * continuous = 0 ) const

Reimplemented Public Functions

virtual QtMedia::AvailabilityError availabilityError () const
virtual bool isAvailable () const

Public Slots

void capture ( const QString & file )

Signals

void error ( QStillImageCapture::Error error )
void imageCaptured ( const QString & fileName, const QImage & preview )
void imageSaved ( const QString & fileName )
void readyForCaptureChanged ( bool ready )

Additional Inherited Members


Detailed Description

The QStillImageCapture class is used for the recording of media content.

The QStillImageCapture 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 QVideoWidget(camera);
    viewFinder->show();

    imageCapture = new QStillImageCapture(camera);

    camera->start();

    imageCapture->capture(fileName);

See also QCamera.


Member Type Documentation

enum QStillImageCapture::Error

ConstantValueDescription
QStillImageCapture::NoError0No Errors.
QStillImageCapture::NotReadyError1The service is not ready for capture yet.
QStillImageCapture::ResourceError2Device is not ready or not available.
QStillImageCapture::NotSupportedFeatureError3Device does not support stillimages capture.
QStillImageCapture::FormatError4Current format is not supported.


Property Documentation

readyForCapture : const bool

Indicates the service is ready to capture an image immediately.

Access functions:

bool isReadyForCapture () const

Notifier signal:

void readyForCaptureChanged ( bool ready )

Member Function Documentation

QStillImageCapture::QStillImageCapture ( QMediaObject * mediaObject, QObject * parent = 0 )

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

The parent is passed to QMediaObject.

QStillImageCapture::~QStillImageCapture ()

Destroys images capture object.

QtMedia::AvailabilityError QStillImageCapture::availabilityError () const   [virtual]

Reimplemented from QMediaObject::availabilityError().

Returns the availability error code.

void QStillImageCapture::capture ( const QString & file )   [slot]

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

QImageEncoderSettings QStillImageCapture::encodingSettings () const

Returns the image encoder settings being used.

See also setEncodingSettings().

Error QStillImageCapture::error () const

Returns the current error state.

See also errorString().

void QStillImageCapture::error ( QStillImageCapture::Error error )   [signal]

Signals that an error has occurred.

QString QStillImageCapture::errorString () const

Returns a string describing the current error state.

See also error().

void QStillImageCapture::imageCaptured ( const QString & fileName, const QImage & preview )   [signal]

QString QStillImageCapture::imageCodecDescription ( const QString & codec ) const

Returns a description of an image codec.

void QStillImageCapture::imageSaved ( const QString & fileName )   [signal]

bool QStillImageCapture::isAvailable () const   [virtual]

Reimplemented from QMediaObject::isAvailable().

Returns true if the images capture service ready to use.

void QStillImageCapture::readyForCaptureChanged ( bool ready )   [signal]

Signals that a camera's ready for capture state has changed.

void QStillImageCapture::setEncodingSettings ( const QImageEncoderSettings & settings )

Sets the image encodeing settings.

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

See also encodingSettings().

QStringList QStillImageCapture::supportedImageCodecs () const

Returns a list of supported image codecs.

QList<QSize> QStillImageCapture::supportedResolutions ( const QImageEncoderSettings & settings = QImageEncoderSettings(), bool * continuous = 0 ) const

Returns a list of resolutions images can be encoded at.

If non null image settings parameter is passed, the returned list is reduced to resolution supported with partial settings like image codec or quality applied.

If the encoder supports arbitrary resolutions within the supported range, *continuous is set to true, otherwise *continuous is set to false.

See also QImageEncoderSettings::resolution().


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0