The QCameraFocusZone class provides information on zones used for autofocusing a camera. More...
Header: | #include <QCameraFocusZone> |
qmake: | QT += multimedia |
enum | FocusZoneStatus { Invalid, Unused, Selected, Focused } |
QCameraFocusZone(const QCameraFocusZone &other) | |
QCameraFocusZone & | operator=(const QCameraFocusZone &other) |
~QCameraFocusZone() | |
QRectF | area() const |
bool | isValid() const |
QCameraFocusZone::FocusZoneStatus | status() const |
bool | operator!=(const QCameraFocusZone &other) const |
bool | operator==(const QCameraFocusZone &other) const |
For cameras that support autofocusing, in order for a camera to autofocus on part of a sensor frame, it considers different zones within the frame. Which zones to use, and where the zones are located vary between different cameras.
This class exposes what zones are used by a particular camera, and a list of the zones can be retrieved by a QCameraFocus instance.
You can use this information to present visual feedback - for example, drawing rectangles around areas of the camera frame that are in focus, or changing the color of a zone as it comes into focus.
focus->setFocusPointMode(QCameraFocus::FocusPointAuto); const QList<QCameraFocusZone> zones = focus->focusZones(); for (const QCameraFocusZone &zone : zones) { if (zone.status() == QCameraFocusZone::Focused) { // Draw a green box at zone.area() } else if (zone.status() == QCameraFocusZone::Selected) { // This area is selected for autofocusing, but is not in focus // Draw a yellow box at zone.area() } }
See also QCameraFocus.
Constant | Value | Description |
---|---|---|
QCameraFocusZone::Invalid |
0 |
This zone is not valid |
QCameraFocusZone::Unused |
1 |
This zone may be used for autofocusing, but is not currently. |
QCameraFocusZone::Selected |
2 |
This zone is currently being used for autofocusing, but is not in focus. |
QCameraFocusZone::Focused |
3 |
This zone is being used for autofocusing and is currently in focus. |
Creates a new QCameraFocusZone as a copy of other.
Assigns other to this QCameraFocusZone.
Destroys this QCameraFocusZone.
Returns the area of the camera frame that this focus zone encompasses.
Coordinates are in frame relative coordinates - QPointF(0,0)
is the top left of the frame, and QPointF(1,1)
is the bottom right.
Returns true if this focus zone has a valid area and status.
Returns the current status of this focus zone.
Returns true if this focus zone is not the same as other.
Returns true if this focus zone is the same as other.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qcamerafocuszone.html