#ifndef _MV_FG_CTRL_H_
#define _MV_FG_CTRL_H_

#include "MVFGDefines.h"
#include "MVFGErrorDefine.h"

/************************************************************************/
/* 动态库导入导出定义                                                   */
/* Import and export definition of the dynamic library                  */
/************************************************************************/
#ifndef MV_FGCTRL_API
    #if (defined (_WIN32) || defined(WIN64))
        #if defined(MV_FGCTRL_EXPORTS)
            #define MV_FGCTRL_API __declspec(dllexport)
        #else
            #define MV_FGCTRL_API __declspec(dllimport)
        #endif
    #else
        #ifndef __stdcall
            #define __stdcall
        #endif 

        #ifndef MV_FGCTRL_API
            #define  MV_FGCTRL_API
        #endif
    #endif
#endif

#ifndef IN
    #define IN
#endif

#ifndef OUT
    #define OUT
#endif

#ifdef __cplusplus
extern "C" {
#endif 

/***********************************************************************/
/*                             版本信息                                */
/*                        Version information                          */
/***********************************************************************/
/********************************************************************//**
 *  @~chinese
 *  @brief  获取SDK版本信息
 *  @return 以字符串形式返回SDK版本信息
 *  @remarks 格式：“版本 + 类型 + 编译时间”
  
 *  @~english
 *  @brief  Get SDK Version Information
 *  @return Returns SDK version information in string form 
 *  @remarks Format: "version + type + compile time"
 ************************************************************************/
MV_FGCTRL_API unsigned char* __stdcall MV_FG_GetSDKVersion();


/***********************************************************************/
/*                             基本操作                                */
/*                         Basic operation                             */
/***********************************************************************/
/********************************************************************//**
 *  @~chinese
 *  @brief  更新采集卡列表
 *  @param  nTLayerType             [IN]           采集卡类型
 *  @param  pbChanged               [OUT]          采集卡列表是否改变
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 进行采集卡操作之前必须调用该接口，只有在调用该接口时内部采集卡列表才会更新。
 
 *  @~english
 *  @brief  Update Interface List
 *  @param  nTLayerType             [IN]            Interface type
 *  @param  pbChanged               [OUT]           Is the interface list changed
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks This API must be called before the operation of the interface. The internal interface list will be updated only when this API is called.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_UpdateInterfaceList(IN unsigned int nTLayerType, OUT bool8_t *pbChanged);

/********************************************************************//**
 *  @~chinese
 *  @brief  释放指定类型的采集卡资源
 *  @param  nTLayerType             [IN]           采集卡类型
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 调用该接口之前必须关闭所有该类型的采集卡。通过FreeLibrary函数释放该库前需要调用该接口释放所有采集卡资源
  
 *  @~english
 *  @brief  Release Interface Resources of the Specified Type
 *  @param  nTLayerType             [IN]            Interface type
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks All interfaces of this type must be closed before calling this API.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_ReleaseTLayerResource(IN unsigned int nTLayerType);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取采集卡数量
 *  @param  pnNumIfaces             [OUT]          采集卡数量
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Number of Interface
 *  @param  pnNumIfaces             [OUT]           Number of interface
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetNumInterfaces(OUT unsigned int *pnNumIfaces);

/********************************************************************//**
 *  @~chinese
 *  @brief  根据索引获取采集卡信息
 *  @param  nIndex                  [IN]           采集卡索引，从0开始
 *  @param  pstIfaceInfo            [OUT]          采集卡信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Obtain Interface Information According to Index
 *  @param  nIndex                  [IN]            Interface index, starting from 0
 *  @param  pstIfaceInfo            [OUT]           Interface information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetInterfaceInfo(IN unsigned int nIndex, OUT MV_FG_INTERFACE_INFO *pstIfaceInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  打开采集卡
 *  @param  nIndex                  [IN]           采集卡索引，从0开始
 *  @param  phIface                 [OUT]          采集卡句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Open Interface
 *  @param  nIndex                  [IN]            Interface index, starting from 0
 *  @param  phIface                 [OUT]           Interface handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_OpenInterface(IN unsigned int nIndex, OUT IFHANDLE* phIface);

/********************************************************************//**
 *  @~chinese
 *  @brief  打开采集卡，可指定权限
 *  @param  nIndex                  [IN]           采集卡索引，从0开始
 *  @param  nAccess                 [IN]           权限
 *  @param  phIface                 [OUT]          采集卡句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 有MV_FG_ACCESS_UNKNOWN、MV_FG_ACCESS_READONLY、MV_FG_ACCESS_CONTROL三种权限类型。\n
             CXP和CML采集卡只能以MV_FG_ACCESS_CONTROL权限打开。
  
 *  @~english
 *  @brief  Open the Interface with Specify Permissions
 *  @param  nIndex                  [IN]            Interface index, starting from 0
 *  @param  nAccess                 [IN]            Access mode
 *  @param  phIface                 [OUT]           Interface handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks There are three access mode: MV_FG_ACCESS_UNKNOWN, MV_FG_ACCESS_READONLY and MV_FG_ACCESS_CONTROL. \n
             CXP and CML interfaces can only be opened with MV_FG_ACCESS_CONTROL access mode.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_OpenInterfaceEx(IN unsigned int nIndex, IN int nAccess, OUT IFHANDLE* phIface);

/********************************************************************//**
 *  @~chinese
 *  @brief  通过采集卡ID打开采集卡，可指定权限
 *  @param  pcInterfaceID           [IN]           采集卡ID
 *  @param  nAccess                 [IN]           权限
 *  @param  phIface                 [OUT]          采集卡句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 有MV_FG_ACCESS_UNKNOWN、MV_FG_ACCESS_READONLY、MV_FG_ACCESS_CONTROL三种权限类型。\n
             CXP和CML采集卡只能以MV_FG_ACCESS_CONTROL权限打开。
  
 *  @~english
 *  @brief  Open the Interface with Specify Permissions
 *  @param  pcInterfaceID           [IN]            InterfaceID
 *  @param  nAccess                 [IN]            Access mode
 *  @param  phIface                 [OUT]           Interface handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks There are three access mode: MV_FG_ACCESS_UNKNOWN, MV_FG_ACCESS_READONLY and MV_FG_ACCESS_CONTROL. \n
             CXP and CML interfaces can only be opened with MV_FG_ACCESS_CONTROL access mode.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_OpenInterfaceByID(IN char* pcInterfaceID, IN int nAccess, OUT IFHANDLE* phIface);

/********************************************************************//**
 *  @~chinese
 *  @brief  关闭采集卡
 *  @param  hIface                  [IN]           采集卡句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Close Interface
 *  @param  hIface                  [IN]            Interface handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_CloseInterface(IN IFHANDLE hIface);

/********************************************************************//**
 *  @~chinese
 *  @brief  更新指定采集卡下的设备列表
 *  @param  hIface                  [IN]           采集卡句柄
 *  @param  pbChanged               [OUT]          设备列表是否改变
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 只有在调用该接口时内部设备列表才会更新。
  
 *  @~english
 *  @brief  Update the Device List Under the Specified Interface
 *  @param  hIface                  [IN]            Interface handle
 *  @param  pbChanged               [OUT]           Is the device list changed
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks The internal device list is updated only when this API is called.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_UpdateDeviceList(IN IFHANDLE hIface, OUT bool8_t *pbChanged);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取设备数量
 *  @param  hIface                  [IN]           采集卡句柄
 *  @param  pnNumDevices            [OUT]          设备数量
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Number of Devices
 *  @param  hIface                  [IN]            Interface handle
 *  @param  pnNumDevices            [OUT]           Number of device
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetNumDevices(IN IFHANDLE hIface, OUT unsigned int *pnNumDevices);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取设备信息
 *  @param  hIface                  [IN]           采集卡句柄
 *  @param  nIndex                  [IN]           设备索引，从0开始
 *  @param  pstDevInfo              [OUT]          设备信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get Device Information
 *  @param  hIface                  [IN]            Interface handle
 *  @param  nIndex                  [IN]            Device index, starting from 0
 *  @param  pstDevInfo              [OUT]           Device information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetDeviceInfo(IN IFHANDLE hIface, IN unsigned int nIndex, OUT MV_FG_DEVICE_INFO *pstDevInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  打开设备
 *  @param  hIface                  [IN]           采集卡句柄
 *  @param  nIndex                  [IN]           设备索引，从0开始
 *  @param  phDevice                [OUT]          设备句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Open Device
 *  @param  hIface                  [IN]            Interface handle
 *  @param  nIndex                  [IN]            Device index, starting from 0
 *  @param  phDevice                [OUT]           Device handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_OpenDevice(IN IFHANDLE hIface, IN unsigned int nIndex, OUT DEVHANDLE* phDevice);

/********************************************************************//**
 *  @~chinese
 *  @brief  打开设备
 *  @param  hIface                  [IN]           采集卡句柄
 *  @param  pcDeviceID              [IN]           设备ID
 *  @param  phDevice                [OUT]          设备句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Open Device
 *  @param  hIface                  [IN]            Interface handle
 *  @param  pcDeviceID              [IN]            DeviceID
 *  @param  phDevice                [OUT]           Device handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_OpenDeviceByID(IN IFHANDLE hIface, IN char* pcDeviceID, OUT DEVHANDLE* phDevice);

/********************************************************************//**
 *  @~chinese
 *  @brief  关闭设备
 *  @param  hDevice                 [IN]           设备句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Close Device
 *  @param  hDevice                 [IN]            Device handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_CloseDevice(IN DEVHANDLE hDevice);


/***********************************************************************/
/*                             图像采集                                */
/*                        Image acquisition                            */
/***********************************************************************/
/********************************************************************//**
 *  @~chinese
 *  @brief  获取流通道数量
 *  @param  hDevice                 [IN]           设备句柄
 *  @param  pnNumStreams            [OUT]          流通道数量
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Number of Streams
 *  @param  hDevice                 [IN]            Device handle
 *  @param  pnNumStreams            [OUT]           Number of streams
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetNumStreams(IN DEVHANDLE hDevice, OUT unsigned int *pnNumStreams);

/********************************************************************//**
 *  @~chinese
 *  @brief  打开流通道
 *  @param  hDevice                 [IN]           设备句柄
 *  @param  nIndex                  [IN]           流通道索引
 *  @param  phStream                [OUT]          流通道句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Open Stream
 *  @param  hDevice                 [IN]            Device handle
 *  @param  nIndex                  [IN]            Stream index
 *  @param  phStream                [OUT]           Stream handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_OpenStream(IN DEVHANDLE hDevice, IN unsigned int nIndex, OUT STREAMHANDLE* phStream);

/********************************************************************//**
 *  @~chinese
 *  @brief  关闭流通道
 *  @param  hStream                 [IN]           流通道句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Close Stream
 *  @param  hStream                 [IN]            Stream handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_CloseStream(IN STREAMHANDLE hStream);

/********************************************************************//**
 *  @~chinese
 *  @brief  设置SDK内部缓存数量
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  nBufferNum              [IN]           缓存数量
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 当未调用该接口或者nBufferNum参数设置为0时，表示SDK内部无缓存，此时需要用户申请缓存并向流通道注册缓存，否则无法开始取流。\n
             当nBufferNum参数设置大于0时，表示缓存由SDK内部进行申请，此时不允许用户向流通道注册缓存。\n
             需合理分配图像缓存数量。在Linux操作系统中，当分配的图像缓存数量过大，导致系统内存过低，应用程序会被操作系统杀死。
  
 *  @~english
 *  @brief  Set the Number of SDK internal Buffers
 *  @param  hStream                 [IN]            Stream handle
 *  @param  nBufferNum              [IN]            Number of buffers
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks When this API is not called or the nBufferNum is set to 0, it indicates that there is no buffer inside the SDK. At this time, the user needs to apply for buffer and register buffer with the stream, otherwise the stream cannot start acquisition. \n
             When the nBufferNum is set to greater than 0, it means that the buffer is applied for internally by the SDK. At this time, users are not allowed to register the buffer with the stream.
             The number of image buffer should be reasonably allocated. In the Linux operating system, when the number of image buffer is too large, the system memory is too low, and the application will be killed by the operating system.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetBufferNum(IN STREAMHANDLE hStream, IN unsigned int nBufferNum);

/********************************************************************//**
 *  @~chinese
 *  @brief  注册帧缓存信息回调函数(SDK内部申请缓存方式)
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  cbFrame                 [IN]           帧缓存信息回调函数
 *  @param  pUser                   [IN]           用户自定义数据
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 在回调函数中处理耗时操作会阻塞后续帧信息获取。\n
             注册回调方式和MV_FG_GetFrameBuffer互斥。\n
             必须在调用MV_FG_StartAcquisition前注册回调函数。
  
 *  @~english
 *  @brief  Register Frame Buffer Information Callback Function (SDK Internal Application Buffer Method)
 *  @param  hStream                 [IN]            Stream handle
 *  @param  cbFrame                 [IN]            Frame buffer information callback function
 *  @param  pUser                   [IN]            User defined data
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Processing time-consuming operations in the callback function will block the acquisition of subsequent frame information. \n
             Registration callback method and MV_FG_GetFrameBuffer is mutually exclusive. \n
             The callback function must be registered before calling MV_FG_StartAcquisition.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_RegisterFrameCallBack(IN STREAMHANDLE hStream, IN MV_FG_FrameCallBack cbFrame, IN void* pUser);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取一帧图像的缓存信息(SDK内部申请缓存方式)
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  pstBufferInfo           [OUT]          缓存信息
 *  @param  nTimeout                [IN]           超时时间，以毫秒为单位
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 需要调用MV_FG_ReleaseFrameBuffer接口进行缓存信息的释放。
  
 *  @~english
 *  @brief  Get the Buffer Information of One Frame of Image (SDK Internal Application Buffer Method)
 *  @param  hStream                 [IN]            Stream handle
 *  @param  pstBufferInfo           [OUT]           Buffer information
 *  @param  nTimeout                [IN]            Timeout in milliseconds
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Need to call MV_FG_ReleaseFrameBuffer API releases the buffer information.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetFrameBuffer(IN STREAMHANDLE hStream, OUT MV_FG_BUFFER_INFO* pstBufferInfo, IN unsigned int nTimeout);

/********************************************************************//**
 *  @~chinese
 *  @brief  释放缓存信息(SDK内部申请缓存方式，此接口用于释放不再使用的图像缓存，与MV_FG_GetFrameBuffer配套使用)
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  pstBufferInfo           [IN]           缓存信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 该接口与MV_FG_GetFrameBuffer配套使用，使用MV_FG_GetFrameBuffer接口取到的图像数据pstBufferInfo，需要用MV_FG_ReleaseFrameBuffer接口进行权限释放。
  
 *  @~english
 *  @brief  Release Buffer Information (SDK Internal Application Buffer Method, this interface can free image buffer, used with MV_FG_GetFrameBuffer)
 *  @param  hStream                 [IN]            Stream handle
 *  @param  pstBufferInfo           [IN]            Buffer information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks This API and MV_FG_GetFrameBuffer should be used in pair. The image data (pstBufferInfo) obtained via MV_FG_GetFrameBuffer should be released by this API.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_ReleaseFrameBuffer(IN STREAMHANDLE hStream, IN MV_FG_BUFFER_INFO* pstBufferInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取缓存内的ChunkData信息
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  pstBufferInfo           [IN]           缓存信息
 *  @param  nIndex                  [IN]           ChunkData索引
 *  @param  pstChunkDataInfo        [OUT]          ChunkData信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 在获取到缓存信息之后，调用MV_FG_ReleaseFrameBuffer或者MV_FG_QueueBuffer之前调用该接口才能得到有效信息。
  
 *  @~english
 *  @brief  Get the ChunkData Information in the Buffer
 *  @param  hStream                 [IN]            Stream handle
 *  @param  pstBufferInfo           [IN]            Buffer information
 *  @param  nIndex                  [IN]            ChunkData index
 *  @param  pstChunkDataInfo        [OUT]           ChunkData information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks After the buffer information is obtained, the valid information can be obtained by calling this API before calling MV_FG_ReleaseFrameBuffer or MV_FG_QueueBuffer.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetBufferChunkData(IN STREAMHANDLE hStream, IN MV_FG_BUFFER_INFO* pstBufferInfo, IN unsigned int nIndex, OUT MV_FG_CHUNK_DATA_INFO* pstChunkDataInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取流通道的图像大小
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  pnPayloadSize           [OUT]          流通道的图像大小
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 修改相机图像相关参数如宽高、像素格式等参数后需要重新获取流通道的图像大小。
  
 *  @~english
 *  @brief  Get the Payload Size of the Stream
 *  @param  hStream                 [IN]            Stream handle
 *  @param  pnPayloadSize           [OUT]           Payload size of stream
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks After modifying the camera image parameters such as width, height, pixel format and so on, it is necessary to re-obtain the payload size of the stream.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetPayloadSize(IN STREAMHANDLE hStream, OUT unsigned int* pnPayloadSize);

/********************************************************************//**
 *  @~chinese
 *  @brief  向流通道中注册缓存(必须在开始取流前注册缓存)
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  pBuffer                 [IN]           图像缓存地址
 *  @param  nSize                   [IN]           图像缓存大小
 *  @param  pPrivate                [IN]           私有信息地址
 *  @param  phBuffer                [OUT]          缓存句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 图像缓存大小通过MV_FG_GetPayloadSize接口获取；私有信息由用户自定义。
  
 *  @~english
 *  @brief  Register Buffer for Stream (the Buffer Must be Registered Before Starting Acquisition)
 *  @param  hStream                 [IN]            Stream handle
 *  @param  pBuffer                 [IN]            Image buffer address
 *  @param  nSize                   [IN]            Image buffer size
 *  @param  pPrivate                [IN]            Private information address
 *  @param  phBuffer                [OUT]           Buffer handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks The image buffer size is obtained through the MV_FG_GetPayloadSize API; Private information is user-defined.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_AnnounceBuffer(IN STREAMHANDLE hStream, IN void *pBuffer, IN unsigned int nSize, IN void *pPrivate, OUT BUFFERHANDLE *phBuffer); 

/********************************************************************//**
 *  @~chinese
 *  @brief  从流通道中撤销缓存
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  hBuffer                 [IN]           缓存句柄
 *  @param  pBuffer                 [OUT]          图像缓存地址
 *  @param  pPrivate                [OUT]          私有信息地址
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 只能撤销未使用队列中的缓存，可通过MV_FG_FlushQueue接口将缓存放到未使用队列。
  
 *  @~english
 *  @brief  Revoke Buffer from Stream
 *  @param  hStream                 [IN]            Stream handle
 *  @param  hBuffer                 [IN]            Buffer handle
 *  @param  pBuffer                 [OUT]           Image buffer address
 *  @param  pPrivate                [OUT]           Private information address
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Can only revoke the buffer in the unused queue. Can put the buffer in the unused queue through the MV_FG_FlushQueue interface.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_RevokeBuffer(IN STREAMHANDLE hStream, IN BUFFERHANDLE hBuffer, OUT void **pBuffer, OUT void **pPrivate);

/********************************************************************//**
 *  @~chinese
 *  @brief  刷新缓存队列
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  enQueueType             [IN]           队列类型
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 取流过程中不支持MV_FG_BUFFER_QUEUE_INPUT_TO_OUTPUT、MV_FG_BUFFER_QUEUE_ALL_DISCARD。
  
 *  @~english
 *  @brief  Flush Buffer Queue
 *  @param  hStream                 [IN]            Stream handle
 *  @param  enQueueType             [IN]            Queue type
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks MV_FG_BUFFER_QUEUE_INPUT_TO_OUTPUT, MV_FG_BUFFER_QUEUE_ALL_DISCARD is not supported during stream acquisition.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_FlushQueue(IN STREAMHANDLE hStream, IN MV_FG_BUFFER_QUEUE_TYPE enQueueType);

/********************************************************************//**
 *  @~chinese
 *  @brief  开始取流
 *  @param  hStream                 [IN]           流通道句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Start Acquisition
 *  @param  hStream                 [IN]            Stream handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_StartAcquisition(IN STREAMHANDLE hStream);

/********************************************************************//**
 *  @~chinese
 *  @brief  停止取流
 *  @param  hStream                 [IN]           流通道句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Stop Acquisition
 *  @param  hStream                 [IN]            Stream handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_StopAcquisition(IN STREAMHANDLE hStream);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取一帧图像的缓存信息(用户向流通道注册缓存方式)
 *  @param  hStream                 [IN]           流通道句柄
 *  @param  phBuffer                [OUT]          缓存句柄
 *  @param  nTimeout                [IN]           超时时间，以毫秒为单位
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 通过MV_FG_GetBufferInfo接口根据缓存句柄获取图像信息。
  
 *  @~english
 *  @brief  Get the Buffer Information of One Frame of Image (The User Registers the Buffer Method)
 *  @param  hStream                 [IN]            Stream handle
 *  @param  phBuffer                [OUT]           Buffer handle
 *  @param  nTimeout                [IN]            Timeout in milliseconds
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Obtain image information according to the buffer handle through the MV_FG_GetBufferInfo interface.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetImageBuffer(IN STREAMHANDLE hStream, OUT BUFFERHANDLE *phBuffer, IN unsigned int nTimeout);

/********************************************************************//**
 *  @~chinese
 *  @brief  通过缓存句柄获取缓存信息
 *  @param  hBuffer                 [IN]           缓存句柄
 *  @param  pstBufferInfo           [OUT]          缓存信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Update Interface List
 *  @param  hBuffer                 [IN]            Buffer handle
 *  @param  pstBufferInfo           [OUT]           Buffer information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetBufferInfo(IN BUFFERHANDLE hBuffer, OUT MV_FG_BUFFER_INFO* pstBufferInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  将队列外的缓存句柄放回输入队列
 *  @param  hBuffer                 [IN]           缓存句柄
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Update Interface List
 *  @param  hBuffer                 [IN]            Buffer handle
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_QueueBuffer(IN BUFFERHANDLE hBuffer);


/***********************************************************************/
/*                             图像处理                                */
/*                         Image processing                            */
/***********************************************************************/
/********************************************************************//**
 *  @~chinese
 *  @brief  显示一帧图像
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  hWnd                    [IN]           窗口句柄
 *  @param  pstDisplayFrameInfo     [IN]           显示的图像信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Display One Frame of Image
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  hWnd                    [IN]            Window handle
 *  @param  pstDisplayFrameInfo     [IN]            Image information to be displayed
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_DisplayOneFrame(IN IMAGEHANDLE hImage, IN void* hWnd, IN MV_FG_DISPLAY_FRAME_INFO *pstDisplayFrameInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  保存BMP图像
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstSaveBitmapInfo       [IN][OUT]      BMP图像信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Save BMP Image
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstSaveBitmapInfo       [IN][OUT]       BMP image information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SaveBitmap(IN IMAGEHANDLE hImage, IN OUT MV_FG_SAVE_BITMAP_INFO *pstSaveBitmapInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  保存JPEG图像
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstSaveJpegInfo         [IN][OUT]      JPEG图像信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Save JPEG Image
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstSaveJpegInfo         [IN][OUT]       JPEG image information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SaveJpeg(IN IMAGEHANDLE hImage, IN OUT MV_FG_SAVE_JPEG_INFO *pstSaveJpegInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  保存TIFF图像
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstSaveTiffInfo         [IN][OUT]      TIFF图像信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Save TIFF Image
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstSaveTiffInfo         [IN][OUT]       TIFF image information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SaveTiffToFile(IN IMAGEHANDLE hImage, IN OUT MV_FG_SAVE_TIFF_TO_FILE_INFO *pstSaveTiffInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  保存PNG图像
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstSavePngInfo          [IN][OUT]      PNG图像信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Save PNG Image
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstSavePngInfo          [IN][OUT]       TIFF image information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SavePngToFile(IN IMAGEHANDLE hImage, IN OUT MV_FG_SAVE_PNG_TO_FILE_INFO *pstSavePngInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  像素格式转换
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstConvertPixelInfo     [IN][OUT]      像素格式转换信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码

 *  @~english
 *  @brief  Pixel Format Conversion
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstConvertPixelInfo     [IN][OUT]       Pixel format conversion information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_ConvertPixelType(IN IMAGEHANDLE hImage, IN OUT MV_FG_CONVERT_PIXEL_INFO *pstConvertPixelInfo);

/********************************************************************//**
 *  @~chinese
 *  @brief  无损解码
 *  @param  hImage                      [IN]            图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstDecodeParam              [IN][OUT]       无损解码参数结构体
 *  @return 成功，返回MV_OK；错误，返回错误码 
 *  @remarks 将从相机中取到的无损压缩码流解码成裸数据，同时支持解析当前相机实时图像的水印信息（如果输入的无损码流不是当前相机或者不是实时取流的，则水印解析可能异常），
             必须传入当前相机的设备句柄才能解析出图像的水印信息，传入采集卡句柄或流句柄只能进行无损解码。
 
 *  @~english
 *  @brief  High Bandwidth Decode
 *  @param  hImage                      [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstDecodeParam              [IN][OUT]       High Bandwidth Decode parameter structure
 *  @return Success, return MV_OK. Failure, return error code
 *  @remarks Decode the lossless compressed data from the camera into raw data,
             the watermark information of the image can only be resolved if the device handle of the current camera is passed in, and the interface handle or stream handle can only be decoded lossless.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_HB_Decode(IN IMAGEHANDLE hImage, IN OUT MV_FG_HB_DECODE_PARAM* pstDecodeParam);

/********************************************************************//**
 *  @~chinese
 *  @brief  重组图像
 *  @param  hImage                  [IN]           图像句柄(可以使用采集卡/设备/流句柄)
 *  @param  pstReconstructInfo      [IN][OUT]      重组信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 支持图像旋转，图像翻转，图像分割，但需搭配特定前置条件如：\n
             图像旋转和图像翻转支持的像素格式为MV_FG_PIXEL_TYPE_Mono8、MV_FG_PIXEL_TYPE_RGB8_Packed和MV_FG_PIXEL_TYPE_BGR8_Packed。\n
             图像分割支持任意像素格式，图像分割应与线阵相机的“MultiLightControl”节点搭配使用，该节点可设置多个不同的曝光值，如MultiLightControl=2，\n
             相机会将两个不同曝光值所对应的两张图像交叠合并为一张图像(实际高度为两张图像的高度)发送给上层应用程序，\n
             调用该接口并传入重组方式为RECONSTRUCT_MODE_SPLIT_BY_LINE_2，可将相机发送的一张图像分割为2张图像，这两张图像分别对应一个曝光值。\n
             若使用普通相机或未打开线阵相机的“MultiLightControl”节点，则图像分割无意义，只是将图像按行分割为2，3，4张图像，\n
             每张图像的高度变为原图像的1/2，1/3，1/4(由enReconstructMode决定)。
  
 *  @~english
 *  @brief  Reconstruct Image
 *  @param  hImage                  [IN]            Image handle (Can use the Interface/Device/Stream handle)
 *  @param  pstReconstructInfo      [IN][OUT]       Reconstruct imag information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Support image rotation, image flip, image segmentation, but with specific preconditions such as: \n
             The pixel format supported by image rotation and image flip is MV_FG_PIXEL_TYPE_Mono8、MV_FG_PIXEL_TYPE_RGB8_Packet and MV_FG_PIXEL_TYPE_BGR8_Packed。 \n
             Image segmentation supports any pixel format. Image segmentation should be used with the "MultiLightControl" node of the linear array camera. This node can set multiple different exposure values, such as MultiLightControl=2, \n
             The camera will overlap and merge two images corresponding to two different exposure values into one image (the actual height is the height of the two images) and send it to the upper application. \n
             Call the interface and pass in RECONSTRUCT_MODE_SPLIT_BY_LINE_2. One image sent by the camera can be divided into two images, each of which corresponds to an exposure value. \n
             If an ordinary camera is used or the "MultiLightControl" node of the linear array camera is not turned on, the image segmentation is meaningless, but the image is divided into 2, 3, and 4 images by line. \n
             The height of each image becomes 1/2, 1/3, 1/4 of the original image (determined by enReconstructMode).
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_ReconstructImage(IN IMAGEHANDLE hImage, IN OUT MV_FG_RECONSTRUCT_INFO *pstReconstructInfo);


/***********************************************************************/
/*                             通用接口                                */
/*                            General API                              */
/***********************************************************************/
/********************************************************************//**
 *  @~chinese
 *  @brief  获取XML文件
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  pData                   [IN][OUT]      存放XML文件的缓存地址
 *  @param  nDataSize               [IN]           存放XML文件的缓存大小
 *  @param  pnDataLen               [OUT]          XML文件长度
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get XML File
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  pData                   [IN][OUT]       Buffer address for storing XML file
 *  @param  nDataSize               [IN]            Buffer size for storing XML file
 *  @param  pnDataLen               [OUT]           Length of XML file
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetXMLFile(IN PORTHANDLE hPort, IN OUT unsigned char* pData, IN unsigned int nDataSize, OUT unsigned int* pnDataLen);

/********************************************************************//**
 *  @~chinese
 *  @brief  获得节点的访问模式
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strName                 [IN]           节点名称
 *  @param  penAccessMode           [OUT]          节点访问模式
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 获取EnumEntry类型节点的访问模式，strName应传入EnumEntry_NodeName_EnumEntryName。\n
             如获取PixelFormat枚举类型下的EnumEntry节点Mono8，strName格式为“EnumEntry_PixelFormat_Mono8”。
  
 *  @~english
 *  @brief  Get the Access Mode of the Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strName                 [IN]            Node name
 *  @param  penAccessMode           [OUT]           Node access mode
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Obtain the access mode of EnumEntry type node, and strName should be passed into EnumEntry_NodeName_EnumEntryName. \n
             For example, get the Mono8 of EnumEntry node under PixelFormat enumeration type, and the strName format is "EnumEntry_PixelFormat_Mono8".
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetNodeAccessMode(IN PORTHANDLE hPort, IN const char * strName, OUT MV_FG_NODE_ACCESS_MODE *penAccessMode);

/********************************************************************//**
 *  @~chinese
 *  @brief  获得节点的类型
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strName                 [IN]           节点名称
 *  @param  penInterfaceType        [OUT]          节点类型
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Type of Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strName                 [IN]            Node name
 *  @param  penInterfaceType        [OUT]           Node type
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetNodeInterfaceType(IN PORTHANDLE hPort, IN const char * strName, OUT MV_FG_NODE_INTERFACE_TYPE *penInterfaceType);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取整型节点信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  pstIntValue             [OUT]          整型节点信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get Integer Node Information
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  pstIntValue             [OUT]           Integer node information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetIntValue(IN PORTHANDLE hPort, IN const char* strKey, OUT MV_FG_INTVALUE *pstIntValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  设置整型节点信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  nValue                  [IN]           要设置的值
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Set Integer Node Information
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  nValue                  [IN]            Value to set
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetIntValue(IN PORTHANDLE hPort, IN const char* strKey, IN int64_t nValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取枚举类型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  pstEnumValue            [OUT]          枚举类型节点信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Information of Enumeration Type Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  pstEnumValue            [OUT]           Enumeration node information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetEnumValue(IN PORTHANDLE hPort, IN const char* strKey, OUT MV_FG_ENUMVALUE *pstEnumValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  设置枚举类型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  nValue                  [IN]           要设置的值
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Set the Information of Enumeration Type Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  nValue                  [IN]            Value to set
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetEnumValue(IN PORTHANDLE hPort, IN const char* strKey, IN unsigned int nValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  通过字符串设置枚举类型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  strValue                [IN]           要设置的值
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Set the Information of Enumeration Type Node through string
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  strValue                [IN]            Value to set
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetEnumValueByString(IN PORTHANDLE hPort, IN const char* strKey, IN const char* strValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取单精度浮点型节点的信息
 *  @param  hPort                   [IN]           参数所属对象句柄
 *  @param  strKey                  [IN]           节点名称
 *  @param  pstFloatValue           [OUT]          单精度浮点型节点信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Information of the float Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  pstFloatValue           [OUT]           Float node information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetFloatValue(IN PORTHANDLE hPort, IN const char* strKey, OUT MV_FG_FLOATVALUE *pstFloatValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  设置单精度浮点型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  fValue                  [IN]           要设置的值
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Set the Information of the float Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  fValue                  [IN]            Value to set
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetFloatValue(IN PORTHANDLE hPort, IN const char* strKey, IN float fValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取布尔型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  pbValue                 [OUT]          布尔型节点信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get Information about Boolean Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  pbValue                 [OUT]           Boolean node information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetBoolValue(IN PORTHANDLE hPort, IN const char* strKey, OUT bool8_t *pbValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  设置布尔类型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  bValue                  [IN]           要设置的值
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Set Information about Boolean Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  bValue                  [IN]            Value to set
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetBoolValue(IN PORTHANDLE hPort, IN const char* strKey, IN bool8_t bValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  获取字符串型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  pstStringValue          [OUT]          字符串型节点信息
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Get the Information of string Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  pstStringValue          [OUT]           String node information
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_GetStringValue(IN PORTHANDLE hPort, IN const char* strKey, OUT MV_FG_STRINGVALUE *pstStringValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  设置字符串型节点的信息
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @param  strValue                [IN]           要设置的值
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Set the Information of string Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @param  strValue                [IN]            Value to set
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetStringValue(IN PORTHANDLE hPort, IN const char* strKey, IN const char* strValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  执行命令型节点的命令
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  strKey                  [IN]           节点名称
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
  
 *  @~english
 *  @brief  Execute Command of Command Node
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strKey                  [IN]            Node name
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetCommandValue(IN PORTHANDLE hPort, IN const char* strKey);

/********************************************************************//**
 *  @~chinese
 *  @brief  配置自定义的整型值
 *  @param  hPort                   [IN]           参数句柄(只能使用设备句柄)
 *  @param  enConfigCmd             [IN]           配置指令
 *  @param  nValue                  [IN]           要配置的值, 范围MV_FG_BAUDRATE_9600 ~ MV_FG_BAUDRATE_AUTOMAX;默认值MV_FG_BAUDRATE_115200
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 仅支持CML相机。
  
 *  @~english
 *  @brief  Configure Custom Integer Values
 *  @param  hPort                   [IN]            Port handle(Can only use Device handle)
 *  @param  enConfigCmd             [IN]            Configuration command
 *  @param  nValue                  [IN]            Values to configure, Value range:MV_FG_BAUDRATE_9600 ~ MV_FG_BAUDRATE_AUTOMAX;Default vaule:MV_FG_BAUDRATE_115200
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Only CML devices are supported.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_SetConfigIntValue(IN PORTHANDLE hPort, IN MV_FG_CONFIG_CMD enConfigCmd, IN int64_t nValue);

/********************************************************************//**
 *  @~chinese
 *  @brief  保存设备属性
 *  @param  hPort                   [IN]            参数句柄(可以使用采集卡/设备句柄)
 *  @param  strFileName             [IN]            属性文件名，不支持中文路径
 *  @return 成功，返回MV_FG_SUCCESS；错误，返回错误码 
 *  @remarks 不支持CML相机

 *  @~english
 *  @brief  Save device feature
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strFileName             [IN]            Property file name, Chinese path is not supported
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Not support CML device
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_FeatureSave(IN PORTHANDLE hPort, IN const char* strFileName);

/********************************************************************//**
 *  @~chinese
 *  @brief  导入设备属性
 *  @param  hPort                   [IN]            参数句柄(可以使用采集卡/设备句柄)
 *  @param  strFileName             [IN]            属性文件名，不支持中文路径
 *  @return 成功，返回MV_FG_SUCCESS；错误，返回错误码 
 *  @remarks 不支持CML相机

 *  @~english
 *  @brief  Load device feature
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  strFileName             [IN]            Property file name, Chinese path is not supported
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Not support CML device
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_FeatureLoad(IN PORTHANDLE hPort, IN const char* strFileName);


/********************************************************************//**
 *  @~chinese
 *  @brief  注册事件回调函数
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备/流句柄)
 *  @param  strEventName            [IN]           事件名称
 *  @param  cbEvent                 [IN]           事件回调函数
 *  @param  pUser                   [IN]           用户自定义数据
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 在回调函数中处理耗时操作会阻塞后续事件信息的获取。\n
             该接口适用用采集卡、设备和流事件回调，通过传入不同句柄进行注册。
  
 *  @~english
 *  @brief  Register Event Callback Function
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device/Stream handle)
 *  @param  strEventName            [IN]            Event name
 *  @param  cbEvent                 [IN]            Event callbacks
 *  @param  pUser                   [IN]            User defined data
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Processing time-consuming operations in the callback function will block the acquisition of subsequent event information. \n
             This API is applicable to the callback of interface, device and stream events, and register by passing in different handles.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_RegisterEventCallBack(IN PORTHANDLE hPort, IN const char* strEventName, IN MV_FG_EventCallBack cbEvent, IN void* pUser);

/********************************************************************//**
 *  @~chinese
 *  @brief  注册异常信息回调函数
 *  @param  hPort                   [IN]           参数句柄(可以使用采集卡/设备句柄)
 *  @param  cbException             [IN]           异常信息回调函数
 *  @param  pUser                   [IN]           用户自定义数据
 *  @return 成功，返回MV_FG_SUCCESS；失败返回错误码
 *  @remarks 在回调函数中处理耗时操作会阻塞后续异常信息的获取。\n
             该接口适用用采集卡、设备异常回调，通过传入不同句柄进行注册。
             目前不支持采集卡的掉线事件，采集卡不支持热插拔，不会出现掉线的情况；采集卡升级后必须要重启PC才能使用，已给出友好提示。
  
 *  @~english
 *  @brief  Register Exception Information Callback Function
 *  @param  hPort                   [IN]            Port handle(Can use Interface/Device handle)
 *  @param  cbException             [IN]            Exception information callback function
 *  @param  pUser                   [IN]            User defined data
 *  @return Success, return MV_FG_SUCCESS. Failure, return error code 
 *  @remarks Processing time-consuming operations in the callback function will block the acquisition of subsequent exception information. \n
             This API is applicable to the callback of interface and device exceptions, and register by passing in different handles.
             Currently, the disconnected event of the Interface is not supported. The Interface does not support hot swap, so the disconnected event does not occur. \n
             After the Interface is upgraded, you must restart the PC to use it. A friendly reminder has been given.
 ************************************************************************/
MV_FGCTRL_API int __stdcall MV_FG_RegisterExceptionCallBack(IN PORTHANDLE hPort, IN MV_FG_ExceptionCallBack cbException, IN void* pUser);

#ifdef __cplusplus
}
#endif 

#endif //_MV_FG_CTRL_H_
