Skip to content

Commit

Permalink
add create/delete one dim classfy result for capi
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaoII committed Apr 17, 2024
1 parent 4b67273 commit 50b7f6d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions c_api/fastdeploy_capi/vision/result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ void FD_C_DestroyClassifyResult(
delete fd_c_classify_result;
}

FD_C_OneDimClassifyResult* FD_C_CreateOneDimClassifyResult() {
FD_C_OneDimClassifyResult* fd_c_one_dim_classify_result = new FD_C_OneDimClassifyResult();
return fd_c_one_dim_classify_result;
}

void FD_C_DestroyOneDimClassifyResult(
__fd_take FD_C_OneDimClassifyResult* fd_c_one_dim_classify_result) {
for (int i = 0; i < fd_c_one_dim_classify_result->size; i++) {
FD_C_DestroyClassifyResult(fd_c_one_dim_classify_result->data + i);
}
delete[] fd_c_one_dim_classify_result->data;
}

void FD_C_ClassifyResultWrapperToCResult(
__fd_keep FD_C_ClassifyResultWrapper* fd_c_classify_result_wrapper,
__fd_keep FD_C_ClassifyResult* fd_c_classify_result_data) {
Expand Down
15 changes: 15 additions & 0 deletions c_api/fastdeploy_capi/vision/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ FD_C_CreateClassifyResult();
FASTDEPLOY_CAPI_EXPORT extern void
FD_C_DestroyClassifyResult(__fd_take FD_C_ClassifyResult* fd_c_classify_result);

/** \brief Create a new FD_C_OneDimClassifyResult object
*
* \return Return a pointer to FD_C_OneDimClassifyResult object
*/
FASTDEPLOY_CAPI_EXPORT extern __fd_give FD_C_OneDimClassifyResult*
FD_C_CreateOneDimClassifyResult();

/** \brief Destroy a FD_C_OneDimClassifyResult object
*
* \param[in] fd_c_one_dim_classify_result pointer to FD_C_OneDimClassifyResult object
*/

FASTDEPLOY_CAPI_EXPORT extern void
FD_C_DestroyOneDimClassifyResult(__fd_take FD_C_OneDimClassifyResult* fd_c_one_dim_classify_result);

/** \brief Get a FD_C_ClassifyResult object from FD_C_ClassifyResultWrapper object
*
* \param[in] fd_c_classify_result_wrapper pointer to FD_C_ClassifyResultWrapper object
Expand Down

0 comments on commit 50b7f6d

Please sign in to comment.