|
|
#ifndef _HEATMAP_H__
|
|
|
#define _HEATMAP_H__
|
|
|
|
|
|
#ifdef WIN32
|
|
|
#if defined(HEATMAP_EXPORTS)
|
|
|
#define HEATMAP_API __declspec(dllexport)
|
|
|
#else
|
|
|
#define HEATMAP_API __declspec(dllimport)
|
|
|
#endif
|
|
|
#define CALLMETHOD __stdcall
|
|
|
#else
|
|
|
#define HEATMAP_API
|
|
|
#define CALLMETHOD
|
|
|
#endif
|
|
|
|
|
|
#ifndef HEATMAP_API
|
|
|
#define HEATMAP_API
|
|
|
#endif
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
extern "C" {
|
|
|
#endif
|
|
|
|
|
|
//Bmp位图信息
|
|
|
typedef struct bmpImageInfo
|
|
|
{
|
|
|
unsigned char *pBuffer; //Bmp图片数据指针
|
|
|
int nWidth; //图片宽度
|
|
|
int nHeight; //图片高度
|
|
|
int nBitCount; //图片位数,支持8位,24位,32位
|
|
|
int nDirection; //数据存储方向 0:从上到下,从左到右, 1:从下到上,从左到右
|
|
|
}BMPIMAGE_INFO;
|
|
|
|
|
|
///输入数据信息
|
|
|
typedef struct heatMapInfoIn
|
|
|
{
|
|
|
BMPIMAGE_INFO stuGrayBmpInfo; //8位Bmp灰度热度图数据:不包含图片头,数据存储方向从上到下
|
|
|
BMPIMAGE_INFO stuBkBmpInfo; //背景图Bmp位图数据:包含图片头,存储方向从下到上
|
|
|
}HEATMAP_IMAGE_IN;
|
|
|
|
|
|
//输出数据信息
|
|
|
typedef struct heatMapInfoOut
|
|
|
{
|
|
|
unsigned char *pBuffer; //输出的彩色热度图数据(包含图片头),宽高、位数和背景图相同
|
|
|
int nPicSize; //图片内存大小(包含头) :宽*高*nBitCount/8 + 54
|
|
|
float fOpacity; //透明度,范围0-1
|
|
|
}HEATMAP_IMAGE_Out;
|
|
|
|
|
|
///\brief 生成热度图数据信息
|
|
|
/// param [in] stuBmpInfoIn Bmp位图数据输入
|
|
|
/// param [in] stuBmpInfoOut Bmp位图数据输出,包含图片头
|
|
|
/// param [out] true or false
|
|
|
HEATMAP_API bool CALLMETHOD CreateHeatMap(const HEATMAP_IMAGE_IN *stuBmpInfoIn, HEATMAP_IMAGE_Out *stuBmpInfoOut);
|
|
|
|
|
|
///\brief 将网络二进制数据转化成灰度数据
|
|
|
/// param [in] srcData 二进制数据
|
|
|
/// param [in] width 宽
|
|
|
/// param [in] height 高
|
|
|
/// param [in] resultOut 灰度数据
|
|
|
/// param [out] true or false
|
|
|
HEATMAP_API bool CALLMETHOD TransNetDataToGrayData(unsigned char * srcData, int width, int height, unsigned char * resultOut);;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
|
|
|
#endif //_HEATMAP_H__
|