fwt_software/include/fgc/VimbaCameraSource.h

45 lines
1.5 KiB
C++

#pragma once
#include "fgc/CameraProfile.h"
#include "fgc/Config.h"
#include "fgc/ICameraSource.h"
#include <memory>
#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;
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace fgc