Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 689 Bytes

接口设计.md

File metadata and controls

34 lines (29 loc) · 689 Bytes

接口设计

C 接口设计

流程设计

  • 获取图像处理类的指针
  • 将图像载入处理类
  • 计算
  • 获取结果

接口

获取图像处理类指针采用

extern "C" DLL_EXPORT ImgProcess *get_process()

载入图像

extern "C" DLL_EXPORT void set_image(ImgProcess *self, unsigned char * image, size_t length)
{
    vector<unsigned char> data(image, image+length);
    cv::mat image = cv::imdecode(data);
    ....
}

计算,根据type类型来计算结果

extern "C" DLL_EXPORT void compute(ImgProcess *self, size_t type)

获取绘制后的图像

extern "C" DLL_EXPORT void get_draw(ImgProcess *self, char *image)