CameraMetaData.h 2.89 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10
#pragma once
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

#include <QObject>

/// Set of meta data which describes a camera available on the vehicle
class CameraMetaData : public QObject
{
    Q_OBJECT

public:
    CameraMetaData(const QString&   name,
                   double           sensorWidth,
                   double           sensorHeight,
                   double           imageWidth,
                   double           imageHeight,
                   double           focalLength,
26 27
                   bool             landscape,
                   bool             fixedOrientation,
28
                   double           minTriggerInterval,
29
                   QObject*         parent = nullptr);
30

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
    Q_PROPERTY(QString  name                READ name               CONSTANT)   ///< Camera name
    Q_PROPERTY(double   sensorWidth         READ sensorWidth        CONSTANT)   ///< Sensor size in millimeters
    Q_PROPERTY(double   sensorHeight        READ sensorHeight       CONSTANT)   ///< Sensor size in millimeters
    Q_PROPERTY(double   imageWidth          READ imageWidth         CONSTANT)   ///< Image size in pixels
    Q_PROPERTY(double   imageHeight         READ imageHeight        CONSTANT)   ///< Image size in pixels
    Q_PROPERTY(double   focalLength         READ focalLength        CONSTANT)   ///< Focal length in millimeters
    Q_PROPERTY(bool     landscape           READ landscape          CONSTANT)   ///< true: camera is in landscape orientation
    Q_PROPERTY(bool     fixedOrientation    READ fixedOrientation   CONSTANT)   ///< true: camera is in fixed orientation
    Q_PROPERTY(double   minTriggerInterval  READ minTriggerInterval CONSTANT)   ///< Minimum time in seconds between each photo taken, 0 for not specified

    QString name                (void) const { return _name; }
    double  sensorWidth         (void) const { return _sensorWidth; }
    double  sensorHeight        (void) const { return _sensorHeight; }
    double  imageWidth          (void) const { return _imageWidth; }
    double  imageHeight         (void) const { return _imageHeight; }
    double  focalLength         (void) const { return _focalLength; }
    bool    landscape           (void) const { return _landscape; }
    bool    fixedOrientation    (void) const { return _fixedOrientation; }
    double  minTriggerInterval  (void) const { return _minTriggerInterval; }
50 51 52 53 54 55 56 57

private:
    QString _name;
    double  _sensorWidth;
    double  _sensorHeight;
    double  _imageWidth;
    double  _imageHeight;
    double  _focalLength;
58 59
    bool    _landscape;
    bool    _fixedOrientation;
60
    double  _minTriggerInterval;
61
};