Header

Image handling


Detailed Description

Functions for capturing, displaying and saving images.


Modules

 Examples
 Image handling example

Typedefs

typedef void GXAPI PR_EVFUNC (int event, int param1, int param2, void *uparam)
 The event function is a callback function which is called during capture.

Functions

static int pr_setpagelight (gxHANDLE handle, int pages, unsigned int *lights)
 Sets the number of document pages to capture and the needed lights for each page.
static int pr_capture (gxHANDLE handle)
 Captures an image sequence from the object window of the PR device.
static int pr_capture_start (gxHANDLE handle, int *reqid)
 Starts the image capturing process in asynchronous mode.
static int pr_capture_getstatus (gxHANDLE handle, int reqid, int *status)
 Returns the state of an image capture process started with the pr_capture_start() function.
static int pr_capture_wait (gxHANDLE handle, int reqid)
 Ends the capture process started with the pr_capture_start() function.
static int pr_capture_preview (gxHANDLE handle, int windowid)
 Captures a preview image.
static int pr_getimage (gxHANDLE handle, int page, int light, int type, gxVARIANT *img)
 Returns a captured image.
static int pr_getenhanceduv (gxHANDLE handle, int page, int imagetype, gxVARIANT *img)
 Remove white backligthing from uv image.
static int pr_saveimage (gxHANDLE handle, int page, int light, int type, const wchar_t *filename, int filetype)
 Saves an image to a file (Unicode version).
static int pr_saveimagea (gxHANDLE handle, int page, int light, int type, const char *filename, int filetype)
 Saves an image to a file (ASCII version).
static int pr_drawimage (gxHANDLE handle, int page, int light, int type, HDC hdc, int x, int y, int xsize, int ysize, gxRCT *frame)
 Displays an image (WIN32 function).


Typedef Documentation

typedef void GXAPI PR_EVFUNC(int event, int param1, int param2, void *uparam)

The event function is a callback function which is called during capture.

The event function of the PR system can be set with pr_seteventfunction().

Parameters:
event The event Id.
param1 The actual page if it is meaningful.
param2 The actual light if it is meaningful.
uparam User parameter.


Function Documentation

static int pr_setpagelight ( gxHANDLE  handle,
int  pages,
unsigned int *  lights 
) [static]

Sets the number of document pages to capture and the needed lights for each page.

More than one page is usable when visa is needed for a passport or when both sides of an Id card is needed to be read.

Parameters:
handle Handle of the prapi module.
pages Number of document pages to read.
lights Array of light masks where each integer represents a page. Each lower bit of them represents a light mask bit. The upper 8 bits represent the id of the object window. The light mask bits can be tested by the pr_getlightmask() function. The object window ids are defined in the PR_WINDOW_ID enumeration.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_capture ( gxHANDLE  handle  )  [static]

Captures an image sequence from the object window of the PR device.

To set the lights needed for capture call the pr_setpagelight() function. To set a callback function to inform the state of the capturing call the pr_seteventfunction() function. The captured images are stored in an inside array. The image handling functions are part of the api. (draw, save, recognize...)

Parameters:
handle Handle of the prapi module.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_capture_start ( gxHANDLE  handle,
int *  reqid 
) [static]

Starts the image capturing process in asynchronous mode.

See pr_capture() for details. Only one capture can be started at a time. The pr_capture_getstatus() or the pr_capture_wait() functions must be called in order the system to call the Event function. (see pr_seteventfunction() )

Parameters:
handle Handle of the prapi module.
reqid Id for the getstatus and the wait functions.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_capture_getstatus ( gxHANDLE  handle,
int  reqid,
int *  status 
) [static]

Returns the state of an image capture process started with the pr_capture_start() function.

If an internal event occurred this function calls the Event function.

Parameters:
handle Handle of the prapi module.
reqid Id for the capture. The pr_capture_start() returned this value.
status Buffer for the result. The value of the result is in percent, it can be negative when the capture is in preprocess state.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_capture_wait ( gxHANDLE  handle,
int  reqid 
) [static]

Ends the capture process started with the pr_capture_start() function.

If there are internal events waiting for report this function calls the Event function.

Parameters:
handle Handle of the prapi module.
reqid Id of the capture returned by the pr_capture_start().
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_capture_preview ( gxHANDLE  handle,
int  windowid 
) [static]

Captures a preview image.

The preview image is a small resolution real-time captured image. The lights for preview capture can be set through the preview_light property. For preview light control the freerun_mode property must contain the PR_FRMODE_PREVIEWLIGHT value.

Parameters:
handle Handle of the prapi module.
windowid Id of the used window. The possible values are defined in PR_WINDOW_ID enumeration.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_getimage ( gxHANDLE  handle,
int  page,
int  light,
int  type,
gxVARIANT img 
) [static]

Returns a captured image.

The Passport Reader system has several functions for working with the captured images. In special cases user functions can be used that are not supported by the system. This function references the image and returns a pointer to the image. The user function can reach the image data through the pointer. After the process the gx_unrefvariant() function must be called in order to decrease the reference counter.

Parameters:
handle Handle of the prapi module.
page The actual page of the image.
light The light settings. The possible values are defined in the PR_LIGHT enumeration.
type The type of the image. The possible values are defined in the PR_IMAGE_TYPE enumeration. If the type is PR_IT_PREVIEW the page and light parameters have no meanings.
img Buffer for the image reference.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_getenhanceduv ( gxHANDLE  handle,
int  page,
int  imagetype,
gxVARIANT img 
) [static]

Remove white backligthing from uv image.

Parameters:
handle Handle of the prapi module.
page The actual page of the image.
imagetype The type of the image. The possible values are defined in the PR_IMAGE_TYPE enumeration.
img Buffer for the image reference.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately ( see gx_geterror() ).

References gx_call().

static int pr_saveimage ( gxHANDLE  handle,
int  page,
int  light,
int  type,
const wchar_t *  filename,
int  filetype 
) [static]

Saves an image to a file (Unicode version).

Parameters:
handle Handle of the prapi module.
page The actual page of the image.
light The light settings. The possible values are defined in the PR_LIGHT enumeration.
type The type of the image. The possible values are defined in the PR_IMAGE_TYPE enumeration. If the type is PR_IT_PREVIEW the page and light parameters have no meanings.
filename The name of the file where to save the image.
filetype File type. The currently supported file types are defined in gximage.h.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_saveimagea ( gxHANDLE  handle,
int  page,
int  light,
int  type,
const char *  filename,
int  filetype 
) [static]

Saves an image to a file (ASCII version).

Parameters:
handle Handle of the prapi module.
page The actual page of the image.
light The light settings. The possible values are defined in the PR_LIGHT enumeration.
type The type of the image. The possible values are defined in the PR_IMAGE_TYPE enumeration. If the type is PR_IT_PREVIEW the page and light parameters have no meanings.
filename The name of the file where to save the image.
filetype File type. The currently supported file types are defined in gximage.h.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().

static int pr_drawimage ( gxHANDLE  handle,
int  page,
int  light,
int  type,
HDC  hdc,
int  x,
int  y,
int  xsize,
int  ysize,
gxRCT frame 
) [static]

Displays an image (WIN32 function).

Parameters:
handle Handle of the prapi module.
page The actual page of the image.
light The light settings. The possible values are defined in the PR_LIGHT enumeration.
type The type of the image. The possible values are defined in the PR_IMAGE_TYPE enumeration. If the type is PR_IT_PREVIEW the page and light parameters have no meaning.
hdc Handle to the device context.
x Left side of the draw area.
y Upper side of the draw area.
xsize Horizontal size of the draw area.
ysize Vertical size of the draw area.
frame Frame of the area on the image to display.
Returns:
On error false is returned and the error code/string in the GX system is set appropriately. ( see gx_geterror() )

References gx_call().


Generated  for Passport Reader
(c) ADAPTIVE RECOGNITION