diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2020-04-24 14:13:39 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2020-06-03 18:35:11 +0100 |
commit | 7322ef87546c55b29056c1d96d8bdbb7f3ba53ef (patch) | |
tree | de3241eef10c29817c0b9baf4b1de9504ca8006a /base/tessocr.h | |
parent | ff02973645a9aff2caf1bcd3032f119995e0d63f (diff) | |
download | ghostpdl-7322ef87546c55b29056c1d96d8bdbb7f3ba53ef.tar.gz |
Tesseract based OCR devices.
pdfocr8/24/32, ocr and hocr devices.
Use OCRLanguage to set languages to use ("eng" by default).
Diffstat (limited to 'base/tessocr.h')
-rw-r--r-- | base/tessocr.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/base/tessocr.h b/base/tessocr.h new file mode 100644 index 000000000..c5e7967b9 --- /dev/null +++ b/base/tessocr.h @@ -0,0 +1,45 @@ +/* Copyright (C) 2020 Artifex Software, Inc. + All Rights Reserved. + + This software is provided AS-IS with no warranty, either express or + implied. + + This software is distributed under license and may not be copied, + modified or distributed except as expressly authorized under the terms + of the license contained in the file LICENSE in this distribution. + + Refer to licensing information at http://www.artifex.com or contact + Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, + CA 94945, U.S.A., +1(415)492-9861, for further information. +*/ + + +/* Simple veneer for tesseract */ + +#ifndef tessocr_h_INCLUDED +# define tessocr_h_INCLUDED + +#include "gsmemory.h" + +int ocr_image_to_utf8(gs_memory_t *mem, + int w, int h, int bpp, int raster, + int xres, int yres, + void *data, int restore_data, + const char *language, char **out); + +int ocr_image_to_hocr(gs_memory_t *mem, + int w, int h, int bpp, int raster, + int xres, int yres, void *data, int restore, + int pagecount, const char *language, char **out); + +int ocr_init_api(gs_memory_t *mem, const char *language, void **state); + +void ocr_fin_api(gs_memory_t *mem, void *api_); + +int ocr_recognise(void *api_, int w, int h, void *data, + int xres, int yres, + int (*callback)(void *, const char *, const int *, const int *, const int *, int), + void *arg); + +#endif + |