Home  Contents

spfinger.imageStart

Finger Core4 Lua Event System

SYNOPSIS

  1. fgrhandle.imageStart = function(fgrhandle, width, height) (returns pixmap [, xoffset [, yoffset]])
  2. fgrhandle.imageEnd = function(fgrhandle, width, height)
  3. fgrhandle.imageError = function(fgrhandle)

DESCRIPTION

Whenever the finger scanner returns an image in response to a command, the image can be automatically received into a pixmap.

The spfinger.imageStart() is called whenever a header is received that indicates an image is coming up. If the callback returns a pixmap, then the image is plotted into it as the data is received. If the callback does not exist or returns nil, the image is not processed. By default, the image is received into the top-left corner of the pixmap. This can be shifted by also returning an xoffset and yoffset.

When the image reception is complete, the function spfinger.imageEnd() is called. This happens only if spfinger.imageStart() did in fact provide a pixmap and no error occured during reception.

On error, the spfinger.imageError() indicates that the reception was aborted.

All image supporting callbacks work fully independent of and do not change the behaviour of the standard callbacks.

RETURN VALUE

The spfinger.imageStart() must return a pixmap if image reception is required.

NOTES

If the returned pixmap is actually a display framebuffer, the received image can be watched live as it is received. For best results, use the extended packet protocol. The smaller the chosen blocksize, the more fluid the reception looks on the display (and the more time it takes.)

There is minimal support for image scaling and cropping with spfinger:setShrink() and spfinger:setCrop().

Even when using the maximum serial port speed of 115200bps, the image transfer takes a few seconds.

SEE ALSO