InterfaceILeptonicaApiSignatures
The exported leptonica api signatures.
Definition
Namespace:Tesseract.Interop
Assembly:Telerik.Windows.Documents.TesseractOcr.dll
Syntax:
public interface ILeptonicaApiSignatures
Methods
boxaGetBox(HandleRef, int, PixArrayAccessType)
Declaration
nint boxaGetBox(HandleRef boxa, int index, PixArrayAccessType accesstype)
Parameters
boxa
index
accesstype
Returns
pixDeskewGeneral(HandleRef, int, float, float, int, int, out float, out float)
Declaration
nint pixDeskewGeneral(HandleRef pix, int redSweep, float sweepRange, float sweepDelta, int redSearch, int thresh, out float pAngle, out float pConf)
Parameters
pix
redSweep
sweepRange
sweepDelta
redSearch
thresh
pAngle
pConf
Returns
pixGetInputFormat(HandleRef)
Declaration
ImageFormat pixGetInputFormat(HandleRef pix)
Parameters
pix
Returns
pixRotate(HandleRef, float, RotationMethod, RotationFill, int, int)
Declaration
nint pixRotate(HandleRef pixs, float angle, RotationMethod type, RotationFill fillColor, int width, int heigh)
Parameters
pixs
angle
type
fillColor
width
heigh
Returns
pixSetInputFormat(HandleRef, ImageFormat)
Declaration
int pixSetInputFormat(HandleRef pix, ImageFormat inputFormat)
Parameters
pix
inputFormat
Returns
pixWrite(string, HandleRef, ImageFormat)
Declaration
int pixWrite(string filename, HandleRef handle, ImageFormat format)
Parameters
filename
handle
format
Returns
pixaAddPix(HandleRef, HandleRef, PixArrayAccessType)
Declaration
int pixaAddPix(HandleRef pixa, HandleRef pix, PixArrayAccessType copyflag)
Parameters
pixa
pix
copyflag
Returns
pixaGetPix(HandleRef, int, PixArrayAccessType)
Declaration
nint pixaGetPix(HandleRef pixa, int index, PixArrayAccessType accesstype)
Parameters
pixa
index
accesstype
Returns
pixcmapAddBlackOrWhite(HandleRef, int, out int)
Adds a color (black\white) if not already there returning it's index through index.
pixcmapAddColor(HandleRef, int, int, int)
Adds the color to the pix color map if their is room.
pixcmapAddNearestColor(HandleRef, int, int, int, out int)
Adds the specified color if it doesn't already exist, returning the color's index in the data array.
Declaration
int pixcmapAddNearestColor(HandleRef cmap, int redValue, int greenValue, int blueValue, out int colorIndex)
Parameters
cmap
The pointer to the colormap instance.
redValue
The red value
greenValue
The green value
blueValue
The blue value
colorIndex
The index of the new color if it was added, or the existing color if it already existed.
Returns
Returns 0 for success, 1 for error, 2 for not enough space.
Remarks
If the color doesn't exist and there is not enough room to add a new color return the nearest color.
pixcmapAddNewColor(HandleRef, int, int, int, out int)
Adds the specified color if it doesn't already exist, returning the colors index in the data array.
Declaration
int pixcmapAddNewColor(HandleRef cmap, int redValue, int greenValue, int blueValue, out int colorIndex)
Parameters
cmap
The pointer to the colormap instance.
redValue
The red value
greenValue
The green value
blueValue
The blue value
colorIndex
The index of the new color if it was added, or the existing color if it already existed.
Returns
Returns 0 for success, 1 for error, 2 for not enough space.
pixcmapClear(HandleRef)
Removes all colors from the color map by setting the count to zero.
pixcmapCopy(HandleRef)
Performs a deep copy of the color map.
pixcmapCountGrayColors(HandleRef, out int)
Returns the number of unique grey colors including black and white.
pixcmapCreate(int)
Creates a new colormap with the specified depth.
pixcmapCreateLinear(int, int)
Creates a new colormap of the specified depth with equally spaced gray color values.
pixcmapCreateRandom(int, int, int)
Creates a new colormap of the specified depth with random colors where the first color can optionally be set to black, and the last optionally set to white.
Declaration
nint pixcmapCreateRandom(int depth, int hasBlack, int hasWhite)
Parameters
depth
The depth of the pix in bpp, can be 2, 4, or 8
hasBlack
If set to 1 the first color will be black.
hasWhite
If set to 1 the last color will be white.
Returns
The pointer to the color map, or null on error.
pixcmapDestroy(ref nint)
Destorys and cleans up any memory used by the color map.
Declaration
void pixcmapDestroy(ref nint cmap)
Parameters
cmap
The pointer to the colormap instance, set to null on success.
pixcmapGetColor(HandleRef, int, out int, out int, out int)
Gets the color at the specified index.
Declaration
int pixcmapGetColor(HandleRef cmap, int index, out int redValue, out int blueValue, out int greenValue)
Parameters
cmap
The pointer to the colormap instance.
index
The index of the color entry.
redValue
The color entry's red value.
blueValue
The color entry's blue value.
greenValue
The color entry's green value.
Returns
Returns 0 if OK; 1 if not accessable (caller should check).
pixcmapGetColor32(HandleRef, int, out int)
Gets the color at the specified index.
Declaration
int pixcmapGetColor32(HandleRef cmap, int index, out int color)
Parameters
cmap
The pointer to the colormap instance.
index
The index of the color entry.
color
The color entry as 32 bit value
Returns
Returns 0 if OK; 1 if not accessable (caller should check).
Remarks
The alpha channel will always be zero as it is not used in Leptonica color maps.
pixcmapGetCount(HandleRef)
Gets the number of color entries in the color map.
pixcmapGetFreeCount(HandleRef)
Gets the number of free color entries in the color map.
pixcmapGetIndex(HandleRef, int, int, int, out int)
Gets the index of the color entry with the specified color, return 0 if found; 1 if not.
pixcmapGetMinDepth(HandleRef, out int)
Gets the minimum pix depth required to support the color map.
pixcmapGetNearestGrayIndex(HandleRef, int, out int)
Finds the index of the color entry closest to the specified color.
pixcmapGetNearestIndex(HandleRef, int, int, int, out int)
Finds the index of the color entry closest to the specified color.
pixcmapGetRankIntensity(HandleRef, float, out int)
Finds the index of the color entry with the rank intensity.
pixcmapHasColor(HandleRef, int)
Returns 0 if the color exists in the color map; otherwise 1.
pixcmapResetColor(HandleRef, int, int, int, int)
Sets a previously allocated color entry.
Declaration
int pixcmapResetColor(HandleRef cmap, int index, int redValue, int blueValue, int greenValue)
Parameters
cmap
The pointer to the colormap instance.
index
The index of the colormap entry
redValue
blueValue
greenValue
Returns
Returns 0 if OK; 1 if not accessable (caller should check).
pixcmapSetBlackAndWhite(HandleRef, int, int)
Sets the darkest color in the colormap to black, if setBlack is 1.
Sets the lightest color in the colormap to white if setWhite is 1.
Declaration
int pixcmapSetBlackAndWhite(HandleRef cmap, int setBlack, int setWhite)
Parameters
cmap
The pointer to the colormap instance.
setBlack
0 for no operation; 1 to set darket color to black
setWhite
0 for no operation; 1 to set lightest color to white
Returns
Returns 0 if OK; 1 on error.
pixcmapUsableColor(HandleRef, int, int, int, out int)
Checks if the color already exists or if their is enough room to add it.
Declaration
int pixcmapUsableColor(HandleRef cmap, int redValue, int greenValue, int blueValue, out int usable)
Parameters
cmap
The pointer to the colormap instance.
redValue
The red value
greenValue
The green value
blueValue
The blue value
usable
Returns 1 if usable; 0 if not.
Returns
Returns 0 if OK, 1 on error.