2018-05-11 17:42:23 +00:00
|
|
|
// Copyright 2018 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <QImage>
|
|
|
|
#include "citra_qt/camera/camera_util.h"
|
2018-05-26 03:26:58 +00:00
|
|
|
#include "citra_qt/camera/qt_camera_base.h"
|
2018-05-11 17:42:23 +00:00
|
|
|
#include "core/frontend/camera/interface.h"
|
|
|
|
|
|
|
|
namespace Camera {
|
|
|
|
|
2018-05-26 03:26:58 +00:00
|
|
|
class StillImageCamera final : public QtCameraInterface {
|
2018-05-11 17:42:23 +00:00
|
|
|
public:
|
2018-05-20 01:07:37 +00:00
|
|
|
StillImageCamera(QImage image, const Service::CAM::Flip& flip);
|
2018-05-11 17:42:23 +00:00
|
|
|
void StartCapture() override;
|
|
|
|
void StopCapture() override;
|
|
|
|
void SetFrameRate(Service::CAM::FrameRate frame_rate) override {}
|
2018-05-26 03:26:58 +00:00
|
|
|
QImage QtReceiveFrame() override;
|
2018-05-11 17:42:23 +00:00
|
|
|
bool IsPreviewAvailable() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QImage image;
|
|
|
|
};
|
|
|
|
|
2018-06-03 03:29:46 +00:00
|
|
|
class StillImageCameraFactory final : public QObject, public QtCameraFactory {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2018-05-11 17:42:23 +00:00
|
|
|
public:
|
2018-05-20 01:07:37 +00:00
|
|
|
std::unique_ptr<CameraInterface> Create(const std::string& config,
|
2018-06-03 03:29:46 +00:00
|
|
|
const Service::CAM::Flip& flip) override;
|
2018-05-11 17:42:23 +00:00
|
|
|
|
2018-06-03 03:29:46 +00:00
|
|
|
Q_INVOKABLE const std::string GetFilePath() const;
|
2018-05-11 17:42:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Camera
|