com.griaule.grFinger
Class FingerprintImage

java.lang.Object
  extended by com.griaule.grFinger.FingerprintImage

public class FingerprintImage
extends Object

This class represents a fingerprint raw image.


Field Summary
static int GRCAP_IMAGE_FORMAT_BMP
          Inadicates a bitmap image format.
 
Constructor Summary
FingerprintImage(GrFinger grFinger, byte[] rawImage, int width, int height, int resolution)
          Create a new FingerprintImage object with the supplied width, height, resolution.
 
Method Summary
 int getHeight()
          Get image height in pixels.
 byte[] getRawImage()
          Get raw image as an array of bytes.
 int getResolution()
          Get the resolution of the image in dpi.
 int getWidth()
          Get image width in pixels.
 ImageProducer newImageProducer()
          Returns an ImageProducer object to allow the fingerprint image to be shown on the screen.
 void saveToFile(String filename, int imageFormat)
          Save the raw image to a file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRCAP_IMAGE_FORMAT_BMP

public static final int GRCAP_IMAGE_FORMAT_BMP
Inadicates a bitmap image format.

See Also:
Constant Field Values
Constructor Detail

FingerprintImage

public FingerprintImage(GrFinger grFinger,
                        byte[] rawImage,
                        int width,
                        int height,
                        int resolution)
Create a new FingerprintImage object with the supplied width, height, resolution. The image data must be in the rawImage variable as a byte array where each byte corresponds to a grayscale pixel.

Parameters:
grFinger - Instance of GrFinger.
rawImage - The fingerprint image in the raw format. Each byte represents one pixel of the image from top to bottom, left to right, each line immediately following the previous one, without padding. Each pixel is a grayscale value from 0 (black) to 255 (white).
width - The image width in pixels.
height - The image height in pixels.
resolution - The image resolution in dpi.
Method Detail

getHeight

public int getHeight()
Get image height in pixels.

Returns:
The image height in pixels.

getRawImage

public byte[] getRawImage()
Get raw image as an array of bytes. If the license type of GrFinger FREE or LIGHT, the image returned by this function is encrypted.

Returns:
Returns the raw image as an array of bytes.

getWidth

public int getWidth()
Get image width in pixels.

Returns:
The image width in pixels.

saveToFile

public void saveToFile(String filename,
                       int imageFormat)
                throws GrErrorException
Save the raw image to a file.

Parameters:
filename - The filename to create.
imageFormat - The image format written to the file. The supported formats are availble as static fields in class FingerprintImage.
Throws:
GrErrorException

getResolution

public int getResolution()
Get the resolution of the image in dpi.

Returns:
Returns the image resolution in dpi.

newImageProducer

public ImageProducer newImageProducer()
                               throws GrErrorException
Returns an ImageProducer object to allow the fingerprint image to be shown on the screen. This ImageProducer should be used with the Component.createImage() method.

Returns:
Returns an ImageProducer object.
Throws:
GrErrorException
See Also:
Component.createImage(java.awt.image.ImageProducer)