SignDoc SDK (Java)  5.0.0
SignDocImage Class Reference

A bitmap image. More...

Inheritance diagram for SignDocImage:

Public Member Functions

 SignDocImage ()
 Constructor. More...
 
synchronized SignDocImage clone () throws SignDocException
 Clone this object. More...
 
synchronized void clear () throws SignDocException
 Remove the image from this object. More...
 
synchronized void setEmpty (int aWidth, int aHeight, int aBitsPerPixel, int aColor) throws SignDocException
 Replace this image with an empty one of the specified size. More...
 
synchronized void loadFromMemory (byte[] aBlob, int aIndex) throws SignDocException
 Load an image from a blob. More...
 
synchronized void loadFromFile (String aPath, int aIndex) throws SignDocException
 Load an image from a file. More...
 
synchronized int getBitsPerPixel () throws SignDocException
 Get the number of bits per pixel. More...
 
synchronized int getNumberOfComponents () throws SignDocException
 Get the number of components. More...
 
synchronized int getBitsPerComponent () throws SignDocException
 Get the number of bits per component. More...
 
synchronized int getWidth () throws SignDocException
 Get the width of the image. More...
 
synchronized int getHeight () throws SignDocException
 Get the height of the image. More...
 
synchronized int getResolutionX () throws SignDocException
 Get the horizontal resolution of the image. More...
 
synchronized int getResolutionY () throws SignDocException
 Get the vertical resolution of the image. More...
 
synchronized void setResolution (int aResolutionX, int aResolutionY) throws SignDocException
 Set the resolution of the image. More...
 
synchronized void resizeToResolution (int aResolutionX, int aResolutionY, String aFilter) throws SignDocException
 Resize the image. More...
 
synchronized void crop (int aX, int aY, int aWidth, int aHeight) throws SignDocException
 Crop the image. More...
 
synchronized void convertToBiLevel (SignDocImageParameters aImageParameters) throws SignDocException
 Convert the image to bi-level black and white. More...
 
synchronized void convertToGrayscale () throws SignDocException
 Convert the image to 8-bit grayscale. More...
 
synchronized void convertToTrueColor () throws SignDocException
 Convert the image to 24-bit RGB (8 bits per color channel). More...
 
synchronized void invert (boolean aAuto) throws SignDocException
 Invert the image. More...
 
synchronized void rotate (int aAngle, int aBackgroundColor) throws SignDocException
 Rotate the image. More...
 
synchronized void mirrorX () throws SignDocException
 Mirror along the vertical axis (flip horizontally). More...
 
synchronized void mirrorY () throws SignDocException
 Mirror along the horizontal axis (flip vertically). More...
 
synchronized int getPixelValue (int aX, int aY) throws SignDocException
 Get the value of a pixel. More...
 
synchronized void setPixelValue (int aX, int aY, int aValue) throws SignDocException
 Set the value of a pixel. More...
 
synchronized int getPixelRGB (int aX, int aY) throws SignDocException
 Get the RGB color of a pixel. More...
 
synchronized void setPixelRGB (int aX, int aY, int aColor) throws SignDocException
 Set the RGB color of a pixel. More...
 
synchronized void drawLine (int aX1, int aY1, int aX2, int aY2, double aStrokeWidth, int aColor) throws SignDocException
 Draw a line. More...
 
synchronized void drawRect (int aX1, int aY1, int aX2, int aY2, double aRadiusX, double aRadiusY, double aStrokeWidth, int aColor, boolean aFill) throws SignDocException
 Draw a rectangle (with both lines parallel to the axes). More...
 
synchronized void drawRect (SignDocImageRect aRect, double aRadiusX, double aRadiusY, double aStrokeWidth, int aColor, boolean aFill) throws SignDocException
 Draw a rectangle (with both lines parallel to the axes). More...
 
synchronized int[] getPalette () throws SignDocException
 Get the palette. More...
 
synchronized void setPaletteAt (int aIndex, int aColor) throws SignDocException
 Set a palette entry. More...
 
synchronized int[] getHistogram () throws SignDocException
 Compute a histogram. More...
 
synchronized int getComplexity (SignDocImageParameters aImageParameters) throws SignDocException
 Compute the complexity of a signature image. More...
 
synchronized SignDocMatchResult matchImage (SignDocImage aOther, SignDocMatchParameters aMatchParameters) throws SignDocException
 Match against a signature image. More...
 
synchronized SignDocMatchResult matchSignature (SignDocSignatureData aOther, SignDocMatchParameters aMatchParameters, SignDocImageParameters aImageParameters) throws SignDocException
 Match against a signature. More...
 
synchronized SignDocMatchResult matchReference (SignDocSignatureData aOther, SignDocMatchParameters aMatchParameters, SignDocImageParameters aImageParameters) throws SignDocException
 Match against a reference. More...
 
synchronized void clean (SignDocImageParameters aImageParameters, SignDocCleanParameters aCleanParameters) throws SignDocException
 Clean a signature image according to the provided parameters. More...
 
synchronized SignDocImageRect cleanSignature (SignDocImageParameters aImageParameters) throws SignDocException
 Clean a signature image. More...
 
synchronized void cleanLines (SignDocImageParameters aImageParameters) throws SignDocException
 Clean lines. More...
 
synchronized SignDocImageRect cleanDate (SignDocImageParameters aImageParameters) throws SignDocException
 Remove handwritten text from the signature image. More...
 
synchronized void cleanFrames (SignDocImageParameters aImageParameters, double aTrust) throws SignDocException
 Clean frames. More...
 
synchronized SignDocImageRect removeMargins (SignDocImageParameters aImageParameters) throws SignDocException
 Remove white margins. More...
 
synchronized SignDocWeightedFrame[] getFrames (SignDocImageParameters aImageParameters) throws SignDocException
 Get the frames of the image. More...
 
synchronized int[] getSplitPositions (SignDocImageParameters aImageParameters) throws SignDocException
 Get the vertical split positions of the image. More...
 
synchronized byte[] saveToMemory (SignDocImageParameters aParameters) throws SignDocException
 Save this image as a blob. More...
 
synchronized byte[] saveToMemory2 (String aFormat) throws SignDocException
 Save this image as a blob. More...
 
synchronized void saveToFile (String aPath, SignDocImageParameters aParameters) throws SignDocException
 Save this image to a file. More...
 
synchronized void saveToFile2 (String aPath, String aFormat) throws SignDocException
 Save this image to a file. More...
 
synchronized void close ()
 Destroy the underlying native object (for java.lang.AutoCloseable). More...
 

Static Public Member Functions

static int getNumberOfPagesFromMemory (byte[] aBlob) throws SignDocException
 Get the number of subimages (pages) in a blob. More...
 
static int getNumberOfPagesFromFile (String aPath) throws SignDocException
 Get the number of subimages (pages) in a file. More...
 

Protected Member Functions

void finalize () throws Throwable
 Finalize this object. More...
 

Detailed Description

A bitmap image.

This class supports images with 1 bit per pixel (bi-level, with RGB palette), 8 bits per pixel (indexed, with RGB palette), and 24 bits per pixel (RGB, 256 levels per color channel). RGB colors are specified as integers of the form 0x00rrggbb (rr is the red component, gg is the green component, bb is the blue component). All three components have values 0 (off) through 255 (on): 0x000000 is black, 0xffffff is white.

Some functions assume (for computing the intensity) that the color profile is sRGB.

Images that have transparent pixels are not supported.

The origin of the coordinate system is in the upper left corner, see Coordinate Systems.

See also
SignDocColor.getRGB()

Constructor & Destructor Documentation

Constructor.

This object won't contain an image, getWidth() and getHeight() will return 0.

See also
setEmpty(), setResolution()

Member Function Documentation

synchronized void clean ( SignDocImageParameters  aImageParameters,
SignDocCleanParameters  aCleanParameters 
) throws SignDocException

Clean a signature image according to the provided parameters.

This function performs multiple clean operations with a single call.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
[in]aCleanParametersActions and parameters, must not be null.
See also
cleanDate(), cleanFrames(), cleanLines(), cleanSignature(), convertToBiLevel(), convertToGrayscale(), convertToTrueColor(), crop(), getComplexity(), invert(), matchImage(), matchReference(), matchSignature(), mirrorX(), mirrorY(), rotate()
synchronized SignDocImageRect cleanDate ( SignDocImageParameters  aImageParameters) throws SignDocException

Remove handwritten text from the signature image.

Handwritten text (such as a date) will be removed from the signature image. Dirt, lines, and machine-printed text must be removed before calling this function.

After cleaning, the image will be cropped to the signature region.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.

If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
A rectangle bounding the signature region within the original image.
See also
clean(), cleanFrames(), cleanLines(), cleanSignature()
synchronized void cleanFrames ( SignDocImageParameters  aImageParameters,
double  aTrust 
) throws SignDocException

Clean frames.

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

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
[in]aTrustMinimum frame weight (0.0 through 1.0). 0.0 removes dirt, 1.0 removes all frames.
See also
clean(), cleanLines(), getFrames()
synchronized void cleanLines ( SignDocImageParameters  aImageParameters) throws SignDocException

Clean lines.

Horizontal and vertical lines will be removed.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then mask the original image with the cleaned bi-level image, making all parts white that are not considered part of the signature.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
See also
clean(), cleanDate(), cleanFrames(), cleanSignature()
synchronized SignDocImageRect cleanSignature ( SignDocImageParameters  aImageParameters) throws SignDocException

Clean a signature image.

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.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.

If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
A rectangle bounding the signature region within the original image.
See also
clean(), cleanDate(), cleanFrames(), cleanLines()
synchronized void clear ( ) throws SignDocException

Remove the image from this object.

See also
setEmpty()
synchronized SignDocImage clone ( ) throws SignDocException

Clone this object.

Returns
A clone of this object.
synchronized void close ( )

Destroy the underlying native object (for java.lang.AutoCloseable).

After calling this method, all methods but close() will throw SignDocUnexpectedErrorException.

synchronized void convertToBiLevel ( SignDocImageParameters  aImageParameters) throws SignDocException

Convert the image to bi-level black and white.

This function uses thresholding.

Unlike SignWare's SPImage.binarize(), this function never inverts the image.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
See also
convertToGrayscale(), convertToTrueColor()
synchronized void convertToGrayscale ( ) throws SignDocException

Convert the image to 8-bit grayscale.

See also
convertToBiLevel(), convertToTrueColor()
synchronized void convertToTrueColor ( ) throws SignDocException

Convert the image to 24-bit RGB (8 bits per color channel).

See also
convertToBiLevel(), convertToGrayscale()
synchronized void crop ( int  aX,
int  aY,
int  aWidth,
int  aHeight 
) throws SignDocException

Crop the image.

The the rectangle to be preserved must lie completely within the current image.

Parameters
[in]aXThe X coordinate of the upper left corner of the rectangle that will be preserved.
[in]aYThe Y coordinate of the upper left corner of the rectangle that will be preserved.
[in]aWidthThe width of the rectangle that will be preserved. Must be positive.
[in]aHeightThe height of the rectangle that will be preserved. Must be positive.
See also
getWidth(), getHeight(), getResolutionX(), getResolutionY(), removeMargins(), resizeToResolution(), rotate()
synchronized void drawLine ( int  aX1,
int  aY1,
int  aX2,
int  aY2,
double  aStrokeWidth,
int  aColor 
) throws SignDocException

Draw a line.

Parameters
[in]aX1X coordinate of the first endpoint of the line.
[in]aY1Y coordinate of the first endpoint of the line.
[in]aX2X coordinate of the second endpoint of the line.
[in]aY2Y coordinate of the second endpoint of the line.
[in]aStrokeWidthStroke width in pixels (need not be an integer, 0 for minimum width).
[in]aColorThe RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
See also
drawRect(), setPixelRGB()
synchronized void drawRect ( int  aX1,
int  aY1,
int  aX2,
int  aY2,
double  aRadiusX,
double  aRadiusY,
double  aStrokeWidth,
int  aColor,
boolean  aFill 
) throws SignDocException

Draw a rectangle (with both lines parallel to the axes).

If aRadiusX and aRadiusY are positive, a quarter ellipse will be drawn in each corner. If aRadiusX or aRadiusY is zero, a normal rectangle will be drawn.

Parameters
[in]aX1X coordinate of the first corner of the rectangle.
[in]aY1Y coordinate of the first corner of the rectangle.
[in]aX2X coordinate of the opposite corner of the rectangle.
[in]aY2Y coordinate of the opposite corner of the rectangle.
[in]aRadiusXHorizontal radius of quarter ellipse.
[in]aRadiusYVertical radius of quarter ellipse.
[in]aStrokeWidthStroke width in pixels (need not be an integer, 0 for minimum width).
[in]aColorThe RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
[in]aFilltrue to fill interior of rectangle, false to stroke border. For filling you might want do use 0 for aStrokeWidth as the stroked rectangle will be filled, that is, the outer dimensions of the rectangle don't depend on aFill.
See also
drawLine(), setPixelRGB()
synchronized void drawRect ( SignDocImageRect  aRect,
double  aRadiusX,
double  aRadiusY,
double  aStrokeWidth,
int  aColor,
boolean  aFill 
) throws SignDocException

Draw a rectangle (with both lines parallel to the axes).

If aRadiusX and aRadiusY are positive, a quarter ellipse will be drawn in each corner. If aRadiusX or aRadiusY is zero, a normal rectangle will be drawn.

Parameters
[in]aRectThe rectangle (does not need to be normalized).
[in]aRadiusXHorizontal radius of quarter ellipse.
[in]aRadiusYVertical radius of quarter ellipse.
[in]aStrokeWidthStroke width in pixels (need not be an integer, 0 for minimum width).
[in]aColorThe RGB color (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
[in]aFilltrue to fill interior of rectangle, false to stroke border. For filling you might want do use 0 for aStrokeWidth as the stroked rectangle will be filled, that is, the outer dimensions of the rectangle don't depend on aFill.
See also
drawLine(), setPixelRGB()
void finalize ( ) throws Throwable
protected

Finalize this object.

Do not call this method unless you know what you are doing.

synchronized int getBitsPerComponent ( ) throws SignDocException

Get the number of bits per component.

Returns
The number of bits per component: 0 (no image), 1 (bi-level), or 8.
See also
getBitsPerPixel(), getNumberOfComponents()
synchronized int getBitsPerPixel ( ) throws SignDocException

Get the number of bits per pixel.

This function returns the product of the return values of getNumberOfComponents() and getBitsPerComponent().

Returns
The number of bits per pixel: 0 (no image), 1 (bi-level), 8 (indexed), or 24 (RGB).
See also
getBitsPerComponent(), getHeight(), getNumberOfComponents(), getPalette(), getWidth()
synchronized int getComplexity ( SignDocImageParameters  aImageParameters) throws SignDocException

Compute the complexity of a signature image.

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

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The complexity of the signature in the range 0 (simplest) through 100 (most complex).
See also
clean()
synchronized SignDocWeightedFrame [] getFrames ( SignDocImageParameters  aImageParameters) throws SignDocException

Get the frames of the image.

This function computes the frames and their weights. Frame weights are floating-point numbers in the range 0.0 through 1.0: 0.0 identifies dirt, 1.0 identifies frames that are part of a signature.

If the image is not a bi-level image, this function will create a temporary bi-level image.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The frames.
See also
cleanFrames(), getSplitPositions()
synchronized int getHeight ( ) throws SignDocException

Get the height of the image.

Returns
The height of the image (in pixels) or 0 if there is no image.
See also
crop(), getWidth(), resizeToResolution()
synchronized int [] getHistogram ( ) throws SignDocException

Compute a histogram.

This function computes an array of integers the same size as the palette returned by getPalette(). Element i tells how many pixels use palette entry i.

Returns
The histogram as array of integers, empty if the image does not use a palette.
See also
getBitsPerPixel(), getPalette()
synchronized int getNumberOfComponents ( ) throws SignDocException

Get the number of components.

Returns
The number of components: 0 (no image), 1 (indexed), or 3 (RGB).
See also
getBitsPerComponent(), getBitsPerPixel()
static int getNumberOfPagesFromFile ( String  aPath) throws SignDocException
static

Get the number of subimages (pages) in a file.

This function opens the file, gets the number of subimages from the file, and closes the file.

Parameters
[in]aPathThe pathname of the file to be read.
Returns
The number of subimages (pages).
See also
getNumberOfPagesFromMemory(), loadFromFile()
static int getNumberOfPagesFromMemory ( byte[]  aBlob) throws SignDocException
static

Get the number of subimages (pages) in a blob.

Parameters
[in]aBlobA blob containing an image in BMP (Windows bitmap), TIFF, PNG, or GIF format.
Returns
The number of subimages (pages).
See also
loadFromMemory()
synchronized int [] getPalette ( ) throws SignDocException

Get the palette.

This function gets the palette of the image as an array of integers representing RGB colors (0x00rrggbb). The array will contain 2 elements if getBitsPerPixel() returns 1, 256 elements if getBitsPerPixel() returns 8, or 0 elements otherwise (the image does not use a palette).

Returns
The palette as array of integers.
See also
getBitsPerPixel(), getHistogram()
synchronized int getPixelRGB ( int  aX,
int  aY 
) throws SignDocException

Get the RGB color of a pixel.

Parameters
[in]aXX coordinate.
[in]aYY coordinate.
Returns
The RGB color of the pixel (0x00rrggbb).
See also
getPalette(), getPixelValue(), setPixeRGB()
synchronized int getPixelValue ( int  aX,
int  aY 
) throws SignDocException

Get the value of a pixel.

Parameters
[in]aXX coordinate.
[in]aYY coordinate.
Returns
The value of the pixel. If getBitsPerPixel() returns 1 or 8, this is the index into the palette, if getBitsPerPixel() returns 24, this is the RGB color (0x00rrggbb).
See also
getHistogram(), getPalette(), getPixelRGB(), setPixelValue()
synchronized int getResolutionX ( ) throws SignDocException

Get the horizontal resolution of the image.

Returns
The horizontal resolution of the image in DPI, 0 if there is no image.
See also
getResolutionY(), setResolution()
synchronized int getResolutionY ( ) throws SignDocException

Get the vertical resolution of the image.

Returns
The vertical resolution of the image in DPI, 0 if there is no image.
See also
getResolutionX(), setResolution()
synchronized int [] getSplitPositions ( SignDocImageParameters  aImageParameters) throws SignDocException

Get the vertical split positions of the image.

If the image is not a bi-level image, this function will create a temporary bi-level image.

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The X coordinates of the split positions, ordered by importance, most important first.
See also
getFrames()
synchronized int getWidth ( ) throws SignDocException

Get the width of the image.

Returns
The width of the image (in pixels) or 0 if there is no image..
See also
crop(), getHeight(), resizeToResolution()
synchronized void invert ( boolean  aAuto) throws SignDocException

Invert the image.

It is unspecified whether inverting is done by modifying the palette or by modifying the pixels.

Parameters
[in]aAutofalse to invert the image unconditionally, true to invert the image only if more than half the pixels have brightness (0 through 255) less than 128.
synchronized void loadFromFile ( String  aPath,
int  aIndex 
) throws SignDocException

Load an image from a file.

This function opens the file, loads the image from the file, and closes the file.

Parameters
[in]aPathThe pathname of the file to be read.
[in]aIndex0-based page number for selecting a subimage (page) of the source image.
See also
getNumberOfPagesFromFile(), saveToFile(), saveToFile2()
synchronized void loadFromMemory ( byte[]  aBlob,
int  aIndex 
) throws SignDocException

Load an image from a blob.

Parameters
[in]aBlobA blob containing an image in BMP (Windows bitmap), TIFF, PNG, or GIF format.
[in]aIndex0-based page number for selecting a subimage (page) of the source image.
See also
getNumberOfPagesFromMemory(), saveToMemory(), saveToMemory2()
synchronized SignDocMatchResult matchImage ( SignDocImage  aOther,
SignDocMatchParameters  aMatchParameters 
) throws SignDocException

Match against a signature image.

The license must allow comparing signatures.

Note
Only the static matching engine can be used.
Parameters
[in]aOtherThe signature image to match against.
[in]aMatchParametersParameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value.
Returns
The match result.
See also
clean(), matchSignature()
synchronized SignDocMatchResult matchReference ( SignDocSignatureData  aOther,
SignDocMatchParameters  aMatchParameters,
SignDocImageParameters  aImageParameters 
) throws SignDocException

Match against a reference.

This function throws an exception if aOther does not have type #SignDocSignatureData.t_reference.

The license must allow comparing signatures.

Parameters
[in]aOtherThe reference to match against.
[in]aMatchParametersParameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value.
[in]aImageParametersParameters controlling how signature are rendered as images for static matching. If this argument is null, all parameters will be set to their respective default value. String parameter "Format" will be ignored.
Returns
The match result.
See also
clean(), matchSignature(), SignDocSignatureData.matchReference()
synchronized SignDocMatchResult matchSignature ( SignDocSignatureData  aOther,
SignDocMatchParameters  aMatchParameters,
SignDocImageParameters  aImageParameters 
) throws SignDocException

Match against a signature.

If aOther is a reference, SignDocSignatureData.selectSignature() must be called once for @ aOther before this function.

This function throws an exception if aOther has type SignDocSignatureData.t_empty.

The license must allow comparing signatures.

Note
Only the static matching engine can be used.
Parameters
[in]aOtherThe signature or reference to match against. Only a single signature will be used.
[in]aMatchParametersParameters controlling how signature are matched. If this argument is null, all parameters will be set to their respective default value.
[in]aImageParametersParameters controlling how signature are rendered as images for static matching. If this argument is null, all parameters will be set to their respective default value. String parameter "Format" will be ignored.
Returns
The match result.
See also
clean(), matchImage(), matchReference(), SignDocSignatureData.matchSignature()
synchronized void mirrorX ( ) throws SignDocException

Mirror along the vertical axis (flip horizontally).

See also
mirrorY(), rotate()
synchronized void mirrorY ( ) throws SignDocException

Mirror along the horizontal axis (flip vertically).

See also
mirrorX(), rotate()
synchronized SignDocImageRect removeMargins ( SignDocImageParameters  aImageParameters) throws SignDocException

Remove white margins.

This function removes white margins ignoring single black pixels.

If the image is not a bi-level image, this function will create a bi-level image, clean the bi-level image, and then crop the original image to the cleaned bi-level image.

If the height or width would become zero, the image will be replaced by a single white pixel (if the image uses a palette, the brightest color in the palette will be used).

The width of the image must not exceed 1280 pixels, the height of the image must not exceed 960 pixels.

See Cleaning signature images for information about cleaning.

Parameters
[in]aImageParametersParameters controlling how images are converted to bi-level black and white. If this argument is null, all parameters will be set to their respective default value.
Returns
The rectangle occopied by the new image within the original image.
See also
clean(), cleanSignature(), crop()
synchronized void resizeToResolution ( int  aResolutionX,
int  aResolutionY,
String  aFilter 
) throws SignDocException

Resize the image.

This function may change the pixel format.

Parameters
[in]aResolutionXThe new horizontal resolution of the image in DPI. Must be positive.
[in]aResolutionYThe new vertical resolution of the image in DPI. Must be positive.
[in]aFilterThe resampling filter, an empty string for the default filter. The following filters are available (case-sensitive):
  • "box": box scaling (fastest)
  • "bilinear": bilinear filter
  • "b-spline": B-Spline filter
  • "bicubic": Bicubic filter (default)
  • "catmull-rom": Catmull-Rom filter
  • "lanczos": Lanczos filter
See also
crop(), getWidth(), getHeight(), getResolutionX(), getResolutionY(), rotate(), setResolution()
synchronized void rotate ( int  aAngle,
int  aBackgroundColor 
) throws SignDocException

Rotate the image.

If the image has 1 bit per pixel, aAngle must be an integer multiple of 90.

The resolution of the image is adjusted only if aAngle is an even integer multiple of 90.

This function throws an exception if aAngle is not an integer multiple of 90, the image uses a palette, and aBackgroundColor is not a color in the palette.

Parameters
[in]aAngleRotation angle (degrees), positive for counter-clockwise, negative for clockwise.
[in]aBackgroundColorThe RGB color (0x00rrggbb) to be used for filling pixels that are not mapped from the source image. This value is used only if aAngle is not an integer multiple of 90.
See also
crop(), getPalette(), mirrorX(), mirrorY(), resizeToResolution()
synchronized void saveToFile ( String  aPath,
SignDocImageParameters  aParameters 
) throws SignDocException

Save this image to a file.

The following parameters of aParameters are used:

  • BitsPerComponent (integer)
  • BlackIsZero (boolean)
  • BottomUp (boolean)
  • Components (integer)
  • Compression (string)
  • Format (string)
  • OverrideResolution (integer)
  • Padding (integer)
  • PixelFormat (string)
  • WhiteIsZero (boolean)
Parameters
[in]aPathThe pathname of the file to be created or overwritten.
[in]aParametersParameters controlling the format of the file.
See also
loadFromFile(), saveToFile2(), saveToMemory()
synchronized void saveToFile2 ( String  aPath,
String  aFormat 
) throws SignDocException

Save this image to a file.

This is a simplified version of saveToFile().

Parameters
[in]aPathThe pathname of the file to be created or overwritten.
[in]aFormatThe format to be used for the image file:
  • "auto": derive the format from the suffix of aPath
  • "bmp": Windows bitmap
  • "gif": GIF
  • "png": PNG
  • "tiff": TIFF; CCITT Group 4 compression is used for images with 1 bit per pixel, LZW compression is used otherwise.
See also
loadFromFile(), saveToFile(), saveToMemory2()
synchronized byte [] saveToMemory ( SignDocImageParameters  aParameters) throws SignDocException

Save this image as a blob.

The following parameters of aParameters are used:

  • BitsPerComponent (integer)
  • BlackIsZero (boolean)
  • BottomUp (boolean)
  • Components (integer)
  • Compression (string)
  • Format (string)
  • OverrideResolution (integer)
  • Padding (integer)
  • PixelFormat (string)
  • WhiteIsZero (boolean)
Parameters
[in]aParametersParameters controlling the format of the blob.
Returns
The image as a blob.
See also
loadFromMemory(), saveToFile(), saveToMemory2()
synchronized byte [] saveToMemory2 ( String  aFormat) throws SignDocException

Save this image as a blob.

This is a simplified version of saveToMemory().

Parameters
[in]aFormatThe format to be used for the image blob:
  • "bmp": Windows bitmap
  • "gif": GIF
  • "png": PNG
  • "tiff": TIFF; CCITT Group 4 compression is used for images with 1 bit per pixel, LZW compression is used otherwise.
Returns
The image as a blob.
See also
loadFromMemory(), saveToFile2(), saveToMemory()
synchronized void setEmpty ( int  aWidth,
int  aHeight,
int  aBitsPerPixel,
int  aColor 
) throws SignDocException

Replace this image with an empty one of the specified size.

The resolution will be set to 72 dots per inch.

Parameters
[in]aWidthThe width of the image (in pixels). Must be positive.
[in]aHeightThe height of the image (in pixels). Must be positive.
[in]aBitsPerPixelNumber of bits per pixel: 1 (bi-level black and white), 8 (grayscale), or 24 (RGB).
[in]aColorAll pixels will be set to this color. If aBitsPerPixel is 24, this is an RGB color (0x00rrggbb), otherwise this is an index into the palette (0 is black).
See also
clear(), setPaletteAt(), setResolution()
synchronized void setPaletteAt ( int  aIndex,
int  aColor 
) throws SignDocException

Set a palette entry.

Parameters
[in]aIndexThe 0-based index of the palette entry (0 through 1 if getBitsPerPixel() returns 1, 0 through 255 if getBitsPerPixel() returns 8).
[in]aColorThe new color for the palette entry (0x00rrggbb).
See also
getBitsPerPixel(), getPalette()
synchronized void setPixelRGB ( int  aX,
int  aY,
int  aColor 
) throws SignDocException

Set the RGB color of a pixel.

Parameters
[in]aXX coordinate.
[in]aYY coordinate.
[in]aColorThe new RGB color of the pixel (0x00rrggbb). This function fails if the color does not exist in the palette of an indexed image.
See also
drawRect(), drawLine(), getPalette(), getPixelRGB(), setPixelValue()
synchronized void setPixelValue ( int  aX,
int  aY,
int  aValue 
) throws SignDocException

Set the value of a pixel.

Parameters
[in]aXX coordinate.
[in]aYY coordinate.
[in]aValueThe new value of the pixel. If getBitsPerPixel() returns 1 or 8, this is the index into the palette, if getBitsPerPixel() returns 24, this is the RGB color (0x00rrggbb). For bi-level images, any value greater than 1 has the same effect as 1.
See also
getPalette(), getPixelValue(), setPixelRGB()
synchronized void setResolution ( int  aResolutionX,
int  aResolutionY 
) throws SignDocException

Set the resolution of the image.

This function does not modify the pixels of the image. Use resizeToResolution() to change the size of the image.

Parameters
[in]aResolutionXThe new horizontal resolution of the image in DPI. Must be positive.
[in]aResolutionYThe new vertical resolution of the image in DPI. Must be positive.
See also
getResolutionX(), getResolutionY(), resizeToResolution()

The documentation for this class was generated from the following file: