flickerreduction.h videomute.h metadata.h imagesettings.h \
imageresolutionmodel.h videosettings.h videoresolutionmodel.h \
notificationscontainer.h sounds.h focus.h autofocus.h \
- roi.h cameraconfig.h videoplayer.h viewfinder.h capability.h
+ roi.h cameraconfig.h videoplayer.h viewfinder.h capability.h \
+ imageresolution.h videoresolution.h
SOURCES += plugin.cpp previewprovider.cpp camera.cpp mode.cpp imagemode.cpp videomode.cpp \
zoom.cpp flash.cpp scene.cpp evcomp.cpp videotorch.cpp whitebalance.cpp \
flickerreduction.cpp videomute.cpp metadata.cpp imagesettings.cpp \
imageresolutionmodel.cpp videosettings.cpp videoresolutionmodel.cpp \
notificationscontainer.cpp sounds.cpp focus.cpp autofocus.cpp \
- roi.cpp cameraconfig.cpp videoplayer.cpp viewfinder.cpp capability.cpp
+ roi.cpp cameraconfig.cpp videoplayer.cpp viewfinder.cpp capability.cpp \
+ imageresolution.cpp videoresolution.cpp
PLUGIN_IMPORT_PATH = QtCamera
target.path = $$[QT_INSTALL_IMPORTS]/$$PLUGIN_IMPORT_PATH
--- /dev/null
+// -*- c++ -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "imageresolution.h"
+
+ImageResolution::ImageResolution(QObject *parent) :
+ QObject(parent),
+ m_fps(-1),
+ m_nightFps(-1),
+ m_megaPixels(-1) {
+
+}
+
+ImageResolution::ImageResolution(const QtCamImageResolution& resolution, QObject *parent) :
+ QObject(parent),
+ m_resolutionId(resolution.id()),
+ m_name(resolution.name()),
+ m_aspectRatio(resolution.aspectRatio()),
+ m_capture(resolution.captureResolution()),
+ m_preview(resolution.previewResolution()),
+ m_viewfinder(resolution.viewfinderResolution()),
+ m_fps(resolution.frameRate()),
+ m_nightFps(resolution.nightFrameRate()),
+ m_megaPixels(resolution.megaPixels()) {
+
+}
+
+ImageResolution::~ImageResolution() {
+
+}
+
+QtCamImageResolution ImageResolution::resolution() {
+ return QtCamImageResolution(m_resolutionId, m_name, m_capture,
+ m_preview, m_viewfinder, m_fps,
+ m_nightFps, m_megaPixels, m_aspectRatio);
+}
+
+QString ImageResolution::resolutionId() const {
+ return m_resolutionId;
+}
+
+void ImageResolution::setResolutionId(const QString& resolutionId) {
+ if (m_resolutionId != resolutionId) {
+ m_resolutionId = resolutionId;
+
+ emit resolutionIdChanged();
+ }
+}
+
+QString ImageResolution::name() const {
+ return m_name;
+}
+
+void ImageResolution::setName(const QString& name) {
+ if (m_name != name) {
+ m_name = name;
+
+ emit nameChanged();
+ }
+}
+
+QString ImageResolution::aspectRatio() const {
+ return m_aspectRatio;
+}
+
+void ImageResolution::setAspectRatio(const QString& aspectRatio) {
+ if (m_aspectRatio != aspectRatio) {
+ m_aspectRatio = aspectRatio;
+
+ emit aspectRatioChanged();
+ }
+}
+
+QSize ImageResolution::capture() const {
+ return m_capture;
+}
+
+void ImageResolution::setCapture(const QSize& capture) {
+ if (m_capture != capture) {
+ m_capture = capture;
+
+ emit captureChanged();
+ }
+}
+
+QSize ImageResolution::preview() const {
+ return m_preview;
+}
+
+void ImageResolution::setPreview(const QSize& preview) {
+ if (m_preview != preview) {
+ m_preview = preview;
+
+ emit previewChanged();
+ }
+}
+
+QSize ImageResolution::viewfinder() const {
+ return m_viewfinder;
+}
+
+void ImageResolution::setViewfinder(const QSize& viewfinder) {
+ if (m_viewfinder != viewfinder) {
+ m_viewfinder = viewfinder;
+
+ emit viewfinderChanged();
+ }
+}
+
+int ImageResolution::fps() const {
+ return m_fps;
+}
+
+void ImageResolution::setFps(int fps) {
+ if (m_fps != fps) {
+ m_fps = fps;
+
+ emit fpsChanged();
+ }
+}
+
+int ImageResolution::nightFps() const {
+ return m_nightFps;
+}
+
+void ImageResolution::setNightFps(int nightFps) {
+ if (m_nightFps != nightFps) {
+ m_nightFps = nightFps;
+
+ emit nightFpsChanged();
+ }
+}
+
+int ImageResolution::megaPixels() const {
+ return m_megaPixels;
+}
+
+void ImageResolution::setMegaPixels(int megaPixels) {
+ if (m_megaPixels != megaPixels) {
+ m_megaPixels = megaPixels;
+
+ emit megaPixelsChanged();
+ }
+}
--- /dev/null
+// -*- c++ -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef IMAGE_RESOLUTION_H
+#define IMAGE_RESOLUTION_H
+
+#include <QObject>
+#include "qtcamimagesettings.h"
+
+class ImageResolution : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QString resolutionLd READ resolutionId WRITE setResolutionId NOTIFY resolutionIdChanged);
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged);
+ Q_PROPERTY(QString aspectRatio READ aspectRatio WRITE setAspectRatio NOTIFY aspectRatioChanged);
+ Q_PROPERTY(QSize captureResolution READ capture WRITE setCapture NOTIFY captureChanged);
+ Q_PROPERTY(QSize previewResolution READ preview WRITE setPreview NOTIFY previewChanged);
+ Q_PROPERTY(QSize viewfinderResolution READ viewfinder WRITE setViewfinder NOTIFY viewfinderChanged);
+ Q_PROPERTY(int frameRate READ fps WRITE setFps NOTIFY fpsChanged);
+ Q_PROPERTY(int nightFrameRate READ nightFps WRITE setNightFps NOTIFY nightFpsChanged);
+ Q_PROPERTY(int megaPixels READ megaPixels WRITE setMegaPixels NOTIFY megaPixelsChanged);
+
+public:
+ ImageResolution(QObject *parent = 0);
+ ImageResolution(const QtCamImageResolution& resolution, QObject *parent = 0);
+ ~ImageResolution();
+
+ QtCamImageResolution resolution();
+
+ QString resolutionId() const;
+ void setResolutionId(const QString& resolutionId);
+
+ QString name() const;
+ void setName(const QString& name);
+
+ QString aspectRatio() const;
+ void setAspectRatio(const QString& aspectRatio);
+
+ QSize capture() const;
+ void setCapture(const QSize& capture);
+
+ QSize preview() const;
+ void setPreview(const QSize& preview);
+
+ QSize viewfinder() const;
+ void setViewfinder(const QSize& viewfinder);
+
+ int fps() const;
+ void setFps(int fps);
+
+ int nightFps() const;
+ void setNightFps(int nightFps);
+
+ int megaPixels() const;
+ void setMegaPixels(int megaPixels);
+
+signals:
+ void resolutionIdChanged();
+ void nameChanged();
+ void captureChanged();
+ void previewChanged();
+ void viewfinderChanged();
+ void fpsChanged();
+ void nightFpsChanged();
+ void megaPixelsChanged();
+ void aspectRatioChanged();
+
+private:
+ QString m_resolutionId;
+ QString m_name;
+ QString m_aspectRatio;
+ QSize m_capture;
+ QSize m_preview;
+ QSize m_viewfinder;
+ int m_fps;
+ int m_nightFps;
+ int m_megaPixels;
+};
+
+#endif /* IMAGE_RESOLUTION_H */
#include "videoplayer.h"
#include "viewfinder.h"
#include "capability.h"
+#include "imageresolution.h"
+#include "videoresolution.h"
#if defined(QT4)
#include <QDeclarativeEngine>
#elif defined(QT5)
qmlRegisterType<VideoPlayer>("QtCameraExtras", MAJOR, MINOR, "VideoPlayer");
qmlRegisterType<Viewfinder>(uri, MAJOR, MINOR, "Viewfinder");
qmlRegisterType<Capability>();
+
+ qmlRegisterType<ImageResolution>(uri, MAJOR, MINOR, "ImageResolution");
+ qmlRegisterType<VideoResolution>(uri, MAJOR, MINOR, "VideoResolution");
}
#if defined(QT4)
--- /dev/null
+// -*- c++ -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "videoresolution.h"
+
+VideoResolution::VideoResolution(QObject *parent) :
+ QObject(parent),
+ m_fps(-1),
+ m_nightFps(-1) {
+
+}
+
+VideoResolution::VideoResolution(const QtCamVideoResolution& resolution, QObject *parent) :
+ QObject(parent),
+ m_resolutionId(resolution.id()),
+ m_name(resolution.name()),
+ m_aspectRatio(resolution.aspectRatio()),
+ m_commonName(resolution.resolution()),
+ m_capture(resolution.captureResolution()),
+ m_preview(resolution.previewResolution()),
+ m_fps(resolution.frameRate()),
+ m_nightFps(resolution.nightFrameRate()) {
+
+}
+
+VideoResolution::~VideoResolution() {
+
+}
+
+QtCamVideoResolution VideoResolution::resolution() {
+ return QtCamVideoResolution(m_resolutionId, m_name, m_capture,
+ m_preview, m_fps, m_nightFps,
+ m_aspectRatio, m_commonName);
+}
+
+QString VideoResolution::resolutionId() const {
+ return m_resolutionId;
+}
+
+void VideoResolution::setResolutionId(const QString& resolutionId) {
+ if (m_resolutionId != resolutionId) {
+ m_resolutionId = resolutionId;
+
+ emit resolutionIdChanged();
+ }
+}
+
+QString VideoResolution::name() const {
+ return m_name;
+}
+
+void VideoResolution::setName(const QString& name) {
+ if (m_name != name) {
+ m_name = name;
+
+ emit nameChanged();
+ }
+}
+
+QString VideoResolution::aspectRatio() const {
+ return m_aspectRatio;
+}
+
+void VideoResolution::setAspectRatio(const QString& aspectRatio) {
+ if (m_aspectRatio != aspectRatio) {
+ m_aspectRatio = aspectRatio;
+
+ emit aspectRatioChanged();
+ }
+}
+
+QSize VideoResolution::capture() const {
+ return m_capture;
+}
+
+void VideoResolution::setCapture(const QSize& capture) {
+ if (m_capture != capture) {
+ m_capture = capture;
+
+ emit captureChanged();
+ }
+}
+
+QSize VideoResolution::preview() const {
+ return m_preview;
+}
+
+void VideoResolution::setPreview(const QSize& preview) {
+ if (m_preview != preview) {
+ m_preview = preview;
+
+ emit previewChanged();
+ }
+}
+
+int VideoResolution::fps() const {
+ return m_fps;
+}
+
+void VideoResolution::setFps(int fps) {
+ if (m_fps != fps) {
+ m_fps = fps;
+
+ emit fpsChanged();
+ }
+}
+
+int VideoResolution::nightFps() const {
+ return m_nightFps;
+}
+
+void VideoResolution::setNightFps(int nightFps) {
+ if (m_nightFps != nightFps) {
+ m_nightFps = nightFps;
+
+ emit nightFpsChanged();
+ }
+}
+
+QString VideoResolution::commonName() const {
+ return m_commonName;
+}
+
+void VideoResolution::setCommonName(const QString& commonName) {
+ if (m_commonName != commonName) {
+ m_commonName = commonName;
+
+ emit commonNameChanged();
+ }
+}
--- /dev/null
+// -*- c++ -*-
+
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef VIDEO_RESOLUTION_H
+#define VIDEO_RESOLUTION_H
+
+#include <QObject>
+#include "qtcamvideosettings.h"
+
+class VideoResolution : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QString resolutionLd READ resolutionId WRITE setResolutionId NOTIFY resolutionIdChanged);
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged);
+ Q_PROPERTY(QString aspectRatio READ aspectRatio WRITE setAspectRatio NOTIFY aspectRatioChanged);
+ Q_PROPERTY(QSize captureResolution READ capture WRITE setCapture NOTIFY captureChanged);
+ Q_PROPERTY(QSize previewResolution READ preview WRITE setPreview NOTIFY previewChanged);
+ Q_PROPERTY(int frameRate READ fps WRITE setFps NOTIFY fpsChanged);
+ Q_PROPERTY(int nightFrameRate READ nightFps WRITE setNightFps NOTIFY nightFpsChanged);
+ Q_PROPERTY(QString commonName READ commonName WRITE setCommonName NOTIFY commonNameChanged);
+
+public:
+ VideoResolution(QObject *parent = 0);
+ VideoResolution(const QtCamVideoResolution& resolution, QObject *parent = 0);
+ ~VideoResolution();
+
+ QtCamVideoResolution resolution();
+
+ QString resolutionId() const;
+ void setResolutionId(const QString& resolutionId);
+
+ QString name() const;
+ void setName(const QString& name);
+
+ QString aspectRatio() const;
+ void setAspectRatio(const QString& aspectRatio);
+
+ QSize capture() const;
+ void setCapture(const QSize& capture);
+
+ QSize preview() const;
+ void setPreview(const QSize& preview);
+
+ int fps() const;
+ void setFps(int fps);
+
+ int nightFps() const;
+ void setNightFps(int nightFps);
+
+ QString commonName() const;
+ void setCommonName(const QString& commonName);
+
+signals:
+ void resolutionIdChanged();
+ void nameChanged();
+ void captureChanged();
+ void previewChanged();
+ void fpsChanged();
+ void nightFpsChanged();
+ void aspectRatioChanged();
+ void commonNameChanged();
+
+private:
+ QString m_resolutionId;
+ QString m_name;
+ QString m_aspectRatio;
+ QString m_commonName;
+ QSize m_capture;
+ QSize m_preview;
+ int m_fps;
+ int m_nightFps;
+};
+
+#endif /* VIDEO_RESOLUTION_H */