Files
ximeaControlDll/Header_Files/irisximeaimager.h
tangchao0503 3df67d7e57 1. 添加功能:setBufferPolicy、setAcqBufferSize(单位MiB);
2. XI_PRM_ACQ_TRANSPORT_BUFFER_SIZE,usb缓存设置;
2023-06-26 15:59:26 +08:00

124 lines
4.5 KiB
C++

#ifndef IRISXIMEAIMAGER_H
#define IRISXIMEAIMAGER_H
#include <memory.h>
#include <exception>
#include <iostream>
#include "irisximeaimager_global.h"
#include "imager_base.h"
#ifdef WIN32
#include <xiApi.h> // Windows
#else
#include <m3api/xiApi.h> // Linux, OSX
#endif
#define CE(func) {XI_RETURN stat = (func); if (XI_OK!=stat) {printf("Error:%d returned from function:"#func"\n",stat);throw stat;}}
#define HandleResult(res,place) if (res!=XI_OK) {printf("Error after %s (%d)\n",place,res);}
namespace Iris
{
class IRISXIMEAIMAGERSHARED_EXPORT IrisXimeaImager:public ImagerBase
{
public:
HANDLE m_xiH;
void setGainOffset(float gain, float offset);
bool setSpectralBin(int spectralBin);
bool setSpatialBin(int spatialBin);
int getSpectralBin();
int getSpatialBin();
void setEffectiveWindow(int OffsetX, int width, int OffsetY, int height);
void setEffectiveWindowRoi(int OffsetX, int width);
int getBufferSizeOfOneFrame();
float getTemperature();
XI_IMG m_image; // image buffer
void setBufferPolicy(int bufferPolicy);//0:XI_BP_UNSAFE; 1:XI_BP_SAFE;
void setAcqBufferSize(int acqBufferSize);//单位MiB
public:
//继承基类的
IrisXimeaImager();//11111111111111111111
virtual ~IrisXimeaImager();
void connect(const char * camera_serial_number=NULL);//111111111111111111111111111111111
void disconnect();//111111111111111111111111111111
void start();//111111111111111111111
void stop();//1111111111111111111111
void get_imager_type(char *buffer, int buffer_size);
void get_serial_number(char *buffer, int buffer_size);
void get_camera_serial_number(char *buffer, int buffer_size);
void generate_configuration_report(char *buffer, int buffer_size);
float get_coeff_a();
float get_coeff_b();
float get_coeff_c();
double get_wavelength_at_band(const int band);//11111111111111111111
int get_frame_buffer_size_in_bytes();
unsigned short* get_frame(unsigned short* buffer);//11111111111111111111111
std::uint64_t get_last_timestamp();
std::uint64_t ticks_per_second();
void set_spectral_bin(int new_spectral_bin);//11111111111111111111111111111111
int get_spectral_bin();
int get_min_spectral_bin();
int get_max_spectral_bin();
int get_band_count();//11111111111111111111
int get_start_band();//对应上一版本api的函数:get_window_start_band
void set_start_band(int band);
int get_min_start_band();
int get_max_start_band();
int get_inc_start_band();
int get_end_band();//对应上一版本api的函数:get_window_end_band
void set_end_band(int band);
int get_min_end_band();
int get_max_end_band();
int get_inc_end_band();
int get_sample_count();//11111111111111111
int get_start_sample();
void set_start_sample(int sample);
int get_min_start_sample();
int get_max_start_sample();
int get_inc_start_sample();
int get_end_sample();
void set_end_sample(int sample);
int get_min_end_sample();
int get_max_end_sample();
int get_inc_end_sample();
void set_framerate(const double frames_per_second);//11111111111111111111111111111111
double get_framerate();//1111111111111111111111
double get_min_framerate();
double get_max_framerate();
double get_min_integration_time();
double get_max_integration_time();
void set_integration_time(const double microsecond);//111111111111111111111
double get_integration_time();//1111111111111111111111111111111
void set_gain(const double gain);//111111111111
double get_gain();//111111111111
double get_min_gain();
double get_max_gain();
void set_internal_trigger();
void set_external_trigger(unsigned int signal_line, bool rising_edge=true);
bool is_trigger_external();
protected:
private:
uint64_t m_timestampOfCamera;
int m_iSpectralBin;
int m_iSpatialBin;
int m_iEffectiveWindow_OffsetX;
int m_iEffectiveWindow_width;
int m_iEffectiveWindow_OffsetY;
int m_iEffectiveWindow_height;
int m_iEffectiveWindowRoi_OffsetX;
int m_iEffectiveWindowRoi_width;
float m_fGain;
float m_fOffset;
};
}
#endif // IRISXIMEAIMAGER_H