Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QCameraImageCapture Class Reference

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

 #include <QCameraImageCapture>

Inherits QObject and QMediaBindableInterface.

Public Types

enum DriveMode { SingleImageCapture }
enum Error { NoError, NotReadyError, ResourceError, NotSupportedFeatureError, FormatError, OutOfSpaceError }

Properties

  • 1 property inherited from QObject

Public Functions

QCameraImageCapture ( QMediaObject * mediaObject, QObject * parent = 0 )
~QCameraImageCapture ()
QtMultimediaKit::AvailabilityError availabilityError () const
QImageEncoderSettings encodingSettings () const
Error error () const
QString errorString () const
QString imageCodecDescription ( const QString & codec ) const
bool isAvailable () 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 QMediaObject * mediaObject () const

Public Slots

void cancelCapture ()
int capture ( const QString & file = QString() )
  • 1 public slot inherited from QObject

Signals

void error ( int id, QCameraImageCapture::Error error, const QString & errorString )
void imageCaptured ( int id, const QImage & preview )
void imageExposed ( int id )
void imageSaved ( int id, const QString & fileName )
void readyForCaptureChanged ( bool ready )

Reimplemented Protected Functions

virtual bool setMediaObject ( QMediaObject * mediaObject )

Additional Inherited Members

Detailed Description

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

The 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);

     recorder = new QMediaRecorder(camera);
     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();

See also QCamera.

Member Type Documentation

enum QCameraImageCapture::DriveMode

ConstantValueDescription
QCameraImageCapture::SingleImageCapture0Drive mode is capturing a single picture.

enum QCameraImageCapture::Error

ConstantValueDescription
QCameraImageCapture::NoError0No Errors.
QCameraImageCapture::NotReadyError1The service is not ready for capture yet.
QCameraImageCapture::ResourceError2Device is not ready or not available.
QCameraImageCapture::NotSupportedFeatureError4Device does not support stillimages capture.
QCameraImageCapture::FormatError5Current format is not supported.
QCameraImageCapture::OutOfSpaceError3No space left on device.

Property Documentation

readyForCapture : const bool

Indicates the service is ready to capture a an image immediately.

Access functions:

bool isReadyForCapture () const

Notifier signal:

void readyForCaptureChanged ( bool ready )

Member Function Documentation

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

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

The parent is passed to QMediaObject.

QCameraImageCapture::~QCameraImageCapture ()

Destroys images capture object.

QtMultimediaKit::AvailabilityError QCameraImageCapture::availabilityError () const

Returns the availability error code.

void QCameraImageCapture::cancelCapture () [slot]

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

int QCameraImageCapture::capture ( const QString & file = QString() ) [slot]

Capture the image and save it to file. This operation is asynchronous in majority of cases, followed by signals QCameraImageCapture::imageCaptured(), QCameraImageCapture::imageSaved() or QCameraImageCapture::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.

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

QImageEncoderSettings QCameraImageCapture::encodingSettings () const

Returns the image encoder settings being used.

See also setEncodingSettings().

Error QCameraImageCapture::error () const

Returns the current error state.

See also errorString().

void QCameraImageCapture::error ( int id, QCameraImageCapture::Error error, const QString & errorString ) [signal]

Signals that the capture request id has failed with an error and errorString description.

QString QCameraImageCapture::errorString () const

Returns a string describing the current error state.

See also error().

void QCameraImageCapture::imageCaptured ( int id, const QImage & preview ) [signal]

Signal emitted when the frame with request id was captured, but not processed and saved yet. Frame preview can be displayed to user.

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

Returns a description of an image codec.

void QCameraImageCapture::imageExposed ( int id ) [signal]

Signal emitted when the frame with request id was exposed.

void QCameraImageCapture::imageSaved ( int id, const QString & fileName ) [signal]

Signal emitted when the frame with request id was saved to fileName.

bool QCameraImageCapture::isAvailable () const

Returns true if the images capture service ready to use.

QMediaObject * QCameraImageCapture::mediaObject () const [virtual]

Reimplemented from QMediaBindableInterface::mediaObject().

See also setMediaObject().

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

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

void QCameraImageCapture::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().

bool QCameraImageCapture::setMediaObject ( QMediaObject * mediaObject ) [virtual protected]

Reimplemented from QMediaBindableInterface::setMediaObject().

See also mediaObject().

QStringList QCameraImageCapture::supportedImageCodecs () const

Returns a list of supported image codecs.

QList<QSize> QCameraImageCapture::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().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.1
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web