Documentation ¶
Index ¶
- func BuildImports(ctx context.Context, waRT wazero.Runtime, embindEngine embind.Engine, ...) error
- func CompileTesseract(ctx context.Context, waRT wazero.Runtime, embEng embind.Engine, ...) (api.Module, error)
- func GetReaderSize(ctx context.Context, readerPtr *io.Reader) (uint32, error)
- func ReadString[T constraints.Integer](mem api.Memory, rawStrPtr T) string
- type CompileConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildImports ¶
func BuildImports(ctx context.Context, waRT wazero.Runtime, embindEngine embind.Engine, compiledMod wazero.CompiledModule) error
BuildImports implements or mocks the host imports required by Tesseract's compiled WASM module.
func CompileTesseract ¶
func GetReaderSize ¶
GetReaderSize attempts to optimally determine an io.Reader's size, with special support for bytes.Buffer like objects, or os.File like objects. Takes a pointer to the reader in case it needs to replace it with a copy (worst case).
func ReadString ¶
func ReadString[T constraints.Integer](mem api.Memory, rawStrPtr T) string
ReadString reads from the provided pointer until we reach a 0. If 0 is not found, returns an empty string. If WASM doesn't need it afterwards, use ReadAndFreeString instead.
Types ¶
type CompileConfig ¶
Click to show internal directories.
Click to hide internal directories.