SignDoc SDK (Java)  5.0.0
SignDocImageParameters Class Reference

Parameters for saving images, converting images to bi-level images, and rendering biometric signatures as images. More...

Inheritance diagram for SignDocImageParameters:

Public Member Functions

 SignDocImageParameters ()
 Constructor. More...
 
synchronized SignDocImageParameters clone () throws SignDocException
 Clone this object. More...
 
synchronized void clear () throws SignDocException
 Unset all parameters. More...
 
synchronized void setBoolean (String aName, boolean aValue) throws SignDocException
 Set a boolean parameter. More...
 
synchronized void setInteger (String aName, int aValue) throws SignDocException
 Set an integer parameter. More...
 
synchronized void setNumber (String aName, double aValue) throws SignDocException
 Set a floating-point number parameter. More...
 
synchronized void setString (String aName, String aValue) throws SignDocException
 Set a string parameter. More...
 
synchronized void setColor (String aName, SignDocColor aValue) throws SignDocException
 Set a color parameter. More...
 
synchronized Boolean getBoolean (String aName) throws SignDocException
 Get the value of a boolean parameter. More...
 
synchronized Integer getInteger (String aName) throws SignDocException
 Get the value of an integer parameter. More...
 
synchronized Double getNumber (String aName) throws SignDocException
 Get the value of a floating-point number parameter. More...
 
synchronized String getString (String aName) throws SignDocException
 Get the value of a string parameter. More...
 
synchronized SignDocColor getColor (String aName) throws SignDocException
 Get the value of a color parameter. More...
 
synchronized String getErrorMessage () throws SignDocException
 Get an error message for the last function call. More...
 
synchronized void close ()
 Destroy the underlying native object (for java.lang.AutoCloseable). More...
 

Static Public Member Functions

static int getType (String aName) throws SignDocException
 Get the type of a parameter. More...
 

Static Public Attributes

static final int t_undefined = 0
 Return value of getType(): The specified parameter is not defined. More...
 
static final int t_boolean = 1
 Return value of getType(): Boolean. More...
 
static final int t_integer = 2
 Return value of getType(): Integer. More...
 
static final int t_number = 3
 Return value of getType(): Floating-point number. More...
 
static final int t_string = 4
 Return value of getType(): String. More...
 
static final int t_color = 5
 Return value of getType(): Color. More...
 

Protected Member Functions

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

Detailed Description

Parameters for saving images, converting images to bi-level images, and rendering biometric signatures as images.

In the descriptions of a parameter, the functions that make use of that parameter are indicated by these letters in square brackets:

Parameters for selecting the image format:

Parameters for conversion to bi-level black and white:

Parameters for configuring the size of the image:

Parameters for tuning the rendering of signatures:

Parameters for adding a cross:

The "raw" format stores the pixels only, without any header or other information. Therefore, the aOutput parameter (of type SignDocRenderOutput) of SignDocSignatureData.renderAsImage() is mandatory. The following paragraphs describe the available raw formats.

If integer parameter "BitsPerComponent" is 1, integer parameter "Components" must be 1 and 8 pixels will be stored per byte. The left-most pixel is stored in the most significant bit (0x80). Padding bits are added such that each row occupies an integral number of bytes. The interpretation of the values of the bits depends on boolean parameters "BlackIsZero" and "WhiteIsZero".

If integer parameter "BitsPerComponent" is 8 and integer parameter "Components" is 1, one byte per pixel (usually the palette index) will be stored.

If integer parameter "BitsPerComponent" is 8 and integer parameter "Components" is 3, three bytes per pixel will be stored: red, green, and blue. The value 0 is used for off, the value 0xff is used for on. The pixel format can be changed by setting string parameter "PixelFormat".

Depending on boolean parameter "BottomUp", the raw image begins with the left-most pixel of the top row (false) or with the left-most pixel of the bottom row (true).

Constructor & Destructor Documentation

Constructor.

No parameters will be set.

Member Function Documentation

synchronized void clear ( ) throws SignDocException

Unset all parameters.

synchronized SignDocImageParameters 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.

void finalize ( ) throws Throwable
protected

Finalize this object.

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

synchronized Boolean getBoolean ( String  aName) throws SignDocException

Get the value of a boolean parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The value of the parameter or null if the parameter is not set or is not a boolean parameter.
See also
setBoolean()
synchronized SignDocColor getColor ( String  aName) throws SignDocException

Get the value of a color parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The value of the parameter or null if the parameter is not set or is not a color parameter.
See also
setColor()
synchronized String getErrorMessage ( ) throws SignDocException

Get an error message for the last function call.

Returns
A string describing the reason for the failure of the last function call. The string is empty if the last call succeeded.
synchronized Integer getInteger ( String  aName) throws SignDocException

Get the value of an integer parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The value of the parameter or null if the parameter is not set or is not an integer parameter.
See also
setInteger()
synchronized Double getNumber ( String  aName) throws SignDocException

Get the value of a floating-point number parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The value of the parameter or null if the parameter is not set or is not a floating-point number parameter.
See also
setNumber()
synchronized String getString ( String  aName) throws SignDocException

Get the value of a string parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The value of the parameter or null if the parameter is not set or is not a string parameter.
See also
setString()
static int getType ( String  aName) throws SignDocException
static

Get the type of a parameter.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The type of the parameter: t_undefined, t_boolean, t_integer, t_number, t_string, or t_color.
synchronized void setBoolean ( String  aName,
boolean  aValue 
) throws SignDocException

Set a boolean parameter.

The following boolean parameters are available:

  • AddCross [R]: true to draw a cross over the signature. The default value is false. See also color parameter "CrossColor" and floating-point number parameters "CrossWidth", "CrossWidthPixels", and "CrossWidthSource". If this parameter is true and the value of color parameter "CrossColor" equals neither the value of color parameter "BackgroundColor" nor the value of color parameter "SignatureColor", then integer parameter "Components" must be 3.
  • BlackIsZero [RS]: true to save black pixels as bits with value 0. This parameter is used for format "raw" with 1 bit per pixel only and must not be set for other formats. If neither "BlackIsZero" nor "WhiteIsZero" is true, the bits will be saved unchanged and their interpretation will depend on the palette. "Black" means the darker one of the two colors. If both colors have the same intensity or both "BlackIsZero" and "WhiteIsZero" are true, an error will be reported.
  • BottomUp [RS]: true to store the image bottom-up, false to store the image top-down. This parameter is used for format "raw" only and is ignored for other formats. The default value is false.
  • WhiteIsZero [RS]: true to save white pixels as bits with value 0. This parameter is used for format "raw" with 1 bit per pixel only and must not be set for other formats. If neither "BlackIsZero" nor "WhiteIsZero" is true, the bits will be saved unchanged and their interpretation will depend on the palette. "White" means the brighter one of the two colors. If both colors have the same intensity or both "BlackIsZero" and "WhiteIsZero" are true, an error will be reported.

This function throws SignDocUnknownParameterException if aName is not the name of a boolean parameter.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
See also
getBoolean(), setColor(), setInteger(), setNumber(), setString()
synchronized void setColor ( String  aName,
SignDocColor  aValue 
) throws SignDocException

Set a color parameter.

The following color parameters are available:

  • BackgroundColor [R]: the background color. Default value: white.
  • CrossColor [R]: the color of the cross (see boolean parameter "AddCross"). Default value: black.
  • SignatureColor [R]: the signature color. Default value: black. If the darkness of the signature is configured to vary (see string parameter "ColorMode"), the signature color actually being used will vary between the background color configured by color parameter "BackgroundColor" and the signature color configured by color parameter "SignatureColor".

This function throws SignDocUnknownParameterException if aName is not the name of a color parameter, SignDocInvalidValueException if aValue is invalid.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
See also
getColor(), setBoolean(), setInteger(), setNumber(), setString()
synchronized void setInteger ( String  aName,
int  aValue 
) throws SignDocException

Set an integer parameter.

The following integer parameters are available:

  • BitsPerComponent [RS] (1 or 8): number of bits per color component. The default value for rendering signatures is 8, the default value for saving images is taken from the image. See also integer parameter "Components".
  • Components [RS] (1 or 3): number of color components:
    • 1: indexed with either 2 or 256 palette entries
    • 3: RGB (integer parameter "BitsPerComponent" must be set to 8)
    The default value for rendering signatures is 1, the default value for saving images is taken from the image. See also integer parameter "BitsPerComponent".
  • ExactHeight [R] (15 or greater): the desired height of the resulting image. The size of the signature will be reduced to make it fit the specified size and margins will be added as needed. If this parameter is set, all other parameters (except for integer parameter "ExactWidth") controlling image size will be ignored. Settings this parameter will slow down rendering considerably.
  • ExactWidth [R] (15 or greater): the desired width of the resulting image. The size of the signature will be reduced to make it fit the specified size and margins will be added as needed. If this parameter is set, all other parameters (except for integer parameter "ExactHeight") controlling image size will be ignored. Settings this parameter will slow down rendering considerably.
  • LimitResolution [MR]: Limit the horizontal resolution of the image to the value of this parameter. The limit for the vertical resolution is computed from the value of this parameter by dividing by the value of floating-point number parameter "ResolutionRatio". If zero, do not limit the resolution. The default value is zero. See also floating-point number parameter "LimitResolutionRelative".
  • OverrideResolution [RS]: set the horizontal resolution of the resulting image. The vertical resolution is computed from the horizontal resolution by dividing by the value of floating-point number parameter "ResolutionRatio". The value of this parameter does not affect the computation of the scaling factor. This parameter is ignored if string parameter "Format" has value "raw".
  • Padding [RS] (0, 1, 2, or 4): row padding in bytes for raw format. No padding will be added if this parameter is 0. Otherwise, each row will be padded at the end with bits or bytes having value 0 such that the length of the row is an integer multiple of the value of this parameter. The default value is 0 (no padding). This parameter affects format "raw" only and is ignored for other formats.
  • Resolution [R]: Scale the coordinates such that the image will have the horizontal resolution (in DPI) set by this parameter. The vertical resolution is computed from the horizontal resolution by dividing by the value of floating-point number parameter "ResolutionRatio". See also integer parameter "OverrideResolution".
  • Threshold [T]: (1 through 255): Threshold for conversion to bi-level black and white. The default value is 128. Pixels with an intensity (0 through 255) of this value or above will be mapped to white, other pixels will be mapped to black.

This function throws SignDocUnknownParameterException if aName is not the name of an integer parameter, SignDocInvalidValueException if aValue is invalid.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
See also
getInteger(), setBoolean(), setColor(), setNumber(), setString()
synchronized void setNumber ( String  aName,
double  aValue 
) throws SignDocException

Set a floating-point number parameter.

The following floating-point number parameters are available:

  • CrossWidth [R]: Horizontal pen width for the cross enabled by boolean parameter "AddCross" in millimeters. The pen width set by this parameter depends on the horizontal resolution of the image. The vertical pen width is computed from the horizontal pen width by dividing by the value of floating-point number parameter "ResolutionRatio". "CrossWidth", "CrossWidthPixels", and "CrossWidthSource" are mutually exclusive. If none of these is set, a default value of 0.5 will be used for "CrossWidth".
  • CrossWidthPixels [R]: Horizontal pen width for the cross enabled by boolean parameter "AddCross" in pixels (that is, in image coordinates). The pen width set by this parameter is not affected by scaling. The vertical pen width is computed from the horizontal pen width by dividing by the value of floating-point number parameter "ResolutionRatio". "CrossWidth", "CrossWidthPixels", and "CrossWidthSource" are mutually exclusive. If none of these is set, a default value of 0.5 will be used for "CrossWidth."
  • CrossWidthSource [R]: Horizontal pen width for the cross enabled by boolean parameter "AddCross" in capture device units. The pen width set by this parameter will be scaled along with the samples of the signature. The vertical pen width is computed from the horizontal pen width by dividing by the value of floating-point number parameter "ResolutionRatio". "CrossWidth", "CrossWidthPixels", and "CrossWidthSource" are mutually exclusive. If none of these is set, a default value of 0.5 will be used for "CrossWidth."
  • LimitResolutionRelative [MR]: If positive, limit the horizontal resolution of the image to the resolution of the capture device multiplied by the value of this parameter. The limit for the vertical resolution is computed from the value of this parameter by dividing by the value of floating-point number parameter "ResolutionRatio". If zero, do not limit the resolution. The default value is 1.0, that is, the size of the signature in the rendered image won't exceed the size of the captured signature. See also integer parameter "LimitResolution". Example: If the resolution is not limited (by setting this parameter to zero) and integer parameter "ExactWidth" is 500 and the signature contains a single sample, you will get a filled circle the diameter of which is 500 pixels.
  • PenWidth [MR]: Horizontal pen width for the signature in millimeters. The pen width set by this parameter depends on the horizontal resolution of the image. The vertical pen width is computed from the horizontal pen width by dividing by the value of floating-point number parameter "ResolutionRatio". "PenWidth", "PenWidthPixels", and "PenWidthSource" are mutually exclusive. If none of these is set, a default value of 0.5 will be used for "PenWidth."
  • PenWidthPixels [MR]: Horizontal pen width for the signature in pixels (that is, in image coordinates). The pen width set by this parameter is not affected by scaling. The vertical pen width is computed from the horizontal pen width by dividing by the value of floating-point number parameter "ResolutionRatio". "PenWidth", "PenWidthPixels", and "PenWidthSource" are mutually exclusive. If none of these is set, a default value of 0.5 will be used for "PenWidth."
  • PenWidthSource [MR]: Horizontal pen width for the signature in capture device units. The pen width set by this parameter will be scaled along with the samples of the signature. The vertical pen width is computed from the horizontal pen width by dividing by the value of floating-point number parameter "ResolutionRatio". "PenWidth", "PenWidthPixels", and "PenWidthSource" are mutually exclusive. If none of these is set, a default value of 0.5 will be used for "PenWidth."
  • ResolutionRatio [R]: Vertical measurements (such as image resolution) are computed from horizontal measurements by dividing the horizontal value by the value of this parameter. The default value is 1.0. The following integer parameters are affected by this parameter: "LimitResolution", "OverrideResolution" and "Resolution". The following floating-point number parameters are affected by this parameter: "CrossWidth", "CrossWidthPixels", "CrossWidthSource", "LimitResolutionRelative", "PenWidth", "PenWidthPixels", "PenWidthSource", and "Scale".
  • Scale [MR]: Convert from capture device coordinates to image coordinates by multiplying with this value. This parameter specifies the horizontal conversion factor, the vertical conversion factor is computed by dividing the value of this parameter by the value of floating-point number parameter "ResolutionRatio". This parameter is ignored if integer parameter "ExactWidth" or "ExactHeight" is set; otherwise, the default value is 1.0.

This function throws SignDocUnknownParameterException if aName is not the name of a floating-point number parameter, SignDocInvalidValueException if aValue is invalid.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
See also
getNumber(), setBoolean(), setColor(), setInteger(), setString()
synchronized void setString ( String  aName,
String  aValue 
) throws SignDocException

Set a string parameter.

The following string parameters are available:

  • ColorMode [R]: how to compute the actual color of the signature:
    • "anti-aliasing": Color will be used for anti-aliasing. This also affects drawing of the cross enabled by boolean parameter "AddCross".
    • "constant": always use the color configured by color parameter "SignatureColor".
    • "pressure": vary the color according to the pressure (force) of the samples.
    The default value is "constant".
  • Compression for TIFF format [RS]:
    • "none": not compressed
    • "ccitt4": CCITT Group 4
    • "lzw": LZW
    • "rle": RLE
    • "zip": ZIP
    The default value is "none". This parameter is used only if string parameter "Format" has value "tiff".
  • Engine [MR]: rendering engine to be used:
    • "cubic": a rendering engine using cubic splines; swapped samples (and other variants of out-of-order samples) can cause funny results
    • "linear": a rendering engine that connects samples with straight lines
    The default value is "cubic".
  • Format [RS]: the image format to be used for the image blob:
    • "auto": derive the format from the suffix of the pathname (not possible when saving to a blob)
    • "bmp": Windows bitmap
    • "gif": GIF
    • "png": PNG
    • "raw: raw pixels, see introduction for details - "tiff": TIFF
    This parameter is mandatory for SignDocImage.saveToFile(), SignDocImage.saveToMemory(), and SignDocSignatureData.renderAsImage(). It is ignored for other functions.
  • PixelFormat [RS]: The pixel format for writing raw pixels. For each character in the string, one byte per pixel will be written, in the order given. The image is created with the number of components specified by integer parameter "Components" (when rendering a signature) or converted to the number of components specified by that parameter (when saving an image). Then, each pixel is written according to the value of string parameter "PixelFormat". That is, the number of characters in that value need not match the value of integer parameter "Components". For instance, you can pad RGB pixels to 4 bytes by using pixel format "RGBP". The following characters are available:
    • B blue
    • G green
    • I intensity (all channels have equal weight)
    • P padding (always 0)
    • R red
    • X palette index
    The default value is "X" for 1 component and "RGB" for 3 components. This parameter must not be set to a non-empty string if the value of integer parameter "BitsPerComponent" is 1.

This function throws SignDocUnknownParameterException if aName is not the name of a string parameter, SignDocInvalidValueException if aValue is invalid.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
See also
getString(), setBoolean(), setColor(), setInteger(), setNumber()

Member Data Documentation

final int t_boolean = 1
static

Return value of getType(): Boolean.

See also
getBoolean(), setBoolean()
final int t_color = 5
static

Return value of getType(): Color.

See also
getColor(), setColor()
final int t_integer = 2
static

Return value of getType(): Integer.

See also
getInteger(), setInteger()
final int t_number = 3
static

Return value of getType(): Floating-point number.

See also
getNumber(), setNumber()
final int t_string = 4
static

Return value of getType(): String.

See also
getString(), setString()
final int t_undefined = 0
static

Return value of getType(): The specified parameter is not defined.


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