visit Kofax web site

de.softpro.signware.SPImage Class Reference

Inheritance diagram for de.softpro.signware.SPImage:

de.softpro.signware.SPSignwareObject List of all members.

Detailed Description

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, 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.

Note:
All cleaning functions allow a maximum image size of 1280 * 960 pixel. This also affects getComplexity and invert when using the flag SP_INVERT_ENGINE.
The SPImage object contains methods to draw text, rectangles or images on the target image, e. g. to dynamically compose a tablet background image.

Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)


Public Member Functions

void binarize (int iMethod, int iThreshold) throws SPSignwareException
 Binarize the image contained in an image object.
void brightness (double fGray, double fGreen, double fBlue) throws SPSignwareException
 Change the brightness of an image.
void cleanBatch (SPCleanParameter pParameter) throws SPSignwareException
 Clean an image based on the parameters provided.
java.awt.Rectangle cleanDate () throws SPSignwareException
 Delete handwritten text within a signature image.
void cleanFrames (double dTrust) throws SPSignwareException
 Delete all frames which are weighted less than dTrust.
void cleanLines () throws SPSignwareException
 Clean lines in a black-and-white or a gray image.
java.awt.Rectangle cleanSignature () throws SPSignwareException
 Clean signature image, remove horizontal lines, printed text and dirt particles.
Object clone ()
 Create a new SPImage object as a clone of another SPImage object.
void contrast (double fGray, double fGreen, double fBlue) throws SPSignwareException
 Change the contrast of an image.
SPImage createClone () throws SPSignwareException
 Create a new SPImage object as a clone of another SPImage object.
void drawImage (byte[] baXMLImage) throws SPSignwareException
 Draw some images in the image.
void drawImage (String strXMLImage) throws SPSignwareException
 Draw some images in the image.
void drawObject (byte[] baXMLObject) throws SPSignwareException
 Draw some rectangles, text and images in the image.
void drawObject (String strXMLObject) throws SPSignwareException
 Draw some rectangles, text and images in the image.
void drawRect (byte[] baXMLRect) throws SPSignwareException
 Draw some rectangles in the image.
void drawRect (String strXMLRect) throws SPSignwareException
 Draw some rectangles in the image.
void drawText (byte[] baXMLText) throws SPSignwareException
 Draw some text in the image.
void drawText (String strXMLText) throws SPSignwareException
 Draw some text in the image.
int getBitsPerPixel () throws SPSignwareException
 Query the number of bits per pixel of the image contained in this object.
int[] getColorImageData () throws SPSignwareException
 Query the image data, one byte per pixel.
int getComplexity () throws SPSignwareException
 Query the complexity of the image contained in this object.
int getDefaultBinarizeMethod () throws SPSignwareException
 Query the default binarisation method in this object, see sec_Cleaning.
int getDefaultBinarizeThreshold () throws SPSignwareException
 Query the default binarisation threshold in this object, see sec_Cleaning.
java.util.Vector< SPWeightedFramegetFrames () throws SPSignwareException
 Query all frames and their weights in this image.
java.awt.image.MemoryImageSource getImage () throws SPSignwareException
 Convert the SPImage to a MemoryImageSource object.
byte[] getImageData () throws SPSignwareException
 Query the image data, one byte per pixel.
int getPixel (int iX, int iY) throws SPSignwareException
 Query a Pixel.
int getResolution () throws SPSignwareException
 Query the resolution of the image contained in this object.
java.awt.Rectangle getSignatureRegion (int iFlags) throws SPSignwareException
 Query the signature region within this image.
java.awt.Dimension getSize () throws SPSignwareException
 Query the size of the image contained in this object.
java.util.Vector< Integer > getSplitPositions () throws SPSignwareException
 Query possible vertical split positions in the image.
void invert (int iFlags) throws SPSignwareException
 Invert the image.
void maskImage (SPImage spMask, java.awt.Rectangle rcl, int iFlags) throws SPSignwareException
 Mask this image with another image spMask in the region defined by the rectangle rcl.
void mirror (int iAxes) throws SPSignwareException
 Mirror the image.
void region (java.awt.Rectangle rcl) throws SPSignwareException
 Reduce this image to the region defined by the Rectangle rcl.
void resize (int iResolution, int iAlgo) throws SPSignwareException
 Resize the image to a defined resolution.
void rotate (int iAngle) throws SPSignwareException
 Rotate the image.
byte[] saveInBitmap (int iFormat) throws SPSignwareException
 Convert the image contents of this object to a standard image format.
void setBitsPerPixel (int iBitsPerPixel, int iColorPalette[]) throws SPSignwareException
 Set the number of bits per pixel of the image contained in this object.
void setBitsPerPixel (int iBitsPerPixel) throws SPSignwareException
 Set the number of bits per pixel of the image contained in this object.
void setDefaultBinarizeParams (int iDefaultMethod, int iDefaultThreshold) throws SPSignwareException
 Set the default threshold in this object, see sec_Cleaning.
void setEmpty (int iWidth, int iHeight, int iColor, int iResolution) throws SPSignwareException
 Set an empty image.
void setEmpty (int iWidth, int iHeight, int iColor, int iResolution, int iBitsPerPixel) throws SPSignwareException
 Set an empty image.
void setImage (SPBitmap pBitmap, int iPage) throws SPSignwareException
 Fill this SPImage object with an image from a bitmap.
void setPixel (int iX, int iY, int iGray) throws SPSignwareException
 Set a Pixel.
void setReference (SPReference pReference, int iIndex, SPTicket pTicket) throws SPSignwareException
 Fill this SPImage object with an image from a SPReference object.
void setReference (SPReference pReference, int iIndex) throws SPSignwareException
 Fill this SPImage object with an image from a SPReference object.
void setResolution (int iRes) throws SPSignwareException
 Set the resolution of the image contained in this object.
void setSignature (SPSignature pSignature, SPTicket pTicket) throws SPSignwareException
 Fill this SPImage object with an image from a SPSignature object.
void setSignature (SPSignature pSignature) throws SPSignwareException
 Fill this SPImage object with an image from a SPSignature object.
void setTellerImage (SPTellerImage pTellerImage) throws SPSignwareException
 Fill this SPImage object with an image from a SPTellerImage object.
void setTemplate (SPTemplate pTemplate, SPTicket pTicket) throws SPSignwareException
 Fill this SPImage object with an image from a SPTemplate object.
void setTemplate (SPTemplate pTemplate) throws SPSignwareException
 Fill this SPImage object with an image from a SPTemplate object.
 SPImage (SPImage origin) throws SPSignwareException
 Create a new SPImage object as a clone of another SPImage object.
 SPImage () throws SPSignwareException
 Create a new SPImage object.

Static Public Attributes

static final String SP_BINARIZE_ENABLE = "SPBinarizeEnable"
 SPCleanParameter for SPImageClean: enable binarization, see sec_Cleaning.
static final String SP_BINARIZE_METHOD = "SPBinarizeMethod"
 SPCleanParameter for SPImageClean: define binarization method, see sec_Cleaning.
static final String SP_BINARIZE_THRESHOLD = "SPBinarizeThreshold"
 SPCleanParameter for SPImageClean: define binarization threshold, see sec_Cleaning.
static final String SP_CLEAN_DATE_ENABLE = "SPCleanDateEnable"
 SPCleanParameter for SPImageClean: enable handwritten text cleaning, see sec_Cleaning.
static final String SP_CLEAN_SIGNATURE_ENABLE = "SPCleanSignatureEnable"
 SPCleanParameter for SPImageClean: enable signature cleaning, see sec_Cleaning.
static final String SP_CLEANFRAMES_ENABLE = "SPCleanFrameEnable"
 SPCleanParameter for SPImageClean: enable frame cleaning, see sec_Cleaning.
static final String SP_CLEANFRAMES_TRUST = "SPCleanFrameTrust"
 SPCleanParameter for SPImageClean: define frame cleaning trust, see sec_Cleaning.
static final String SP_CLEANLINES_ENABLE = "SPCleanLineEnable"
 SPCleanParameter for SPImageClean: enable line cleaning, see sec_Cleaning.
static final String SP_CUT_REGION_BOTTOM = "SPCutRegionBottom"
 SPCleanParameter for SPImageClean: define cut region bottom coordinate, see sec_Cleaning.
static final String SP_CUT_REGION_ENABLE = "SPCutRegionEnable"
 SPCleanParameter for SPImageClean: enable cut region, see sec_Cleaning.
static final String SP_CUT_REGION_LEFT = "SPCutRegionLeft"
 SPCleanParameter for SPImageClean: define cut region left coordinate, see sec_Cleaning.
static final String SP_CUT_REGION_RIGHT = "SPCutRegionRight"
 SPCleanParameter for SPImageClean: define cut region right coordinate, see sec_Cleaning.
static final String SP_CUT_REGION_TOP = "SPCutRegionTop"
 SPCleanParameter for SPImageClean: define cut region top coordinate, see sec_Cleaning.
static final int SP_CUT_SIGNATURE = 1
 Flag to cut the signature region in the image, see sec_Cleaning.
static final String SP_CUT_SIGNATURE_REGION_ENABLE = "SPCutSignatureRegionEnable"
 SPCleanParameter for SPImageClean: enable signature region cut, see sec_Cleaning.
static final int SP_INVERT_AUTO = 1
 Flag to determine image inversion automatically.
static final String SP_INVERT_ENABLE = "SPInvertEnable"
 SPCleanParameter for SPImageClean: enable inversion, see sec_Cleaning.
static final int SP_INVERT_ENGINE = 2
 Flag to request usage of the static cleaning engine instead of internal algorithms.
static final String SP_INVERT_FLAGS = "SPInvertFlags"
 SPCleanParameter for SPImageClean: define invert flags, bit combination of SP_INVERT_AUTO, SP_INVERT_ENGINE, SP_INVERT_NONE, see sec_Cleaning.
static final int SP_INVERT_NONE = 4
 Flag to ignore image inversion.
static final int SP_MASK_AND = 2
 Mask operation AND, image will be anded with the mask.
static final int SP_MASK_CPY = 4
 Mask operation COPY, the mask will be copied into the image.
static final int SP_MASK_MAX = 6
 Mask operation MAX, image will be the maximum of the corresponding pixels in image and mask.
static final int SP_MASK_MIN = 7
 Mask operation MIN, image will be the minimum of the corresponding pixels in image and mask.
static final int SP_MASK_NOTCPY = 5
 Mask operation NOT COPY, the mask will be inverted and copied into the image.
static final int SP_MASK_OR = 1
 Mask operation OR, image will be ored with the mask.
static final int SP_MASK_XOR = 3
 Mask operation XOR, image will be xored with the mask.
static final String SP_MIRROR_AXES = "SPMirrorAxes"
 SPCleanParameter for SPImageClean: define mirror axes, bit combination of 1: horizontal, 2 vertical, see sec_Cleaning.
static final String SP_MIRROR_ENABLE = "SPMirrorEnable"
 SPCleanParameter for SPImageClean: enable mirror, see sec_Cleaning.
static final String SP_ROTATE_ANGLE = "SPRotateAngle"
 SPCleanParameter for SPImageClean: define rotation angle, 90 / 180 or 270, see sec_Cleaning.
static final String SP_ROTATE_ENABLE = "SPRotateEnable"
 SPCleanParameter for SPImageClean: enable rotation, see sec_Cleaning.

Package Functions

final native int jniFree ()


Constructor & Destructor Documentation

de.softpro.signware.SPImage.SPImage  )  throws SPSignwareException
 

Create a new SPImage object.

Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageCreate

de.softpro.signware.SPImage.SPImage SPImage  origin  )  throws SPSignwareException
 

Create a new SPImage object as a clone of another SPImage object.

Parameters:
origin [i] the SPImage object that should be copied to this object
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageClone


Member Function Documentation

void de.softpro.signware.SPImage.binarize int  iMethod,
int  iThreshold
throws SPSignwareException
 

Binarize the image contained in an image object.

Images are expected to have black strokes on white background with a gray level 255 equaling white. Binarization will invert the image if the background in black.

The image may be inverted after this operation.

Calculation of best binarization threshold: find the gray level with the most pixels in the image histogram. The calculated best threshold will be defined at the gray level with most pixel - 25.

This function returns immediately if the image is a black-and-white image.

Parameters:
iMethod [i] the binarisation algorithm
  • 0 set the threshold to iThreshold
  • 1 set the threshold iThreshold gray levels above the histogram peak
  • 2 set the threshold iThreshold gray levels above nex minimum relative to the histogram peak
iThreshold [i] binarization threshold to binarize a gray image into a black-and-white image.
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageBinarize

void de.softpro.signware.SPImage.brightness double  fGray,
double  fGreen,
double  fBlue
throws SPSignwareException
 

Change the brightness of an image.

Parameters:
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
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageBrightness

void de.softpro.signware.SPImage.cleanBatch SPCleanParameter  pParameter  )  throws SPSignwareException
 

Clean an image based on the parameters provided.

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

Parameters:
pParameter [i] Parameters used for cleaning
Exceptions:
SPSignwareException on errors
See also:
SPImageClean

java.awt.Rectangle de.softpro.signware.SPImage.cleanDate  )  throws SPSignwareException
 

Delete handwritten text within a signature image.

If this image is a gray image then this function will create a black-and-white image, clean frames in the black-and-white image and finally mask this image with the black-and-white image.
If this image is a black-and-white image this function will directly clean this image.

For an overview on image cleaning see sec_Cleaning.

Returns:
java.awt.Rectangle, a rectangle specifying the position of the resulting image relative to the uncleaned image.
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPImageCleanFrames

void de.softpro.signware.SPImage.cleanFrames double  dTrust  )  throws SPSignwareException
 

Delete all frames which are weighted less than dTrust.

If this image is a gray image then this function will create a black-and-white image, clean frames in the black-and-white image and finally mask this image with the black-and-white image.
If this image is a black-and-white image this function will directly clean this image.

For an overview on image cleaning see sec_Cleaning.

Parameters:
dTrust [i] the weighting factor, range 0.0 .. 1.0, 0.0 will delete nothing, 1.0 will delete the entire image
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPImageCleanFrames

void de.softpro.signware.SPImage.cleanLines  )  throws SPSignwareException
 

Clean lines in a black-and-white or a gray image.

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

For an overview on image cleaning see sec_Cleaning.

Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPImageCleanLines

java.awt.Rectangle de.softpro.signware.SPImage.cleanSignature  )  throws SPSignwareException
 

Clean signature image, remove horizontal lines, printed text and dirt particles.

If this image is a gray image then this function will create a black-and-white image, clean frames in the black-and-white image and finally mask this image with the black-and-white image.
If this image is a black-and-white image this function will directly clean this image.

For an overview on image cleaning see sec_Cleaning.

Returns:
java.awt.Rectangle, a rectangle specifying the position of the resulting image relative to the uncleaned image.
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPImageCleanFrames

Object de.softpro.signware.SPImage.clone  ) 
 

Create a new SPImage object as a clone of another SPImage object.

Returns:
SPImage the clone of this object
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageClone

void de.softpro.signware.SPImage.contrast double  fGray,
double  fGreen,
double  fBlue
throws SPSignwareException
 

Change the contrast of an image.

Parameters:
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
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageContrast

SPImage de.softpro.signware.SPImage.createClone  )  throws SPSignwareException
 

Create a new SPImage object as a clone of another SPImage object.

Returns:
SPImage the clone of this object
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageClone

void de.softpro.signware.SPImage.drawImage byte[]  baXMLImage  )  throws SPSignwareException
 

Draw some images in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
baXMLImage [i] a description of the images, position to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawText

void de.softpro.signware.SPImage.drawImage String  strXMLImage  )  throws SPSignwareException
 

Draw some images in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
strXMLImage [i] a description of the images, position to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawText

void de.softpro.signware.SPImage.drawObject byte[]  baXMLObject  )  throws SPSignwareException
 

Draw some rectangles, text and images in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
baXMLObject [i] a description of the rectangles, text and images to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawObject

void de.softpro.signware.SPImage.drawObject String  strXMLObject  )  throws SPSignwareException
 

Draw some rectangles, text and images in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
strXMLObject [i] a description of the rectangles, text and images to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawObject

void de.softpro.signware.SPImage.drawRect byte[]  baXMLRect  )  throws SPSignwareException
 

Draw some rectangles in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
baXMLRect [i] a description of the rectangles, position text and image to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawRect

void de.softpro.signware.SPImage.drawRect String  strXMLRect  )  throws SPSignwareException
 

Draw some rectangles in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
strXMLRect [i] a description of the rectangles, position text and image to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawRect

void de.softpro.signware.SPImage.drawText byte[]  baXMLText  )  throws SPSignwareException
 

Draw some text in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
baXMLText [i] a description of the text, position and font to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawText

void de.softpro.signware.SPImage.drawText String  strXMLText  )  throws SPSignwareException
 

Draw some text in the image.

For an overview on XML tags please see sec_XML_Data

Parameters:
strXMLText [i] a description of the text, position and font to be included
Exceptions:
SPSignwareException on errors
See also:
SPImageDrawText

int de.softpro.signware.SPImage.getBitsPerPixel  )  throws SPSignwareException
 

Query the number of bits per pixel of the image contained in this object.

Returns:
int the bits per pixel of the image, 1 or 8
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

int [] de.softpro.signware.SPImage.getColorImageData  )  throws SPSignwareException
 

Query the image data, one byte per pixel.

The returned byte array will contain the gray levels for all pixel of the image, stored from left to right and top to bottom, e.g pixel(w, h) = result[h * width + w].

Returns:
int[] the image data
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

int de.softpro.signware.SPImage.getComplexity  )  throws SPSignwareException
 

Query the complexity of the image contained in this object.

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

Returns:
int the complexity of the image
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)

int de.softpro.signware.SPImage.getDefaultBinarizeMethod  )  throws SPSignwareException
 

Query the default binarisation method in this object, see sec_Cleaning.

Returns:
int the default method
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetDefaultBinarizeParams, setDefaultBinarizeParams

int de.softpro.signware.SPImage.getDefaultBinarizeThreshold  )  throws SPSignwareException
 

Query the default binarisation threshold in this object, see sec_Cleaning.

Returns:
int the default threshold
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageGetDefaultBinarizeParams, setDefaultBinarizeParams

java.util.Vector<SPWeightedFrame> de.softpro.signware.SPImage.getFrames  )  throws SPSignwareException
 

Query all frames and their weights in this image.

For an overview on image cleaning see sec_Cleaning

Returns:
a vector of SPWeightedFrame
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPWeightedFrame, SPImageGetFrames

java.awt.image.MemoryImageSource de.softpro.signware.SPImage.getImage  )  throws SPSignwareException
 

Convert the SPImage to a MemoryImageSource object.

This is a convenience function to convert SPImage objects to java.awt.Image

Note:
Use Container.createImage to convert the MemoryImageSource (which implements the ImageProducer interface) to an Image object.
Returns:
java.awt.image.MemoryImageSource the converted image
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
Example:
 // Sample usage of the MemoryImageSource
 class MyClass extends Component {
     ...
     java.awt.Image getImage(SPImage spImage) {
         java.awt.Image image = this.createImage(spImage.getImage());
         return image;
     }
 }
Example:
// Create a MemoryImageSource object (e.g. to implement your own color mapping)
 public createMemoryImageSource(SPImage spImage) throws SPSignwareException
 {
     Point pt = spImage.getSize();
     int iBpP = spImage.getBitsPerPixel();
     int [] imgsrc = null;
     if(iBpP <= 8) {
         byte[] img = spImage.getImageData();
         imgsrc = new int[img.length];
         for(int ik = 0; ik < img.length; ik++)
             imgsrc [ik] = 0xff000000 | ((img[ik] & 0xff) << 16)  | ((img[ik] & 0xff) << 8) | (img[ik] & 0xff);
     } else {
         imgsrc = spImage.getColorImageData();
     }
     return new MemoryImageSource(pt.x, pt.y, imgsrc, 0, pt.x);
 }

byte [] de.softpro.signware.SPImage.getImageData  )  throws SPSignwareException
 

Query the image data, one byte per pixel.

The returned byte array will contain the gray levels for all pixel of the image, stored from left to right and top to bottom, e.g pixel(w, h) = result[h * width + w].

Returns:
byte[] the image data
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

int de.softpro.signware.SPImage.getPixel int  iX,
int  iY
throws SPSignwareException
 

Query a Pixel.

The gray value 255 represents the color white, 0 represents black.

Parameters:
iX [i] x-coordinate, 0-based
iY [i] y-coordinate, 0-based
Returns:
int the gray or color level of the pixel at x, y
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

int de.softpro.signware.SPImage.getResolution  )  throws SPSignwareException
 

Query the resolution of the image contained in this object.

Returns:
int the resolution of the image
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

java.awt.Rectangle de.softpro.signware.SPImage.getSignatureRegion int  iFlags  )  throws SPSignwareException
 

Query the signature region within this image.

For an overview on image cleaning see sec_Cleaning

Parameters:
iFlags [i] a bitwise combination of these values:
  • SP_CUT_SIGNATURE cut this image to the signature region
Returns:
Rectangle The signature coordinates.
Exceptions:
SPSignwareException on errors
See also:
SPImageGetSignatureRegion

java.awt.Dimension de.softpro.signware.SPImage.getSize  )  throws SPSignwareException
 

Query the size of the image contained in this object.

Returns:
java.awt.Dimension the size of the image, width and height
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

java.util.Vector<Integer> de.softpro.signware.SPImage.getSplitPositions  )  throws SPSignwareException
 

Query possible vertical split positions in the image.

For an overview on image cleaning see sec_Cleaning

Returns:
java.util.Vector a vector of int elements, each passing a vertical split position
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPImageGetSplitPositions

void de.softpro.signware.SPImage.invert int  iFlags  )  throws SPSignwareException
 

Invert the image.

Parameters:
iFlags [i] inversion flags, a bit combination of these values
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageRotate

final native int de.softpro.signware.SPImage.jniFree  )  [package, virtual]
 

Implements de.softpro.signware.SPSignwareObject.

void de.softpro.signware.SPImage.maskImage SPImage  spMask,
java.awt.Rectangle  rcl,
int  iFlags
throws SPSignwareException
 

Mask this image with another image spMask in the region defined by the rectangle rcl.

spMask MUST be smaller or equal to this image, width and height of rcl must equal width and height of spMask!

Parameters:
spMask [i] mask image
rcl [i] mask region
iFlags [i] mask operation
Exceptions:
SPSignwareException on errors
See also:
SPImageMaskImage

void de.softpro.signware.SPImage.mirror int  iAxes  )  throws SPSignwareException
 

Mirror the image.

Parameters:
iAxes [i] mirror axes, 1 horicontal, 2 vertical, 3 horizontal and vertical
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageMirror

void de.softpro.signware.SPImage.region java.awt.Rectangle  rcl  )  throws SPSignwareException
 

Reduce this image to the region defined by the Rectangle rcl.

Parameters:
rcl [i] final image region
Exceptions:
SPSignwareException on errors
See also:
SPImageRegion

void de.softpro.signware.SPImage.resize int  iResolution,
int  iAlgo
throws SPSignwareException
 

Resize the image to a defined resolution.

The new Resultion must be smaller than the current resolution.

Parameters:
iResolution [i] the new resolution of the image, in dots per inch [dpi]
iAlgo [i] algorithm, must be 0
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageResize, getResolution, setResolution

void de.softpro.signware.SPImage.rotate int  iAngle  )  throws SPSignwareException
 

Rotate the image.

Since:
Version 3.0 rotates any angle.
Parameters:
iAngle [i] rotation angle in degrees
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageRotate

byte [] de.softpro.signware.SPImage.saveInBitmap int  iFormat  )  throws SPSignwareException
 

Convert the image contents of this object to a standard image format.

Parameters:
iFormat [i] format specifier, one of the following:
Returns:
the image data in a byte array
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

void de.softpro.signware.SPImage.setBitsPerPixel int  iBitsPerPixel,
int  iColorPalette[]
throws SPSignwareException
 

Set the number of bits per pixel of the image contained in this object.

Parameters:
iBitsPerPixel [i] the bits per pixel of the image, 1 or 8
iColorPalette [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
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

void de.softpro.signware.SPImage.setBitsPerPixel int  iBitsPerPixel  )  throws SPSignwareException
 

Set the number of bits per pixel of the image contained in this object.

Parameters:
iBitsPerPixel [i] the bits per pixel of the image, 1 or 8
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

void de.softpro.signware.SPImage.setDefaultBinarizeParams int  iDefaultMethod,
int  iDefaultThreshold
throws SPSignwareException
 

Set the default threshold in this object, see sec_Cleaning.

The default threshold is used to temporarily convert gray to black-and-white images. It affects these functions:

Returns:
int the resolution of the image
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetDefaultThreshold, getDefaultThreshold

void de.softpro.signware.SPImage.setEmpty int  iWidth,
int  iHeight,
int  iColor,
int  iResolution
throws SPSignwareException
 

Set an empty image.

SPImage supports gray scale images with 8 bit per pixel.

Parameters:
iWidth [i] Width of the image
iHeight [i] height of the image
iColor [i] Color of the image (gray level in range 0 .. 255, see below)
iResolution [i] the resolution of the created image [in DPI]
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetEmpty

void de.softpro.signware.SPImage.setEmpty int  iWidth,
int  iHeight,
int  iColor,
int  iResolution,
int  iBitsPerPixel
throws SPSignwareException
 

Set an empty image.

SPImage supports gray scale images with 8 bit per pixel.

Parameters:
iWidth [i] Width of the image
iHeight [i] height of the image
iColor [i] Color of the image (gray level in range 0 .. 255, see below)
iResolution [i] the resolution of the created image [in DPI]
iBitsPerPixel [i] the bit depth of the created image, 1 (black-and-white), 8 (gray-scale) or 24 (color)
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetEmpty

void de.softpro.signware.SPImage.setImage SPBitmap  pBitmap,
int  iPage
throws SPSignwareException
 

Fill this SPImage object with an image from a bitmap.

Parameters:
pBitmap [i] the SPBitmap object
iPage [i] 0-based page number in multi-page images
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetBitmap

void de.softpro.signware.SPImage.setPixel int  iX,
int  iY,
int  iGray
throws SPSignwareException
 

Set a Pixel.

The gray value 255 represents the color white, 0 represents black.

For black-and-white images pass either 0 or 255.

Parameters:
iX [i] x-coordinate, 0-based
iY [i] y-coordinate, 0-based
iGray [i] gray or color level, range 0 ... 255
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)

void de.softpro.signware.SPImage.setReference SPReference  pReference,
int  iIndex,
SPTicket  pTicket
throws SPSignwareException
 

Fill this SPImage object with an image from a SPReference object.

Parameters:
pReference [i] the SPReference object
iIndex [i] 0 - based index into the signatures
pTicket [i] a charged ticket, must be charged for SPTicket.ticket_render, pass null if tickets are not required
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetReference

void de.softpro.signware.SPImage.setReference SPReference  pReference,
int  iIndex
throws SPSignwareException
 

Fill this SPImage object with an image from a SPReference object.

Parameters:
pReference [i] the SPReference object
iIndex [i] 0 - based index into the signatures
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetReference

void de.softpro.signware.SPImage.setResolution int  iRes  )  throws SPSignwareException
 

Set the resolution of the image contained in this object.

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

Parameters:
iRes [i] the resolution of the image
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetResolution, getResolution, resize

void de.softpro.signware.SPImage.setSignature SPSignature  pSignature,
SPTicket  pTicket
throws SPSignwareException
 

Fill this SPImage object with an image from a SPSignature object.

Parameters:
pSignature [i] the SPSignature object
pTicket [i] a charged ticket, must be charged for SPTicket.ticket_render, pass null if tickets are not required
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetSignature

void de.softpro.signware.SPImage.setSignature SPSignature  pSignature  )  throws SPSignwareException
 

Fill this SPImage object with an image from a SPSignature object.

Parameters:
pSignature [i] the SPSignature object
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetSignature

void de.softpro.signware.SPImage.setTellerImage SPTellerImage  pTellerImage  )  throws SPSignwareException
 

Fill this SPImage object with an image from a SPTellerImage object.

Parameters:
pTellerImage [i] the SPTellerImage object
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32)
See also:
SPImageSetSignature

void de.softpro.signware.SPImage.setTemplate SPTemplate  pTemplate,
SPTicket  pTicket
throws SPSignwareException
 

Fill this SPImage object with an image from a SPTemplate object.

Parameters:
pTemplate [i] the SPTemplate object
pTicket [i] a charged ticket, must be charged for SPTicket.ticket_render, pass null if tickets are not required
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetReference

void de.softpro.signware.SPImage.setTemplate SPTemplate  pTemplate  )  throws SPSignwareException
 

Fill this SPImage object with an image from a SPTemplate object.

Parameters:
pTemplate [i] the SPTemplate object
Exceptions:
SPSignwareException on errors
Operating Systems:
Windows (Win32), Linux (i386), Linux (x86_64), Android (ARMv7a), Darwin (x86_64)
See also:
SPImageSetReference


Member Data Documentation

final String de.softpro.signware.SPImage.SP_BINARIZE_ENABLE = "SPBinarizeEnable" [static]
 

SPCleanParameter for SPImageClean: enable binarization, see sec_Cleaning.

See also:
binarize, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_BINARIZE_METHOD = "SPBinarizeMethod" [static]
 

SPCleanParameter for SPImageClean: define binarization method, see sec_Cleaning.

See also:
binarize, cleanBatch, SPCleanParameter.setParameter(String, int)

final String de.softpro.signware.SPImage.SP_BINARIZE_THRESHOLD = "SPBinarizeThreshold" [static]
 

SPCleanParameter for SPImageClean: define binarization threshold, see sec_Cleaning.

See also:
binarize, cleanBatch, SPCleanParameter.setParameter(String, int)

final String de.softpro.signware.SPImage.SP_CLEAN_DATE_ENABLE = "SPCleanDateEnable" [static]
 

SPCleanParameter for SPImageClean: enable handwritten text cleaning, see sec_Cleaning.

See also:
cleanDate, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CLEAN_SIGNATURE_ENABLE = "SPCleanSignatureEnable" [static]
 

SPCleanParameter for SPImageClean: enable signature cleaning, see sec_Cleaning.

See also:
cleanSignature, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CLEANFRAMES_ENABLE = "SPCleanFrameEnable" [static]
 

SPCleanParameter for SPImageClean: enable frame cleaning, see sec_Cleaning.

See also:
cleanFrames, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CLEANFRAMES_TRUST = "SPCleanFrameTrust" [static]
 

SPCleanParameter for SPImageClean: define frame cleaning trust, see sec_Cleaning.

See also:
cleanFrames, cleanBatch, SPCleanParameter.setParameter(String, double)

final String de.softpro.signware.SPImage.SP_CLEANLINES_ENABLE = "SPCleanLineEnable" [static]
 

SPCleanParameter for SPImageClean: enable line cleaning, see sec_Cleaning.

See also:
cleanLines, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CUT_REGION_BOTTOM = "SPCutRegionBottom" [static]
 

SPCleanParameter for SPImageClean: define cut region bottom coordinate, see sec_Cleaning.

See also:
region, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CUT_REGION_ENABLE = "SPCutRegionEnable" [static]
 

SPCleanParameter for SPImageClean: enable cut region, see sec_Cleaning.

See also:
region, cleanBatch, SPImageRegion, SPImageClean, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CUT_REGION_LEFT = "SPCutRegionLeft" [static]
 

SPCleanParameter for SPImageClean: define cut region left coordinate, see sec_Cleaning.

See also:
region, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CUT_REGION_RIGHT = "SPCutRegionRight" [static]
 

SPCleanParameter for SPImageClean: define cut region right coordinate, see sec_Cleaning.

See also:
region, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_CUT_REGION_TOP = "SPCutRegionTop" [static]
 

SPCleanParameter for SPImageClean: define cut region top coordinate, see sec_Cleaning.

See also:
region, cleanBatch, SPCleanParameter.appendEnableFlag see sec_Cleaning

final int de.softpro.signware.SPImage.SP_CUT_SIGNATURE = 1 [static]
 

Flag to cut the signature region in the image, see sec_Cleaning.

See also:
region, SPImageGetSignatureRegion

final String de.softpro.signware.SPImage.SP_CUT_SIGNATURE_REGION_ENABLE = "SPCutSignatureRegionEnable" [static]
 

SPCleanParameter for SPImageClean: enable signature region cut, see sec_Cleaning.

See also:
cutSignatureRegion, cleanBatch, SPCleanParameter.appendEnableFlag

final int de.softpro.signware.SPImage.SP_INVERT_AUTO = 1 [static]
 

Flag to determine image inversion automatically.

SPImageInvert will invert the image only if the background is black, else SPImageInvert will leave the image unchanged

See also:
invert, cleanBatch, SPImageInvert

final String de.softpro.signware.SPImage.SP_INVERT_ENABLE = "SPInvertEnable" [static]
 

SPCleanParameter for SPImageClean: enable inversion, see sec_Cleaning.

See also:
invert, cleanBatch, SPCleanParameter.appendEnableFlag

final int de.softpro.signware.SPImage.SP_INVERT_ENGINE = 2 [static]
 

Flag to request usage of the static cleaning engine instead of internal algorithms.

SPImageInvert will be delegated to a cleaning engine. SP_PARAMERR will be returned if the image color depth is not supported by the engine.

This flag is not supported under Linux.

See also:
invert, cleanBatch, SPImageInvert

final String de.softpro.signware.SPImage.SP_INVERT_FLAGS = "SPInvertFlags" [static]
 

SPCleanParameter for SPImageClean: define invert flags, bit combination of SP_INVERT_AUTO, SP_INVERT_ENGINE, SP_INVERT_NONE, see sec_Cleaning.

See also:
invert, cleanBatch, SPCleanParameter.setParameter(String, int)

final int de.softpro.signware.SPImage.SP_INVERT_NONE = 4 [static]
 

Flag to ignore image inversion.

SPImageInvert return without inverting the image

See also:
invert, cleanBatch, SPImageInvert

final int de.softpro.signware.SPImage.SP_MASK_AND = 2 [static]
 

Mask operation AND, image will be anded with the mask.

See also:
maskImage

final int de.softpro.signware.SPImage.SP_MASK_CPY = 4 [static]
 

Mask operation COPY, the mask will be copied into the image.

See also:
maskImage

final int de.softpro.signware.SPImage.SP_MASK_MAX = 6 [static]
 

Mask operation MAX, image will be the maximum of the corresponding pixels in image and mask.

See also:
maskImage

final int de.softpro.signware.SPImage.SP_MASK_MIN = 7 [static]
 

Mask operation MIN, image will be the minimum of the corresponding pixels in image and mask.

See also:
maskImage

final int de.softpro.signware.SPImage.SP_MASK_NOTCPY = 5 [static]
 

Mask operation NOT COPY, the mask will be inverted and copied into the image.

See also:
maskImage

final int de.softpro.signware.SPImage.SP_MASK_OR = 1 [static]
 

Mask operation OR, image will be ored with the mask.

See also:
maskImage

final int de.softpro.signware.SPImage.SP_MASK_XOR = 3 [static]
 

Mask operation XOR, image will be xored with the mask.

See also:
maskImage

final String de.softpro.signware.SPImage.SP_MIRROR_AXES = "SPMirrorAxes" [static]
 

SPCleanParameter for SPImageClean: define mirror axes, bit combination of 1: horizontal, 2 vertical, see sec_Cleaning.

See also:
mirror, cleanBatch, SPCleanParameter.setParameter(String, int)

final String de.softpro.signware.SPImage.SP_MIRROR_ENABLE = "SPMirrorEnable" [static]
 

SPCleanParameter for SPImageClean: enable mirror, see sec_Cleaning.

See also:
mirror, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_ROTATE_ANGLE = "SPRotateAngle" [static]
 

SPCleanParameter for SPImageClean: define rotation angle, 90 / 180 or 270, see sec_Cleaning.

See also:
rotate, cleanBatch, SPCleanParameter.appendEnableFlag

final String de.softpro.signware.SPImage.SP_ROTATE_ENABLE = "SPRotateEnable" [static]
 

SPCleanParameter for SPImageClean: enable rotation, see sec_Cleaning.

See also:
rotate, cleanBatch, SPCleanParameter.appendEnableFlag


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