50 lines
1.8 KiB
C++
50 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include "fgc/CameraProfile.h"
|
|
#include "fgc/Config.h"
|
|
#include "fgc/ICameraSource.h"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace fgc {
|
|
|
|
// Real camera source backed by the Allied Vision Vimba X SDK (VmbCPP). Opens the
|
|
// cameras named by their CameraSpec and configures each one by handing its
|
|
// profile's settings XML to the SDK - the XML the VimbaX Viewer wrote, so the
|
|
// camera receives exactly the combination the GUI validated.
|
|
//
|
|
// The camera free-runs continuously at the rate the profile sets, with its own
|
|
// auto-exposure tracking the light. trigger() hands over the latest complete
|
|
// frame, restarting acquisition if the stream has stalled. Encode/save lives in
|
|
// ImagePipeline.
|
|
class VimbaCameraSource : public ICameraSource {
|
|
public:
|
|
// specs and profiles are index-aligned and in open order: cameras[i] is
|
|
// configured by profiles[i], so a camera never inherits its neighbour's
|
|
// settings.
|
|
VimbaCameraSource(std::vector<CameraSpec> specs, std::vector<CameraProfile> profiles);
|
|
~VimbaCameraSource() override;
|
|
|
|
void open() override;
|
|
void close() override;
|
|
void start() override;
|
|
void stop() override;
|
|
bool trigger() override;
|
|
bool setProfile(int camera_index, const CameraProfile& profile) override;
|
|
void setFrameCallback(FrameCallback cb) override;
|
|
int cameraCount() const override;
|
|
std::vector<CameraDeviceInfo> deviceInfo() override;
|
|
bool grabFrame(int camera_index, Frame& out, int timeout_ms) override;
|
|
bool setFeature(int camera_index, const std::string& name, const std::string& value) override;
|
|
bool featureRange(int camera_index, const std::string& name, double& min, double& max) override;
|
|
bool restoreProfile(int camera_index) override;
|
|
|
|
private:
|
|
struct Impl;
|
|
std::unique_ptr<Impl> impl_;
|
|
};
|
|
|
|
} // namespace fgc
|