![]() |
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 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().
event | The event Id. | |
param1 | The actual page if it is meaningful. | |
param2 | The actual light if it is meaningful. | |
uparam | User parameter. |
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.
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. |
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...)
handle | Handle of the prapi module. |
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() )
handle | Handle of the prapi module. | |
reqid | Id for the getstatus and the wait functions. |
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.
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. |
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.
handle | Handle of the prapi module. | |
reqid | Id of the capture returned by the pr_capture_start(). |
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.
handle | Handle of the prapi module. | |
windowid | Id of the used window. The possible values are defined in PR_WINDOW_ID enumeration. |
References gx_call().
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.
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. |
References gx_call().
Remove white backligthing from uv image.
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. |
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).
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. |
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).
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. |
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).
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. |
References gx_call().