Package org.bytedeco.tesseract
Class TessResultRenderer
- java.lang.Object
-
- org.bytedeco.javacpp.Pointer
-
- org.bytedeco.tesseract.TessResultRenderer
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
TessAltoRenderer,TessBoxTextRenderer,TessHOcrRenderer,TessLSTMBoxRenderer,TessOsdRenderer,TessPAGERenderer,TessPDFRenderer,TessTextRenderer,TessTsvRenderer,TessUnlvRenderer,TessWordStrBoxRenderer
@Namespace("tesseract") @NoOffset @Properties(inherit=tesseract.class) public class TessResultRenderer extends Pointer
Interface for rendering tesseract results into a document, such as text, HOCR or pdf. This class is abstract. Specific classes handle individual formats. This interface is then used to inject the renderer class into tesseract when processing images. For simplicity implementing this with tesseract version 3.01, the renderer contains document state that is cleared from document to document just as the TessBaseAPI is. This way the base API can just delegate its rendering functionality to injected renderers, and the renderers can manage the associated state needed for the specific formats in addition to the heuristics for producing it.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bytedeco.javacpp.Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
-
-
Constructor Summary
Constructors Constructor Description TessResultRenderer(Pointer p)Pointer cast constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanAddImage(TessBaseAPI api)Adds the recognized text from the source image to the current document.booleanBeginDocument(String title)booleanBeginDocument(BytePointer title)Starts a new document with the given title.booleanEndDocument()Finishes the document and finalizes the output data Invalid if BeginDocument not yet called.BytePointerfile_extension()booleanhappy()intimagenum()Returns the index of the last image given to AddImage (i.e.voidinsert(TessResultRenderer next)TessResultRenderernext()BytePointertitle()-
Methods inherited from class org.bytedeco.javacpp.Pointer
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, trimMemory, withDeallocator, zero
-
-
-
-
Constructor Detail
-
TessResultRenderer
public TessResultRenderer(Pointer p)
Pointer cast constructor. InvokesPointer(Pointer).
-
-
Method Detail
-
insert
public void insert(TessResultRenderer next)
-
next
public TessResultRenderer next()
-
BeginDocument
@Cast("bool") public boolean BeginDocument(@Cast("const char*") BytePointer title)
Starts a new document with the given title. This clears the contents of the output data. Title should use UTF-8 encoding.
-
AddImage
@Cast("bool") public boolean AddImage(TessBaseAPI api)
Adds the recognized text from the source image to the current document. Invalid if BeginDocument not yet called. Note that this API is a bit weird but is designed to fit into the current TessBaseAPI implementation where the api has lots of state information that we might want to add in.
-
EndDocument
@Cast("bool") public boolean EndDocument()
Finishes the document and finalizes the output data Invalid if BeginDocument not yet called.
-
file_extension
@Cast("const char*") public BytePointer file_extension()
-
title
@Cast("const char*") public BytePointer title()
-
happy
@Cast("bool") public boolean happy()
-
imagenum
public int imagenum()
Returns the index of the last image given to AddImage (i.e. images are incremented whether the image succeeded or not) This is always defined. It means either the number of the current image, the last image ended, or in the completed document depending on when in the document lifecycle you are looking at it. Will return -1 if a document was never started.
-
-