diff --git a/debian/libaltaircam/changelog b/debian/libaltaircam/changelog index fc4508e42..099e4ca0b 100644 --- a/debian/libaltaircam/changelog +++ b/debian/libaltaircam/changelog @@ -1,3 +1,9 @@ +libaltaircam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- altair; Mon, 20 May 2024 08:37:31 +0800 + libaltaircam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libbressercam/changelog b/debian/libbressercam/changelog index 070186d9a..ac65beb55 100644 --- a/debian/libbressercam/changelog +++ b/debian/libbressercam/changelog @@ -1,3 +1,9 @@ +libbressercam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- bresser; Mon, 20 May 2024 08:37:37 +0800 + libbressercam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libmallincam/changelog b/debian/libmallincam/changelog index 6c2ff75eb..b0963a9b0 100644 --- a/debian/libmallincam/changelog +++ b/debian/libmallincam/changelog @@ -1,3 +1,9 @@ +libmallincam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- procom; Mon, 20 May 2024 08:37:54 +0800 + libmallincam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libnncam/changelog b/debian/libnncam/changelog index 2f3d290c5..f44cb8d6a 100644 --- a/debian/libnncam/changelog +++ b/debian/libnncam/changelog @@ -1,3 +1,9 @@ +libnncam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- nn; Mon, 20 May 2024 08:38:12 +0800 + libnncam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libogmacam/changelog b/debian/libogmacam/changelog index e1589fdcb..196add7e8 100644 --- a/debian/libogmacam/changelog +++ b/debian/libogmacam/changelog @@ -1,3 +1,9 @@ +libogmacam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- ogmavision; Mon, 20 May 2024 08:37:43 +0800 + libogmacam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libomegonprocam/changelog b/debian/libomegonprocam/changelog index a557fe2ec..4169b2404 100644 --- a/debian/libomegonprocam/changelog +++ b/debian/libomegonprocam/changelog @@ -1,3 +1,9 @@ +libomegonprocam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- nimax; Mon, 20 May 2024 08:38:00 +0800 + libomegonprocam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libstarshootg/changelog b/debian/libstarshootg/changelog index 5dc89d719..e9e80aec8 100644 --- a/debian/libstarshootg/changelog +++ b/debian/libstarshootg/changelog @@ -1,3 +1,9 @@ +libstarshootg (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- orion; Mon, 20 May 2024 08:37:49 +0800 + libstarshootg (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libtoupcam/changelog b/debian/libtoupcam/changelog index 3c1b01c4b..0a8bf2458 100644 --- a/debian/libtoupcam/changelog +++ b/debian/libtoupcam/changelog @@ -1,3 +1,9 @@ +libtoupcam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- touptek; Mon, 20 May 2024 08:37:24 +0800 + libtoupcam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/debian/libtscam/changelog b/debian/libtscam/changelog index 8804ae70e..b59933b1f 100644 --- a/debian/libtscam/changelog +++ b/debian/libtscam/changelog @@ -1,3 +1,9 @@ +libtscam (55.25633.20240519) jammy; urgency=medium + + * Upstream release + + -- teleskop; Mon, 20 May 2024 08:38:18 +0800 + libtscam (55.24621.20240204) jammy; urgency=medium * Upstream release diff --git a/libaltaircam/CMakeLists.txt b/libaltaircam/CMakeLists.txt index 4eb442a50..eda6f2eab 100644 --- a/libaltaircam/CMakeLists.txt +++ b/libaltaircam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libaltaircam) -set (LIBALTAIRCAM_VERSION "55.24621") +set (LIBALTAIRCAM_VERSION "55.25633") set (LIBALTAIRCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libaltaircam/altaircam.h b/libaltaircam/altaircam.h index 8b3aea759..8c9dac485 100644 --- a/libaltaircam/altaircam.h +++ b/libaltaircam/altaircam.h @@ -1,7 +1,7 @@ #ifndef __altaircam_h__ #define __altaircam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Altaircam_t { int unused; } *HAltaircam; #define ALTAIRCAM_SATURATION_MIN 0 /* saturation */ #define ALTAIRCAM_SATURATION_MAX 255 /* saturation */ #define ALTAIRCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define ALTAIRCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define ALTAIRCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define ALTAIRCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define ALTAIRCAM_BRIGHTNESS_MAX 128 /* brightness */ #define ALTAIRCAM_CONTRAST_DEF 0 /* contrast */ -#define ALTAIRCAM_CONTRAST_MIN (-100) /* contrast */ -#define ALTAIRCAM_CONTRAST_MAX 100 /* contrast */ +#define ALTAIRCAM_CONTRAST_MIN (-150) /* contrast */ +#define ALTAIRCAM_CONTRAST_MAX 150 /* contrast */ #define ALTAIRCAM_GAMMA_DEF 100 /* gamma */ #define ALTAIRCAM_GAMMA_MIN 20 /* gamma */ #define ALTAIRCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Altaircam_t { int unused; } *HAltaircam; #define ALTAIRCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define ALTAIRCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define ALTAIRCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define ALTAIRCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define ALTAIRCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define ALTAIRCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define ALTAIRCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define ALTAIRCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define ALTAIRCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define ALTAIRCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define ALTAIRCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define ALTAIRCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ AltaircamResolution res[16]; -} AltaircamModelV2; /* camera model v2 */ +} AltaircamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Altaircam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Altaircam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Altaircam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Altaircam_Open */ #endif const AltaircamModelV2* model; -} AltaircamDeviceV2; /* camera instance for enumerating */ +} AltaircamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) ALTAIRCAM_API(const wchar_t*) Altaircam_Version(); @@ -483,11 +483,11 @@ ALTAIRCAM_API(HRESULT) Altaircam_Trigger(HAltaircam h, unsigned short nNumber); /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -ALTAIRCAM_API(HRESULT) Altaircam_TriggerSync(HAltaircam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, AltaircamFrameInfoV3* pInfo); +ALTAIRCAM_API(HRESULT) Altaircam_TriggerSync(HAltaircam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, AltaircamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Altaircam_StartXXXX. @@ -542,10 +542,10 @@ ALTAIRCAM_API(HRESULT) Altaircam_get_RawFormat(HAltaircam h, unsigned* pFourCC, |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ ALTAIRCAM_API(HRESULT) Altaircam_get_BlackBalance(HAltaircam h, unsigned short /* Flat Field Correction */ ALTAIRCAM_API(HRESULT) Altaircam_FfcOnce(HAltaircam h); #if defined(_WIN32) -ALTAIRCAM_API(HRESULT) Altaircam_FfcExport(HAltaircam h, const wchar_t* filepath); -ALTAIRCAM_API(HRESULT) Altaircam_FfcImport(HAltaircam h, const wchar_t* filepath); +ALTAIRCAM_API(HRESULT) Altaircam_FfcExport(HAltaircam h, const wchar_t* filePath); +ALTAIRCAM_API(HRESULT) Altaircam_FfcImport(HAltaircam h, const wchar_t* filePath); #else -ALTAIRCAM_API(HRESULT) Altaircam_FfcExport(HAltaircam h, const char* filepath); -ALTAIRCAM_API(HRESULT) Altaircam_FfcImport(HAltaircam h, const char* filepath); +ALTAIRCAM_API(HRESULT) Altaircam_FfcExport(HAltaircam h, const char* filePath); +ALTAIRCAM_API(HRESULT) Altaircam_FfcImport(HAltaircam h, const char* filePath); #endif /* Dark Field Correction */ ALTAIRCAM_API(HRESULT) Altaircam_DfcOnce(HAltaircam h); #if defined(_WIN32) -ALTAIRCAM_API(HRESULT) Altaircam_DfcExport(HAltaircam h, const wchar_t* filepath); -ALTAIRCAM_API(HRESULT) Altaircam_DfcImport(HAltaircam h, const wchar_t* filepath); +ALTAIRCAM_API(HRESULT) Altaircam_DfcExport(HAltaircam h, const wchar_t* filePath); +ALTAIRCAM_API(HRESULT) Altaircam_DfcImport(HAltaircam h, const wchar_t* filePath); #else -ALTAIRCAM_API(HRESULT) Altaircam_DfcExport(HAltaircam h, const char* filepath); -ALTAIRCAM_API(HRESULT) Altaircam_DfcImport(HAltaircam h, const char* filepath); +ALTAIRCAM_API(HRESULT) Altaircam_DfcExport(HAltaircam h, const char* filePath); +ALTAIRCAM_API(HRESULT) Altaircam_DfcImport(HAltaircam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ ALTAIRCAM_API(HRESULT) Altaircam_FpncOnce(HAltaircam h); #if defined(_WIN32) -ALTAIRCAM_API(HRESULT) Altaircam_FpncExport(HAltaircam h, const wchar_t* filepath); -ALTAIRCAM_API(HRESULT) Altaircam_FpncImport(HAltaircam h, const wchar_t* filepath); +ALTAIRCAM_API(HRESULT) Altaircam_FpncExport(HAltaircam h, const wchar_t* filePath); +ALTAIRCAM_API(HRESULT) Altaircam_FpncImport(HAltaircam h, const wchar_t* filePath); #else -ALTAIRCAM_API(HRESULT) Altaircam_FpncExport(HAltaircam h, const char* filepath); -ALTAIRCAM_API(HRESULT) Altaircam_FpncImport(HAltaircam h, const char* filepath); +ALTAIRCAM_API(HRESULT) Altaircam_FpncExport(HAltaircam h, const char* filePath); +ALTAIRCAM_API(HRESULT) Altaircam_FpncImport(HAltaircam h, const char* filePath); #endif ALTAIRCAM_API(HRESULT) Altaircam_put_Hue(HAltaircam h, int Hue); @@ -1032,8 +1032,8 @@ ALTAIRCAM_API(HRESULT) Altaircam_feed_Pipe(HAltaircam h, unsigned pipeId); #define ALTAIRCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define ALTAIRCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define ALTAIRCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define ALTAIRCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define ALTAIRCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define ALTAIRCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define ALTAIRCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define ALTAIRCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define ALTAIRCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define ALTAIRCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ ALTAIRCAM_API(HRESULT) Altaircam_feed_Pipe(HAltaircam h, unsigned pipeId); #define ALTAIRCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define ALTAIRCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define ALTAIRCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define ALTAIRCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define ALTAIRCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define ALTAIRCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ ALTAIRCAM_API(HRESULT) Altaircam_get_Option(HAltaircam h, unsigned iOption, int ALTAIRCAM_API(HRESULT) Altaircam_put_Roi(HAltaircam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); ALTAIRCAM_API(HRESULT) Altaircam_get_Roi(HAltaircam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +ALTAIRCAM_API(HRESULT) Altaircam_put_RoiN(HAltaircam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + ALTAIRCAM_API(HRESULT) Altaircam_put_XY(HAltaircam h, int x, int y); #define ALTAIRCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ ALTAIRCAM_API(HRESULT) Altaircam_put_XY(HAltaircam h, int x, int y); #define ALTAIRCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define ALTAIRCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define ALTAIRCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define ALTAIRCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define ALTAIRCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define ALTAIRCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define ALTAIRCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define ALTAIRCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define ALTAIRCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define ALTAIRCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define ALTAIRCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PALTAIRCAM_HOTPLUG)(void* ctxHotPlug); ALTAIRCAM_API(HRESULT) Altaircam_GigeEnable(PALTAIRCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +ALTAIRCAM_API(HRESULT) Altaircam_export_Cfg(HAltaircam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, ALTAIRCAM_API(void) Altaircam_HotPlug(PALTAIRCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +ALTAIRCAM_API(unsigned) Altaircam_EnumWithName(AltaircamDeviceV2 pti[ALTAIRCAM_MAX]); +ALTAIRCAM_API(HRESULT) Altaircam_set_Name(HAltaircam h, const char* name); +ALTAIRCAM_API(HRESULT) Altaircam_query_Name(HAltaircam h, char name[64]); +#if defined(_WIN32) +ALTAIRCAM_API(HRESULT) Altaircam_put_Name(const wchar_t* camId, const char* name); +ALTAIRCAM_API(HRESULT) Altaircam_get_Name(const wchar_t* camId, char name[64]); +#else +ALTAIRCAM_API(HRESULT) Altaircam_put_Name(const char* camId, const char* name); +ALTAIRCAM_API(HRESULT) Altaircam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } AltaircamLensInfo; ALTAIRCAM_API(HRESULT) Altaircam_get_LensInfo(HAltaircam h, AltaircamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + AltaircamAFStatus_NA = 0x0,/* Not available */ AltaircamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ AltaircamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ AltaircamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { AltaircamAFMode AF_Mode; AltaircamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } AltaircamAFState; ALTAIRCAM_API(HRESULT) Altaircam_get_AFState(HAltaircam h, AltaircamAFState* pState); -ALTAIRCAM_API(HRESULT) Altaircam_put_AFMode(HAltaircam h, AltaircamAFMode mode); +ALTAIRCAM_API(HRESULT) Altaircam_put_AFMode(HAltaircam h, AltaircamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); ALTAIRCAM_API(HRESULT) Altaircam_put_AFRoi(HAltaircam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +ALTAIRCAM_API(HRESULT) Altaircam_get_AFRoi(HAltaircam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); ALTAIRCAM_API(HRESULT) Altaircam_put_AFAperture(HAltaircam h, int iAperture); ALTAIRCAM_API(HRESULT) Altaircam_put_AFFMPos(HAltaircam h, int iFMPos); @@ -1381,7 +1419,6 @@ ALTAIRCAM_API(HRESULT) Altaircam_get_FrameRate(HAltaircam h, unsigned* nFrame, #define ALTAIRCAM_AAF_SETPOSITION 0x01 #define ALTAIRCAM_AAF_GETPOSITION 0x02 #define ALTAIRCAM_AAF_SETZERO 0x03 -#define ALTAIRCAM_AAF_GETZERO 0x04 #define ALTAIRCAM_AAF_SETDIRECTION 0x05 #define ALTAIRCAM_AAF_GETDIRECTION 0x06 #define ALTAIRCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ ALTAIRCAM_API(HRESULT) Altaircam_get_VignetMidPointInt(HAltaircam h, int* nMidP #define ALTAIRCAM_FLAG_BITDEPTH14 ALTAIRCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define ALTAIRCAM_FLAG_BITDEPTH16 ALTAIRCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -ALTAIRCAM_API(HRESULT) Altaircam_set_Name(HAltaircam h, const char* name); -ALTAIRCAM_API(HRESULT) Altaircam_query_Name(HAltaircam h, char name[64]); -ALTAIRCAM_API(HRESULT) Altaircam_put_Name(const wchar_t* camId, const char* name); -ALTAIRCAM_API(HRESULT) Altaircam_get_Name(const wchar_t* camId, char name[64]); -#else -ALTAIRCAM_API(HRESULT) Altaircam_set_Name(HAltaircam h, const char* name); -ALTAIRCAM_API(HRESULT) Altaircam_query_Name(HAltaircam h, char name[64]); -ALTAIRCAM_API(HRESULT) Altaircam_put_Name(const char* camId, const char* name); -ALTAIRCAM_API(HRESULT) Altaircam_get_Name(const char* camId, char name[64]); -#endif -ALTAIRCAM_API(unsigned) Altaircam_EnumWithName(AltaircamDeviceV2 pti[ALTAIRCAM_MAX]); - -ALTAIRCAM_API(HRESULT) Altaircam_put_RoiN(HAltaircam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - ALTAIRCAM_API(HRESULT) Altaircam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); ALTAIRCAM_API(HRESULT) Altaircam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libaltaircam/arm64/libaltaircam.bin b/libaltaircam/arm64/libaltaircam.bin index a761b29ba..9bde5e1a1 100644 Binary files a/libaltaircam/arm64/libaltaircam.bin and b/libaltaircam/arm64/libaltaircam.bin differ diff --git a/libaltaircam/armhf/libaltaircam.bin b/libaltaircam/armhf/libaltaircam.bin index 48049c471..1e20194bf 100644 Binary files a/libaltaircam/armhf/libaltaircam.bin and b/libaltaircam/armhf/libaltaircam.bin differ diff --git a/libaltaircam/mac/libaltaircam.bin b/libaltaircam/mac/libaltaircam.bin index 89e221e2c..3b99a22e7 100644 Binary files a/libaltaircam/mac/libaltaircam.bin and b/libaltaircam/mac/libaltaircam.bin differ diff --git a/libaltaircam/x64/libaltaircam.bin b/libaltaircam/x64/libaltaircam.bin index cf216712a..2c49c5b85 100644 Binary files a/libaltaircam/x64/libaltaircam.bin and b/libaltaircam/x64/libaltaircam.bin differ diff --git a/libbressercam/CMakeLists.txt b/libbressercam/CMakeLists.txt index 78f7ca6e3..e48fcb4ed 100644 --- a/libbressercam/CMakeLists.txt +++ b/libbressercam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libbressercam) -set (LIBBRESSERCAM_VERSION "55.24621") +set (LIBBRESSERCAM_VERSION "55.25633") set (LIBBRESSERCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libbressercam/arm64/libbressercam.bin b/libbressercam/arm64/libbressercam.bin index 6b7abeb90..f58622fee 100644 Binary files a/libbressercam/arm64/libbressercam.bin and b/libbressercam/arm64/libbressercam.bin differ diff --git a/libbressercam/armhf/libbressercam.bin b/libbressercam/armhf/libbressercam.bin index a1cef33c1..0c614bcc5 100644 Binary files a/libbressercam/armhf/libbressercam.bin and b/libbressercam/armhf/libbressercam.bin differ diff --git a/libbressercam/bressercam.h b/libbressercam/bressercam.h index 8e9c83e20..d65ceae96 100644 --- a/libbressercam/bressercam.h +++ b/libbressercam/bressercam.h @@ -1,7 +1,7 @@ #ifndef __bressercam_h__ #define __bressercam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Bressercam_t { int unused; } *HBressercam; #define BRESSERCAM_SATURATION_MIN 0 /* saturation */ #define BRESSERCAM_SATURATION_MAX 255 /* saturation */ #define BRESSERCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define BRESSERCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define BRESSERCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define BRESSERCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define BRESSERCAM_BRIGHTNESS_MAX 128 /* brightness */ #define BRESSERCAM_CONTRAST_DEF 0 /* contrast */ -#define BRESSERCAM_CONTRAST_MIN (-100) /* contrast */ -#define BRESSERCAM_CONTRAST_MAX 100 /* contrast */ +#define BRESSERCAM_CONTRAST_MIN (-150) /* contrast */ +#define BRESSERCAM_CONTRAST_MAX 150 /* contrast */ #define BRESSERCAM_GAMMA_DEF 100 /* gamma */ #define BRESSERCAM_GAMMA_MIN 20 /* gamma */ #define BRESSERCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Bressercam_t { int unused; } *HBressercam; #define BRESSERCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define BRESSERCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define BRESSERCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define BRESSERCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define BRESSERCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define BRESSERCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define BRESSERCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define BRESSERCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define BRESSERCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define BRESSERCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define BRESSERCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define BRESSERCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ BressercamResolution res[16]; -} BressercamModelV2; /* camera model v2 */ +} BressercamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Bressercam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Bressercam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Bressercam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Bressercam_Open */ #endif const BressercamModelV2* model; -} BressercamDeviceV2; /* camera instance for enumerating */ +} BressercamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) BRESSERCAM_API(const wchar_t*) Bressercam_Version(); @@ -483,11 +483,11 @@ BRESSERCAM_API(HRESULT) Bressercam_Trigger(HBressercam h, unsigned short nNumbe /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -BRESSERCAM_API(HRESULT) Bressercam_TriggerSync(HBressercam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, BressercamFrameInfoV3* pInfo); +BRESSERCAM_API(HRESULT) Bressercam_TriggerSync(HBressercam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, BressercamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Bressercam_StartXXXX. @@ -542,10 +542,10 @@ BRESSERCAM_API(HRESULT) Bressercam_get_RawFormat(HBressercam h, unsigned* pFour |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ BRESSERCAM_API(HRESULT) Bressercam_get_BlackBalance(HBressercam h, unsigned sho /* Flat Field Correction */ BRESSERCAM_API(HRESULT) Bressercam_FfcOnce(HBressercam h); #if defined(_WIN32) -BRESSERCAM_API(HRESULT) Bressercam_FfcExport(HBressercam h, const wchar_t* filepath); -BRESSERCAM_API(HRESULT) Bressercam_FfcImport(HBressercam h, const wchar_t* filepath); +BRESSERCAM_API(HRESULT) Bressercam_FfcExport(HBressercam h, const wchar_t* filePath); +BRESSERCAM_API(HRESULT) Bressercam_FfcImport(HBressercam h, const wchar_t* filePath); #else -BRESSERCAM_API(HRESULT) Bressercam_FfcExport(HBressercam h, const char* filepath); -BRESSERCAM_API(HRESULT) Bressercam_FfcImport(HBressercam h, const char* filepath); +BRESSERCAM_API(HRESULT) Bressercam_FfcExport(HBressercam h, const char* filePath); +BRESSERCAM_API(HRESULT) Bressercam_FfcImport(HBressercam h, const char* filePath); #endif /* Dark Field Correction */ BRESSERCAM_API(HRESULT) Bressercam_DfcOnce(HBressercam h); #if defined(_WIN32) -BRESSERCAM_API(HRESULT) Bressercam_DfcExport(HBressercam h, const wchar_t* filepath); -BRESSERCAM_API(HRESULT) Bressercam_DfcImport(HBressercam h, const wchar_t* filepath); +BRESSERCAM_API(HRESULT) Bressercam_DfcExport(HBressercam h, const wchar_t* filePath); +BRESSERCAM_API(HRESULT) Bressercam_DfcImport(HBressercam h, const wchar_t* filePath); #else -BRESSERCAM_API(HRESULT) Bressercam_DfcExport(HBressercam h, const char* filepath); -BRESSERCAM_API(HRESULT) Bressercam_DfcImport(HBressercam h, const char* filepath); +BRESSERCAM_API(HRESULT) Bressercam_DfcExport(HBressercam h, const char* filePath); +BRESSERCAM_API(HRESULT) Bressercam_DfcImport(HBressercam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ BRESSERCAM_API(HRESULT) Bressercam_FpncOnce(HBressercam h); #if defined(_WIN32) -BRESSERCAM_API(HRESULT) Bressercam_FpncExport(HBressercam h, const wchar_t* filepath); -BRESSERCAM_API(HRESULT) Bressercam_FpncImport(HBressercam h, const wchar_t* filepath); +BRESSERCAM_API(HRESULT) Bressercam_FpncExport(HBressercam h, const wchar_t* filePath); +BRESSERCAM_API(HRESULT) Bressercam_FpncImport(HBressercam h, const wchar_t* filePath); #else -BRESSERCAM_API(HRESULT) Bressercam_FpncExport(HBressercam h, const char* filepath); -BRESSERCAM_API(HRESULT) Bressercam_FpncImport(HBressercam h, const char* filepath); +BRESSERCAM_API(HRESULT) Bressercam_FpncExport(HBressercam h, const char* filePath); +BRESSERCAM_API(HRESULT) Bressercam_FpncImport(HBressercam h, const char* filePath); #endif BRESSERCAM_API(HRESULT) Bressercam_put_Hue(HBressercam h, int Hue); @@ -1032,8 +1032,8 @@ BRESSERCAM_API(HRESULT) Bressercam_feed_Pipe(HBressercam h, unsigned pipeId); #define BRESSERCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define BRESSERCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define BRESSERCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define BRESSERCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define BRESSERCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define BRESSERCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define BRESSERCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define BRESSERCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define BRESSERCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define BRESSERCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ BRESSERCAM_API(HRESULT) Bressercam_feed_Pipe(HBressercam h, unsigned pipeId); #define BRESSERCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define BRESSERCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define BRESSERCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define BRESSERCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define BRESSERCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define BRESSERCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ BRESSERCAM_API(HRESULT) Bressercam_get_Option(HBressercam h, unsigned iOption, BRESSERCAM_API(HRESULT) Bressercam_put_Roi(HBressercam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); BRESSERCAM_API(HRESULT) Bressercam_get_Roi(HBressercam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +BRESSERCAM_API(HRESULT) Bressercam_put_RoiN(HBressercam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + BRESSERCAM_API(HRESULT) Bressercam_put_XY(HBressercam h, int x, int y); #define BRESSERCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ BRESSERCAM_API(HRESULT) Bressercam_put_XY(HBressercam h, int x, int y); #define BRESSERCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define BRESSERCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define BRESSERCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define BRESSERCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define BRESSERCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define BRESSERCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define BRESSERCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define BRESSERCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define BRESSERCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define BRESSERCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define BRESSERCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PBRESSERCAM_HOTPLUG)(void* ctxHotPlug); BRESSERCAM_API(HRESULT) Bressercam_GigeEnable(PBRESSERCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +BRESSERCAM_API(HRESULT) Bressercam_export_Cfg(HBressercam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, BRESSERCAM_API(void) Bressercam_HotPlug(PBRESSERCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +BRESSERCAM_API(unsigned) Bressercam_EnumWithName(BressercamDeviceV2 pti[BRESSERCAM_MAX]); +BRESSERCAM_API(HRESULT) Bressercam_set_Name(HBressercam h, const char* name); +BRESSERCAM_API(HRESULT) Bressercam_query_Name(HBressercam h, char name[64]); +#if defined(_WIN32) +BRESSERCAM_API(HRESULT) Bressercam_put_Name(const wchar_t* camId, const char* name); +BRESSERCAM_API(HRESULT) Bressercam_get_Name(const wchar_t* camId, char name[64]); +#else +BRESSERCAM_API(HRESULT) Bressercam_put_Name(const char* camId, const char* name); +BRESSERCAM_API(HRESULT) Bressercam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } BressercamLensInfo; BRESSERCAM_API(HRESULT) Bressercam_get_LensInfo(HBressercam h, BressercamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + BressercamAFStatus_NA = 0x0,/* Not available */ BressercamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ BressercamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ BressercamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { BressercamAFMode AF_Mode; BressercamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } BressercamAFState; BRESSERCAM_API(HRESULT) Bressercam_get_AFState(HBressercam h, BressercamAFState* pState); -BRESSERCAM_API(HRESULT) Bressercam_put_AFMode(HBressercam h, BressercamAFMode mode); +BRESSERCAM_API(HRESULT) Bressercam_put_AFMode(HBressercam h, BressercamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); BRESSERCAM_API(HRESULT) Bressercam_put_AFRoi(HBressercam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +BRESSERCAM_API(HRESULT) Bressercam_get_AFRoi(HBressercam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); BRESSERCAM_API(HRESULT) Bressercam_put_AFAperture(HBressercam h, int iAperture); BRESSERCAM_API(HRESULT) Bressercam_put_AFFMPos(HBressercam h, int iFMPos); @@ -1381,7 +1419,6 @@ BRESSERCAM_API(HRESULT) Bressercam_get_FrameRate(HBressercam h, unsigned* nFram #define BRESSERCAM_AAF_SETPOSITION 0x01 #define BRESSERCAM_AAF_GETPOSITION 0x02 #define BRESSERCAM_AAF_SETZERO 0x03 -#define BRESSERCAM_AAF_GETZERO 0x04 #define BRESSERCAM_AAF_SETDIRECTION 0x05 #define BRESSERCAM_AAF_GETDIRECTION 0x06 #define BRESSERCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ BRESSERCAM_API(HRESULT) Bressercam_get_VignetMidPointInt(HBressercam h, int* nM #define BRESSERCAM_FLAG_BITDEPTH14 BRESSERCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define BRESSERCAM_FLAG_BITDEPTH16 BRESSERCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -BRESSERCAM_API(HRESULT) Bressercam_set_Name(HBressercam h, const char* name); -BRESSERCAM_API(HRESULT) Bressercam_query_Name(HBressercam h, char name[64]); -BRESSERCAM_API(HRESULT) Bressercam_put_Name(const wchar_t* camId, const char* name); -BRESSERCAM_API(HRESULT) Bressercam_get_Name(const wchar_t* camId, char name[64]); -#else -BRESSERCAM_API(HRESULT) Bressercam_set_Name(HBressercam h, const char* name); -BRESSERCAM_API(HRESULT) Bressercam_query_Name(HBressercam h, char name[64]); -BRESSERCAM_API(HRESULT) Bressercam_put_Name(const char* camId, const char* name); -BRESSERCAM_API(HRESULT) Bressercam_get_Name(const char* camId, char name[64]); -#endif -BRESSERCAM_API(unsigned) Bressercam_EnumWithName(BressercamDeviceV2 pti[BRESSERCAM_MAX]); - -BRESSERCAM_API(HRESULT) Bressercam_put_RoiN(HBressercam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - BRESSERCAM_API(HRESULT) Bressercam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); BRESSERCAM_API(HRESULT) Bressercam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libbressercam/mac/libbressercam.bin b/libbressercam/mac/libbressercam.bin index 89ab0c1d2..0594040ca 100644 Binary files a/libbressercam/mac/libbressercam.bin and b/libbressercam/mac/libbressercam.bin differ diff --git a/libbressercam/x64/libbressercam.bin b/libbressercam/x64/libbressercam.bin index 8f1c98aa3..2fbae3dfd 100644 Binary files a/libbressercam/x64/libbressercam.bin and b/libbressercam/x64/libbressercam.bin differ diff --git a/libmallincam/CMakeLists.txt b/libmallincam/CMakeLists.txt index dc7639fac..cb5d14848 100644 --- a/libmallincam/CMakeLists.txt +++ b/libmallincam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libmallincam) -set (LIBMALLINCAM_VERSION "55.24621") +set (LIBMALLINCAM_VERSION "55.25633") set (LIBMALLINCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libmallincam/arm64/libmallincam.bin b/libmallincam/arm64/libmallincam.bin index 526a2c8c0..3b05e30e1 100644 Binary files a/libmallincam/arm64/libmallincam.bin and b/libmallincam/arm64/libmallincam.bin differ diff --git a/libmallincam/armhf/libmallincam.bin b/libmallincam/armhf/libmallincam.bin index ac33b38f3..17ee54aeb 100644 Binary files a/libmallincam/armhf/libmallincam.bin and b/libmallincam/armhf/libmallincam.bin differ diff --git a/libmallincam/mac/libmallincam.bin b/libmallincam/mac/libmallincam.bin index 3fc3c4c1a..98e4d0f59 100644 Binary files a/libmallincam/mac/libmallincam.bin and b/libmallincam/mac/libmallincam.bin differ diff --git a/libmallincam/mallincam.h b/libmallincam/mallincam.h index 38dc361b1..39f101571 100644 --- a/libmallincam/mallincam.h +++ b/libmallincam/mallincam.h @@ -1,7 +1,7 @@ #ifndef __mallincam_h__ #define __mallincam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Mallincam_t { int unused; } *HMallincam; #define MALLINCAM_SATURATION_MIN 0 /* saturation */ #define MALLINCAM_SATURATION_MAX 255 /* saturation */ #define MALLINCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define MALLINCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define MALLINCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define MALLINCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define MALLINCAM_BRIGHTNESS_MAX 128 /* brightness */ #define MALLINCAM_CONTRAST_DEF 0 /* contrast */ -#define MALLINCAM_CONTRAST_MIN (-100) /* contrast */ -#define MALLINCAM_CONTRAST_MAX 100 /* contrast */ +#define MALLINCAM_CONTRAST_MIN (-150) /* contrast */ +#define MALLINCAM_CONTRAST_MAX 150 /* contrast */ #define MALLINCAM_GAMMA_DEF 100 /* gamma */ #define MALLINCAM_GAMMA_MIN 20 /* gamma */ #define MALLINCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Mallincam_t { int unused; } *HMallincam; #define MALLINCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define MALLINCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define MALLINCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define MALLINCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define MALLINCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define MALLINCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define MALLINCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define MALLINCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define MALLINCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define MALLINCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define MALLINCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define MALLINCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ MallincamResolution res[16]; -} MallincamModelV2; /* camera model v2 */ +} MallincamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Mallincam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Mallincam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Mallincam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Mallincam_Open */ #endif const MallincamModelV2* model; -} MallincamDeviceV2; /* camera instance for enumerating */ +} MallincamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) MALLINCAM_API(const wchar_t*) Mallincam_Version(); @@ -483,11 +483,11 @@ MALLINCAM_API(HRESULT) Mallincam_Trigger(HMallincam h, unsigned short nNumber); /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -MALLINCAM_API(HRESULT) Mallincam_TriggerSync(HMallincam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, MallincamFrameInfoV3* pInfo); +MALLINCAM_API(HRESULT) Mallincam_TriggerSync(HMallincam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, MallincamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Mallincam_StartXXXX. @@ -542,10 +542,10 @@ MALLINCAM_API(HRESULT) Mallincam_get_RawFormat(HMallincam h, unsigned* pFourCC, |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ MALLINCAM_API(HRESULT) Mallincam_get_BlackBalance(HMallincam h, unsigned short /* Flat Field Correction */ MALLINCAM_API(HRESULT) Mallincam_FfcOnce(HMallincam h); #if defined(_WIN32) -MALLINCAM_API(HRESULT) Mallincam_FfcExport(HMallincam h, const wchar_t* filepath); -MALLINCAM_API(HRESULT) Mallincam_FfcImport(HMallincam h, const wchar_t* filepath); +MALLINCAM_API(HRESULT) Mallincam_FfcExport(HMallincam h, const wchar_t* filePath); +MALLINCAM_API(HRESULT) Mallincam_FfcImport(HMallincam h, const wchar_t* filePath); #else -MALLINCAM_API(HRESULT) Mallincam_FfcExport(HMallincam h, const char* filepath); -MALLINCAM_API(HRESULT) Mallincam_FfcImport(HMallincam h, const char* filepath); +MALLINCAM_API(HRESULT) Mallincam_FfcExport(HMallincam h, const char* filePath); +MALLINCAM_API(HRESULT) Mallincam_FfcImport(HMallincam h, const char* filePath); #endif /* Dark Field Correction */ MALLINCAM_API(HRESULT) Mallincam_DfcOnce(HMallincam h); #if defined(_WIN32) -MALLINCAM_API(HRESULT) Mallincam_DfcExport(HMallincam h, const wchar_t* filepath); -MALLINCAM_API(HRESULT) Mallincam_DfcImport(HMallincam h, const wchar_t* filepath); +MALLINCAM_API(HRESULT) Mallincam_DfcExport(HMallincam h, const wchar_t* filePath); +MALLINCAM_API(HRESULT) Mallincam_DfcImport(HMallincam h, const wchar_t* filePath); #else -MALLINCAM_API(HRESULT) Mallincam_DfcExport(HMallincam h, const char* filepath); -MALLINCAM_API(HRESULT) Mallincam_DfcImport(HMallincam h, const char* filepath); +MALLINCAM_API(HRESULT) Mallincam_DfcExport(HMallincam h, const char* filePath); +MALLINCAM_API(HRESULT) Mallincam_DfcImport(HMallincam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ MALLINCAM_API(HRESULT) Mallincam_FpncOnce(HMallincam h); #if defined(_WIN32) -MALLINCAM_API(HRESULT) Mallincam_FpncExport(HMallincam h, const wchar_t* filepath); -MALLINCAM_API(HRESULT) Mallincam_FpncImport(HMallincam h, const wchar_t* filepath); +MALLINCAM_API(HRESULT) Mallincam_FpncExport(HMallincam h, const wchar_t* filePath); +MALLINCAM_API(HRESULT) Mallincam_FpncImport(HMallincam h, const wchar_t* filePath); #else -MALLINCAM_API(HRESULT) Mallincam_FpncExport(HMallincam h, const char* filepath); -MALLINCAM_API(HRESULT) Mallincam_FpncImport(HMallincam h, const char* filepath); +MALLINCAM_API(HRESULT) Mallincam_FpncExport(HMallincam h, const char* filePath); +MALLINCAM_API(HRESULT) Mallincam_FpncImport(HMallincam h, const char* filePath); #endif MALLINCAM_API(HRESULT) Mallincam_put_Hue(HMallincam h, int Hue); @@ -1032,8 +1032,8 @@ MALLINCAM_API(HRESULT) Mallincam_feed_Pipe(HMallincam h, unsigned pipeId); #define MALLINCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define MALLINCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define MALLINCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define MALLINCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define MALLINCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define MALLINCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define MALLINCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define MALLINCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define MALLINCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define MALLINCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ MALLINCAM_API(HRESULT) Mallincam_feed_Pipe(HMallincam h, unsigned pipeId); #define MALLINCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define MALLINCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define MALLINCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define MALLINCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define MALLINCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define MALLINCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ MALLINCAM_API(HRESULT) Mallincam_get_Option(HMallincam h, unsigned iOption, int MALLINCAM_API(HRESULT) Mallincam_put_Roi(HMallincam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); MALLINCAM_API(HRESULT) Mallincam_get_Roi(HMallincam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +MALLINCAM_API(HRESULT) Mallincam_put_RoiN(HMallincam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + MALLINCAM_API(HRESULT) Mallincam_put_XY(HMallincam h, int x, int y); #define MALLINCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ MALLINCAM_API(HRESULT) Mallincam_put_XY(HMallincam h, int x, int y); #define MALLINCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define MALLINCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define MALLINCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define MALLINCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define MALLINCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define MALLINCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define MALLINCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define MALLINCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define MALLINCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define MALLINCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define MALLINCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PMALLINCAM_HOTPLUG)(void* ctxHotPlug); MALLINCAM_API(HRESULT) Mallincam_GigeEnable(PMALLINCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +MALLINCAM_API(HRESULT) Mallincam_export_Cfg(HMallincam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, MALLINCAM_API(void) Mallincam_HotPlug(PMALLINCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +MALLINCAM_API(unsigned) Mallincam_EnumWithName(MallincamDeviceV2 pti[MALLINCAM_MAX]); +MALLINCAM_API(HRESULT) Mallincam_set_Name(HMallincam h, const char* name); +MALLINCAM_API(HRESULT) Mallincam_query_Name(HMallincam h, char name[64]); +#if defined(_WIN32) +MALLINCAM_API(HRESULT) Mallincam_put_Name(const wchar_t* camId, const char* name); +MALLINCAM_API(HRESULT) Mallincam_get_Name(const wchar_t* camId, char name[64]); +#else +MALLINCAM_API(HRESULT) Mallincam_put_Name(const char* camId, const char* name); +MALLINCAM_API(HRESULT) Mallincam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } MallincamLensInfo; MALLINCAM_API(HRESULT) Mallincam_get_LensInfo(HMallincam h, MallincamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + MallincamAFStatus_NA = 0x0,/* Not available */ MallincamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ MallincamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ MallincamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { MallincamAFMode AF_Mode; MallincamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } MallincamAFState; MALLINCAM_API(HRESULT) Mallincam_get_AFState(HMallincam h, MallincamAFState* pState); -MALLINCAM_API(HRESULT) Mallincam_put_AFMode(HMallincam h, MallincamAFMode mode); +MALLINCAM_API(HRESULT) Mallincam_put_AFMode(HMallincam h, MallincamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); MALLINCAM_API(HRESULT) Mallincam_put_AFRoi(HMallincam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +MALLINCAM_API(HRESULT) Mallincam_get_AFRoi(HMallincam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); MALLINCAM_API(HRESULT) Mallincam_put_AFAperture(HMallincam h, int iAperture); MALLINCAM_API(HRESULT) Mallincam_put_AFFMPos(HMallincam h, int iFMPos); @@ -1381,7 +1419,6 @@ MALLINCAM_API(HRESULT) Mallincam_get_FrameRate(HMallincam h, unsigned* nFrame, #define MALLINCAM_AAF_SETPOSITION 0x01 #define MALLINCAM_AAF_GETPOSITION 0x02 #define MALLINCAM_AAF_SETZERO 0x03 -#define MALLINCAM_AAF_GETZERO 0x04 #define MALLINCAM_AAF_SETDIRECTION 0x05 #define MALLINCAM_AAF_GETDIRECTION 0x06 #define MALLINCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ MALLINCAM_API(HRESULT) Mallincam_get_VignetMidPointInt(HMallincam h, int* nMidP #define MALLINCAM_FLAG_BITDEPTH14 MALLINCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define MALLINCAM_FLAG_BITDEPTH16 MALLINCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -MALLINCAM_API(HRESULT) Mallincam_set_Name(HMallincam h, const char* name); -MALLINCAM_API(HRESULT) Mallincam_query_Name(HMallincam h, char name[64]); -MALLINCAM_API(HRESULT) Mallincam_put_Name(const wchar_t* camId, const char* name); -MALLINCAM_API(HRESULT) Mallincam_get_Name(const wchar_t* camId, char name[64]); -#else -MALLINCAM_API(HRESULT) Mallincam_set_Name(HMallincam h, const char* name); -MALLINCAM_API(HRESULT) Mallincam_query_Name(HMallincam h, char name[64]); -MALLINCAM_API(HRESULT) Mallincam_put_Name(const char* camId, const char* name); -MALLINCAM_API(HRESULT) Mallincam_get_Name(const char* camId, char name[64]); -#endif -MALLINCAM_API(unsigned) Mallincam_EnumWithName(MallincamDeviceV2 pti[MALLINCAM_MAX]); - -MALLINCAM_API(HRESULT) Mallincam_put_RoiN(HMallincam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - MALLINCAM_API(HRESULT) Mallincam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); MALLINCAM_API(HRESULT) Mallincam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libmallincam/x64/libmallincam.bin b/libmallincam/x64/libmallincam.bin index 19838edaa..a07dec2a5 100644 Binary files a/libmallincam/x64/libmallincam.bin and b/libmallincam/x64/libmallincam.bin differ diff --git a/libnncam/CMakeLists.txt b/libnncam/CMakeLists.txt index f0d1f7f25..665c91916 100644 --- a/libnncam/CMakeLists.txt +++ b/libnncam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libnncam) -set (LIBNNCAM_VERSION "55.24621") +set (LIBNNCAM_VERSION "55.25633") set (LIBNNCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libnncam/arm64/libnncam.bin b/libnncam/arm64/libnncam.bin index c8a47f710..85a194e09 100644 Binary files a/libnncam/arm64/libnncam.bin and b/libnncam/arm64/libnncam.bin differ diff --git a/libnncam/armhf/libnncam.bin b/libnncam/armhf/libnncam.bin index 6346b39a6..988b554d0 100644 Binary files a/libnncam/armhf/libnncam.bin and b/libnncam/armhf/libnncam.bin differ diff --git a/libnncam/mac/libnncam.bin b/libnncam/mac/libnncam.bin index 5700ba915..094f4f7cb 100644 Binary files a/libnncam/mac/libnncam.bin and b/libnncam/mac/libnncam.bin differ diff --git a/libnncam/nncam.h b/libnncam/nncam.h index 4af68fbd6..a65ad22dd 100644 --- a/libnncam/nncam.h +++ b/libnncam/nncam.h @@ -1,7 +1,7 @@ #ifndef __nncam_h__ #define __nncam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Nncam_t { int unused; } *HNncam; #define NNCAM_SATURATION_MIN 0 /* saturation */ #define NNCAM_SATURATION_MAX 255 /* saturation */ #define NNCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define NNCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define NNCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define NNCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define NNCAM_BRIGHTNESS_MAX 128 /* brightness */ #define NNCAM_CONTRAST_DEF 0 /* contrast */ -#define NNCAM_CONTRAST_MIN (-100) /* contrast */ -#define NNCAM_CONTRAST_MAX 100 /* contrast */ +#define NNCAM_CONTRAST_MIN (-150) /* contrast */ +#define NNCAM_CONTRAST_MAX 150 /* contrast */ #define NNCAM_GAMMA_DEF 100 /* gamma */ #define NNCAM_GAMMA_MIN 20 /* gamma */ #define NNCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Nncam_t { int unused; } *HNncam; #define NNCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define NNCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define NNCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define NNCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define NNCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define NNCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define NNCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define NNCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define NNCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define NNCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define NNCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define NNCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ NncamResolution res[16]; -} NncamModelV2; /* camera model v2 */ +} NncamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Nncam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Nncam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Nncam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Nncam_Open */ #endif const NncamModelV2* model; -} NncamDeviceV2; /* camera instance for enumerating */ +} NncamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) NNCAM_API(const wchar_t*) Nncam_Version(); @@ -483,11 +483,11 @@ NNCAM_API(HRESULT) Nncam_Trigger(HNncam h, unsigned short nNumber); /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -NNCAM_API(HRESULT) Nncam_TriggerSync(HNncam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, NncamFrameInfoV3* pInfo); +NNCAM_API(HRESULT) Nncam_TriggerSync(HNncam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, NncamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Nncam_StartXXXX. @@ -542,10 +542,10 @@ NNCAM_API(HRESULT) Nncam_get_RawFormat(HNncam h, unsigned* pFourCC, unsigned* p |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ NNCAM_API(HRESULT) Nncam_get_BlackBalance(HNncam h, unsigned short aSub[3]); /* Flat Field Correction */ NNCAM_API(HRESULT) Nncam_FfcOnce(HNncam h); #if defined(_WIN32) -NNCAM_API(HRESULT) Nncam_FfcExport(HNncam h, const wchar_t* filepath); -NNCAM_API(HRESULT) Nncam_FfcImport(HNncam h, const wchar_t* filepath); +NNCAM_API(HRESULT) Nncam_FfcExport(HNncam h, const wchar_t* filePath); +NNCAM_API(HRESULT) Nncam_FfcImport(HNncam h, const wchar_t* filePath); #else -NNCAM_API(HRESULT) Nncam_FfcExport(HNncam h, const char* filepath); -NNCAM_API(HRESULT) Nncam_FfcImport(HNncam h, const char* filepath); +NNCAM_API(HRESULT) Nncam_FfcExport(HNncam h, const char* filePath); +NNCAM_API(HRESULT) Nncam_FfcImport(HNncam h, const char* filePath); #endif /* Dark Field Correction */ NNCAM_API(HRESULT) Nncam_DfcOnce(HNncam h); #if defined(_WIN32) -NNCAM_API(HRESULT) Nncam_DfcExport(HNncam h, const wchar_t* filepath); -NNCAM_API(HRESULT) Nncam_DfcImport(HNncam h, const wchar_t* filepath); +NNCAM_API(HRESULT) Nncam_DfcExport(HNncam h, const wchar_t* filePath); +NNCAM_API(HRESULT) Nncam_DfcImport(HNncam h, const wchar_t* filePath); #else -NNCAM_API(HRESULT) Nncam_DfcExport(HNncam h, const char* filepath); -NNCAM_API(HRESULT) Nncam_DfcImport(HNncam h, const char* filepath); +NNCAM_API(HRESULT) Nncam_DfcExport(HNncam h, const char* filePath); +NNCAM_API(HRESULT) Nncam_DfcImport(HNncam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ NNCAM_API(HRESULT) Nncam_FpncOnce(HNncam h); #if defined(_WIN32) -NNCAM_API(HRESULT) Nncam_FpncExport(HNncam h, const wchar_t* filepath); -NNCAM_API(HRESULT) Nncam_FpncImport(HNncam h, const wchar_t* filepath); +NNCAM_API(HRESULT) Nncam_FpncExport(HNncam h, const wchar_t* filePath); +NNCAM_API(HRESULT) Nncam_FpncImport(HNncam h, const wchar_t* filePath); #else -NNCAM_API(HRESULT) Nncam_FpncExport(HNncam h, const char* filepath); -NNCAM_API(HRESULT) Nncam_FpncImport(HNncam h, const char* filepath); +NNCAM_API(HRESULT) Nncam_FpncExport(HNncam h, const char* filePath); +NNCAM_API(HRESULT) Nncam_FpncImport(HNncam h, const char* filePath); #endif NNCAM_API(HRESULT) Nncam_put_Hue(HNncam h, int Hue); @@ -1032,8 +1032,8 @@ NNCAM_API(HRESULT) Nncam_feed_Pipe(HNncam h, unsigned pipeId); #define NNCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define NNCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define NNCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define NNCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define NNCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define NNCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define NNCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define NNCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define NNCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define NNCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ NNCAM_API(HRESULT) Nncam_feed_Pipe(HNncam h, unsigned pipeId); #define NNCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define NNCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define NNCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define NNCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define NNCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define NNCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ NNCAM_API(HRESULT) Nncam_get_Option(HNncam h, unsigned iOption, int* piValue); NNCAM_API(HRESULT) Nncam_put_Roi(HNncam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); NNCAM_API(HRESULT) Nncam_get_Roi(HNncam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +NNCAM_API(HRESULT) Nncam_put_RoiN(HNncam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + NNCAM_API(HRESULT) Nncam_put_XY(HNncam h, int x, int y); #define NNCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ NNCAM_API(HRESULT) Nncam_put_XY(HNncam h, int x, int y); #define NNCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define NNCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define NNCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define NNCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define NNCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define NNCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define NNCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define NNCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define NNCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define NNCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define NNCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PNNCAM_HOTPLUG)(void* ctxHotPlug); NNCAM_API(HRESULT) Nncam_GigeEnable(PNNCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +NNCAM_API(HRESULT) Nncam_export_Cfg(HNncam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, NNCAM_API(void) Nncam_HotPlug(PNNCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +NNCAM_API(unsigned) Nncam_EnumWithName(NncamDeviceV2 pti[NNCAM_MAX]); +NNCAM_API(HRESULT) Nncam_set_Name(HNncam h, const char* name); +NNCAM_API(HRESULT) Nncam_query_Name(HNncam h, char name[64]); +#if defined(_WIN32) +NNCAM_API(HRESULT) Nncam_put_Name(const wchar_t* camId, const char* name); +NNCAM_API(HRESULT) Nncam_get_Name(const wchar_t* camId, char name[64]); +#else +NNCAM_API(HRESULT) Nncam_put_Name(const char* camId, const char* name); +NNCAM_API(HRESULT) Nncam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } NncamLensInfo; NNCAM_API(HRESULT) Nncam_get_LensInfo(HNncam h, NncamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + NncamAFStatus_NA = 0x0,/* Not available */ NncamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ NncamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ NncamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { NncamAFMode AF_Mode; NncamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } NncamAFState; NNCAM_API(HRESULT) Nncam_get_AFState(HNncam h, NncamAFState* pState); -NNCAM_API(HRESULT) Nncam_put_AFMode(HNncam h, NncamAFMode mode); +NNCAM_API(HRESULT) Nncam_put_AFMode(HNncam h, NncamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); NNCAM_API(HRESULT) Nncam_put_AFRoi(HNncam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +NNCAM_API(HRESULT) Nncam_get_AFRoi(HNncam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); NNCAM_API(HRESULT) Nncam_put_AFAperture(HNncam h, int iAperture); NNCAM_API(HRESULT) Nncam_put_AFFMPos(HNncam h, int iFMPos); @@ -1381,7 +1419,6 @@ NNCAM_API(HRESULT) Nncam_get_FrameRate(HNncam h, unsigned* nFrame, unsigned* nT #define NNCAM_AAF_SETPOSITION 0x01 #define NNCAM_AAF_GETPOSITION 0x02 #define NNCAM_AAF_SETZERO 0x03 -#define NNCAM_AAF_GETZERO 0x04 #define NNCAM_AAF_SETDIRECTION 0x05 #define NNCAM_AAF_GETDIRECTION 0x06 #define NNCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ NNCAM_API(HRESULT) Nncam_get_VignetMidPointInt(HNncam h, int* nMidPoint); #define NNCAM_FLAG_BITDEPTH14 NNCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define NNCAM_FLAG_BITDEPTH16 NNCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -NNCAM_API(HRESULT) Nncam_set_Name(HNncam h, const char* name); -NNCAM_API(HRESULT) Nncam_query_Name(HNncam h, char name[64]); -NNCAM_API(HRESULT) Nncam_put_Name(const wchar_t* camId, const char* name); -NNCAM_API(HRESULT) Nncam_get_Name(const wchar_t* camId, char name[64]); -#else -NNCAM_API(HRESULT) Nncam_set_Name(HNncam h, const char* name); -NNCAM_API(HRESULT) Nncam_query_Name(HNncam h, char name[64]); -NNCAM_API(HRESULT) Nncam_put_Name(const char* camId, const char* name); -NNCAM_API(HRESULT) Nncam_get_Name(const char* camId, char name[64]); -#endif -NNCAM_API(unsigned) Nncam_EnumWithName(NncamDeviceV2 pti[NNCAM_MAX]); - -NNCAM_API(HRESULT) Nncam_put_RoiN(HNncam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - NNCAM_API(HRESULT) Nncam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); NNCAM_API(HRESULT) Nncam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libnncam/x64/libnncam.bin b/libnncam/x64/libnncam.bin index 92610c49b..080b9adeb 100644 Binary files a/libnncam/x64/libnncam.bin and b/libnncam/x64/libnncam.bin differ diff --git a/libogmacam/CMakeLists.txt b/libogmacam/CMakeLists.txt index 8748d1756..18c5c960f 100644 --- a/libogmacam/CMakeLists.txt +++ b/libogmacam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libogmacam) -set (LIBOGMACAM_VERSION "55.24621") +set (LIBOGMACAM_VERSION "55.25633") set (LIBOGMACAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libogmacam/arm64/libogmacam.bin b/libogmacam/arm64/libogmacam.bin index 10a9eedb5..4c4b2dcf3 100644 Binary files a/libogmacam/arm64/libogmacam.bin and b/libogmacam/arm64/libogmacam.bin differ diff --git a/libogmacam/armhf/libogmacam.bin b/libogmacam/armhf/libogmacam.bin index b6e0ce3eb..509b73eb0 100644 Binary files a/libogmacam/armhf/libogmacam.bin and b/libogmacam/armhf/libogmacam.bin differ diff --git a/libogmacam/mac/libogmacam.bin b/libogmacam/mac/libogmacam.bin index 1158ee971..b95840edf 100644 Binary files a/libogmacam/mac/libogmacam.bin and b/libogmacam/mac/libogmacam.bin differ diff --git a/libogmacam/ogmacam.h b/libogmacam/ogmacam.h index b5b7cfd35..24557d6ae 100644 --- a/libogmacam/ogmacam.h +++ b/libogmacam/ogmacam.h @@ -1,7 +1,7 @@ #ifndef __ogmacam_h__ #define __ogmacam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Ogmacam_t { int unused; } *HOgmacam; #define OGMACAM_SATURATION_MIN 0 /* saturation */ #define OGMACAM_SATURATION_MAX 255 /* saturation */ #define OGMACAM_BRIGHTNESS_DEF 0 /* brightness */ -#define OGMACAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define OGMACAM_BRIGHTNESS_MAX 64 /* brightness */ +#define OGMACAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define OGMACAM_BRIGHTNESS_MAX 128 /* brightness */ #define OGMACAM_CONTRAST_DEF 0 /* contrast */ -#define OGMACAM_CONTRAST_MIN (-100) /* contrast */ -#define OGMACAM_CONTRAST_MAX 100 /* contrast */ +#define OGMACAM_CONTRAST_MIN (-150) /* contrast */ +#define OGMACAM_CONTRAST_MAX 150 /* contrast */ #define OGMACAM_GAMMA_DEF 100 /* gamma */ #define OGMACAM_GAMMA_MIN 20 /* gamma */ #define OGMACAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Ogmacam_t { int unused; } *HOgmacam; #define OGMACAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define OGMACAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define OGMACAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define OGMACAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define OGMACAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define OGMACAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define OGMACAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define OGMACAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define OGMACAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define OGMACAM_BANDWIDTH_DEF 100 /* bandwidth */ #define OGMACAM_BANDWIDTH_MIN 1 /* bandwidth */ #define OGMACAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ OgmacamResolution res[16]; -} OgmacamModelV2; /* camera model v2 */ +} OgmacamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Ogmacam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Ogmacam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Ogmacam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Ogmacam_Open */ #endif const OgmacamModelV2* model; -} OgmacamDeviceV2; /* camera instance for enumerating */ +} OgmacamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) OGMACAM_API(const wchar_t*) Ogmacam_Version(); @@ -483,11 +483,11 @@ OGMACAM_API(HRESULT) Ogmacam_Trigger(HOgmacam h, unsigned short nNumber); /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -OGMACAM_API(HRESULT) Ogmacam_TriggerSync(HOgmacam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, OgmacamFrameInfoV3* pInfo); +OGMACAM_API(HRESULT) Ogmacam_TriggerSync(HOgmacam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, OgmacamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Ogmacam_StartXXXX. @@ -542,10 +542,10 @@ OGMACAM_API(HRESULT) Ogmacam_get_RawFormat(HOgmacam h, unsigned* pFourCC, unsig |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ OGMACAM_API(HRESULT) Ogmacam_get_BlackBalance(HOgmacam h, unsigned short aSub[3 /* Flat Field Correction */ OGMACAM_API(HRESULT) Ogmacam_FfcOnce(HOgmacam h); #if defined(_WIN32) -OGMACAM_API(HRESULT) Ogmacam_FfcExport(HOgmacam h, const wchar_t* filepath); -OGMACAM_API(HRESULT) Ogmacam_FfcImport(HOgmacam h, const wchar_t* filepath); +OGMACAM_API(HRESULT) Ogmacam_FfcExport(HOgmacam h, const wchar_t* filePath); +OGMACAM_API(HRESULT) Ogmacam_FfcImport(HOgmacam h, const wchar_t* filePath); #else -OGMACAM_API(HRESULT) Ogmacam_FfcExport(HOgmacam h, const char* filepath); -OGMACAM_API(HRESULT) Ogmacam_FfcImport(HOgmacam h, const char* filepath); +OGMACAM_API(HRESULT) Ogmacam_FfcExport(HOgmacam h, const char* filePath); +OGMACAM_API(HRESULT) Ogmacam_FfcImport(HOgmacam h, const char* filePath); #endif /* Dark Field Correction */ OGMACAM_API(HRESULT) Ogmacam_DfcOnce(HOgmacam h); #if defined(_WIN32) -OGMACAM_API(HRESULT) Ogmacam_DfcExport(HOgmacam h, const wchar_t* filepath); -OGMACAM_API(HRESULT) Ogmacam_DfcImport(HOgmacam h, const wchar_t* filepath); +OGMACAM_API(HRESULT) Ogmacam_DfcExport(HOgmacam h, const wchar_t* filePath); +OGMACAM_API(HRESULT) Ogmacam_DfcImport(HOgmacam h, const wchar_t* filePath); #else -OGMACAM_API(HRESULT) Ogmacam_DfcExport(HOgmacam h, const char* filepath); -OGMACAM_API(HRESULT) Ogmacam_DfcImport(HOgmacam h, const char* filepath); +OGMACAM_API(HRESULT) Ogmacam_DfcExport(HOgmacam h, const char* filePath); +OGMACAM_API(HRESULT) Ogmacam_DfcImport(HOgmacam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ OGMACAM_API(HRESULT) Ogmacam_FpncOnce(HOgmacam h); #if defined(_WIN32) -OGMACAM_API(HRESULT) Ogmacam_FpncExport(HOgmacam h, const wchar_t* filepath); -OGMACAM_API(HRESULT) Ogmacam_FpncImport(HOgmacam h, const wchar_t* filepath); +OGMACAM_API(HRESULT) Ogmacam_FpncExport(HOgmacam h, const wchar_t* filePath); +OGMACAM_API(HRESULT) Ogmacam_FpncImport(HOgmacam h, const wchar_t* filePath); #else -OGMACAM_API(HRESULT) Ogmacam_FpncExport(HOgmacam h, const char* filepath); -OGMACAM_API(HRESULT) Ogmacam_FpncImport(HOgmacam h, const char* filepath); +OGMACAM_API(HRESULT) Ogmacam_FpncExport(HOgmacam h, const char* filePath); +OGMACAM_API(HRESULT) Ogmacam_FpncImport(HOgmacam h, const char* filePath); #endif OGMACAM_API(HRESULT) Ogmacam_put_Hue(HOgmacam h, int Hue); @@ -1032,8 +1032,8 @@ OGMACAM_API(HRESULT) Ogmacam_feed_Pipe(HOgmacam h, unsigned pipeId); #define OGMACAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define OGMACAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define OGMACAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define OGMACAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define OGMACAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define OGMACAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define OGMACAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define OGMACAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define OGMACAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define OGMACAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ OGMACAM_API(HRESULT) Ogmacam_feed_Pipe(HOgmacam h, unsigned pipeId); #define OGMACAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define OGMACAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define OGMACAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define OGMACAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define OGMACAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define OGMACAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ OGMACAM_API(HRESULT) Ogmacam_get_Option(HOgmacam h, unsigned iOption, int* piVa OGMACAM_API(HRESULT) Ogmacam_put_Roi(HOgmacam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); OGMACAM_API(HRESULT) Ogmacam_get_Roi(HOgmacam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +OGMACAM_API(HRESULT) Ogmacam_put_RoiN(HOgmacam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + OGMACAM_API(HRESULT) Ogmacam_put_XY(HOgmacam h, int x, int y); #define OGMACAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ OGMACAM_API(HRESULT) Ogmacam_put_XY(HOgmacam h, int x, int y); #define OGMACAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define OGMACAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define OGMACAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define OGMACAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define OGMACAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define OGMACAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define OGMACAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define OGMACAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define OGMACAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define OGMACAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define OGMACAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* POGMACAM_HOTPLUG)(void* ctxHotPlug); OGMACAM_API(HRESULT) Ogmacam_GigeEnable(POGMACAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +OGMACAM_API(HRESULT) Ogmacam_export_Cfg(HOgmacam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, OGMACAM_API(void) Ogmacam_HotPlug(POGMACAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +OGMACAM_API(unsigned) Ogmacam_EnumWithName(OgmacamDeviceV2 pti[OGMACAM_MAX]); +OGMACAM_API(HRESULT) Ogmacam_set_Name(HOgmacam h, const char* name); +OGMACAM_API(HRESULT) Ogmacam_query_Name(HOgmacam h, char name[64]); +#if defined(_WIN32) +OGMACAM_API(HRESULT) Ogmacam_put_Name(const wchar_t* camId, const char* name); +OGMACAM_API(HRESULT) Ogmacam_get_Name(const wchar_t* camId, char name[64]); +#else +OGMACAM_API(HRESULT) Ogmacam_put_Name(const char* camId, const char* name); +OGMACAM_API(HRESULT) Ogmacam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } OgmacamLensInfo; OGMACAM_API(HRESULT) Ogmacam_get_LensInfo(HOgmacam h, OgmacamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + OgmacamAFStatus_NA = 0x0,/* Not available */ OgmacamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ OgmacamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ OgmacamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { OgmacamAFMode AF_Mode; OgmacamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } OgmacamAFState; OGMACAM_API(HRESULT) Ogmacam_get_AFState(HOgmacam h, OgmacamAFState* pState); -OGMACAM_API(HRESULT) Ogmacam_put_AFMode(HOgmacam h, OgmacamAFMode mode); +OGMACAM_API(HRESULT) Ogmacam_put_AFMode(HOgmacam h, OgmacamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); OGMACAM_API(HRESULT) Ogmacam_put_AFRoi(HOgmacam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +OGMACAM_API(HRESULT) Ogmacam_get_AFRoi(HOgmacam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); OGMACAM_API(HRESULT) Ogmacam_put_AFAperture(HOgmacam h, int iAperture); OGMACAM_API(HRESULT) Ogmacam_put_AFFMPos(HOgmacam h, int iFMPos); @@ -1381,7 +1419,6 @@ OGMACAM_API(HRESULT) Ogmacam_get_FrameRate(HOgmacam h, unsigned* nFrame, unsign #define OGMACAM_AAF_SETPOSITION 0x01 #define OGMACAM_AAF_GETPOSITION 0x02 #define OGMACAM_AAF_SETZERO 0x03 -#define OGMACAM_AAF_GETZERO 0x04 #define OGMACAM_AAF_SETDIRECTION 0x05 #define OGMACAM_AAF_GETDIRECTION 0x06 #define OGMACAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ OGMACAM_API(HRESULT) Ogmacam_get_VignetMidPointInt(HOgmacam h, int* nMidPoint); #define OGMACAM_FLAG_BITDEPTH14 OGMACAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define OGMACAM_FLAG_BITDEPTH16 OGMACAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -OGMACAM_API(HRESULT) Ogmacam_set_Name(HOgmacam h, const char* name); -OGMACAM_API(HRESULT) Ogmacam_query_Name(HOgmacam h, char name[64]); -OGMACAM_API(HRESULT) Ogmacam_put_Name(const wchar_t* camId, const char* name); -OGMACAM_API(HRESULT) Ogmacam_get_Name(const wchar_t* camId, char name[64]); -#else -OGMACAM_API(HRESULT) Ogmacam_set_Name(HOgmacam h, const char* name); -OGMACAM_API(HRESULT) Ogmacam_query_Name(HOgmacam h, char name[64]); -OGMACAM_API(HRESULT) Ogmacam_put_Name(const char* camId, const char* name); -OGMACAM_API(HRESULT) Ogmacam_get_Name(const char* camId, char name[64]); -#endif -OGMACAM_API(unsigned) Ogmacam_EnumWithName(OgmacamDeviceV2 pti[OGMACAM_MAX]); - -OGMACAM_API(HRESULT) Ogmacam_put_RoiN(HOgmacam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - OGMACAM_API(HRESULT) Ogmacam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); OGMACAM_API(HRESULT) Ogmacam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libogmacam/x64/libogmacam.bin b/libogmacam/x64/libogmacam.bin index f82369c7a..d69a98eac 100644 Binary files a/libogmacam/x64/libogmacam.bin and b/libogmacam/x64/libogmacam.bin differ diff --git a/libomegonprocam/CMakeLists.txt b/libomegonprocam/CMakeLists.txt index 100915207..18d79b4db 100644 --- a/libomegonprocam/CMakeLists.txt +++ b/libomegonprocam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libomegonprocam) -set (LIBOMEGONPROCAM_VERSION "55.24621") +set (LIBOMEGONPROCAM_VERSION "55.25633") set (LIBOMEGONPROCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libomegonprocam/arm64/libomegonprocam.bin b/libomegonprocam/arm64/libomegonprocam.bin index 50371cbb9..38b676290 100644 Binary files a/libomegonprocam/arm64/libomegonprocam.bin and b/libomegonprocam/arm64/libomegonprocam.bin differ diff --git a/libomegonprocam/armhf/libomegonprocam.bin b/libomegonprocam/armhf/libomegonprocam.bin index bf3e8b3dd..43e0fd669 100644 Binary files a/libomegonprocam/armhf/libomegonprocam.bin and b/libomegonprocam/armhf/libomegonprocam.bin differ diff --git a/libomegonprocam/mac/libomegonprocam.bin b/libomegonprocam/mac/libomegonprocam.bin index 3d23ce1ee..6124e98a3 100644 Binary files a/libomegonprocam/mac/libomegonprocam.bin and b/libomegonprocam/mac/libomegonprocam.bin differ diff --git a/libomegonprocam/omegonprocam.h b/libomegonprocam/omegonprocam.h index 928581701..422cd3957 100644 --- a/libomegonprocam/omegonprocam.h +++ b/libomegonprocam/omegonprocam.h @@ -1,7 +1,7 @@ #ifndef __omegonprocam_h__ #define __omegonprocam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Omegonprocam_t { int unused; } *HOmegonprocam; #define OMEGONPROCAM_SATURATION_MIN 0 /* saturation */ #define OMEGONPROCAM_SATURATION_MAX 255 /* saturation */ #define OMEGONPROCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define OMEGONPROCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define OMEGONPROCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define OMEGONPROCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define OMEGONPROCAM_BRIGHTNESS_MAX 128 /* brightness */ #define OMEGONPROCAM_CONTRAST_DEF 0 /* contrast */ -#define OMEGONPROCAM_CONTRAST_MIN (-100) /* contrast */ -#define OMEGONPROCAM_CONTRAST_MAX 100 /* contrast */ +#define OMEGONPROCAM_CONTRAST_MIN (-150) /* contrast */ +#define OMEGONPROCAM_CONTRAST_MAX 150 /* contrast */ #define OMEGONPROCAM_GAMMA_DEF 100 /* gamma */ #define OMEGONPROCAM_GAMMA_MIN 20 /* gamma */ #define OMEGONPROCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Omegonprocam_t { int unused; } *HOmegonprocam; #define OMEGONPROCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define OMEGONPROCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define OMEGONPROCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define OMEGONPROCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define OMEGONPROCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define OMEGONPROCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define OMEGONPROCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define OMEGONPROCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define OMEGONPROCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define OMEGONPROCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define OMEGONPROCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define OMEGONPROCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ OmegonprocamResolution res[16]; -} OmegonprocamModelV2; /* camera model v2 */ +} OmegonprocamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Omegonprocam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Omegonprocam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Omegonprocam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Omegonprocam_Open */ #endif const OmegonprocamModelV2* model; -} OmegonprocamDeviceV2; /* camera instance for enumerating */ +} OmegonprocamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) OMEGONPROCAM_API(const wchar_t*) Omegonprocam_Version(); @@ -483,11 +483,11 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_Trigger(HOmegonprocam h, unsigned short /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -OMEGONPROCAM_API(HRESULT) Omegonprocam_TriggerSync(HOmegonprocam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, OmegonprocamFrameInfoV3* pInfo); +OMEGONPROCAM_API(HRESULT) Omegonprocam_TriggerSync(HOmegonprocam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, OmegonprocamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Omegonprocam_StartXXXX. @@ -542,10 +542,10 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_get_RawFormat(HOmegonprocam h, unsigned* |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_get_BlackBalance(HOmegonprocam h, unsign /* Flat Field Correction */ OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcOnce(HOmegonprocam h); #if defined(_WIN32) -OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcExport(HOmegonprocam h, const wchar_t* filepath); -OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcImport(HOmegonprocam h, const wchar_t* filepath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcExport(HOmegonprocam h, const wchar_t* filePath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcImport(HOmegonprocam h, const wchar_t* filePath); #else -OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcExport(HOmegonprocam h, const char* filepath); -OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcImport(HOmegonprocam h, const char* filepath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcExport(HOmegonprocam h, const char* filePath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FfcImport(HOmegonprocam h, const char* filePath); #endif /* Dark Field Correction */ OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcOnce(HOmegonprocam h); #if defined(_WIN32) -OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcExport(HOmegonprocam h, const wchar_t* filepath); -OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcImport(HOmegonprocam h, const wchar_t* filepath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcExport(HOmegonprocam h, const wchar_t* filePath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcImport(HOmegonprocam h, const wchar_t* filePath); #else -OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcExport(HOmegonprocam h, const char* filepath); -OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcImport(HOmegonprocam h, const char* filepath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcExport(HOmegonprocam h, const char* filePath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_DfcImport(HOmegonprocam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncOnce(HOmegonprocam h); #if defined(_WIN32) -OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncExport(HOmegonprocam h, const wchar_t* filepath); -OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncImport(HOmegonprocam h, const wchar_t* filepath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncExport(HOmegonprocam h, const wchar_t* filePath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncImport(HOmegonprocam h, const wchar_t* filePath); #else -OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncExport(HOmegonprocam h, const char* filepath); -OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncImport(HOmegonprocam h, const char* filepath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncExport(HOmegonprocam h, const char* filePath); +OMEGONPROCAM_API(HRESULT) Omegonprocam_FpncImport(HOmegonprocam h, const char* filePath); #endif OMEGONPROCAM_API(HRESULT) Omegonprocam_put_Hue(HOmegonprocam h, int Hue); @@ -1032,8 +1032,8 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_feed_Pipe(HOmegonprocam h, unsigned pipe #define OMEGONPROCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define OMEGONPROCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define OMEGONPROCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define OMEGONPROCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define OMEGONPROCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define OMEGONPROCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define OMEGONPROCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define OMEGONPROCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define OMEGONPROCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define OMEGONPROCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_feed_Pipe(HOmegonprocam h, unsigned pipe #define OMEGONPROCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define OMEGONPROCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define OMEGONPROCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define OMEGONPROCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define OMEGONPROCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define OMEGONPROCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_get_Option(HOmegonprocam h, unsigned iOp OMEGONPROCAM_API(HRESULT) Omegonprocam_put_Roi(HOmegonprocam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); OMEGONPROCAM_API(HRESULT) Omegonprocam_get_Roi(HOmegonprocam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +OMEGONPROCAM_API(HRESULT) Omegonprocam_put_RoiN(HOmegonprocam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + OMEGONPROCAM_API(HRESULT) Omegonprocam_put_XY(HOmegonprocam h, int x, int y); #define OMEGONPROCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_put_XY(HOmegonprocam h, int x, int y); #define OMEGONPROCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define OMEGONPROCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define OMEGONPROCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define OMEGONPROCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define OMEGONPROCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define OMEGONPROCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define OMEGONPROCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define OMEGONPROCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define OMEGONPROCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define OMEGONPROCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define OMEGONPROCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* POMEGONPROCAM_HOTPLUG)(void* ctxHotPlug); OMEGONPROCAM_API(HRESULT) Omegonprocam_GigeEnable(POMEGONPROCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +OMEGONPROCAM_API(HRESULT) Omegonprocam_export_Cfg(HOmegonprocam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, OMEGONPROCAM_API(void) Omegonprocam_HotPlug(POMEGONPROCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +OMEGONPROCAM_API(unsigned) Omegonprocam_EnumWithName(OmegonprocamDeviceV2 pti[OMEGONPROCAM_MAX]); +OMEGONPROCAM_API(HRESULT) Omegonprocam_set_Name(HOmegonprocam h, const char* name); +OMEGONPROCAM_API(HRESULT) Omegonprocam_query_Name(HOmegonprocam h, char name[64]); +#if defined(_WIN32) +OMEGONPROCAM_API(HRESULT) Omegonprocam_put_Name(const wchar_t* camId, const char* name); +OMEGONPROCAM_API(HRESULT) Omegonprocam_get_Name(const wchar_t* camId, char name[64]); +#else +OMEGONPROCAM_API(HRESULT) Omegonprocam_put_Name(const char* camId, const char* name); +OMEGONPROCAM_API(HRESULT) Omegonprocam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } OmegonprocamLensInfo; OMEGONPROCAM_API(HRESULT) Omegonprocam_get_LensInfo(HOmegonprocam h, OmegonprocamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + OmegonprocamAFStatus_NA = 0x0,/* Not available */ OmegonprocamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ OmegonprocamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ OmegonprocamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { OmegonprocamAFMode AF_Mode; OmegonprocamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } OmegonprocamAFState; OMEGONPROCAM_API(HRESULT) Omegonprocam_get_AFState(HOmegonprocam h, OmegonprocamAFState* pState); -OMEGONPROCAM_API(HRESULT) Omegonprocam_put_AFMode(HOmegonprocam h, OmegonprocamAFMode mode); +OMEGONPROCAM_API(HRESULT) Omegonprocam_put_AFMode(HOmegonprocam h, OmegonprocamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); OMEGONPROCAM_API(HRESULT) Omegonprocam_put_AFRoi(HOmegonprocam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +OMEGONPROCAM_API(HRESULT) Omegonprocam_get_AFRoi(HOmegonprocam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); OMEGONPROCAM_API(HRESULT) Omegonprocam_put_AFAperture(HOmegonprocam h, int iAperture); OMEGONPROCAM_API(HRESULT) Omegonprocam_put_AFFMPos(HOmegonprocam h, int iFMPos); @@ -1381,7 +1419,6 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_get_FrameRate(HOmegonprocam h, unsigned* #define OMEGONPROCAM_AAF_SETPOSITION 0x01 #define OMEGONPROCAM_AAF_GETPOSITION 0x02 #define OMEGONPROCAM_AAF_SETZERO 0x03 -#define OMEGONPROCAM_AAF_GETZERO 0x04 #define OMEGONPROCAM_AAF_SETDIRECTION 0x05 #define OMEGONPROCAM_AAF_GETDIRECTION 0x06 #define OMEGONPROCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ OMEGONPROCAM_API(HRESULT) Omegonprocam_get_VignetMidPointInt(HOmegonprocam h, i #define OMEGONPROCAM_FLAG_BITDEPTH14 OMEGONPROCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define OMEGONPROCAM_FLAG_BITDEPTH16 OMEGONPROCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -OMEGONPROCAM_API(HRESULT) Omegonprocam_set_Name(HOmegonprocam h, const char* name); -OMEGONPROCAM_API(HRESULT) Omegonprocam_query_Name(HOmegonprocam h, char name[64]); -OMEGONPROCAM_API(HRESULT) Omegonprocam_put_Name(const wchar_t* camId, const char* name); -OMEGONPROCAM_API(HRESULT) Omegonprocam_get_Name(const wchar_t* camId, char name[64]); -#else -OMEGONPROCAM_API(HRESULT) Omegonprocam_set_Name(HOmegonprocam h, const char* name); -OMEGONPROCAM_API(HRESULT) Omegonprocam_query_Name(HOmegonprocam h, char name[64]); -OMEGONPROCAM_API(HRESULT) Omegonprocam_put_Name(const char* camId, const char* name); -OMEGONPROCAM_API(HRESULT) Omegonprocam_get_Name(const char* camId, char name[64]); -#endif -OMEGONPROCAM_API(unsigned) Omegonprocam_EnumWithName(OmegonprocamDeviceV2 pti[OMEGONPROCAM_MAX]); - -OMEGONPROCAM_API(HRESULT) Omegonprocam_put_RoiN(HOmegonprocam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - OMEGONPROCAM_API(HRESULT) Omegonprocam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); OMEGONPROCAM_API(HRESULT) Omegonprocam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libomegonprocam/x64/libomegonprocam.bin b/libomegonprocam/x64/libomegonprocam.bin index 6d48c2cc7..9d1450b4d 100644 Binary files a/libomegonprocam/x64/libomegonprocam.bin and b/libomegonprocam/x64/libomegonprocam.bin differ diff --git a/libstarshootg/CMakeLists.txt b/libstarshootg/CMakeLists.txt index 3f280ebce..bed54d68b 100644 --- a/libstarshootg/CMakeLists.txt +++ b/libstarshootg/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libstarshootg) -set (LIBSTARSHOOTG_VERSION "55.24621") +set (LIBSTARSHOOTG_VERSION "55.25633") set (LIBSTARSHOOTG_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libstarshootg/arm64/libstarshootg.bin b/libstarshootg/arm64/libstarshootg.bin index 1d627edc5..07dac4370 100644 Binary files a/libstarshootg/arm64/libstarshootg.bin and b/libstarshootg/arm64/libstarshootg.bin differ diff --git a/libstarshootg/armhf/libstarshootg.bin b/libstarshootg/armhf/libstarshootg.bin index a3df50472..583b46742 100644 Binary files a/libstarshootg/armhf/libstarshootg.bin and b/libstarshootg/armhf/libstarshootg.bin differ diff --git a/libstarshootg/mac/libstarshootg.bin b/libstarshootg/mac/libstarshootg.bin index 123d6265a..70e80e6a5 100644 Binary files a/libstarshootg/mac/libstarshootg.bin and b/libstarshootg/mac/libstarshootg.bin differ diff --git a/libstarshootg/starshootg.h b/libstarshootg/starshootg.h index 4ed96916f..f7ce99fa8 100644 --- a/libstarshootg/starshootg.h +++ b/libstarshootg/starshootg.h @@ -1,7 +1,7 @@ #ifndef __starshootg_h__ #define __starshootg_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Starshootg_t { int unused; } *HStarshootg; #define STARSHOOTG_SATURATION_MIN 0 /* saturation */ #define STARSHOOTG_SATURATION_MAX 255 /* saturation */ #define STARSHOOTG_BRIGHTNESS_DEF 0 /* brightness */ -#define STARSHOOTG_BRIGHTNESS_MIN (-64) /* brightness */ -#define STARSHOOTG_BRIGHTNESS_MAX 64 /* brightness */ +#define STARSHOOTG_BRIGHTNESS_MIN (-128) /* brightness */ +#define STARSHOOTG_BRIGHTNESS_MAX 128 /* brightness */ #define STARSHOOTG_CONTRAST_DEF 0 /* contrast */ -#define STARSHOOTG_CONTRAST_MIN (-100) /* contrast */ -#define STARSHOOTG_CONTRAST_MAX 100 /* contrast */ +#define STARSHOOTG_CONTRAST_MIN (-150) /* contrast */ +#define STARSHOOTG_CONTRAST_MAX 150 /* contrast */ #define STARSHOOTG_GAMMA_DEF 100 /* gamma */ #define STARSHOOTG_GAMMA_MIN 20 /* gamma */ #define STARSHOOTG_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Starshootg_t { int unused; } *HStarshootg; #define STARSHOOTG_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define STARSHOOTG_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define STARSHOOTG_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define STARSHOOTG_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define STARSHOOTG_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define STARSHOOTG_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define STARSHOOTG_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define STARSHOOTG_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define STARSHOOTG_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define STARSHOOTG_BANDWIDTH_DEF 100 /* bandwidth */ #define STARSHOOTG_BANDWIDTH_MIN 1 /* bandwidth */ #define STARSHOOTG_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ StarshootgResolution res[16]; -} StarshootgModelV2; /* camera model v2 */ +} StarshootgModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Starshootg_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Starshootg_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Starshootg_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Starshootg_Open */ #endif const StarshootgModelV2* model; -} StarshootgDeviceV2; /* camera instance for enumerating */ +} StarshootgDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) STARSHOOTG_API(const wchar_t*) Starshootg_Version(); @@ -483,11 +483,11 @@ STARSHOOTG_API(HRESULT) Starshootg_Trigger(HStarshootg h, unsigned short nNumbe /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -STARSHOOTG_API(HRESULT) Starshootg_TriggerSync(HStarshootg h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, StarshootgFrameInfoV3* pInfo); +STARSHOOTG_API(HRESULT) Starshootg_TriggerSync(HStarshootg h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, StarshootgFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Starshootg_StartXXXX. @@ -542,10 +542,10 @@ STARSHOOTG_API(HRESULT) Starshootg_get_RawFormat(HStarshootg h, unsigned* pFour |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ STARSHOOTG_API(HRESULT) Starshootg_get_BlackBalance(HStarshootg h, unsigned sho /* Flat Field Correction */ STARSHOOTG_API(HRESULT) Starshootg_FfcOnce(HStarshootg h); #if defined(_WIN32) -STARSHOOTG_API(HRESULT) Starshootg_FfcExport(HStarshootg h, const wchar_t* filepath); -STARSHOOTG_API(HRESULT) Starshootg_FfcImport(HStarshootg h, const wchar_t* filepath); +STARSHOOTG_API(HRESULT) Starshootg_FfcExport(HStarshootg h, const wchar_t* filePath); +STARSHOOTG_API(HRESULT) Starshootg_FfcImport(HStarshootg h, const wchar_t* filePath); #else -STARSHOOTG_API(HRESULT) Starshootg_FfcExport(HStarshootg h, const char* filepath); -STARSHOOTG_API(HRESULT) Starshootg_FfcImport(HStarshootg h, const char* filepath); +STARSHOOTG_API(HRESULT) Starshootg_FfcExport(HStarshootg h, const char* filePath); +STARSHOOTG_API(HRESULT) Starshootg_FfcImport(HStarshootg h, const char* filePath); #endif /* Dark Field Correction */ STARSHOOTG_API(HRESULT) Starshootg_DfcOnce(HStarshootg h); #if defined(_WIN32) -STARSHOOTG_API(HRESULT) Starshootg_DfcExport(HStarshootg h, const wchar_t* filepath); -STARSHOOTG_API(HRESULT) Starshootg_DfcImport(HStarshootg h, const wchar_t* filepath); +STARSHOOTG_API(HRESULT) Starshootg_DfcExport(HStarshootg h, const wchar_t* filePath); +STARSHOOTG_API(HRESULT) Starshootg_DfcImport(HStarshootg h, const wchar_t* filePath); #else -STARSHOOTG_API(HRESULT) Starshootg_DfcExport(HStarshootg h, const char* filepath); -STARSHOOTG_API(HRESULT) Starshootg_DfcImport(HStarshootg h, const char* filepath); +STARSHOOTG_API(HRESULT) Starshootg_DfcExport(HStarshootg h, const char* filePath); +STARSHOOTG_API(HRESULT) Starshootg_DfcImport(HStarshootg h, const char* filePath); #endif /* Fix Pattern Noise Correction */ STARSHOOTG_API(HRESULT) Starshootg_FpncOnce(HStarshootg h); #if defined(_WIN32) -STARSHOOTG_API(HRESULT) Starshootg_FpncExport(HStarshootg h, const wchar_t* filepath); -STARSHOOTG_API(HRESULT) Starshootg_FpncImport(HStarshootg h, const wchar_t* filepath); +STARSHOOTG_API(HRESULT) Starshootg_FpncExport(HStarshootg h, const wchar_t* filePath); +STARSHOOTG_API(HRESULT) Starshootg_FpncImport(HStarshootg h, const wchar_t* filePath); #else -STARSHOOTG_API(HRESULT) Starshootg_FpncExport(HStarshootg h, const char* filepath); -STARSHOOTG_API(HRESULT) Starshootg_FpncImport(HStarshootg h, const char* filepath); +STARSHOOTG_API(HRESULT) Starshootg_FpncExport(HStarshootg h, const char* filePath); +STARSHOOTG_API(HRESULT) Starshootg_FpncImport(HStarshootg h, const char* filePath); #endif STARSHOOTG_API(HRESULT) Starshootg_put_Hue(HStarshootg h, int Hue); @@ -1032,8 +1032,8 @@ STARSHOOTG_API(HRESULT) Starshootg_feed_Pipe(HStarshootg h, unsigned pipeId); #define STARSHOOTG_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define STARSHOOTG_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define STARSHOOTG_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define STARSHOOTG_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define STARSHOOTG_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define STARSHOOTG_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define STARSHOOTG_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define STARSHOOTG_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define STARSHOOTG_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define STARSHOOTG_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ STARSHOOTG_API(HRESULT) Starshootg_feed_Pipe(HStarshootg h, unsigned pipeId); #define STARSHOOTG_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define STARSHOOTG_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define STARSHOOTG_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define STARSHOOTG_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define STARSHOOTG_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define STARSHOOTG_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ STARSHOOTG_API(HRESULT) Starshootg_get_Option(HStarshootg h, unsigned iOption, STARSHOOTG_API(HRESULT) Starshootg_put_Roi(HStarshootg h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); STARSHOOTG_API(HRESULT) Starshootg_get_Roi(HStarshootg h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +STARSHOOTG_API(HRESULT) Starshootg_put_RoiN(HStarshootg h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + STARSHOOTG_API(HRESULT) Starshootg_put_XY(HStarshootg h, int x, int y); #define STARSHOOTG_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ STARSHOOTG_API(HRESULT) Starshootg_put_XY(HStarshootg h, int x, int y); #define STARSHOOTG_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define STARSHOOTG_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define STARSHOOTG_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define STARSHOOTG_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define STARSHOOTG_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define STARSHOOTG_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define STARSHOOTG_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define STARSHOOTG_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define STARSHOOTG_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define STARSHOOTG_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define STARSHOOTG_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PSTARSHOOTG_HOTPLUG)(void* ctxHotPlug); STARSHOOTG_API(HRESULT) Starshootg_GigeEnable(PSTARSHOOTG_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +STARSHOOTG_API(HRESULT) Starshootg_export_Cfg(HStarshootg h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, STARSHOOTG_API(void) Starshootg_HotPlug(PSTARSHOOTG_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +STARSHOOTG_API(unsigned) Starshootg_EnumWithName(StarshootgDeviceV2 pti[STARSHOOTG_MAX]); +STARSHOOTG_API(HRESULT) Starshootg_set_Name(HStarshootg h, const char* name); +STARSHOOTG_API(HRESULT) Starshootg_query_Name(HStarshootg h, char name[64]); +#if defined(_WIN32) +STARSHOOTG_API(HRESULT) Starshootg_put_Name(const wchar_t* camId, const char* name); +STARSHOOTG_API(HRESULT) Starshootg_get_Name(const wchar_t* camId, char name[64]); +#else +STARSHOOTG_API(HRESULT) Starshootg_put_Name(const char* camId, const char* name); +STARSHOOTG_API(HRESULT) Starshootg_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } StarshootgLensInfo; STARSHOOTG_API(HRESULT) Starshootg_get_LensInfo(HStarshootg h, StarshootgLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + StarshootgAFStatus_NA = 0x0,/* Not available */ StarshootgAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ StarshootgAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ StarshootgAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { StarshootgAFMode AF_Mode; StarshootgAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } StarshootgAFState; STARSHOOTG_API(HRESULT) Starshootg_get_AFState(HStarshootg h, StarshootgAFState* pState); -STARSHOOTG_API(HRESULT) Starshootg_put_AFMode(HStarshootg h, StarshootgAFMode mode); +STARSHOOTG_API(HRESULT) Starshootg_put_AFMode(HStarshootg h, StarshootgAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); STARSHOOTG_API(HRESULT) Starshootg_put_AFRoi(HStarshootg h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +STARSHOOTG_API(HRESULT) Starshootg_get_AFRoi(HStarshootg h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); STARSHOOTG_API(HRESULT) Starshootg_put_AFAperture(HStarshootg h, int iAperture); STARSHOOTG_API(HRESULT) Starshootg_put_AFFMPos(HStarshootg h, int iFMPos); @@ -1381,7 +1419,6 @@ STARSHOOTG_API(HRESULT) Starshootg_get_FrameRate(HStarshootg h, unsigned* nFram #define STARSHOOTG_AAF_SETPOSITION 0x01 #define STARSHOOTG_AAF_GETPOSITION 0x02 #define STARSHOOTG_AAF_SETZERO 0x03 -#define STARSHOOTG_AAF_GETZERO 0x04 #define STARSHOOTG_AAF_SETDIRECTION 0x05 #define STARSHOOTG_AAF_GETDIRECTION 0x06 #define STARSHOOTG_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ STARSHOOTG_API(HRESULT) Starshootg_get_VignetMidPointInt(HStarshootg h, int* nM #define STARSHOOTG_FLAG_BITDEPTH14 STARSHOOTG_FLAG_RAW14 /* pixel format, RAW 14bits */ #define STARSHOOTG_FLAG_BITDEPTH16 STARSHOOTG_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -STARSHOOTG_API(HRESULT) Starshootg_set_Name(HStarshootg h, const char* name); -STARSHOOTG_API(HRESULT) Starshootg_query_Name(HStarshootg h, char name[64]); -STARSHOOTG_API(HRESULT) Starshootg_put_Name(const wchar_t* camId, const char* name); -STARSHOOTG_API(HRESULT) Starshootg_get_Name(const wchar_t* camId, char name[64]); -#else -STARSHOOTG_API(HRESULT) Starshootg_set_Name(HStarshootg h, const char* name); -STARSHOOTG_API(HRESULT) Starshootg_query_Name(HStarshootg h, char name[64]); -STARSHOOTG_API(HRESULT) Starshootg_put_Name(const char* camId, const char* name); -STARSHOOTG_API(HRESULT) Starshootg_get_Name(const char* camId, char name[64]); -#endif -STARSHOOTG_API(unsigned) Starshootg_EnumWithName(StarshootgDeviceV2 pti[STARSHOOTG_MAX]); - -STARSHOOTG_API(HRESULT) Starshootg_put_RoiN(HStarshootg h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - STARSHOOTG_API(HRESULT) Starshootg_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); STARSHOOTG_API(HRESULT) Starshootg_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libstarshootg/x64/libstarshootg.bin b/libstarshootg/x64/libstarshootg.bin index 0dace69b6..507c42984 100644 Binary files a/libstarshootg/x64/libstarshootg.bin and b/libstarshootg/x64/libstarshootg.bin differ diff --git a/libtoupcam/CMakeLists.txt b/libtoupcam/CMakeLists.txt index 53b3bcd32..626422b2f 100644 --- a/libtoupcam/CMakeLists.txt +++ b/libtoupcam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libtoupcam) -set (LIBTOUPCAM_VERSION "55.24621") +set (LIBTOUPCAM_VERSION "55.25633") set (LIBTOUPCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libtoupcam/arm64/libtoupcam.bin b/libtoupcam/arm64/libtoupcam.bin index 7c184278b..850bbd6d7 100644 Binary files a/libtoupcam/arm64/libtoupcam.bin and b/libtoupcam/arm64/libtoupcam.bin differ diff --git a/libtoupcam/armhf/libtoupcam.bin b/libtoupcam/armhf/libtoupcam.bin index 807bb2ef4..05308115b 100644 Binary files a/libtoupcam/armhf/libtoupcam.bin and b/libtoupcam/armhf/libtoupcam.bin differ diff --git a/libtoupcam/mac/libtoupcam.bin b/libtoupcam/mac/libtoupcam.bin index 731d86e5d..45ff0a2e0 100644 Binary files a/libtoupcam/mac/libtoupcam.bin and b/libtoupcam/mac/libtoupcam.bin differ diff --git a/libtoupcam/toupcam.h b/libtoupcam/toupcam.h index 652364c15..92abbacb1 100644 --- a/libtoupcam/toupcam.h +++ b/libtoupcam/toupcam.h @@ -1,7 +1,7 @@ #ifndef __toupcam_h__ #define __toupcam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Toupcam_t { int unused; } *HToupcam, *HToupCam; #define TOUPCAM_SATURATION_MIN 0 /* saturation */ #define TOUPCAM_SATURATION_MAX 255 /* saturation */ #define TOUPCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define TOUPCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define TOUPCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define TOUPCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define TOUPCAM_BRIGHTNESS_MAX 128 /* brightness */ #define TOUPCAM_CONTRAST_DEF 0 /* contrast */ -#define TOUPCAM_CONTRAST_MIN (-100) /* contrast */ -#define TOUPCAM_CONTRAST_MAX 100 /* contrast */ +#define TOUPCAM_CONTRAST_MIN (-150) /* contrast */ +#define TOUPCAM_CONTRAST_MAX 150 /* contrast */ #define TOUPCAM_GAMMA_DEF 100 /* gamma */ #define TOUPCAM_GAMMA_MIN 20 /* gamma */ #define TOUPCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Toupcam_t { int unused; } *HToupcam, *HToupCam; #define TOUPCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define TOUPCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define TOUPCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define TOUPCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define TOUPCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define TOUPCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define TOUPCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define TOUPCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define TOUPCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define TOUPCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define TOUPCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define TOUPCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ ToupcamResolution res[16]; -} ToupcamModelV2; /* camera model v2 */ +} ToupcamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Toupcam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Toupcam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Toupcam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Toupcam_Open */ #endif const ToupcamModelV2* model; -} ToupcamDeviceV2; /* camera instance for enumerating */ +} ToupcamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) TOUPCAM_API(const wchar_t*) Toupcam_Version(); @@ -483,11 +483,11 @@ TOUPCAM_API(HRESULT) Toupcam_Trigger(HToupcam h, unsigned short nNumber); /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -TOUPCAM_API(HRESULT) Toupcam_TriggerSync(HToupcam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, ToupcamFrameInfoV3* pInfo); +TOUPCAM_API(HRESULT) Toupcam_TriggerSync(HToupcam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, ToupcamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Toupcam_StartXXXX. @@ -542,10 +542,10 @@ TOUPCAM_API(HRESULT) Toupcam_get_RawFormat(HToupcam h, unsigned* pFourCC, unsig |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ TOUPCAM_API(HRESULT) Toupcam_get_BlackBalance(HToupcam h, unsigned short aSub[3 /* Flat Field Correction */ TOUPCAM_API(HRESULT) Toupcam_FfcOnce(HToupcam h); #if defined(_WIN32) -TOUPCAM_API(HRESULT) Toupcam_FfcExport(HToupcam h, const wchar_t* filepath); -TOUPCAM_API(HRESULT) Toupcam_FfcImport(HToupcam h, const wchar_t* filepath); +TOUPCAM_API(HRESULT) Toupcam_FfcExport(HToupcam h, const wchar_t* filePath); +TOUPCAM_API(HRESULT) Toupcam_FfcImport(HToupcam h, const wchar_t* filePath); #else -TOUPCAM_API(HRESULT) Toupcam_FfcExport(HToupcam h, const char* filepath); -TOUPCAM_API(HRESULT) Toupcam_FfcImport(HToupcam h, const char* filepath); +TOUPCAM_API(HRESULT) Toupcam_FfcExport(HToupcam h, const char* filePath); +TOUPCAM_API(HRESULT) Toupcam_FfcImport(HToupcam h, const char* filePath); #endif /* Dark Field Correction */ TOUPCAM_API(HRESULT) Toupcam_DfcOnce(HToupcam h); #if defined(_WIN32) -TOUPCAM_API(HRESULT) Toupcam_DfcExport(HToupcam h, const wchar_t* filepath); -TOUPCAM_API(HRESULT) Toupcam_DfcImport(HToupcam h, const wchar_t* filepath); +TOUPCAM_API(HRESULT) Toupcam_DfcExport(HToupcam h, const wchar_t* filePath); +TOUPCAM_API(HRESULT) Toupcam_DfcImport(HToupcam h, const wchar_t* filePath); #else -TOUPCAM_API(HRESULT) Toupcam_DfcExport(HToupcam h, const char* filepath); -TOUPCAM_API(HRESULT) Toupcam_DfcImport(HToupcam h, const char* filepath); +TOUPCAM_API(HRESULT) Toupcam_DfcExport(HToupcam h, const char* filePath); +TOUPCAM_API(HRESULT) Toupcam_DfcImport(HToupcam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ TOUPCAM_API(HRESULT) Toupcam_FpncOnce(HToupcam h); #if defined(_WIN32) -TOUPCAM_API(HRESULT) Toupcam_FpncExport(HToupcam h, const wchar_t* filepath); -TOUPCAM_API(HRESULT) Toupcam_FpncImport(HToupcam h, const wchar_t* filepath); +TOUPCAM_API(HRESULT) Toupcam_FpncExport(HToupcam h, const wchar_t* filePath); +TOUPCAM_API(HRESULT) Toupcam_FpncImport(HToupcam h, const wchar_t* filePath); #else -TOUPCAM_API(HRESULT) Toupcam_FpncExport(HToupcam h, const char* filepath); -TOUPCAM_API(HRESULT) Toupcam_FpncImport(HToupcam h, const char* filepath); +TOUPCAM_API(HRESULT) Toupcam_FpncExport(HToupcam h, const char* filePath); +TOUPCAM_API(HRESULT) Toupcam_FpncImport(HToupcam h, const char* filePath); #endif TOUPCAM_API(HRESULT) Toupcam_put_Hue(HToupcam h, int Hue); @@ -1032,8 +1032,8 @@ TOUPCAM_API(HRESULT) Toupcam_feed_Pipe(HToupcam h, unsigned pipeId); #define TOUPCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define TOUPCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define TOUPCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define TOUPCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define TOUPCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define TOUPCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define TOUPCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define TOUPCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define TOUPCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define TOUPCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ TOUPCAM_API(HRESULT) Toupcam_feed_Pipe(HToupcam h, unsigned pipeId); #define TOUPCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define TOUPCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define TOUPCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define TOUPCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define TOUPCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define TOUPCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ TOUPCAM_API(HRESULT) Toupcam_get_Option(HToupcam h, unsigned iOption, int* piVa TOUPCAM_API(HRESULT) Toupcam_put_Roi(HToupcam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); TOUPCAM_API(HRESULT) Toupcam_get_Roi(HToupcam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +TOUPCAM_API(HRESULT) Toupcam_put_RoiN(HToupcam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + TOUPCAM_API(HRESULT) Toupcam_put_XY(HToupcam h, int x, int y); #define TOUPCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ TOUPCAM_API(HRESULT) Toupcam_put_XY(HToupcam h, int x, int y); #define TOUPCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define TOUPCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define TOUPCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define TOUPCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define TOUPCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define TOUPCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define TOUPCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define TOUPCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define TOUPCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define TOUPCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define TOUPCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PTOUPCAM_HOTPLUG)(void* ctxHotPlug); TOUPCAM_API(HRESULT) Toupcam_GigeEnable(PTOUPCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +TOUPCAM_API(HRESULT) Toupcam_export_Cfg(HToupcam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, TOUPCAM_API(void) Toupcam_HotPlug(PTOUPCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +TOUPCAM_API(unsigned) Toupcam_EnumWithName(ToupcamDeviceV2 pti[TOUPCAM_MAX]); +TOUPCAM_API(HRESULT) Toupcam_set_Name(HToupcam h, const char* name); +TOUPCAM_API(HRESULT) Toupcam_query_Name(HToupcam h, char name[64]); +#if defined(_WIN32) +TOUPCAM_API(HRESULT) Toupcam_put_Name(const wchar_t* camId, const char* name); +TOUPCAM_API(HRESULT) Toupcam_get_Name(const wchar_t* camId, char name[64]); +#else +TOUPCAM_API(HRESULT) Toupcam_put_Name(const char* camId, const char* name); +TOUPCAM_API(HRESULT) Toupcam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } ToupcamLensInfo; TOUPCAM_API(HRESULT) Toupcam_get_LensInfo(HToupcam h, ToupcamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + ToupcamAFStatus_NA = 0x0,/* Not available */ ToupcamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ ToupcamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ ToupcamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { ToupcamAFMode AF_Mode; ToupcamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } ToupcamAFState; TOUPCAM_API(HRESULT) Toupcam_get_AFState(HToupcam h, ToupcamAFState* pState); -TOUPCAM_API(HRESULT) Toupcam_put_AFMode(HToupcam h, ToupcamAFMode mode); +TOUPCAM_API(HRESULT) Toupcam_put_AFMode(HToupcam h, ToupcamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); TOUPCAM_API(HRESULT) Toupcam_put_AFRoi(HToupcam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +TOUPCAM_API(HRESULT) Toupcam_get_AFRoi(HToupcam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); TOUPCAM_API(HRESULT) Toupcam_put_AFAperture(HToupcam h, int iAperture); TOUPCAM_API(HRESULT) Toupcam_put_AFFMPos(HToupcam h, int iFMPos); @@ -1381,7 +1419,6 @@ TOUPCAM_API(HRESULT) Toupcam_get_FrameRate(HToupcam h, unsigned* nFrame, unsign #define TOUPCAM_AAF_SETPOSITION 0x01 #define TOUPCAM_AAF_GETPOSITION 0x02 #define TOUPCAM_AAF_SETZERO 0x03 -#define TOUPCAM_AAF_GETZERO 0x04 #define TOUPCAM_AAF_SETDIRECTION 0x05 #define TOUPCAM_AAF_GETDIRECTION 0x06 #define TOUPCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ TOUPCAM_API(HRESULT) Toupcam_get_VignetMidPointInt(HToupcam h, int* nMidPoint); #define TOUPCAM_FLAG_BITDEPTH14 TOUPCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define TOUPCAM_FLAG_BITDEPTH16 TOUPCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -TOUPCAM_API(HRESULT) Toupcam_set_Name(HToupcam h, const char* name); -TOUPCAM_API(HRESULT) Toupcam_query_Name(HToupcam h, char name[64]); -TOUPCAM_API(HRESULT) Toupcam_put_Name(const wchar_t* camId, const char* name); -TOUPCAM_API(HRESULT) Toupcam_get_Name(const wchar_t* camId, char name[64]); -#else -TOUPCAM_API(HRESULT) Toupcam_set_Name(HToupcam h, const char* name); -TOUPCAM_API(HRESULT) Toupcam_query_Name(HToupcam h, char name[64]); -TOUPCAM_API(HRESULT) Toupcam_put_Name(const char* camId, const char* name); -TOUPCAM_API(HRESULT) Toupcam_get_Name(const char* camId, char name[64]); -#endif -TOUPCAM_API(unsigned) Toupcam_EnumWithName(ToupcamDeviceV2 pti[TOUPCAM_MAX]); - -TOUPCAM_API(HRESULT) Toupcam_put_RoiN(HToupcam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - TOUPCAM_API(HRESULT) Toupcam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); TOUPCAM_API(HRESULT) Toupcam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libtoupcam/x64/libtoupcam.bin b/libtoupcam/x64/libtoupcam.bin index 0f9cab866..99a1d07d2 100644 Binary files a/libtoupcam/x64/libtoupcam.bin and b/libtoupcam/x64/libtoupcam.bin differ diff --git a/libtscam/CMakeLists.txt b/libtscam/CMakeLists.txt index 66ae33f57..c7bfe20ff 100644 --- a/libtscam/CMakeLists.txt +++ b/libtscam/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) project (libtscam) -set (LIBTSCAM_VERSION "55.24621") +set (LIBTSCAM_VERSION "55.25633") set (LIBTSCAM_SOVERSION "55") list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/") diff --git a/libtscam/arm64/libtscam.bin b/libtscam/arm64/libtscam.bin index 9c653b618..8ea5576cd 100644 Binary files a/libtscam/arm64/libtscam.bin and b/libtscam/arm64/libtscam.bin differ diff --git a/libtscam/armhf/libtscam.bin b/libtscam/armhf/libtscam.bin index 606dd76fa..1fafd0efb 100644 Binary files a/libtscam/armhf/libtscam.bin and b/libtscam/armhf/libtscam.bin differ diff --git a/libtscam/mac/libtscam.bin b/libtscam/mac/libtscam.bin index c056920a9..8851f5336 100644 Binary files a/libtscam/mac/libtscam.bin and b/libtscam/mac/libtscam.bin differ diff --git a/libtscam/tscam.h b/libtscam/tscam.h index 7986ca4dc..552785774 100644 --- a/libtscam/tscam.h +++ b/libtscam/tscam.h @@ -1,7 +1,7 @@ #ifndef __tscam_h__ #define __tscam_h__ -/* Version: 55.24621.20240204 */ +/* Version: 55.25633.20240519 */ /* Platform & Architecture: (1) Win32: @@ -187,11 +187,11 @@ typedef struct Tscam_t { int unused; } *HTscam; #define TSCAM_SATURATION_MIN 0 /* saturation */ #define TSCAM_SATURATION_MAX 255 /* saturation */ #define TSCAM_BRIGHTNESS_DEF 0 /* brightness */ -#define TSCAM_BRIGHTNESS_MIN (-64) /* brightness */ -#define TSCAM_BRIGHTNESS_MAX 64 /* brightness */ +#define TSCAM_BRIGHTNESS_MIN (-128) /* brightness */ +#define TSCAM_BRIGHTNESS_MAX 128 /* brightness */ #define TSCAM_CONTRAST_DEF 0 /* contrast */ -#define TSCAM_CONTRAST_MIN (-100) /* contrast */ -#define TSCAM_CONTRAST_MAX 100 /* contrast */ +#define TSCAM_CONTRAST_MIN (-150) /* contrast */ +#define TSCAM_CONTRAST_MAX 150 /* contrast */ #define TSCAM_GAMMA_DEF 100 /* gamma */ #define TSCAM_GAMMA_MIN 20 /* gamma */ #define TSCAM_GAMMA_MAX 180 /* gamma */ @@ -220,9 +220,9 @@ typedef struct Tscam_t { int unused; } *HTscam; #define TSCAM_AUTOEXPO_THRESHOLD_DEF 5 /* auto exposure threshold */ #define TSCAM_AUTOEXPO_THRESHOLD_MIN 2 /* auto exposure threshold */ #define TSCAM_AUTOEXPO_THRESHOLD_MAX 15 /* auto exposure threshold */ -#define TSCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damp: thousandths */ -#define TSCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damp: thousandths */ -#define TSCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damp: thousandths */ +#define TSCAM_AUTOEXPO_DAMP_DEF 0 /* auto exposure damping coefficient: thousandths */ +#define TSCAM_AUTOEXPO_DAMP_MIN 0 /* auto exposure damping coefficient: thousandths */ +#define TSCAM_AUTOEXPO_DAMP_MAX 1000 /* auto exposure damping coefficient: thousandths */ #define TSCAM_BANDWIDTH_DEF 100 /* bandwidth */ #define TSCAM_BANDWIDTH_MIN 1 /* bandwidth */ #define TSCAM_BANDWIDTH_MAX 100 /* bandwidth */ @@ -275,21 +275,21 @@ typedef struct { float xpixsz; /* physical pixel size in micrometer */ float ypixsz; /* physical pixel size in micrometer */ TscamResolution res[16]; -} TscamModelV2; /* camera model v2 */ +} TscamModelV2; /* device model v2 */ typedef struct { #if defined(_WIN32) - wchar_t displayname[64]; /* display name */ + wchar_t displayname[64]; /* display name: model name or user-defined name (if any and Tscam_EnumWithName) */ wchar_t id[64]; /* unique and opaque id of a connected camera, for Tscam_Open */ #else - char displayname[64]; /* display name */ + char displayname[64]; /* display name: model name or user-defined name (if any and Tscam_EnumWithName) */ char id[64]; /* unique and opaque id of a connected camera, for Tscam_Open */ #endif const TscamModelV2* model; -} TscamDeviceV2; /* camera instance for enumerating */ +} TscamDeviceV2; /* device instance for enumerating */ /* - get the version of this dll/so/dylib, which is: 55.24621.20240204 + get the version of this dll/so/dylib, which is: 55.25633.20240519 */ #if defined(_WIN32) TSCAM_API(const wchar_t*) Tscam_Version(); @@ -483,11 +483,11 @@ TSCAM_API(HRESULT) Tscam_Trigger(HTscam h, unsigned short nNumber); /* trigger synchronously - nTimeout: 0: by default, exposure * 102% + 4000 milliseconds + nWaitMS: 0: by default, exposure * 102% + 4000 milliseconds 0xffffffff: wait infinite other: milliseconds to wait */ -TSCAM_API(HRESULT) Tscam_TriggerSync(HTscam h, unsigned nTimeout, void* pImageData, int bits, int rowPitch, TscamFrameInfoV3* pInfo); +TSCAM_API(HRESULT) Tscam_TriggerSync(HTscam h, unsigned nWaitMS, void* pImageData, int bits, int rowPitch, TscamFrameInfoV3* pInfo); /* put_Size, put_eSize, can be used to set the video output resolution BEFORE Tscam_StartXXXX. @@ -542,10 +542,10 @@ TSCAM_API(HRESULT) Tscam_get_RawFormat(HTscam h, unsigned* pFourCC, unsigned* p |-----------------------------------------------------------------| | Auto Exposure Target | 10~220 | 120 | | Exposure Gain | 100~ | 100 | - | Temp | 2000~15000 | 6503 | - | Tint | 200~2500 | 1000 | + | Temp | 1000~25000 | 6503 | + | Tint | 100~2500 | 1000 | | LevelRange | 0~255 | Low = 0, High = 255 | - | Contrast | -100~100 | 0 | + | Contrast | -150~150 | 0 | | Hue | -180~180 | 0 | | Saturation | 0~255 | 128 | | Brightness | -64~64 | 0 | @@ -626,33 +626,33 @@ TSCAM_API(HRESULT) Tscam_get_BlackBalance(HTscam h, unsigned short aSub[3]); /* Flat Field Correction */ TSCAM_API(HRESULT) Tscam_FfcOnce(HTscam h); #if defined(_WIN32) -TSCAM_API(HRESULT) Tscam_FfcExport(HTscam h, const wchar_t* filepath); -TSCAM_API(HRESULT) Tscam_FfcImport(HTscam h, const wchar_t* filepath); +TSCAM_API(HRESULT) Tscam_FfcExport(HTscam h, const wchar_t* filePath); +TSCAM_API(HRESULT) Tscam_FfcImport(HTscam h, const wchar_t* filePath); #else -TSCAM_API(HRESULT) Tscam_FfcExport(HTscam h, const char* filepath); -TSCAM_API(HRESULT) Tscam_FfcImport(HTscam h, const char* filepath); +TSCAM_API(HRESULT) Tscam_FfcExport(HTscam h, const char* filePath); +TSCAM_API(HRESULT) Tscam_FfcImport(HTscam h, const char* filePath); #endif /* Dark Field Correction */ TSCAM_API(HRESULT) Tscam_DfcOnce(HTscam h); #if defined(_WIN32) -TSCAM_API(HRESULT) Tscam_DfcExport(HTscam h, const wchar_t* filepath); -TSCAM_API(HRESULT) Tscam_DfcImport(HTscam h, const wchar_t* filepath); +TSCAM_API(HRESULT) Tscam_DfcExport(HTscam h, const wchar_t* filePath); +TSCAM_API(HRESULT) Tscam_DfcImport(HTscam h, const wchar_t* filePath); #else -TSCAM_API(HRESULT) Tscam_DfcExport(HTscam h, const char* filepath); -TSCAM_API(HRESULT) Tscam_DfcImport(HTscam h, const char* filepath); +TSCAM_API(HRESULT) Tscam_DfcExport(HTscam h, const char* filePath); +TSCAM_API(HRESULT) Tscam_DfcImport(HTscam h, const char* filePath); #endif /* Fix Pattern Noise Correction */ TSCAM_API(HRESULT) Tscam_FpncOnce(HTscam h); #if defined(_WIN32) -TSCAM_API(HRESULT) Tscam_FpncExport(HTscam h, const wchar_t* filepath); -TSCAM_API(HRESULT) Tscam_FpncImport(HTscam h, const wchar_t* filepath); +TSCAM_API(HRESULT) Tscam_FpncExport(HTscam h, const wchar_t* filePath); +TSCAM_API(HRESULT) Tscam_FpncImport(HTscam h, const wchar_t* filePath); #else -TSCAM_API(HRESULT) Tscam_FpncExport(HTscam h, const char* filepath); -TSCAM_API(HRESULT) Tscam_FpncImport(HTscam h, const char* filepath); +TSCAM_API(HRESULT) Tscam_FpncExport(HTscam h, const char* filePath); +TSCAM_API(HRESULT) Tscam_FpncImport(HTscam h, const char* filePath); #endif TSCAM_API(HRESULT) Tscam_put_Hue(HTscam h, int Hue); @@ -1032,8 +1032,8 @@ TSCAM_API(HRESULT) Tscam_feed_Pipe(HTscam h, unsigned pipeId); #define TSCAM_OPTION_OVERCLOCK 0x5d /* overclock, default: 0 */ #define TSCAM_OPTION_RESET_SENSOR 0x5e /* reset sensor */ #define TSCAM_OPTION_ISP 0x5f /* Enable hardware ISP: 0 => auto (disable in RAW mode, otherwise enable), 1 => enable, -1 => disable; default: 0 */ -#define TSCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damp: time (thousandths) */ -#define TSCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damp: gain (thousandths) */ +#define TSCAM_OPTION_AUTOEXP_EXPOTIME_DAMP 0x60 /* Auto exposure damping coefficient: time (thousandths). The larger the damping coefficient, the smoother and slower the exposure time changes */ +#define TSCAM_OPTION_AUTOEXP_GAIN_DAMP 0x61 /* Auto exposure damping coefficient: gain (thousandths). The larger the damping coefficient, the smoother and slower the gain changes */ #define TSCAM_OPTION_MOTOR_NUMBER 0x62 /* range: [1, 20] */ #define TSCAM_OPTION_MOTOR_POS 0x10000000 /* range: [1, 702] */ #define TSCAM_OPTION_PSEUDO_COLOR_START 0x63 /* Pseudo: start color, BGR format */ @@ -1079,11 +1079,19 @@ TSCAM_API(HRESULT) Tscam_feed_Pipe(HTscam h, unsigned pipeId); #define TSCAM_OPTION_OVEREXP_POLICY 0x68 /* Auto exposure over exposure policy: when overexposed, 0 => directly reduce the exposure time/gain to the minimum value; or 1 => reduce exposure time/gain in proportion to current and target brightness. + n(n>1) => first adjust the exposure time to (maximum automatic exposure time * maximum automatic exposure gain) * n / 1000, and then adjust according to the strategy of 1 The advantage of policy 0 is that the convergence speed is faster, but there is black screen. Policy 1 avoids the black screen, but the convergence speed is slower. Default: 0 */ #define TSCAM_OPTION_READOUT_MODE 0x69 /* Readout mode: 0 = IWR (Integrate While Read), 1 = ITR (Integrate Then Read) */ +#define TSCAM_OPTION_TAILLIGHT 0x6a /* Turn on/off tail Led light: 0 => off, 1 => on; default: on */ +#define TSCAM_OPTION_LENSSTATE 0x6b /* Load/Save lens state to EEPROM: 0 => load, 1 => save */ +#define TSCAM_OPTION_AWB_CONTINUOUS 0x6c /* Auto White Balance: continuous mode + 0: disable (default) + n>0: every n millisecond(s) + n<0: every -n frame + */ /* pixel format */ #define TSCAM_PIXELFORMAT_RAW8 0x00 @@ -1124,6 +1132,9 @@ TSCAM_API(HRESULT) Tscam_get_Option(HTscam h, unsigned iOption, int* piValue); TSCAM_API(HRESULT) Tscam_put_Roi(HTscam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); TSCAM_API(HRESULT) Tscam_get_Roi(HTscam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); +/* multiple Roi */ +TSCAM_API(HRESULT) Tscam_put_RoiN(HTscam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); + TSCAM_API(HRESULT) Tscam_put_XY(HTscam h, int x, int y); #define TSCAM_IOCONTROLTYPE_GET_SUPPORTEDMODE 0x01 /* 0x01 => Input, 0x02 => Output, (0x01 | 0x02) => support both Input and Output */ @@ -1208,6 +1219,13 @@ TSCAM_API(HRESULT) Tscam_put_XY(HTscam h, int x, int y); #define TSCAM_IOCONTROLTYPE_GET_OUTPUTCOUNTERVALUE 0x37 /* Output Counter Value, range: [0 ~ 65535] */ #define TSCAM_IOCONTROLTYPE_SET_OUTPUTCOUNTERVALUE 0x38 #define TSCAM_IOCONTROLTYPE_SET_OUTPUT_PAUSE 0x3a /* Output pause: 1 => puase, 0 => unpause */ +#define TSCAM_IOCONTROLTYPE_GET_INPUT_STATE 0x3c /* Input state: 0 (low level) or 1 (high level) */ +#define TSCAM_IOCONTROLTYPE_GET_USER_PULSE_HIGH 0x3e /* User pulse high level time: us */ +#define TSCAM_IOCONTROLTYPE_SET_USER_PULSE_HIGH 0x3f +#define TSCAM_IOCONTROLTYPE_GET_USER_PULSE_LOW 0x40 /* User pulse low level time: us */ +#define TSCAM_IOCONTROLTYPE_SET_USER_PULSE_LOW 0x41 +#define TSCAM_IOCONTROLTYPE_GET_USER_PULSE_NUMBER 0x42 /* User pulse number: default 0 */ +#define TSCAM_IOCONTROLTYPE_SET_USER_PULSE_NUMBER 0x43 #define TSCAM_IOCONTROL_DELAYTIME_MAX (5 * 1000 * 1000) @@ -1256,7 +1274,15 @@ typedef void (__stdcall* PTSCAM_HOTPLUG)(void* ctxHotPlug); TSCAM_API(HRESULT) Tscam_GigeEnable(PTSCAM_HOTPLUG funHotPlug, void* ctxHotPlug); /* -USB hotplug is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: + filePath: + "*": export to EEPROM + "0x????" or "0X????": export to EEPROM specified address + file path: export to file in ini format +*/ +TSCAM_API(HRESULT) Tscam_export_Cfg(HTscam h, const char* filePath); + +/* +This function is only available on macOS and Linux, it's unnecessary on Windows & Android. To process the device plug in / pull out: (1) On Windows, please refer to the MSDN (a) Device Management, https://docs.microsoft.com/en-us/windows/win32/devio/device-management (b) Detecting Media Insertion or Removal, https://docs.microsoft.com/en-us/windows/win32/devio/detecting-media-insertion-or-removal @@ -1270,8 +1296,18 @@ Recommendation: for better rubustness, when notify of device insertion arrives, TSCAM_API(void) Tscam_HotPlug(PTSCAM_HOTPLUG funHotPlug, void* ctxHotPlug); #endif -typedef struct -{ +TSCAM_API(unsigned) Tscam_EnumWithName(TscamDeviceV2 pti[TSCAM_MAX]); +TSCAM_API(HRESULT) Tscam_set_Name(HTscam h, const char* name); +TSCAM_API(HRESULT) Tscam_query_Name(HTscam h, char name[64]); +#if defined(_WIN32) +TSCAM_API(HRESULT) Tscam_put_Name(const wchar_t* camId, const char* name); +TSCAM_API(HRESULT) Tscam_get_Name(const wchar_t* camId, char name[64]); +#else +TSCAM_API(HRESULT) Tscam_put_Name(const char* camId, const char* name); +TSCAM_API(HRESULT) Tscam_get_Name(const char* camId, char name[64]); +#endif + +typedef struct { unsigned short lensID; unsigned char lensType; unsigned char statusAfmf; /* LENS_AF = 0x00, LENS_MF = 0x80 */ @@ -1295,6 +1331,7 @@ typedef struct unsigned sizeFN; const char** arrayFN; + const char* lensName; /* lens Name */ } TscamLensInfo; TSCAM_API(HRESULT) Tscam_get_LensInfo(HTscam h, TscamLensInfo* pInfo); @@ -1312,6 +1349,7 @@ typedef enum typedef enum { + TscamAFStatus_NA = 0x0,/* Not available */ TscamAFStatus_PEAKPOINT = 0x1,/* Focus completed, find the focus position */ TscamAFStatus_DEFOCUS = 0x2,/* End of focus, defocus */ TscamAFStatus_NEAR = 0x3,/* Focusing ended, object too close */ @@ -1327,14 +1365,14 @@ typedef struct { TscamAFMode AF_Mode; TscamAFStatus AF_Status; unsigned char AF_LensAP_Update_Flag; /* mark for whether the lens aperture is calibrated */ - unsigned char AF_LensManual_Flag; /* if true, allows manual operation */ - unsigned char Reserved[2]; + unsigned char Reserved[3]; } TscamAFState; TSCAM_API(HRESULT) Tscam_get_AFState(HTscam h, TscamAFState* pState); -TSCAM_API(HRESULT) Tscam_put_AFMode(HTscam h, TscamAFMode mode); +TSCAM_API(HRESULT) Tscam_put_AFMode(HTscam h, TscamAFMode mode, int bFixedWD, unsigned uiNear, unsigned uiFar); TSCAM_API(HRESULT) Tscam_put_AFRoi(HTscam h, unsigned xOffset, unsigned yOffset, unsigned xWidth, unsigned yHeight); +TSCAM_API(HRESULT) Tscam_get_AFRoi(HTscam h, unsigned* pxOffset, unsigned* pyOffset, unsigned* pxWidth, unsigned* pyHeight); TSCAM_API(HRESULT) Tscam_put_AFAperture(HTscam h, int iAperture); TSCAM_API(HRESULT) Tscam_put_AFFMPos(HTscam h, int iFMPos); @@ -1381,7 +1419,6 @@ TSCAM_API(HRESULT) Tscam_get_FrameRate(HTscam h, unsigned* nFrame, unsigned* nT #define TSCAM_AAF_SETPOSITION 0x01 #define TSCAM_AAF_GETPOSITION 0x02 #define TSCAM_AAF_SETZERO 0x03 -#define TSCAM_AAF_GETZERO 0x04 #define TSCAM_AAF_SETDIRECTION 0x05 #define TSCAM_AAF_GETDIRECTION 0x06 #define TSCAM_AAF_SETMAXINCREMENT 0x07 @@ -1596,28 +1633,13 @@ TSCAM_API(HRESULT) Tscam_get_VignetMidPointInt(HTscam h, int* nMidPoint); #define TSCAM_FLAG_BITDEPTH14 TSCAM_FLAG_RAW14 /* pixel format, RAW 14bits */ #define TSCAM_FLAG_BITDEPTH16 TSCAM_FLAG_RAW16 /* pixel format, RAW 16bits */ -#if defined(_WIN32) -TSCAM_API(HRESULT) Tscam_set_Name(HTscam h, const char* name); -TSCAM_API(HRESULT) Tscam_query_Name(HTscam h, char name[64]); -TSCAM_API(HRESULT) Tscam_put_Name(const wchar_t* camId, const char* name); -TSCAM_API(HRESULT) Tscam_get_Name(const wchar_t* camId, char name[64]); -#else -TSCAM_API(HRESULT) Tscam_set_Name(HTscam h, const char* name); -TSCAM_API(HRESULT) Tscam_query_Name(HTscam h, char name[64]); -TSCAM_API(HRESULT) Tscam_put_Name(const char* camId, const char* name); -TSCAM_API(HRESULT) Tscam_get_Name(const char* camId, char name[64]); -#endif -TSCAM_API(unsigned) Tscam_EnumWithName(TscamDeviceV2 pti[TSCAM_MAX]); - -TSCAM_API(HRESULT) Tscam_put_RoiN(HTscam h, unsigned xOffset[], unsigned yOffset[], unsigned xWidth[], unsigned yHeight[], unsigned Num); - TSCAM_API(HRESULT) Tscam_log_File(const #if defined(_WIN32) wchar_t* #else char* #endif - filepath); + filePath); TSCAM_API(HRESULT) Tscam_log_Level(unsigned level); /* 0 => none; 1 => error; 2 => debug; 3 => verbose */ #if defined(_WIN32) diff --git a/libtscam/x64/libtscam.bin b/libtscam/x64/libtscam.bin index 76d936871..3bb84adac 100644 Binary files a/libtscam/x64/libtscam.bin and b/libtscam/x64/libtscam.bin differ