Grabba Driver for Android
Unified driver for Grabba devices on the Android operating system
FingerprintImage Class Reference

Description

Class encapsulating fingerprint image data plus associated metadata.

This structure is used by FingerprintListener to deliver the results of successful fingerprint image captures to the user.

Thread safety:

  • Static functions: safe
  • Concurrent accesses to distinct objects: safe
  • Concurrent accesses to same object: unsafe, unless all accesses are read-only (i.e. query functions, generateBase64(), generateBitmap())

Classes

enum  TypeID
 Enumeration of fingerprint image types for capture and enrolment functions. More...
 

Public Member Functions

 FingerprintImage ()
 Default construction - null (empty) image.
 
 FingerprintImage (@NonNull byte[] initData, @NonNull TypeID initType, int initRows, int initColumns)
 Construction with given image data and metadata. More...
 
int columns ()
 Query the number of pixel columns in the image. More...
 
byte [] data ()
 Query the contents of the fingerprint image. More...
 
String generateBase64 (@NonNull ErrorCode error)
 Encode a fingerprint image as a MIME-compliant Base64 string. More...
 
byte [] generateBitmap (@NonNull ErrorCode error)
 Attempt to generate a grey-scale bitmap (BMP/DIB format) from the image. More...
 
TypeID imageType ()
 Query the type of image data represented by the object. More...
 
int rows ()
 Query the number of pixel rows in the image. More...
 
void setColumns (int newColumns)
 Set the number of pixel columns in the image. More...
 
void setData (@NonNull byte[] newData)
 Set the contents of the fingerprint image. More...
 
void setImageType (@NonNull TypeID newType)
 Set the type of image data represented by the object. More...
 
void setRows (int newRows)
 Set the number of pixel rows in the image. More...
 
String typeName ()
 Obtain the name of the current image type ID. More...
 

Static Public Member Functions

static String typeName (@NonNull TypeID imageType)
 Obtain the name of a given image type ID. More...
 

Constructor & Destructor Documentation

◆ FingerprintImage()

FingerprintImage ( @NonNull byte []  initData,
@NonNull TypeID  initType,
int  initRows,
int  initColumns 
)

Construction with given image data and metadata.

Parameters
initDataInitial value of the image data, passed by copy
initTypeInitial value of the image type ID
initRowsInitial count of pixel rows in the image; must be non-negative
initColumnsInitial count of pixel columns in the image; must be non-negative
Exceptions
IllegalArgumentExceptionif any of the supplied parameters are invalid

Member Function Documentation

◆ columns()

int columns ( )

Query the number of pixel columns in the image.

Returns
Number of pixel columns

◆ data()

byte [] data ( )

Query the contents of the fingerprint image.

For uncompressed images this will use a raw 8bpp grayscale format - i.e. one byte per pixel, scanning left to right within each row, and rows ordered from top to bottom. No header or footer data is included.

For images in the V1 or WSQ formats, the specified data format is used; refer to the relevant format specifications for additional details.

Returns
Image contents, represented in the specified format and passed by copy

◆ generateBase64()

String generateBase64 ( @NonNull ErrorCode  error)

Encode a fingerprint image as a MIME-compliant Base64 string.

If the supplied error code indicates no prior errors, and the image is not in the V1 compression format, then an attempt will be made to convert the fingerprint image to the BMP (DIB) format as per generateBitmap(). The resultant image data is then encoded as a Base64 string, with a suitable MIME type header prepended.

Parameters
errorError code; operation proceeds only if set to NO_ERROR. If an error is detected during this operation, then the parameter will be updated with the details.
Returns
Generated encoding if the operation proceeds and is successful; empty string otherwise

◆ generateBitmap()

byte [] generateBitmap ( @NonNull ErrorCode  error)

Attempt to generate a grey-scale bitmap (BMP/DIB format) from the image.

If the supplied error code indicates no prior errors, and the image is not in the V1_COMPRESSION format, then an attempt will be made to convert that image to the Microsoft BMP (DIB) format.

Image data for this function is typically taken from a FingerprintListener.imageEvent callback parameter.

Note
This decoder has not been FBI-certified, and is not guaranteed to be accurate for the purposes of automatic fingerprint comparison.
Parameters
errorError code; operation proceeds only if set to NO_ERROR. If an error is detected during this operation, then the parameter will be updated with the details.
Returns
Generated bitmap file if the operation proceeds and is successful, empty (0x0) bitmap otherwise

◆ imageType()

TypeID imageType ( )

Query the type of image data represented by the object.

Returns
Image type; see TypeID for details

◆ rows()

int rows ( )

Query the number of pixel rows in the image.

Returns
Number of pixel rows

◆ setColumns()

void setColumns ( int  newColumns)

Set the number of pixel columns in the image.

Parameters
newColumnsNew number of pixel columns

◆ setData()

void setData ( @NonNull byte []  newData)

Set the contents of the fingerprint image.

Refer to data() for the details of the format.

Parameters
newDataImage contents, represented in the specified format

◆ setImageType()

void setImageType ( @NonNull TypeID  newType)

Set the type of image data represented by the object.

Parameters
newTypeNew image type in the TypeID format

◆ setRows()

void setRows ( int  newRows)

Set the number of pixel rows in the image.

Parameters
newRowsNew number of pixel rows

◆ typeName() [1/2]

String typeName ( )

Obtain the name of the current image type ID.

Returns
String representation of imageType() if known; empty string if unknown

◆ typeName() [2/2]

static String typeName ( @NonNull TypeID  imageType)
static

Obtain the name of a given image type ID.

Parameters
imageTypeThe type of image which is being queried
Returns
String representation of supplied image type if known; empty string if unknown