Documentation updates for declarative camera elements.

A number of things were missing.

Change-Id: Ic4eb2e88804b519478eeae733cc5f473b717270d
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
Michael Goddard
2012-02-10 23:35:33 +10:00
committed by Qt by Nokia
parent 0d74c7193a
commit 048e38bd19
7 changed files with 358 additions and 38 deletions

View File

@@ -164,7 +164,7 @@ void QDeclarativeCamera::componentComplete()
/*!
Returns any camera error.
\sa QDeclarativeError::Error
\sa QDeclarativeCameraError::Error
*/
QDeclarativeCamera::Error QDeclarativeCamera::error() const
{
@@ -181,6 +181,20 @@ QString QDeclarativeCamera::errorString() const
return m_camera->errorString();
}
/*!
\qmlproperty enumeration Camera::captureMode
\table
\header \o Value \o Description
\row \o CaptureStillImage
\o Prepares the camera element for capturing still images.
\row \o CaptureVideo
\o Prepares the camera element for capturing video.
\endtable
*/
QDeclarativeCamera::CaptureMode QDeclarativeCamera::captureMode() const
{
return QDeclarativeCamera::CaptureMode(int(m_camera->captureMode()));

View File

@@ -51,10 +51,47 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass CameraCapture QDeclarativeCameraCapture
\brief The CameraCapture element provides an interface for camera capture related settings
\brief The CameraCapture element provides an interface for capturing camera images
\ingroup multimedia_qml
Documentation to be written.
This element allows you to capture still images and be notified when they
are available or saved to disk. You can adjust the resolution of the captured
image and where the saved image should go.
This element is a child of a Camera element (as the
\l {Camera::imageCapture}{imageCapture} property) and cannot be created
directly.
\qml
import QtQuick 2.0
import QtMultimedia 5.0
Camera {
id: camera
imageCapture {
onImageCaptured: {
// Show the preview in an Image element
photoPreview.source = preview
}
}
}
VideoOutput {
source: camera
focus : visible // to receive focus and capture key events when visible
MouseArea {
anchors.fill: parent;
onClicked: camera.imageCapture.capture();
}
}
Image {
id: photoPreview
}
\endqml
*/
QDeclarativeCameraCapture::QDeclarativeCameraCapture(QCamera *camera, QObject *parent) :
@@ -81,7 +118,7 @@ QDeclarativeCameraCapture::~QDeclarativeCameraCapture()
}
/*!
\qmlproperty string CameraCapture::ready
\qmlproperty bool CameraCapture::ready
\property QDeclarativeCameraCapture::ready
Indicates camera is ready to capture photo.
@@ -98,6 +135,8 @@ bool QDeclarativeCameraCapture::isReadyForCapture() const
Start image capture. The \l onImageCaptured() and \l onImageSaved() signals will
be emitted when the capture is complete.
The image will be captured to the default system location.
CameraCapture::capture returns the capture requestId parameter, used with
imageExposed(), imageCaptured(), imageMetadataAvailable() and imageSaved() signals.
*/
@@ -107,8 +146,8 @@ int QDeclarativeCameraCapture::capture()
}
/*!
\qmlmethod CameraCapture::captureToLocation()
\fn QDeclarativeCameraCapture::captureToLocation()
\qmlmethod CameraCapture::captureToLocation(location)
\fn QDeclarativeCameraCapture::captureToLocation(const QString &location)
Start image capture to specified \a location. The \l onImageCaptured() and \l onImageSaved() signals will
be emitted when the capture is complete.
@@ -125,7 +164,7 @@ int QDeclarativeCameraCapture::captureToLocation(const QString &location)
\qmlmethod CameraCapture::cancelCapture()
\fn QDeclarativeCameraCapture::cancelCapture()
Cancel pendig image capture requests.
Cancel pending image capture requests.
*/
void QDeclarativeCameraCapture::cancelCapture()
@@ -200,7 +239,7 @@ QCameraImageCapture::Error QDeclarativeCameraCapture::error() const
/*!
\qmlproperty size CameraCapture::errorString
\qmlproperty string CameraCapture::errorString
\property QDeclarativeCameraCapture::errorString
The last capture related error message.
@@ -210,6 +249,12 @@ QString QDeclarativeCameraCapture::errorString() const
return m_capture->errorString();
}
/*!
\qmlmethod CameraCapture::setMetadata(key, value)
\fn QDeclarativeCameraCapture::setMetadata(const QString &key, const QVariant &value)
Sets a particular metadata \a key to \a value for the subsequent image captures.
*/
void QDeclarativeCameraCapture::setMetadata(const QString &key, const QVariant &value)
{
if (m_metadataWriterControl)
@@ -246,6 +291,17 @@ void QDeclarativeCameraCapture::setMetadata(const QString &key, const QVariant &
*/
/*!
\qmlsignal CameraCapture::onImageMetadataAvailable(requestId, key, value)
\fn QDeclarativeCameraCapture::imageMetadataAvailable(int requestId, const QString &key, const QVariant &value);
This handler is called when the image with \a requestId has new metadata
available with the key \a key and value \a value.
\sa onImageCaptured
*/
QT_END_NAMESPACE
#include "moc_qdeclarativecameracapture_p.cpp"

View File

@@ -49,10 +49,13 @@ QT_BEGIN_NAMESPACE
\brief The CameraExposure element provides interface for exposure related camera settings.
\ingroup multimedia_qml
This element is part of the \bold{QtMultimedia 5.0} module.
It should not be constructed separately but provided by Camera.exposure.
This element allows you to adjust exposure related settings
like aperture and shutter speed, metering and ISO speed.
It should not be constructed separately but provided by the
Camera element's \l {Camera::exposure} {exposure} property.
\qml
import QtQuick 2.0
@@ -112,7 +115,7 @@ void QDeclarativeCameraExposure::setExposureCompensation(qreal ev)
}
/*!
\qmlproperty real CameraExposure::isoSensitivity
\qmlproperty integer CameraExposure::iso
\property QDeclarativeCameraExposure::iso
The sensor's ISO sensitivity.
@@ -126,7 +129,10 @@ int QDeclarativeCameraExposure::isoSensitivity() const
\qmlproperty real CameraExposure::shutterSpeed
\property QDeclarativeCameraExposure::shutterSpeed
The camera's shutter speed, in seconds.
The camera's current shutter speed setting, in seconds. To affect
the shutter speed you can use the \l manualShutterSpeed
property and \l setAutoShutterSpeed().
*/
qreal QDeclarativeCameraExposure::shutterSpeed() const
{
@@ -137,13 +143,29 @@ qreal QDeclarativeCameraExposure::shutterSpeed() const
\qmlproperty real CameraExposure::aperture
\property QDeclarativeCameraExposure::aperture
The lens aperture as an F number (the ratio of the focal length to effective aperture diameter).
The current lens aperture as an F number (the ratio of
the focal length to effective aperture diameter).
\sa manualAperture, setAutoAperture()
*/
qreal QDeclarativeCameraExposure::aperture() const
{
return m_exposure->aperture();
}
/*!
\qmlproperty integer CameraExposure::manualIsoSensitivity
\property QDeclarativeCameraExposure::manualIsoSensitivity
This property allows you to set a specific ISO setting
for image capturing.
If a negative value is specified, the camera will
automatically determine an appropriate value.
\sa iso, setAutoIsoSensitivity()
*/
int QDeclarativeCameraExposure::manualIsoSensitivity() const
{
return m_manualIso;
@@ -160,6 +182,17 @@ void QDeclarativeCameraExposure::setManualIsoSensitivity(int iso)
emit manualIsoSensitivityChanged(iso);
}
/*!
\qmlproperty real CameraExposure::manualShutterSpeed
\property QDeclarativeCameraExposure::manualShutterSpeed
This property allows you to set the shutter speed to
use during capture. If the value is less than zero,
then an automatic value is used and the camera will
determine an appropriate shutter speed.
\l shutterSpeed, setAutoShutterSpeed()
*/
qreal QDeclarativeCameraExposure::manualShutterSpeed() const
{
return m_manualShutterSpeed;
@@ -176,6 +209,17 @@ void QDeclarativeCameraExposure::setManualShutterSpeed(qreal speed)
emit manualShutterSpeedChanged(speed);
}
/*!
\qmlproperty real CameraExposure::manualAperture
\property QDeclarativeCameraExposure::manualAperture
This property allows you to set the aperture (F number)
setting to use during capture. If the value is less than zero,
then an automatic value is used and the camera will
determine an appropriate aperture value.
\l aperture, setAutoAperture()
*/
qreal QDeclarativeCameraExposure::manualAperture() const
{
return m_manualAperture;
@@ -193,7 +237,8 @@ void QDeclarativeCameraExposure::setManualAperture(qreal aperture)
}
/*!
Turn on auto aperture. The manual aperture value is reset to -1.0
\qmlmethod CameraExposure::setAutoAperture()
Turn on auto aperture selection. The manual aperture value is reset to -1.0
*/
void QDeclarativeCameraExposure::setAutoAperture()
{
@@ -201,7 +246,8 @@ void QDeclarativeCameraExposure::setAutoAperture()
}
/*!
Turn on auto shutter speed. The manual shutter speed value is reset to -1.0
\qmlmethod CameraExposure::setAutoShutterSpeed()
Turn on auto shutter speed selection. The manual shutter speed value is reset to -1.0
*/
void QDeclarativeCameraExposure::setAutoShutterSpeed()
{
@@ -209,7 +255,8 @@ void QDeclarativeCameraExposure::setAutoShutterSpeed()
}
/*!
Turn on auto ISO sensitivity. The manual ISO value is reset to -1.
\qmlmethod CameraExposure::setAutoIsoSensitivity()
Turn on auto ISO sensitivity selection. The manual ISO value is reset to -1.
*/
void QDeclarativeCameraExposure::setAutoIsoSensitivity()
{
@@ -220,6 +267,8 @@ void QDeclarativeCameraExposure::setAutoIsoSensitivity()
\qmlproperty enumeration CameraExposure::exposureMode
\property QDeclarativeCameraExposure::exposureMode
Set the camera exposure mode to one of the following:
\table
\header \o Value \o Description
\row \o Camera.ExposureManual \o Manual mode.
@@ -250,17 +299,12 @@ void QDeclarativeCameraExposure::setExposureMode(QDeclarativeCamera::ExposureMod
}
}
/*!
\qmlsignal CameraExposure::exposureModeChanged(CameraExposure::ExposureMode)
\fn void QDeclarativeCameraExposure::exposureModeChanged(QDeclarativeCamera::ExposureMode)
*/
/*!
\qmlproperty QPointF CameraExposure::spotMeteringPoint
\property QDeclarativeCameraExposure::spotMeteringPoint
The relative frame coordinates of the point to use for exposure metering (in relative
frame coordinates). This point is only used in spot metering mode, and typically defaults
The relative frame coordinates of the point to use for exposure metering.
This point is only used in spot metering mode, and typically defaults
to the center \c (0.5, 0.5).
*/
@@ -278,6 +322,20 @@ void QDeclarativeCameraExposure::setSpotMeteringPoint(const QPointF &point)
emit spotMeteringPointChanged(spotMeteringPoint());
}
/*!
\qmlproperty enumeration CameraExposure::meteringMode
\property QDeclarativeCameraExposure::meteringMode
Set the camera metering mode (how exposure is balanced)
to one of the following:
\table
\header \o Value \o Description
\row \o Camera.MeteringMatrix \o A matrix of sample points is used to measure exposure.
\row \o Camera.MeteringAverage \o An average is used to measure exposure.
\row \o Camera.MeteringSpot \o A specific location (\l spotMeteringPoint) is used to measure exposure.
\endtable
*/
QDeclarativeCamera::MeteringMode QDeclarativeCameraExposure::meteringMode() const
{
return QDeclarativeCamera::MeteringMode(m_exposure->meteringMode());

View File

@@ -51,7 +51,13 @@ QT_BEGIN_NAMESPACE
This element is part of the \bold{QtMultimedia 5.0} module.
It should not be constructed separately but provided by Camera.flash.
The CameraFlash element allows you to operate the camera flash
hardware and control the flash mode used. Not all cameras have
flash hardware (and in some cases it is shared with the
\l {Torch}{torch} hardware).
It should not be constructed separately but provided by the
Camera element's \l {Camera::flash}{flash} property.
\qml
import QtQuick 2.0

View File

@@ -51,7 +51,12 @@ QT_BEGIN_NAMESPACE
This element is part of the \bold{QtMultimedia 5.0} module.
It should not be constructed separately but provided by Camera.focus.
The CameraFocus element allows control over manual and automatic
focus settings, including information about any parts of the
camera frame that are selected for autofocusing.
It is not constructed separately but is provided by the
Camera element's \l {Camera::focus}{focus} property.
\qml
import QtQuick 2.0
@@ -104,12 +109,23 @@ QDeclarativeCameraFocus::~QDeclarativeCameraFocus()
It's possible to combine multiple Camera::FocusMode values,
for example Camera.FocusMacro + Camera.FocusContinuous.
In automatic focusing modes, the \l focusPointMode property
and \l focusZones property provide information and control
over how automatic focusing is performed.
*/
QDeclarativeCamera::FocusMode QDeclarativeCameraFocus::focusMode() const
{
return QDeclarativeCamera::FocusMode(int(m_focus->focusMode()));
}
/*!
\qmlmethod bool CameraFocus::isFocusModeSupported(mode)
\fn QDeclarativeCameraFocus::isFocusPointModeSupported(QDeclarativeCamera::FocusMode mode)
Returns true if the supplied \a mode is a supported focus mode, and
false otherwise.
*/
bool QDeclarativeCameraFocus::isFocusModeSupported(QDeclarativeCamera::FocusMode mode) const
{
return m_focus->isFocusModeSupported(QCameraFocus::FocusModes(int(mode)));
@@ -124,7 +140,12 @@ void QDeclarativeCameraFocus::setFocusMode(QDeclarativeCamera::FocusMode mode)
\qmlproperty CameraFocus::FocusPointMode CameraFocus::focusPointMode
\property QDeclarativeCameraFocus::focusPointMode
The current camera focus point mode.
The current camera focus point mode. This is used in automatic
focusing modes to determine what to focus on.
If the current focus point mode is \c Camera.FocusPointCustom, the
\l customFocusPoint property allows you to specify which part of
the frame to focus on.
*/
QDeclarativeCamera::FocusPointMode QDeclarativeCameraFocus::focusPointMode() const
{
@@ -139,6 +160,13 @@ void QDeclarativeCameraFocus::setFocusPointMode(QDeclarativeCamera::FocusPointMo
}
}
/*!
\qmlmethod bool CameraFocus::isFocusPointModeSupported(mode)
\fn QDeclarativeCameraFocus::isFocusPointModeSupported(QDeclarativeCamera::FocusPointMode mode)
Returns true if the supplied \a mode is a supported focus point mode, and
false otherwise.
*/
bool QDeclarativeCameraFocus::isFocusPointModeSupported(QDeclarativeCamera::FocusPointMode mode) const
{
return m_focus->isFocusPointModeSupported(QCameraFocus::FocusPointMode(mode));
@@ -149,7 +177,8 @@ bool QDeclarativeCameraFocus::isFocusPointModeSupported(QDeclarativeCamera::Focu
\property QDeclarativeCameraFocus::customFocusPoint
Position of custom focus point, in relative frame coordinates:
QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5) points to the frame center.
QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5)
points to the frame center.
Custom focus point is used only in FocusPointCustom focus mode.
*/
@@ -172,8 +201,16 @@ void QDeclarativeCameraFocus::setCustomFocusPoint(const QPointF &point)
\property QDeclarativeCameraFocus::focusZones
List of current camera focus zones,
each including area specified in the same coordinates as \l customFocusPoint
and zone status.
each including \c area specified in the same coordinates as \l customFocusPoint
and zone \c status as one of the following values:
\table
\header \o Value \o Description
\row \o Camera.FocusAreaUnused \o This focus point area is currently unused in autofocusing.
\row \o Camera.FocusAreaSelected \o This focus point area is used in autofocusing, but is not in focus.
\row \o Camera.FocusAreaFocused \o This focus point is used in autofocusing, and is in focus.
\endtable
\qml
@@ -188,14 +225,17 @@ void QDeclarativeCameraFocus::setCustomFocusPoint(const QPointF &point)
Rectangle {
border {
width: 2
color: status == CameraFocus.Focused ? "green" : "white"
color: status == Camera.FocusAreaFocused ? "green" : "white"
}
color: "transparent"
x: area.x * viewfinder.width
y: area.y * viewfinder.height
width: area.width * viewfinder.width
height: area.height * viewfinder.height
// Map from the relative, normalized frame coordinates
property mappedRect: viewfinder.mapNormalizedRectToItem(area);
x: mappedRect.x
y: mappedRect.y
width: mappedRect.width
height: mappedRect.height
}
}
}

View File

@@ -49,8 +49,37 @@ QT_BEGIN_NAMESPACE
\brief The CameraCapture element provides an interface for camera capture related settings
\ingroup multimedia_qml
Documentation to be written.
The CameraImageProcessing element provides control over post-processing
done by the camera middleware, including white balance adjustments,
contrast, saturation, sharpening, and denoising
It is not constructed separately but is provided by the Camera element's
\l {Camera::imageProcessing}{imageProcessing} property.
\qml
import QtQuick 2.0
import QtMultimedia 5.0
Camera {
id: camera
imageProcessing {
whiteBalanceMode: Camera.WhiteBalanceTungsten
contrast: 0.66
saturation: -0.5
}
}
\endqml
*/
/*!
\class QDeclarativeCameraImageProcessing
\internal
\brief The CameraCapture element provides an interface for camera capture related settings
*/
QDeclarativeCameraImageProcessing::QDeclarativeCameraImageProcessing(QCamera *camera, QObject *parent) :
QObject(parent)
@@ -100,7 +129,7 @@ void QDeclarativeCameraImageProcessing::setWhiteBalanceMode(QDeclarativeCameraIm
}
/*!
\qmlproperty int CameraImageProcessing::manualWhiteBalance
\qmlproperty qreal CameraImageProcessing::manualWhiteBalance
The color temperature used when in manual white balance mode (WhiteBalanceManual).
The units are Kelvin.

View File

@@ -48,10 +48,21 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass CameraRecorder QDeclarativeCameraRecorder
\brief The CameraRecorder element provides an interface for camera movie recording related settings
\brief The CameraRecorder element controls video recording with the Camera.
\ingroup multimedia_qml
Documentation to be written.
This element allows recording camera streams to files, and adjusting recording
settings and metadata for videos.
This element is a child of a Camera element (as the
\l {Camera::videoRecorder}{videoRecorder} property) and cannot be created
directly.
There are many different settings for each part of the recording process (audio,
video, and output formats), as well as control over muting and where to store
the output file.
\sa QAudioEncoderSettings, QVideoEncoderSettings
*/
QDeclarativeCameraRecorder::QDeclarativeCameraRecorder(QCamera *camera, QObject *parent) :
@@ -74,21 +85,47 @@ QDeclarativeCameraRecorder::~QDeclarativeCameraRecorder()
{
}
/*!
\qmlproperty size CameraRecorder::captureResolution
The video frame dimensions to use when capturing
video.
*/
QSize QDeclarativeCameraRecorder::captureResolution()
{
return m_videoSettings.resolution();
}
/*!
\qmlproperty string CameraRecorder::audioCodec
The audio codec to use for recording video.
Typically this is something like \c aac or \c amr-wb.
\sa whiteBalanceMode
*/
QString QDeclarativeCameraRecorder::audioCodec() const
{
return m_audioSettings.codec();
}
/*!
\qmlproperty string CameraRecorder::videoCodec
The video codec to use for recording video.
Typically this is something like \c h264.
*/
QString QDeclarativeCameraRecorder::videoCodec() const
{
return m_videoSettings.codec();
}
/*!
\qmlproperty string CameraRecorder::mediaContainer
The media container to use for recording video.
Typically this is something like \c mp4.
*/
QString QDeclarativeCameraRecorder::mediaContainer() const
{
return m_mediaContainer;
@@ -130,26 +167,56 @@ void QDeclarativeCameraRecorder::setMediaContainer(const QString &container)
}
}
/*!
\qmlproperty qreal CameraRecorder::frameRate
The video framerate to use when recording video,
in frames per second.
*/
qreal QDeclarativeCameraRecorder::frameRate() const
{
return m_videoSettings.frameRate();
}
/*!
\qmlproperty int CameraRecorder::videoBitRate
The video bit rate to use when recording video,
in bits per second.
*/
int QDeclarativeCameraRecorder::videoBitRate() const
{
return m_videoSettings.bitRate();
}
/*!
\qmlproperty int CameraRecorder::audioBitRate
The audio bit rate to use when recording video,
in bits per second.
*/
int QDeclarativeCameraRecorder::audioBitRate() const
{
return m_audioSettings.bitRate();
}
/*!
\qmlproperty int CameraRecorder::audioChannels
The number of audio channels to encode when
recording video (1 is mono, 2 is stereo).
*/
int QDeclarativeCameraRecorder::audioChannels() const
{
return m_audioSettings.channelCount();
}
/*!
\qmlproperty int CameraRecorder::audioSampleRate
The audio sample rate to encode audio at, when
recording video.
*/
int QDeclarativeCameraRecorder::audioSampleRate() const
{
return m_audioSettings.sampleRate();
@@ -200,16 +267,36 @@ void QDeclarativeCameraRecorder::setAudioSampleRate(int rate)
}
}
// XXX todo
QMediaRecorder::Error QDeclarativeCameraRecorder::error() const
{
return m_recorder->error();
}
/*!
\qmlproperty string Camera::errorString
A description of the current error, if any.
*/
QString QDeclarativeCameraRecorder::errorString() const
{
return m_recorder->errorString();
}
/*!
\qmlproperty enumeration CameraRecorder::recorderState
The current state of the camera recorder object.
\table
\header \o Value \o Description
\row \o StoppedState
\o The camera is not recording video.
\row \o RecordingState
\o The camera is recording video.
\endtable
*/
QDeclarativeCameraRecorder::RecorderState QDeclarativeCameraRecorder::recorderState() const
{
//paused state is not supported for camera
@@ -221,11 +308,21 @@ QDeclarativeCameraRecorder::RecorderState QDeclarativeCameraRecorder::recorderSt
return RecorderState(state);
}
/*!
\qmlmethod CameraRecorder::record()
Starts recording.
*/
void QDeclarativeCameraRecorder::record()
{
setRecorderState(RecordingState);
}
/*!
\qmlmethod CameraRecorder::stop()
Stops recording.
*/
void QDeclarativeCameraRecorder::stop()
{
setRecorderState(StoppedState);
@@ -284,11 +381,25 @@ void QDeclarativeCameraRecorder::setOutputLocation(const QString &location)
}
}
/*!
\qmlproperty int CameraRecorder::duration
\property QDeclarativeCameraRecorder::duration
Returns the current duration of the recording, in
milliseconds.
*/
qint64 QDeclarativeCameraRecorder::duration() const
{
return m_recorder->duration();
}
/*!
\qmlproperty bool CameraRecorder::muted
\property QDeclarativeCameraRecorder::muted
Whether or not the audio input is muted during
recording.
*/
bool QDeclarativeCameraRecorder::isMuted() const
{
return m_recorder->isMuted();
@@ -299,6 +410,12 @@ void QDeclarativeCameraRecorder::setMuted(bool muted)
m_recorder->setMuted(muted);
}
/*!
\qmlmethod CameraRecorder::setMetadata(key, value)
Sets metadata for the next video to be recorder, with
the given \a key being associated with \a value.
*/
void QDeclarativeCameraRecorder::setMetadata(const QString &key, const QVariant &value)
{
m_recorder->setMetaData(key, value);