visit Kofax web site

SPImage.h File Reference


Detailed Description

SignWare Dynamic Development toolkit, static image object.

Author:
uko

SPImage object

The SPImage object implements a representation of a static image. The image may be loaded from a color, a gray-scale or a black-and-white image, most image formats can be read, such as tiff, jpeg, png, gif and many more.

The SPImage object can load indexed color images, however the saved image will be converted to a true color image.

The SPImage object includes methods to perform signature cleaning (see Static Image cleaning), cleaning funtionality is optimized for signature snippets which are typically gray-scale or black-and-white regions of a scanned image that include the handwritten signature. Cleaning methods cannot be applied to color images.

The SPImage object contains methods to draw text, rectangles or images on the target image, e. g. to dynamically compose a tablet background image.

Note:
All cleaning functions allow a maximum image size of 1280 * 960 pixel. This also affects SPImageGetComplexity and SPImageInvert when using the flag SP_INVERT_ENGINE.

Static Image cleaning

Static image cleaning is optimized for signature snippets. Cleaning other images such as photographs might not produce the expected results. Cut the signature region whenever possible. Any elements that are not relevant to a signature might have negative effects on the cleaning process and signature verification.

The cleaning functions provided here include:

All the above functions can be called either directly or via a single call to SPImageCleanBatch. SPImageCleanBatch is passed a parameter set that determines which of the above functions to call and also includes fine tuning parameters for the appropriate functions.

Some cleaning functions are performed on black-and-white images, they are based on algorithms implemented in the static compare engine. Gray-scale and color images will be binarized, cleaned and the resulting black-and-white image will be used as a mask on the gray-scale or color image. The visible impact is that the background of the resulting gray-scale or color images will be cleaned while maintaining the gray and color levels of the signature. Please note that the image polarity (black text on white background) is essential for the masking process. It is recommended to call SPImageInvert (passing SP_INVERT_AUTO) first. The temporary binarization uses the default method and threshold (see SPImageSetDefaultBinarizeParams) and calls SPImageBinarize.

Some cleaning functions will resize the resulting image. Don't assume that the image size won't change, always retrieve the image size (see SPImageGetSize) if needed.

The resulting image will not be resized if the resulting image becomes empty, an empty image will thus have the size of the original image with all pixels set to 255 (white).

SPImageCleanBatch is optimized for batch mode operation where a set of images is to be cleaned using the same parameters. Interactive cleaning normally accesses the cleaning functions directly.

If you call SPImageCleanBatch, each of the above cleaning functions must be enabled separately with SPCleanParameterAppendEnableFlag, please see the sample code below.

The order of processing is determined by the order of appending the associated enable flags, but for speed reasons, these functions are always called first, according to the order of the enable flags:

Some cleaning functions require additional parameters (properties) to be set.
Cleaning function Enable flag Required Parameters
SPImageBinarize SP_BINARIZE_ENABLE SPINT32 SP_BINARIZE_THRESHOLD, SPINT32 SP_BINARIZE_METHOD
SPImageCleanDate SP_CLEAN_DATE_ENABLE --
SPImageCleanFrames SP_CLEANFRAMES_ENABLE SPDOUBLE SP_CLEANFRAMES_TRUST
SPImageCleanLines SP_CLEANLINES_ENABLE --
SPImageCleanSignature SP_CLEAN_SIGNATURE_ENABLE --
SPImageGetSignatureRegion SP_CUT_SIGNATURE_REGION_ENABLE --
SPImageInvert SP_INVERT_ENABLE SPINT32 SP_INVERT_FLAGS
SPImageMirror SP_MIRROR_ENABLE SPINT32 SP_MIRROR_AXES
SPImageRegion SP_CUT_REGION_ENABLE SPINT32 SP_CUT_REGION_TOP, SPINT32 SP_CUT_REGION_LEFT, SPINT32 SP_CUT_REGION_BOTTOM, SPINT32 SP_CUT_REGION_RIGHT
SPImageRotate SP_ROTATE_ENABLE SPINT32 SP_ROTATE_ANGLE

Cleaning functions using the static engine require a license for cleaning.

Note:
Dynamic signatures do not require cleaning as they are clean per se. You should not save dynamic signatures as static images but rather render dynamic signatures into static images whenever required, else important biometric features might be lost (static images cannot save the dynamic features of a signature).
Example (C):
 int cleanImage(pSDKIMAGE_T pImage)
 {
     pSDKCLEANPARAMETER pParams = 0;
     int rc;
     rc = SPCleanParameterCreate(&pParams);
     if(rc != SP_NOERR) return rc;
     SPCleanParameterAppendEnableFlag(pParams, SP_INVERT_ENABLE);
     SPCleanParameterSetInt(pParams, SP_INVERT_FLAGS, SP_INVERT_AUTO);
     SPCleanParameterAppendEnableFlag(pParams, SP_CLEANLINES_ENABLE);
     rc = SPImageCleanBatch(pImage, pParams);
     SPCleanParameterFree(&pParams);
     return rc;
 }

Example (Java):

 void cleanImage(SPImage pImage) throws SPSignwareException
 {
     SPCleanParameter pParams = new SPCleanParameter();
     pParams.appendEnableFlag(SPImage.SP_INVERT_ENABLE);
     pParams.setParameter(SPImage.SP_INVERT_FLAGS, SPImage.SP_INVERT_AUTO);
     pParams.appendEnableFlag(SPImage.SP_CLEANLINES_ENABLE);
     pImage.clean(pParams);
     return rc;
 }


Defines

#define SP_BINARIZE_ENABLE   "SPBinarizeEnable"
 SPCleanParameter enable flag: binarize image.
#define SP_BINARIZE_METHOD   "SPBinarizeMethod"
 SPCleanParameter integer property: select the binarization method.
#define SP_BINARIZE_THRESHOLD   "SPBinarizeThreshold"
 SPCleanParameter integer property: threshold for binarization.
#define SP_CLEAN_DATE_ENABLE   "SPCleanDateEnable"
 SPCleanParameter enable flag: clean handwritten text.
#define SP_CLEAN_SIGNATURE_ENABLE   "SPCleanSignatureEnable"
 SPCleanParameter enable flag: clean signature.
#define SP_CLEANFRAMES_ENABLE   "SPCleanFrameEnable"
 SPCleanParameter enable flag: clean frames.
#define SP_CLEANFRAMES_TRUST   "SPCleanFrameTrust"
 SPCleanParameter floating-point property: trust value for cleaning frames.
#define SP_CLEANLINES_ENABLE   "SPCleanLineEnable"
 SPCleanParameter enable flag: clean lines.
#define SP_CUT_REGION_BOTTOM   "SPCutRegionBottom"
 SPCleanParameter integer property: bottom coordinate of cut region.
#define SP_CUT_REGION_ENABLE   "SPCutRegionEnable"
 SPCleanParameter enable flag: crop image to signature region.
#define SP_CUT_REGION_LEFT   "SPCutRegionLeft"
 SPCleanParameter integer property: left coordinate of cut region.
#define SP_CUT_REGION_RIGHT   "SPCutRegionRight"
 SPCleanParameter integer property: right coordinate of cut region.
#define SP_CUT_REGION_TOP   "SPCutRegionTop"
 SPCleanParameter integer property: top coordinate of cut region.
#define SP_CUT_SIGNATURE   1
 Flag to crop the image to the signature region.
#define SP_CUT_SIGNATURE_REGION_ENABLE   "SPCutSignatureRegionEnable"
 SPCleanParameter enable flag: crop the image to the signature region.
#define SP_INVERT_AUTO   1
 Flag to invert images automatically.
#define SP_INVERT_ENABLE   "SPInvertEnable"
 SPCleanParameter enable flag: invert image.
#define SP_INVERT_ENGINE   2
 Flag to request usage of the static cleaning engine instead of SignWare's own algorithms.
#define SP_INVERT_FLAGS   "SPInvertFlags"
 SPCleanParameter integer property: invert flags.
#define SP_INVERT_NONE   4
 Flag to cause the image not to be inverted.
#define SP_MASK_AND   2
 Mask operation: AND.
#define SP_MASK_CPY   4
 Mask operation: COPY.
#define SP_MASK_MAX   6
 Mask operation: MAX.
#define SP_MASK_MIN   7
 Mask operation: MIN.
#define SP_MASK_NOTCPY   5
 Mask operation: NOT COPY.
#define SP_MASK_OR   1
 Mask operation: OR.
#define SP_MASK_XOR   3
 Mask operation: XOR.
#define SP_MIRROR_AXES   "SPMirrorAxes"
 SPCleanParameter integer property: mirror axes.
#define SP_MIRROR_ENABLE   "SPMirrorEnable"
 SPCleanParameter enable flag: mirror image.
#define SP_ROTATE_ANGLE   "SPRotateAngle"
 SPCleanParameter integer property: rotation angle.
#define SP_ROTATE_ENABLE   "SPRotateEnable"
 SPCleanParameter enable flag: rotate image.

Functions

SPINT32 __cdecl SPImageBinarize (pSPIMAGE_T pImage, int iMethod, int iThreshold)
 Binarize the image stored in an SPImage object.
SPINT32 __cdecl SPImageBrightness (pSPIMAGE_T pImage, SPDOUBLE fGray, SPDOUBLE fGreen, SPDOUBLE fBlue)
 Change the brightness of an image.
SPINT32 __cdecl SPImageCleanBatch (pSPIMAGE_T pImage, const pSPCLEANPARAMETER_T pParameter)
 Clean the image stored in an SPImage object taking parameters from an SPCleanParameter object.
SPINT32 __cdecl SPImageCleanDate (pSPIMAGE_T pImage, pSPRECT_T pRcl)
 Clean handwritten text in the image stored in an SPImage object.
SPINT32 __cdecl SPImageCleanFrames (pSPIMAGE_T pImage, SPDOUBLE dTrust)
 Clean frames in the image stored in an SPImage object.
SPINT32 __cdecl SPImageCleanLines (pSPIMAGE_T pImage)
 Clean lines in a black-and-white or a gray-scale image stored in an SPImage object.
SPINT32 __cdecl SPImageCleanSignature (pSPIMAGE_T pImage, pSPRECT_T pRcl)
 Clean the signature image stored in an SPImage object.
SPINT32 __cdecl SPImageClone (pSPIMAGE_T pImage, pSPIMAGE_T *ppClone)
 Create a copy of an SPImage object.
SPINT32 __cdecl SPImageContrast (pSPIMAGE_T pImage, SPDOUBLE fGray, SPDOUBLE fGreen, SPDOUBLE fBlue)
 Change the contrast of an image.
SPINT32 __cdecl SPImageCreate (pSPIMAGE_T *ppImage)
 Create an empty SPImage object.
SPINT32 __cdecl SPImageDrawImage (pSPIMAGE_T pImage, const char *pszXMLImage)
 Draw some images on the image stored in an SPImage object.
SPINT32 __cdecl SPImageDrawObject (pSPIMAGE_T pImage, const char *pszXMLObject)
 Draw some images, texts, and rectangles on the image stored in an SPImage object.
SPINT32 __cdecl SPImageDrawRect (pSPIMAGE_T pImage, const char *pszXMLRect)
 Draw some rectangles on the image stored in an SPImage object.
SPINT32 __cdecl SPImageDrawText (pSPIMAGE_T pImage, const char *pszXMLText)
 Draw some text on the image stored in an SPImage object.
SPINT32 __cdecl SPImageFree (pSPIMAGE_T *ppImage)
 Deallocate an SPImage object.
SPINT32 __cdecl SPImageGetBitsPerPixel (pSPIMAGE_T pImage, SPINT32 *piBitsPerPixel)
 Get the number of bits per pixel of the image stored in an SPImage object.
SPINT32 __cdecl SPImageGetComplexity (pSPIMAGE_T pImage, SPINT32 *piComplexity)
 Get the complexity of the static signature image stored in an SPImage object.
SPINT32 __cdecl SPImageGetDefaultBinarizeParams (pSPIMAGE_T pImage, SPINT32 *piMethod, SPINT32 *piThreshold)
 Get the default method and threshold for binarizing images.
SPINT32 __cdecl SPImageGetFrames (pSPIMAGE_T pImage, pSP_WEIGHTED_FRAME_T *ppFrames, SPINT32 *piFrameSize)
 Get all frames of the image stored in an SPImage object.
SPINT32 __cdecl SPImageGetImageData (pSPIMAGE_T pImage, SPUCHAR **ppbImageData, SPINT32 *piImageDataLen)
 Get the image data of an SPImage object.
SPINT32 __cdecl SPImageGetImageData2 (pSPIMAGE_T pImage, SPVPTR *ppbImageData, SPINT32 *piImageDataLen)
 Get the image data of an SPImage object.
SPINT32 __cdecl SPImageGetPixel (pSPIMAGE_T pImage, SPINT32 iX, SPINT32 iY, SPINT32 *piGray)
 Get the gray level of a pixel of the image stored in an SPImage object.
SPINT32 __cdecl SPImageGetResolution (pSPIMAGE_T pImage, SPINT32 *piResolution)
 Get the resolution of the image stored in an SPImage object.
SPINT32 __cdecl SPImageGetSignatureRegion (pSPIMAGE_T pImage, SPINT32 iFlags, pSPRECT_T rclRegion)
 Get the signature region within the image stored in an SPImage object.
SPINT32 __cdecl SPImageGetSize (pSPIMAGE_T pImage, SPINT32 *piWidth, SPINT32 *piHeight)
 Get the size of an image stored in an SPImage object.
SPINT32 __cdecl SPImageGetSplitPositions (pSPIMAGE_T pImage, SPINT32 **ppSplits, SPINT32 *piNumSplits)
 Get possible split positions of the image stored in an SPImage object.
SPINT32 __cdecl SPImageInvert (pSPIMAGE_T pImage, SPINT32 iFlags)
 Invert the image stored in an SPImage object.
SPINT32 __cdecl SPImageMaskImage (pSPIMAGE_T pImage, pSPIMAGE_T pMask, pSPRECT_T pRect, int iFlags)
 Mask the image of an SPImage object with the image of another SPImage object.
SPINT32 __cdecl SPImageMirror (pSPIMAGE_T pImage, SPINT32 iAxes)
 Mirror the image stored in an SPImage object.
SPINT32 __cdecl SPImageRegion (pSPIMAGE_T pImage, pSPRECT_T pRcl)
 Crop the image of an SPImage object.
SPINT32 __cdecl SPImageResize (pSPIMAGE_T pImage, SPINT32 iResolution, SPINT32 iAlgo)
 Resize the image.
SPINT32 __cdecl SPImageRotate (pSPIMAGE_T pImage, SPINT32 iAngle)
 Rotate the image stored in an SPImage object.
SPINT32 __cdecl SPImageSaveInBitmap (pSPIMAGE_T pImage, SPUCHAR **ppBitmap, SPINT32 *piBitmapLen, SPINT32 iFormat)
 Create an SPBitmap object from an SPImage object.
SPINT32 __cdecl SPImageSetBitmap (pSPIMAGE_T pImage, const SPUCHAR *pbBitmap, SPINT32 iBitmapLen, SPINT32 iPage)
 Copy a bitmap into an SPImage object.
SPINT32 __cdecl SPImageSetBitsPerPixel (pSPIMAGE_T pImage, SPINT32 iBitsPerPixel)
 Set the number of bits per pixel of the image stored in an SPImage object.
SPINT32 __cdecl SPImageSetBitsPerPixel2 (pSPIMAGE_T pImage, SPINT32 iBitsPerPixel, SPINT32 *piColorPalette)
 Set the number of bits per pixel of the image stored in an SPImage object.
SPINT32 __cdecl SPImageSetDefaultBinarizeParams (pSPIMAGE_T pImage, int iMethod, int iThreshold)
 Set the default binarization method and threshold.
SPINT32 __cdecl SPImageSetEmpty (pSPIMAGE_T pImage, SPINT32 iWidth, SPINT32 iHeight, SPINT32 iGray, int iResolution)
 Clear an image.
SPINT32 __cdecl SPImageSetEmpty2 (pSPIMAGE_T pImage, SPINT32 iWidth, SPINT32 iHeight, SPINT32 iGray, SPINT32 iResolution, SPINT32 iBitDepth)
 Clear an image.
SPINT32 __cdecl SPImageSetPixel (pSPIMAGE_T pImage, SPINT32 iX, SPINT32 iY, SPINT32 iGray)
 Set a pixel in the image stored in an SPImage object.
SPINT32 __cdecl SPImageSetReference (pSPIMAGE_T pImage, pSPREFERENCE_T pReference, int iIndex)
 Copy a signature image of an SPReference object into an SPImage object.
SPINT32 __cdecl SPImageSetResolution (pSPIMAGE_T pImage, int iRes)
 Overwrite the resolution of the image stored in an SPImage object.
SPINT32 __cdecl SPImageSetSignature (pSPIMAGE_T pImage, pSPSIGNATURE_T pSignature)
 Copy the image of an SPSignature object into an SPImage object.
SPINT32 __cdecl SPImageSetTellerImage (pSPIMAGE_T pImage, pSPTELLERIMAGE_T pTellerImage)
 Copy the image of an SPTellerImage object into an SPImage object.
SPINT32 __cdecl SPImageSetTemplate (pSPIMAGE_T pImage, pSPTEMPLATE_T pTemplate)
 Copy the image of an SPTemplate object into an SPImage object.


Define Documentation

#define SP_BINARIZE_ENABLE   "SPBinarizeEnable"
 

SPCleanParameter enable flag: binarize image.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:

See also:
SPImageBinarize, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_BINARIZE_METHOD   "SPBinarizeMethod"
 

SPCleanParameter integer property: select the binarization method.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_BINARIZE_ENABLE. See SPImageBinarize for the meaning of the value.

See also:
SPImageBinarize, SPImageCleanBatch, SPCleanParameterSetInt

#define SP_BINARIZE_THRESHOLD   "SPBinarizeThreshold"
 

SPCleanParameter integer property: threshold for binarization.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_BINARIZE_ENABLE. See SPImageBinarize for the meaning of the value.

See also:
SPImageBinarize, SPImageCleanBatch, SPCleanParameterSetInt

#define SP_CLEAN_DATE_ENABLE   "SPCleanDateEnable"
 

SPCleanParameter enable flag: clean handwritten text.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.

See also:
SPImageCleanDate, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_CLEAN_SIGNATURE_ENABLE   "SPCleanSignatureEnable"
 

SPCleanParameter enable flag: clean signature.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.

See also:
SPImageCleanSignature, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_CLEANFRAMES_ENABLE   "SPCleanFrameEnable"
 

SPCleanParameter enable flag: clean frames.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:

See also:
SPImageCleanFrames, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_CLEANFRAMES_TRUST   "SPCleanFrameTrust"
 

SPCleanParameter floating-point property: trust value for cleaning frames.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CLEANFRAMES_ENABLE. The value must be in 0.0 through 1.0. All frames whose weight is smaller than this value will be deleted.

See also:
SPImageCleanFrames, SPImageCleanBatch, SPCleanParameterSetDouble

#define SP_CLEANLINES_ENABLE   "SPCleanLineEnable"
 

SPCleanParameter enable flag: clean lines.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.

See also:
SPImageCleanLines, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_CUT_REGION_BOTTOM   "SPCutRegionBottom"
 

SPCleanParameter integer property: bottom coordinate of cut region.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.

See also:
SPImageRegion, SPImageCleanBatch, SPCleanParameterSetInt
Todo:
Define inclusive/exclusive.

#define SP_CUT_REGION_ENABLE   "SPCutRegionEnable"
 

SPCleanParameter enable flag: crop image to signature region.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following properties must be set:

See also:
SPImageRegion, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_CUT_REGION_LEFT   "SPCutRegionLeft"
 

SPCleanParameter integer property: left coordinate of cut region.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.

See also:
SPImageRegion, SPImageCleanBatch, SPCleanParameterSetInt
Todo:
Define inclusive/exclusive.

#define SP_CUT_REGION_RIGHT   "SPCutRegionRight"
 

SPCleanParameter integer property: right coordinate of cut region.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.

See also:
SPImageRegion, SPImageCleanBatch, SPCleanParameterSetInt
Todo:
Define inclusive/exclusive.

#define SP_CUT_REGION_TOP   "SPCutRegionTop"
 

SPCleanParameter integer property: top coordinate of cut region.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_CUT_REGION_ENABLE.

See also:
SPImageRegion, SPImageCleanBatch, SPCleanParameterSetInt
Todo:
Define inclusive/exclusive.

#define SP_CUT_SIGNATURE   1
 

Flag to crop the image to the signature region.

see Static Image cleaning

See also:
SPImageGetSignatureRegion

#define SP_CUT_SIGNATURE_REGION_ENABLE   "SPCutSignatureRegionEnable"
 

SPCleanParameter enable flag: crop the image to the signature region.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. No properties are required.

See also:
SPImageGetSignatureRegion, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_INVERT_AUTO   1
 

Flag to invert images automatically.

If this flag is given to SPImageInvert, the image will be inverted only if the majority of pixels is black.

See also:
SPImageInvert, SPImageCleanBatch

#define SP_INVERT_ENABLE   "SPInvertEnable"
 

SPCleanParameter enable flag: invert image.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:

See also:
SPImageInvert, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_INVERT_ENGINE   2
 

Flag to request usage of the static cleaning engine instead of SignWare's own algorithms.

If this flag is given to SPImageInvert, inverting will be delegated to the static engine. SP_PARAMERR will be returned if the image color depth is not supported by the static engine.

This flag is not supported under Linux.

See also:
SPImageInvert, SPImageCleanBatch

#define SP_INVERT_FLAGS   "SPInvertFlags"
 

SPCleanParameter integer property: invert flags.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_INVERT_ENABLE. The value is a bitwise combination of these flags:

See also:
SPImageInvert, SPImageCleanBatch, SPCleanParameterSetInt

#define SP_INVERT_NONE   4
 

Flag to cause the image not to be inverted.

If this flag is given to SPImageInvert, the image won't be inverted.

See also:
SPImageInvert, SPImageCleanBatch

#define SP_MASK_AND   2
 

Mask operation: AND.

The image will be ANDed with the mask.

See also:
SPImageMaskImage

#define SP_MASK_CPY   4
 

Mask operation: COPY.

The mask will be copied to the image.

See also:
SPImageMaskImage

#define SP_MASK_MAX   6
 

Mask operation: MAX.

For each pixel, the maximum pixel value of the image and the mask will be copied to the image.

See also:
SPImageMaskImage

#define SP_MASK_MIN   7
 

Mask operation: MIN.

For each pixel, the minimum pixel value of the image and the mask will be copied to the image.

See also:
SPImageMaskImage

#define SP_MASK_NOTCPY   5
 

Mask operation: NOT COPY.

The inverse of the mask will be copied to the image.

See also:
SPImageMaskImage

#define SP_MASK_OR   1
 

Mask operation: OR.

The image will be ORed with the mask.

See also:
SPImageMaskImage

#define SP_MASK_XOR   3
 

Mask operation: XOR.

The image will be XORed with the mask.

See also:
SPImageMaskImage

#define SP_MIRROR_AXES   "SPMirrorAxes"
 

SPCleanParameter integer property: mirror axes.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_MIRROR_ENABLE. The value is a bitwise combination of these values:

  • 1: mirror at the horizontal axis
  • 2: mirror at the vertical axis
See also:
SPImageMirror, SPImageCleanBatch, SPCleanParameterSetInt

#define SP_MIRROR_ENABLE   "SPMirrorEnable"
 

SPCleanParameter enable flag: mirror image.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:

See also:
SPImageMirror, SPImageCleanBatch, SPCleanParameterAppendEnableFlag

#define SP_ROTATE_ANGLE   "SPRotateAngle"
 

SPCleanParameter integer property: rotation angle.

This property is used by SPImageCleanBatch, see Static Image cleaning, and is required by SP_ROTATE_ENABLE. The value must be 90, 180, or 270.

See also:
SPImageRotate, SPImageCleanBatch, SPCleanParameterSetInt

#define SP_ROTATE_ENABLE   "SPRotateEnable"
 

SPCleanParameter enable flag: rotate image.

This enable flag is used by SPImageCleanBatch, see Static Image cleaning. The following property must be set:

See also:
SPImageRotate, SPImageCleanBatch, SPCleanParameterAppendEnableFlag


Function Documentation

SPINT32 __cdecl SPImageBinarize pSPIMAGE_T  pImage,
int  iMethod,
int  iThreshold
 

Binarize the image stored in an SPImage object.

This function turns a gray-scale image into a black-and-white image. Signature images are expected to have black strokes on white background, gray level 255 being white. This function will invert the image if the majority of pixels is black.

To compute the best binarization threshold, find the gray level with the most pixels in the image histogramm, then subtract 25. That is implemented in method 1 and with a threshold of 25.

This function does nothing if the image is a black-and-white image.

A typical Signature Histogram shows a peak in the region of the background level, and ideally shows a second (lower) peak at the signature gray level. The background is assumed white (gray level 255) while the signature should be black (0), the second lower peak should thus have a lower gray level than the absolute peak.
Method 1 sets the threshold below the background gray level (typically the absolute peak of the histogramm)
Method 2 sets the threshold above the minimum gray level distribution between background and signature gray levels.

Note:
The image might be inverted after calling this function.
Parameters:
pImage [i] pointer to an SPImage object.
iMethod [i] binarization method. Implemented methods include:
  • 0 set the threshold to iThreshold
  • 1 set the threshold to iThreshold gray levels below the histogram peak
  • 2 set the threshold to iThreshold gray levels above the minimum next below the histogram peak
iThreshold [i] binarization threshold.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64), Darwin (x86_64)

SPINT32 __cdecl SPImageBrightness pSPIMAGE_T  pImage,
SPDOUBLE  fGray,
SPDOUBLE  fGreen,
SPDOUBLE  fBlue
 

Change the brightness of an image.

The algorithm recalculates each Pixel (very generic):
pix[y][x] = pix[y][x] * fBrightness;

Parameters:
pImage [i] pointer to an SPImage object.
fGray [i] brightness factor for the gray channel of the image. If the image is a color image then fGray applies to the red channel
fGreen [i] brightness factor for the green channel of the image, if the image is a color image. pass -1.0 to apply fGray to the green channel
fBlue [i] brightness factor for the blue channel of the image, if the image is a color image. pass -1.0 to apply fGray to the blue channel
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageCleanBatch pSPIMAGE_T  pImage,
const pSPCLEANPARAMETER_T  pParameter
 

Clean the image stored in an SPImage object taking parameters from an SPCleanParameter object.

This is a compact call to perform any combination of cleaning, please see Static Image cleaning for details.

Parameters:
pImage [i] pointer to an SPImage object.
pParameter [i] pointer to an SPCleanParameter object.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)

SPINT32 __cdecl SPImageCleanDate pSPIMAGE_T  pImage,
pSPRECT_T  pRcl
 

Clean handwritten text in the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

This function cleans handwritten text such as a date etc. After cleaning, the image will be cropped to the signature region. The image will not be cropped if the cleaned image is empty.

If the image is a gray-scale image, this function will create a black-and-white image, clean the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.

Parameters:
pImage [i] pointer to an SPImage object.
pRcl [o] pointer to a variable that will be filled with the coordinates of a rectangle bounding the signature region within the image. You may pass NULL if you don't need the rectangle.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)
See also:
SPImageCleanFrames, SPImageCleanLines, SPImageCleanSignature

SPINT32 __cdecl SPImageCleanFrames pSPIMAGE_T  pImage,
SPDOUBLE  dTrust
 

Clean frames in the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

This function removes all frames that have a weight smaller than dTrust.

If the image is a gray-scale image, this function will create a black-and-white image, clean the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.

Parameters:
pImage [i] pointer to an SPImage object.
dTrust [i] minimum frame weight. This value must be in 0.0 through 1.0, 0.0 removes dirt, 1.0 removes all frames.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)
See also:
SPImageCleanDate, SPImageCleanLines, SPImageCleanSignature, SPImageGetFrames

SPINT32 __cdecl SPImageCleanLines pSPIMAGE_T  pImage  ) 
 

Clean lines in a black-and-white or a gray-scale image stored in an SPImage object.

For an overview of image cleaning see Static Image cleaning.

If the image is a gray-scale image, this function will create a black-and-white image, clean lines in the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.

Parameters:
pImage [i] pointer to an SPImage object.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)
See also:
SPImageCleanDate, SPImageCleanFrames, SPImageCleanSignature

SPINT32 __cdecl SPImageCleanSignature pSPIMAGE_T  pImage,
pSPRECT_T  pRcl
 

Clean the signature image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

This function cleans horizontal Lines, printed text, and dirt not being part of a signature. After cleaning, the image will be cropped to the signature region. The image will not be cropped if the cleaned image is empty.

If the image is a gray-scale image, this function will create a black-and-white image, clean the black-and-white image, and then mask the gray-scale image with the cleaned black-and-white image.

Parameters:
pImage [i] pointer to an SPImage object.
pRcl [o] pointer to a variable that will be filled with the coordinates of a rectangle bounding the signature region within the image. You may pass NULL if you don't need the rectangle.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)
See also:
SPImageCleanDate, SPImageCleanFrames, SPImageCleanLines

SPINT32 __cdecl SPImageClone pSPIMAGE_T  pImage,
pSPIMAGE_T ppClone
 

Create a copy of an SPImage object.

Parameters:
pImage [i] pointer to the SPImage object to be copied.
ppClone [io] pointer to a variable that will be filled with a pointer to a new SPImage object. The caller is responsible for deallocating the new object by calling SPImageFree.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageFree

SPINT32 __cdecl SPImageContrast pSPIMAGE_T  pImage,
SPDOUBLE  fGray,
SPDOUBLE  fGreen,
SPDOUBLE  fBlue
 

Change the contrast of an image.

The algorithm recalculates each Pixel (very generic):
pix[y][x] = (pix[y][x] - 127) * fBrightness + 127;

Parameters:
pImage [i] pointer to an SPImage object.
fGray [i] contrast factor for the gray channel of the image. If the image is a color image then fGray applies to the red channel
fGreen [i] contrast factor for the green channel of the image, if the image is a color image. pass -1.0 to apply fGray to the green channel
fBlue [i] contrast factor for the blue channel of the image, if the image is a color image. pass -1.0 to apply fGray to the blue channel
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageCreate pSPIMAGE_T ppImage  ) 
 

Create an empty SPImage object.

Parameters:
ppImage [o] pointer to a variable that will be filled with a pointer to a new SPImage object. The caller is responsible for deallocating the new object by calling SPImageFree.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageFree, SPImageSetBitmap, SPImageSetEmpty, SPImageSetReference, SPImageSetSignature, SPImageSetTellerImage, SPImageSetTemplate

SPINT32 __cdecl SPImageDrawImage pSPIMAGE_T  pImage,
const char *  pszXMLImage
 

Draw some images on the image stored in an SPImage object.

The bitdepth or this object will be preserved, e.g. the resulting image will be a gray image if you draw a colored image on a gray image.

Parameters:
pImage [i] pointer to an SPImage object.
pszXMLImage [i] XML description of the images and their position, see Description of parameters passed as XML strings. Use the SPSWImageFields element, the coordinate origin must be Image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM)
See also:
SPImageDrawObject, SPImageDrawRect, SPImageDrawText

SPINT32 __cdecl SPImageDrawObject pSPIMAGE_T  pImage,
const char *  pszXMLObject
 

Draw some images, texts, and rectangles on the image stored in an SPImage object.

Group assignments to calculate max font sizes are valid within the object elements defined in pszXMLObject. All prior group assignments are not considered any more.
The bitdepth or this object will be preserved, e.g. the resulting image will be a gray image if you draw colored objects on a gray image.
SPSWVirtualButton and SPSWVirtualButtonFields elements will be ignored.

Parameters:
pImage [i] pointer to an SPImage object.
pszXMLObject [i] XML description of the objects to be drawn, see Description of parameters passed as XML strings. The coordinate origin must be Image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM)
See also:
SPImageDrawImage, SPImageDrawRect, SPImageDrawText

SPINT32 __cdecl SPImageDrawRect pSPIMAGE_T  pImage,
const char *  pszXMLRect
 

Draw some rectangles on the image stored in an SPImage object.

Group assignments to calculate max font sizes are valid within the rectangle elements defined in pszXMLRect. All prior group assignments are not considered any more.
The bitdepth or this object will be preserved, e.g. the resulting image will be a gray image if you draw colored rectangles on a gray image.

Parameters:
pImage [i] pointer to an SPImage object.
pszXMLRect [i] XML description of the rectangles, positions, images and text, see Description of parameters passed as XML strings. Use the SPSWRectFields element, the coordinate origin must be Image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM)
See also:
SPImageDrawImage, SPImageDrawObject, SPImageDrawText

SPINT32 __cdecl SPImageDrawText pSPIMAGE_T  pImage,
const char *  pszXMLText
 

Draw some text on the image stored in an SPImage object.

Group assignments to calculate max font sizes are valid within the text elements defined in pszXMLText. All prior group assignments are not considered any more.
The bitdepth or this object will be preserved, e.g. the resulting image will be a gray image if you draw colored text on a gray image.

Parameters:
pImage [i] pointer to an SPImage object.
pszXMLText [i] XML description of the text, position and font, see Description of parameters passed as XML strings. Use the SPSWRectFields element, the coordinate origin must be Image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM)
See also:
SPImageDrawImage, SPImageDrawObject, SPImageDrawRect

SPINT32 __cdecl SPImageFree pSPIMAGE_T ppImage  ) 
 

Deallocate an SPImage object.

The SPImage object must have been created by SPImageCreate or SPImageClone.

Parameters:
ppImage [io] pointer to a variable containing a pointer to an SPImage object. The variable will be set to NULL if this function succeeds.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageClone, SPImageCreate

SPINT32 __cdecl SPImageGetBitsPerPixel pSPIMAGE_T  pImage,
SPINT32 piBitsPerPixel
 

Get the number of bits per pixel of the image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
piBitsPerPixel [o] pointer to a variable that will be filled with the number of bits per pixel (color resolution) of the SPImage object's image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetBitsPerPixel

SPINT32 __cdecl SPImageGetComplexity pSPIMAGE_T  pImage,
SPINT32 piComplexity
 

Get the complexity of the static signature image stored in an SPImage object.

The returned complexity is valid only if the SPImage object contains a clean signature image.

Parameters:
pImage [i] pointer to an SPImage object.
piComplexity [o] pointer to a variable that will be filled with the complexity of the signature image. The range of values is 0 (simple) through 100 (complex).
Returns:
SP_NOERR on success, else an error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)

SPINT32 __cdecl SPImageGetDefaultBinarizeParams pSPIMAGE_T  pImage,
SPINT32 piMethod,
SPINT32 piThreshold
 

Get the default method and threshold for binarizing images.

See Static Image cleaning for details. Initially, the default binarization method is 2, the default binarization threshold is 25.

Parameters:
pImage [i] pointer to an SPImage object.
piMethod [o] pointer to a variable that will be filled with the default binarization method.
piThreshold [o] pointer to a variable that will be filled with the default binarization threshold.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageBinarize, SPImageSetDefaultBinarizeParams

SPINT32 __cdecl SPImageGetFrames pSPIMAGE_T  pImage,
pSP_WEIGHTED_FRAME_T ppFrames,
SPINT32 piFrameSize
 

Get all frames of the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

This function extracts all frames and their weights from the image. Frame weights are floating-point values in the range 0.0 through 1.0. The value 0.0 identifies dirt, a value of 1.0 identifies frames that are part of a signature.

Parameters:
pImage [i] pointer to an SPImage object.
ppFrames [o] pointer to a variable that will be filled with a pointer to an array of SP_WEIGHTED_FRAME objects. The caller is responsible for deallocating the array by calling SPFreeMemory.
piFrameSize [o] pointer to a variable that will be filled with the number of frames, ie, the number of elements of the array returned via ppFrames.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)
See also:
SPFreeMemory, SPImageCleanFrames, SPImageGetSplitPositions, SPGuiDispSetWeightedFrames

SPINT32 __cdecl SPImageGetImageData pSPIMAGE_T  pImage,
SPUCHAR **  ppbImageData,
SPINT32 piImageDataLen
 

Get the image data of an SPImage object.

The image data always includes one byte per pixel (8 bits per pixel). The value 255 represents the color white, 0 represents the color black. The pixel at location x, y can be obtained this way:

 pbImageData[y * iWidth + x]
where iWidth is the width of the image (see SPImageGetSize).

Parameters:
pImage [i] pointer to an SPImage object.
ppbImageData [o] pointer to a variable that will be filled with a pointer to an array of bytes containing the image data. The caller is responsible for deallocating that array of bytes by calling SPBitmapFree.
piImageDataLen [o] pointer to a variable that will be filled with the length (in bytes) of the image data returned via ppbImageData.
Returns:
SP_NOERR on success, else error code:
Deprecated:
Function SPImageGetImageData2 supports color and gray-scale images, use SPImageGetImageData2 for future developements
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetPixel, SPImageGetImageData2
Example:
 // C-API
 unsigned char getPixel(pSPIMAGE_T pImage, int x, int y)
 {
      SPINT32 iW = 0, iH = 0;
      SPINT32 rc;
      rc = SPImageGetImageSize(pImage, &iW, &iH);
      // if(rc != SP_NOERR) ErrorHandler(rc);
      SPUCHAR *pImData = 0;
      SPINT32 iImLen = 0;
      rc = SPImageGetImageData(pImage, &pImData, &iImLen);
      // if(rc != SP_NOERR) ErrorHandler(rc);
      SPUCHAR pch = pImData[x + y * iW];
      SPBitmapFree(&pImData);
      return pch;
 }

SPINT32 __cdecl SPImageGetImageData2 pSPIMAGE_T  pImage,
SPVPTR ppbImageData,
SPINT32 piImageDataLen
 

Get the image data of an SPImage object.

The image data includes one byte per pixel (8 bits per pixel) or 4 bytes per pixel(24 bits per pixel or 32 bits per pixel). The value 255 (or 0xffffff for true color images) represents the color white, 0 represents the color black. The pixel at location x, y can be obtained this way:

 if(iBpP <=8)
     char agPix = ((char *)pbImageData)[(y * iWidth + x)]
 else
     int  aiPix = ((int  *)pbImageData)[(y * iWidth + x)]
where iWidth is the width of the image (see SPImageGetSize).

Parameters:
pImage [i] pointer to an SPImage object.
ppbImageData [o] pointer to a variable that will be filled with a pointer to an array of bytes or integer containing the image data. The caller is responsible for deallocating that array of bytes by calling SPBitmapFree.
piImageDataLen [o] pointer to a variable that will be filled with the length (in pixels, bytes for b/w and gray images, integers for color images) of the image data returned via ppbImageData.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetPixel
Example:
 // C-API
 unsigned int getPixel(pSPIMAGE_T pImage, int x, int y)
 {
      SPINT32 iW = 0, iH = 0;
      SPINT32 iBpP = 0;
      SPINT32 rc;
      rc = SPImageGetImageSize(pImage, &iW, &iH);
      // if(rc != SP_NOERR) ErrorHandler(rc);
      rc = SPImageGetBitsPerPixel(pImage, &BpP);
      // if(rc != SP_NOERR) ErrorHandler(rc);
      SPVPTR *pImData = 0;
      SPINT32 iImLen = 0;
      rc = SPImageGetImageData2(pImage, &pImData, &iImLen);
      // if(rc != SP_NOERR) ErrorHandler(rc);
      SPUINT32 pch = 0;
      if(iBpP > 8) {
          SPUINT32 *pIm = (SPUINT32 *) pImData;
          pch = pIm[x + y * iW];
      } else {
          SPUCHAR *pIm = (SPUCHAR *) pImData;
          pch = pIm[x + y * iW];
      }
      SPBitmapFree(&pImData);
      return pch;
 }

SPINT32 __cdecl SPImageGetPixel pSPIMAGE_T  pImage,
SPINT32  iX,
SPINT32  iY,
SPINT32 piGray
 

Get the gray level of a pixel of the image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
iX [i] zero-based X coordinate in the image [in pixel].
iY [i] zero-based Y coordinate in the image [in pixel].
piGray [i] pointer to a variable that will be filled with the gray or color level of the pixel at iX, iY. The value 255 represents the color white, 0 represents the color black.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetImageData, SPImageSetPixel

SPINT32 __cdecl SPImageGetResolution pSPIMAGE_T  pImage,
SPINT32 piResolution
 

Get the resolution of the image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
piResolution [o] pointer to a variable that will be filled with the resolution (in DPI) of the SPImage object's image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageGetSize, SPImageSetResolution, SPImageResize

SPINT32 __cdecl SPImageGetSignatureRegion pSPIMAGE_T  pImage,
SPINT32  iFlags,
pSPRECT_T  rclRegion
 

Get the signature region within the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

If the signature image is empty, the signature region will be set to a width and a height of 1.

Parameters:
pImage [i] pointer to an SPImage object.
iFlags [i] 0 or a bitwise combination of these values:
rclRegion [o] pointer to a variable that will be filled with the coordinates of a rectangle bounding the signature in the original image. You may pass NULL if you don't need the rectangle.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)

SPINT32 __cdecl SPImageGetSize pSPIMAGE_T  pImage,
SPINT32 piWidth,
SPINT32 piHeight
 

Get the size of an image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
piWidth [o] pointer to a variable that will be filled with the width of the SPImage object's image.
piHeight [o] pointer to a variable that will be filled with the height of the SPImage object's image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageGetResolution

SPINT32 __cdecl SPImageGetSplitPositions pSPIMAGE_T  pImage,
SPINT32 **  ppSplits,
SPINT32 piNumSplits
 

Get possible split positions of the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

This function analyzes the image to find the X coordinates of possible word boundaries.

Parameters:
pImage [i] pointer to an SPImage object.
ppSplits [o] pointer to a variable that will be filled with a pointer to an array of integers. The caller is responsible for deallocating the array by calling SPFreeMemory.
piNumSplits [o] pointer to a variable that will be filled with the number of split positions, ie, the number of elements of the array returned via ppSplits.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a)
See also:
SPImageGetFrames, SPGuiDispSetSplitLines

SPINT32 __cdecl SPImageInvert pSPIMAGE_T  pImage,
SPINT32  iFlags
 

Invert the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

Parameters:
pImage [i] pointer to an SPImage object.
iFlags [i] inversion flags, a combination of these values:
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageMaskImage pSPIMAGE_T  pImage,
pSPIMAGE_T  pMask,
pSPRECT_T  pRect,
int  iFlags
 

Mask the image of an SPImage object with the image of another SPImage object.

Parameters:
pImage [i] pointer to the SPImage object containing the image to be masked.
pMask [i] pointer to the SPImage object containing the image to be used as mask. Both the width and the height of the mask image must not exceed the width and the height, respectively, of the image pointed to by pImage.
pRect [i] the rectangle that will be masked in the image pointed to by pImage. The width and the height of the rectangle must equal the width and the height, respectively, of the mask image.
iFlags [i] the mask operation. These operations are supported:
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageMirror pSPIMAGE_T  pImage,
SPINT32  iAxes
 

Mirror the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

Parameters:
pImage [i] pointer to an SPImage object.
iAxes [i] mirror axes:
  • 1 horizontal
  • 2 vertical
  • 3 horizontal and vertical
Returns:
SP_NOERR on success, else error code:
See also:
SPImageRotate
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageRegion pSPIMAGE_T  pImage,
pSPRECT_T  pRcl
 

Crop the image of an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

Parameters:
pImage [i] pointer to an SPImage object.
pRcl [i] pointer to a rectangle defining the region in pixel relativ to the pImage object to be included in the resulting image. Left and top coordinates are included in the resulting image, right and buttom coordinates are excluded. the resulting image has a height = bottom - top and a width = right - left.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageResize pSPIMAGE_T  pImage,
SPINT32  iResolution,
SPINT32  iAlgo
 

Resize the image.

The image will be resized to match the new resolution iRes [dots per inch], iRes must be smaller than the current resolution of the image Algorithm 0 is optimized to resize signatures for comparing the signature image statically, see SPCompareStaticImage and SP_COMPARE_AUTOZOOM.

Parameters:
pImage [i] pointer to an SPImage object.
iResolution [i] new resolution of the image
iAlgo [i] currently not used, must be 0
Returns:
SP_NOERR on success, else error code
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetResolution, SPImageSetResolution

SPINT32 __cdecl SPImageRotate pSPIMAGE_T  pImage,
SPINT32  iAngle
 

Rotate the image stored in an SPImage object.

For an overview of image cleaning, see Static Image cleaning.

Since:
Version 3.0 rotates any angle.
Parameters:
pImage [i] pointer to an SPImage object.
iAngle [i] rotation angle in degrees, negative angles rotate clockwise.
Returns:
SP_NOERR on success, else error code:
See also:
SPImageMirror
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)

SPINT32 __cdecl SPImageSaveInBitmap pSPIMAGE_T  pImage,
SPUCHAR **  ppBitmap,
SPINT32 piBitmapLen,
SPINT32  iFormat
 

Create an SPBitmap object from an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
ppBitmap [o] pointer to a variable that will be filled with a pointer to an array of bytes containing the bitmap. The caller is responsible for deallocating that array of bytes by calling SPBitmapFree.
piBitmapLen [o] pointer to a variable that will be filled with the length (in bytes) of the bitmap returned via ppbBitmap.
iFormat [i] desired format of the bitmap: Flags that can be added with the `|' operator:
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPBitmapFree

SPINT32 __cdecl SPImageSetBitmap pSPIMAGE_T  pImage,
const SPUCHAR pbBitmap,
SPINT32  iBitmapLen,
SPINT32  iPage
 

Copy a bitmap into an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
pbBitmap [i] pointer to an array of bytes containing a bitmap image in a standard format such as BMP, TIFF etc.
iBitmapLen [i] size (in bytes) of the array of bytes pointed to by pbBitmap.
iPage [i] zero-based page number to select a subimage.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageSetReference, SPImageSetSignature, SPImageSetTellerImage, SPImageSetTemplate

SPINT32 __cdecl SPImageSetBitsPerPixel pSPIMAGE_T  pImage,
SPINT32  iBitsPerPixel
 

Set the number of bits per pixel of the image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
iBitsPerPixel [i] desired number of bits per pixel, range: 1, 8 or 24.
The image will be converted from color to gray scale if the number of bits per pixel is set to 8.
The image will be binarized (using the default binarize parameters) if the number of bits per pixel is set to 1.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetBitsPerPixel, SPImageSetEmpty2, SPImageSetDefaultBinarizeParams

SPINT32 __cdecl SPImageSetBitsPerPixel2 pSPIMAGE_T  pImage,
SPINT32  iBitsPerPixel,
SPINT32 piColorPalette
 

Set the number of bits per pixel of the image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
iBitsPerPixel [i] desired number of bits per pixel, range: 1, 8 or 24.
The image will be converted from color to gray scale if the number of bits per pixel is set to 8.
The image will be binarized (using the default binarize parameters) if the number of bits per pixel is set to 1.
piColorPalette [i] an array of 256 colors (in the format 0xrrggbb) that will be used to set the color for each pixel, when converting a BW or gray image to a color image.
ignored when creating a gray or BW image.
may be NULL
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetBitsPerPixel, SPImageSetEmpty2, SPImageSetDefaultBinarizeParams

SPINT32 __cdecl SPImageSetDefaultBinarizeParams pSPIMAGE_T  pImage,
int  iMethod,
int  iThreshold
 

Set the default binarization method and threshold.

The default binarization method and threshold are used to temporarily convert gray-scale images to black-and-white images. They affect these functions:

See Static Image cleaning for details. Initially, the default binarization method is 2, the default binarization threshold is 25.

Parameters:
pImage [i] pointer to an SPImage object.
iMethod [i] desired default binarization method.
iThreshold [i] desired default binarization threshold.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageBinarize, SPImageGetDefaultBinarizeParams

SPINT32 __cdecl SPImageSetEmpty pSPIMAGE_T  pImage,
SPINT32  iWidth,
SPINT32  iHeight,
SPINT32  iGray,
int  iResolution
 

Clear an image.

The image will be resized to the given width and height and all pixels will be set to the given gray scale.

The created image will be a gray-scale image with 8 bit per pixel. Call SPImageSetEmpty2 if you want to create a color or a black-and-white image.

Parameters:
pImage [i] pointer to an SPImage object.
iWidth [i] desired width of the image.
iHeight [i] desired height of the image.
iGray [i] desired gray level (0 through 255) of the image.
iResolution [i] desired resolution (in DPI) of the image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageSetEmpty2, SPImageSetBitsPerPixel

SPINT32 __cdecl SPImageSetEmpty2 pSPIMAGE_T  pImage,
SPINT32  iWidth,
SPINT32  iHeight,
SPINT32  iGray,
SPINT32  iResolution,
SPINT32  iBitDepth
 

Clear an image.

The image will be resized to the given width and height and all pixels will be set to the given gray scale.

The created image will be a color image with 24 bits per pixel, or a gray-scale image with 8 bit per pixel or a black-and-white image with 1 bit per pixel.

Parameters:
pImage [i] pointer to an SPImage object.
iWidth [i] desired width of the image.
iHeight [i] desired height of the image.
iGray [i] desired gray level (0 through 255) of the image.
iResolution [i] desired resolution (in DPI) of the image.
iBitDepth [i] desired bit depth of the image, may be 1, 8 or 24
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageSetBitsPerPixel

SPINT32 __cdecl SPImageSetPixel pSPIMAGE_T  pImage,
SPINT32  iX,
SPINT32  iY,
SPINT32  iGray
 

Set a pixel in the image stored in an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
iX [i] zero-based X coordinate in the image [in pixel].
iY [i] zero-based Y coordinate in the image [in pixel].
iGray [i] desired gray or color level of the pixel. Range for gray level images: 0 through 255, format for color images 0xrrggbb (r: red component, g: green component, b: blue component, each component has range 0 ... 255). The value 255 represents the color white, 0 represents the color black. For black-and-white images, pass either 0 or 255.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetPixel

SPINT32 __cdecl SPImageSetReference pSPIMAGE_T  pImage,
pSPREFERENCE_T  pReference,
int  iIndex
 

Copy a signature image of an SPReference object into an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
pReference [i] pointer to an SPReference object.
iIndex [i] zero-based index of a signature in the reference.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageSetBitmap, SPImageSetSignature, SPImageSetTellerImage, SPImageSetTemplate

SPINT32 __cdecl SPImageSetResolution pSPIMAGE_T  pImage,
int  iRes
 

Overwrite the resolution of the image stored in an SPImage object.

SPImageSetResolution overrules the resolution tag of the contained image, use SPImageResize() to change the resolution and to calculate the contents based on the new resolution

Parameters:
pImage [i] pointer to an SPImage object.
iRes [i] new resolution of the image.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetResolution, SPImageSetResize

SPINT32 __cdecl SPImageSetSignature pSPIMAGE_T  pImage,
pSPSIGNATURE_T  pSignature
 

Copy the image of an SPSignature object into an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
pSignature [i] pointer to an SPSignature object.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageSetBitmap, SPImageSetReference, SPImageSetTellerImage, SPImageSetTemplate

SPINT32 __cdecl SPImageSetTellerImage pSPIMAGE_T  pImage,
pSPTELLERIMAGE_T  pTellerImage
 

Copy the image of an SPTellerImage object into an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
pTellerImage [i] pointer to an SPTellerImage object.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM)
See also:
SPImageCreate, SPImageSetBitmap, SPImageSetReference, SPImageSetSignature, SPImageSetTemplate, SPTellerImageCreateFromImage

SPINT32 __cdecl SPImageSetTemplate pSPIMAGE_T  pImage,
pSPTEMPLATE_T  pTemplate
 

Copy the image of an SPTemplate object into an SPImage object.

Parameters:
pImage [i] pointer to an SPImage object.
pTemplate [i] pointer to an SPTemplate object.
Returns:
SP_NOERR on success, else error code:
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Linux (ARM), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate, SPImageSetBitmap, SPImageSetReference, SPImageSetSignature, SPImageSetTellerImage