2018-05-11 18:42:23 +01: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 04:26:58 +01:00
|
|
|
#include "citra_qt/camera/qt_camera_base.h"
|
2018-05-11 18:42:23 +01:00
|
|
|
#include "core/frontend/camera/interface.h"
|
|
|
|
|
|
|
|
namespace Camera {
|
|
|
|
|
2018-05-26 04:26:58 +01:00
|
|
|
class StillImageCamera final : public QtCameraInterface {
|
2018-05-11 18:42:23 +01:00
|
|
|
public:
|
2018-05-20 02:07:37 +01:00
|
|
|
StillImageCamera(QImage image, const Service::CAM::Flip& flip);
|
2018-06-07 07:48:52 +01:00
|
|
|
~StillImageCamera();
|
2018-05-11 18:42:23 +01:00
|
|
|
void StartCapture() override;
|
|
|
|
void StopCapture() override;
|
|
|
|
void SetFrameRate(Service::CAM::FrameRate frame_rate) override {}
|
2018-05-26 04:26:58 +01:00
|
|
|
QImage QtReceiveFrame() override;
|
2018-05-11 18:42:23 +01:00
|
|
|
bool IsPreviewAvailable() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QImage image;
|
|
|
|
};
|
|
|
|
|
2018-06-03 04:29:46 +01:00
|
|
|
class StillImageCameraFactory final : public QObject, public QtCameraFactory {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2018-05-11 18:42:23 +01:00
|
|
|
public:
|
2018-05-20 02:07:37 +01:00
|
|
|
std::unique_ptr<CameraInterface> Create(const std::string& config,
|
2018-06-03 04:29:46 +01:00
|
|
|
const Service::CAM::Flip& flip) override;
|
2018-05-11 18:42:23 +01:00
|
|
|
|
2018-06-03 04:29:46 +01:00
|
|
|
Q_INVOKABLE const std::string GetFilePath() const;
|
2018-06-07 07:48:52 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// Record the path chosen to avoid multiple prompt problem
|
|
|
|
static std::string last_path;
|
|
|
|
|
|
|
|
friend class StillImageCamera;
|
2018-05-11 18:42:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Camera
|