123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #pragma once
- #include <string>
- #include "TypeDef.h"
- #include "ILamp.h"
- using namespace JVision;
- #pragma comment(lib,"JVisionLib.lib")
- enum MATERIAL_TYPE
- {
- MATERIAL_NULL,
- MATERIAL_WAFER,
- MATERIAL_WAFFLE,
- MATERIAL_BOX,
- MATERIAL_BOND
- };
- typedef struct
- {
- int iCameraId;
- string name;
- MATERIAL_TYPE eType;
- }CameraInfo;
- typedef long (*CallVideoBack) (int iCameraId,ImageInfo image);
- #ifdef CAMERA_BASE_EXPORTS
- #define CAMERA_BASE_DLL_API __declspec(dllexport)
- #else
- #define CAMERA_BASE_DLL_API
- #endif
- class __declspec(dllexport) CCameraBase
- {
- public:
- CCameraBase(int id, string sDescribe,bool bEnable);
- ~CCameraBase(){}
- virtual long Open() = 0;
- virtual void Close() = 0;
- virtual long VideoStart() = 0;
- virtual long VideoStop() = 0;
- virtual long GrabImage(ImageInfo& image) = 0;
- virtual long SetExposure(double exposure) = 0;
- virtual double GetExposure() = 0;
- virtual long SetGain(double gain) = 0;
- virtual double GetGain() = 0;
- int GetCameraID() { return m_iCameraId; };
- string GetCameraDescribe() { return m_sDescribe; };
- bool IsEnable() { return m_bEnable; };
- UINT GetImageWidthCenter();
- UINT GetImageHeightCenter();
- LONG SaveImage2File(ImageInfo image, const char* fileName);
-
- LONG SetLightChannelIndex(int type,
- string red_addr, int red_channel, string green_addr, int green_channel, string blue_addr, int blue_channel,
- string point_addr, int point_channel);
-
- LONG SetRedLight(int LightValue);
-
- LONG SetGreenLight(int LightValue);
-
- LONG SetBlueLight(int LightValue);
-
- LONG SetPointLight(int LightValue);
-
- LONG SetLight(int redLightValue, int greenLightValue, int blueLightValue);
-
- LONG GetLight(int &redLightValue, int &greenLightValue, int &blueLightValue,int &pointLightValue);
- void SetVideoCallBackFunc(CallVideoBack func) { m_funVideoCallBack = func; };
- protected:
- int m_iCameraId;
- string m_sName;
- string m_sDescribe;
- UINT m_iWidthMax = 2248;
- UINT m_iHeightMax = 2048;
- bool m_bEnable = false;
- double m_dExposure;
- double m_dGain;
- ILamp* m_pRedLamp = nullptr;
- ILamp* m_pGreenLamp = nullptr;
- ILamp* m_pBlueLamp = nullptr;
- ILamp* m_pPointLamp = nullptr;
- INT m_iRedLightChannel;
- INT m_iGreenLightChannel;
- INT m_iBlueLightChannel;
- INT m_iPointLightChannel;
- CallVideoBack m_funVideoCallBack = nullptr;
- };
|