mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-05 19:26:51 +08:00
Added a function to the C binding to free a char* pointer
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include <alpr.h>
|
#include <alpr.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
OPENALPRC_DLL_EXPORT OPENALPR* openalpr_init(const char* country, const char* configFile, const char* runtimeDir)
|
OPENALPRC_DLL_EXPORT OPENALPR* openalpr_init(const char* country, const char* configFile, const char* runtimeDir)
|
||||||
{
|
{
|
||||||
@@ -99,6 +100,12 @@ OPENALPRC_DLL_EXPORT char* openalpr_recognize_encodedimage(OPENALPR* instance, u
|
|||||||
return result_obj;
|
return result_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OPENALPRC_DLL_EXPORT void openalpr_free_response_string(char* response)
|
||||||
|
{
|
||||||
|
free(response);
|
||||||
|
}
|
||||||
|
|
||||||
OPENALPRC_DLL_EXPORT void openalpr_cleanup(OPENALPR* instance)
|
OPENALPRC_DLL_EXPORT void openalpr_cleanup(OPENALPR* instance)
|
||||||
{
|
{
|
||||||
delete ((alpr::Alpr*) instance);
|
delete ((alpr::Alpr*) instance);
|
||||||
|
@@ -65,6 +65,11 @@ char* openalpr_recognize_rawimage(OPENALPR* instance, unsigned char* pixelData,
|
|||||||
// Recognizes the encoded (e.g., JPEG, PNG) image. bytes are the raw bytes for the image data.
|
// Recognizes the encoded (e.g., JPEG, PNG) image. bytes are the raw bytes for the image data.
|
||||||
char* openalpr_recognize_encodedimage(OPENALPR* instance, unsigned char* bytes, long long length, struct AlprCRegionOfInterest roi);
|
char* openalpr_recognize_encodedimage(OPENALPR* instance, unsigned char* bytes, long long length, struct AlprCRegionOfInterest roi);
|
||||||
|
|
||||||
|
// Frees a char* response that was provided from a recognition request.
|
||||||
|
// This is required for interoperating with managed languages (e.g., C#) that can't free the memory themselves
|
||||||
|
void openalpr_free_response_string(char* response);
|
||||||
|
|
||||||
|
// Free the memory for the OpenALPR instance created with openalpr_init
|
||||||
void openalpr_cleanup(OPENALPR* instance);
|
void openalpr_cleanup(OPENALPR* instance);
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user