Blame view

src/nvdec/ImageSaveGPU.h 2.93 KB
92989af0   ming   更新解码器
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  /*******************************************************************************************
  * Version: VPT_x64_V2.0.0_20170904
  * CopyRight: 中科院自动化研究所模式识别实验室图像视频组
  * UpdateDate: 20170904
  * Content: 人车物监测跟踪
  ********************************************************************************************/
  
  #ifndef IMAGESAVEGPU_H_
  #define IMAGESAVEGPU_H_
  
  #ifdef _MSC_VER
  	#ifdef IMAGESAVEGPU_EXPORTS
  		#define IMAGESAVEGPU_API __declspec(dllexport)
  	#else
  		#define IMAGESAVEGPU_API __declspec(dllimport)
  	#endif
  #else
  #define IMAGESAVEGPU_API __attribute__((visibility ("default")))
  #endif
  // 功能:保存成jpeg文件
  // szOutputFile		输出图片路径,如D:\\out.jpg
  // d_srcRGB			输入RGB数据,由cudaMalloc分配的显存空间,数据排列形式为:BBBBBB......GGGGGG......RRRRRRRR......
  // img_width		RGB数据图片的宽度
  // img_height		RGB数据图片的高度
  //
  //IMAGESAVEGPU_API int saveJPEG(const char *szOutputFile, float* d_srcRGB, int img_width, int img_height);
  //IMAGESAVEGPU_API int saveJPEG(const char *szOutputFile, float* d_srcRGB);
  //
  //IMAGESAVEGPU_API int saveJPEG(const char *szOutputFile, unsigned char* d_srcRGB, int img_width, int img_height);
  //IMAGESAVEGPU_API int saveJPEG(const char *szOutputFile, unsigned char* d_srcRGB);
  
  // 功能:防缩图像
  IMAGESAVEGPU_API int resizeFrame(float* d_srcRGB, int src_width, int src_height, float* d_dstRGB, int dst_width, int dst_height);
  
  // 功能:部分拷贝数据
  IMAGESAVEGPU_API int partMemCopy(unsigned char* d_srcRGB, int src_width, int src_height, unsigned char* d_dstRGB, int left, int top, int right, int bottom);
  
  //IMAGESAVEGPU_API int partMemResizeImage(float * d_srcRGB, int src_width, int src_height, unsigned char** d_dstRGB,
  //	int* vleft, int * vtop, int* vright, int* vbottom, int *dst_w, int *dst_h,
  //	float submeanb, float submeang, float submeanr,
  //	float varianceb, float varianceg, float variancer);
  
  
  IMAGESAVEGPU_API int PartMemResizeBatch(unsigned char * d_srcRGB, int src_width, int src_height, unsigned char** d_dstRGB,
  	int count, int* vleft, int * vtop, int* vright, int* vbottom, int *dst_w, int *dst_h,
  	float submeanb, float submeang, float submeanr,
  	float varianceb, float varianceg, float variancer);
  
  
  //// 功能:初始化GPU保存图像的各种量化表
  //IMAGESAVEGPU_API int initTables();
  //IMAGESAVEGPU_API int initTables(int falg, int width, int height);
  //
  //// 功能:释放资源
  //IMAGESAVEGPU_API int releaseJpegSaver();
  
  // 功能:在GPU中绘制快照包围框
  IMAGESAVEGPU_API int drawImageOnGPU(float* d_srcRGB, int src_width, int src_height, int left, int top, int right, int bottom);
  
  IMAGESAVEGPU_API int drawImageOnGPU(unsigned char* d_srcRGB, int src_width, int src_height, int left, int top, int right, int bottom);
  
  // 功能:在GPU中绘制直线
  IMAGESAVEGPU_API int drawLineOnGPU(float* d_srcRGB, int src_width, int src_height, int begin_x, int begin_y, int end_x, int end_y);
  
  #endif