net.sourceforge.tess4j
Interface TessDllAPI

All Superinterfaces:
com.sun.jna.Library

public interface TessDllAPI
extends com.sun.jna.Library

A Java wrapper for Tesseract OCR DLL using JNA Interface Mapping.


Nested Class Summary
static interface TessDllAPI.CANCEL_FUNC
          Callback for cancel_func.
 
Nested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler
 
Field Summary
static TessDllAPI INSTANCE
          An instance of the class library.
static java.lang.String LIB_NAME
          DLL library name.
 
Fields inherited from interface com.sun.jna.Library
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
 
Method Summary
 int TessDllBeginPage(int xsize, int ysize, java.nio.ByteBuffer buf)
          BeginPage assumes the first memory address is the bottom of the image (MS DIB format).
 int TessDllBeginPageBPP(int xsize, int ysize, java.nio.ByteBuffer buf, byte bpp)
          BeginPage assumes the first memory address is the bottom of the image (MS DIB format).
 int TessDllBeginPageLang(int xsize, int ysize, java.nio.ByteBuffer buf, java.lang.String lang)
          BeginPage assumes the first memory address is the bottom of the image (MS DIB format).
 int TessDllBeginPageLangBPP(int xsize, int ysize, java.nio.ByteBuffer buf, java.lang.String lang, byte bpp)
          BeginPage assumes the first memory address is the bottom of the image (MS DIB format).
 int TessDllBeginPageUpright(int xsize, int ysize, java.nio.ByteBuffer buf, java.lang.String lang)
          BeginPageUpright assumes the first memory address is the top of the image (TIFF format).
 int TessDllBeginPageUprightBPP(int xsize, int ysize, java.nio.ByteBuffer buf, java.lang.String lang, byte bpp)
          BeginPageUpright assumes the first memory address is the top of the image (TIFF format).
 void TessDllEndPage()
          Ends page.
 ETEXT_DESC TessDllRecognize_a_Block(int left, int right, int top, int bottom)
          Recognizes one word or section from the bitmap or the whole page.
 ETEXT_DESC TessDllRecognize_all_Words()
          Recognizes the whole page.
 void TessDllRelease()
          Releases any memory associated with the recognize class object.
 

Field Detail

LIB_NAME

static final java.lang.String LIB_NAME
DLL library name.

See Also:
Constant Field Values

INSTANCE

static final TessDllAPI INSTANCE
An instance of the class library.

Method Detail

TessDllBeginPage

int TessDllBeginPage(int xsize,
                     int ysize,
                     java.nio.ByteBuffer buf)
BeginPage assumes the first memory address is the bottom of the image (MS DIB format).

Parameters:
xsize - width of image
ysize - height of image
buf - a buffer of bytes for a 1 bit per pixel bitmap
Returns:

TessDllBeginPageLang

int TessDllBeginPageLang(int xsize,
                         int ysize,
                         java.nio.ByteBuffer buf,
                         java.lang.String lang)
BeginPage assumes the first memory address is the bottom of the image (MS DIB format).

Parameters:
xsize - width of image
ysize - height of image
buf - a buffer of bytes for a 1 bit per pixel bitmap
lang - the code of the language for which the data will be loaded. Codes follow ISO 639-3 standard. If it is null, English (eng) will be loaded.
Returns:

TessDllBeginPageUpright

int TessDllBeginPageUpright(int xsize,
                            int ysize,
                            java.nio.ByteBuffer buf,
                            java.lang.String lang)
BeginPageUpright assumes the first memory address is the top of the image (TIFF format).

Parameters:
xsize - width of image
ysize - height of image
buf - a buffer of bytes for a 1 bit per pixel bitmap
lang - the code of the language for which the data will be loaded. Codes follow ISO 639-3 standard. If it is null, English (eng) will be loaded.
Returns:

TessDllBeginPageBPP

int TessDllBeginPageBPP(int xsize,
                        int ysize,
                        java.nio.ByteBuffer buf,
                        byte bpp)
BeginPage assumes the first memory address is the bottom of the image (MS DIB format).

Parameters:
xsize - width of image
ysize - height of image
buf - a buffer of bytes for a bitmap
bpp - bit depth (bits per pixel): 1 for binary bitmap; 8 for gray; 24 for color RGB
Returns:

TessDllBeginPageLangBPP

int TessDllBeginPageLangBPP(int xsize,
                            int ysize,
                            java.nio.ByteBuffer buf,
                            java.lang.String lang,
                            byte bpp)
BeginPage assumes the first memory address is the bottom of the image (MS DIB format).

Parameters:
xsize - width of image
ysize - height of image
buf - a buffer of bytes for a bitmap
lang - the code of the language for which the data will be loaded. Codes follow ISO 639-3 standard. If it is null, English (eng) will be loaded.
bpp - bit depth (bits per pixel): 1 for binary bitmap; 8 for gray; 24 for color RGB
Returns:

TessDllBeginPageUprightBPP

int TessDllBeginPageUprightBPP(int xsize,
                               int ysize,
                               java.nio.ByteBuffer buf,
                               java.lang.String lang,
                               byte bpp)
BeginPageUpright assumes the first memory address is the top of the image (TIFF format).

Parameters:
xsize - width of image
ysize - height of image
buf - a buffer of bytes for a bitmap
lang - the code of the language for which the data will be loaded. Codes follow ISO 639-3 standard. If it is null, English (eng) will be loaded.
bpp - bit depth (bits per pixel): 1 for binary bitmap; 8 for gray; 24 for color RGB
Returns:

TessDllEndPage

void TessDllEndPage()
Ends page.


TessDllRecognize_a_Block

ETEXT_DESC TessDllRecognize_a_Block(int left,
                                    int right,
                                    int top,
                                    int bottom)
Recognizes one word or section from the bitmap or the whole page. To extract the whole page, just enter zeros for left, right, top, bottom. Limit of 32000 characters can be returned.
Note: Getting one word at time is not yet optimized for speed.

Parameters:
left - left of block
right - right of block
top - top of block
bottom - bottom of block
Returns:

TessDllRecognize_all_Words

ETEXT_DESC TessDllRecognize_all_Words()
Recognizes the whole page. Limit of 32000 characters can be returned.

Returns:

TessDllRelease

void TessDllRelease()
Releases any memory associated with the recognize class object.