2018-01-11 00:52:32 +00:00
|
|
|
#ifndef __OCR_DRIVER__H
|
|
|
|
#define __OCR_DRIVER__H
|
|
|
|
|
2018-01-25 20:22:42 +00:00
|
|
|
#include <boolean.h>
|
|
|
|
#include <retro_common_api.h>
|
|
|
|
|
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
|
2018-01-11 00:52:32 +00:00
|
|
|
struct ocr_image_info
|
|
|
|
{
|
2018-01-25 20:22:42 +00:00
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
2018-01-11 00:52:32 +00:00
|
|
|
unsigned pixel_format;
|
2018-01-25 20:22:42 +00:00
|
|
|
void* data;
|
2018-01-11 00:52:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct ocr_driver
|
|
|
|
{
|
2018-01-25 20:22:42 +00:00
|
|
|
void* (*init)(int game_character_set);
|
2018-01-11 00:52:32 +00:00
|
|
|
void (*free)(void* data);
|
|
|
|
|
2018-01-25 02:35:14 +00:00
|
|
|
/* returned char pointers do not need to be freed but are 1 time use, they may be destroyed on the next call to get_text */
|
|
|
|
char* (*get_text)(void* data, struct ocr_image_info image);
|
2018-01-11 00:52:32 +00:00
|
|
|
|
|
|
|
const char *ident;
|
|
|
|
} ocr_driver_t;
|
|
|
|
|
2018-01-17 22:00:57 +00:00
|
|
|
#ifdef HAVE_TESSERACT
|
2018-01-11 00:52:32 +00:00
|
|
|
extern const ocr_driver_t ocr_tesseract;
|
2018-01-17 22:00:57 +00:00
|
|
|
#endif
|
2018-01-11 00:52:32 +00:00
|
|
|
extern const ocr_driver_t ocr_null;
|
|
|
|
|
2018-01-17 22:00:57 +00:00
|
|
|
bool ocr_driver_init(void);
|
|
|
|
void ocr_driver_free(void);
|
2018-01-25 02:35:14 +00:00
|
|
|
|
|
|
|
/* returned char pointers do not need to be freed but are 1 time use, they may be destroyed on the next call to ocr_driver_get_text */
|
2018-01-17 22:00:57 +00:00
|
|
|
char* ocr_driver_get_text(struct ocr_image_info image);
|
2018-01-11 00:52:32 +00:00
|
|
|
|
2018-01-25 20:22:42 +00:00
|
|
|
RETRO_END_DECLS
|
|
|
|
|
2018-01-11 00:52:32 +00:00
|
|
|
#endif
|