FPCaptureAccess SDK Programmers Guide
FPCaptureAccess SDK Programmers Guide
FPCaptureAccess SDK
Programmer’s Guide
© 2009 Cogent, Inc. All rights reserved.
This document contains commercial information and trade secrets of Cogent, Inc. which are confidential and
proprietary in nature and are subject to protection under law. Access to the information contained herein, howsoever
acquired and of whatsoever nature, will not entitle the accessor thereof to acquire any right thereto. The data subject to
this restriction are contained in all sheets of this document. Disclosure of any such information or trade secrets shall
not be made without the prior written permission of Cogent, Inc.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Cogent,
Inc.
The information in this document is subject to change without notice. The software mentioned in this document is
furnished under license and may only be used or copied in accordance with the terms of such license. Contact software
manufacturers directly for terms of software licenses for any software mentioned in this document not originating from
Cogent, Inc.
All brand or product names are the trademarks or registered trademarks of their respective holders.
1 Overview 1
2 Key Terms 1
3 System Requirements 2
4 SDK Usage 3
4.1 SDK Implementation...................................................................................................... 3
4.2 General Information ...................................................................................................... 3
4.3 Typical Workflow to Acquire Images............................................................................. 3
4.3.1 Using One Scanner ............................................................................................ 3
4.3.2 Using Multiple Scanners.................................................................................... 6
Contents iii
Proprietary
5.7.16 CG4_Controls_Beeper...................................................................................... 33
5.7.17 CG4_Capture_SetCaptureOK ........................................................................... 34
5.7.18 CG4_Capture_SetStartRollingFlag ................................................................... 35
5.7.19 CG4_Capture_GetRollParameters .................................................................... 36
5.7.20 CG4_Capture_SetRollParameters .................................................................... 37
5.7.21 CG4_Capture_Calibration ................................................................................ 38
5.7.22 CG4_Controls_RegisterFootSwitchInfo............................................................ 39
5.7.23 CG4_Capture_RegisterCallbackPreviewImage................................................. 40
5.7.24 CG4_Capture_RegisterCallbackTakingResultImage ........................................ 41
5.7.25 CG4_Capture_RegisterCallbackResultImage ................................................... 42
5.7.26 CG4_Capture_RegisterCallbackFootSwitch ..................................................... 43
5.7.27 CG4_Capture_RegisterCallbackKeypad ........................................................... 44
5.7.28 CG4_Capture_RegisterCallbackObjectQuality................................................. 45
5.7.29 CG4_Capture_RegisterCallbackObjectPosition ............................................... 46
5.7.30 CG4_Capture_RegisterCallbackDeviceIsConnected ........................................ 47
5.7.31 CG4_CallbackPreviewImage ............................................................................ 48
5.7.32 CG4_CallbackResultImage .............................................................................. 49
5.7.33 CG4_CallbackFootSwitch................................................................................. 50
5.7.34 CG4_CallbackKeypad ...................................................................................... 51
5.7.35 CG4_CallbackObjectQuality ............................................................................ 52
5.7.36 CG4_CallbackDeviceIsConnected.................................................................... 53
5.7.37 CG4_Capture_GetImageMask .......................................................................... 54
5.7.38 CG4_Capture_SetAutoCapInfo ........................................................................ 55
5.7.39 CG4_Capture_SetAutoCapArea ....................................................................... 56
5.7.40 CG4_Capture_SetAutoCapFinMask ................................................................. 57
5.7.41 CG4_Control_CmdSetValue ............................................................................. 58
Contents iv
Proprietary
6.7.5 CG4_M_Main_DeInitialize ................................................................................ 71
6.7.6 CG4_M_Main_DeInitializeAll............................................................................ 72
6.7.7 CG4_M_Main_IsInitialized ............................................................................... 73
6.7.8 CG4_M_Main_GetDeviceInfo............................................................................ 74
6.7.9 CG4_M_Capture_SetMode ............................................................................... 75
6.7.10 CG4_M_Capture_Start ..................................................................................... 76
6.7.11 CG4_M_Capture_Abort .................................................................................... 77
6.7.12 CG4_M_Capture_TakeResultImage ................................................................. 78
6.7.13 CG4_M_Capture_AcquireResultImage ............................................................. 79
6.7.14 CG4_M_Controls_SetStateLEDs ....................................................................... 80
6.7.15 CG4_M_Controls_SetLEDs ............................................................................... 81
6.7.16 CG4_M_Controls_Beeper ................................................................................. 82
6.7.17 CG4_M_Capture_SetCaptureOK ...................................................................... 83
6.7.18 CG4_M_Capture_SetStartRollingFlag............................................................... 84
6.7.19 CG4_M_Capture_GetRollParameters ............................................................... 85
6.7.20 CG4_M_Capture_SetRollParameters ................................................................ 86
6.7.21 CG4_M_Capture_Calibration ........................................................................... 87
6.7.22 CG4_M_Controls_RegisterFootSwitchInfo ....................................................... 88
6.7.23 CG4_M_Capture_RegisterCallbackPreviewImage ............................................ 89
6.7.24 CG4_M_Capture_RegisterCallbackTakingResultImage ................................... 90
6.7.25 CG4_M_Capture_RegisterCallbackResultImage .............................................. 91
6.7.26 CG4_M_Capture_RegisterCallbackFootSwitch................................................. 92
6.7.27 CG4_M_Capture_RegisterCallbackKeypad ...................................................... 93
6.7.28 CG4_M_Capture_RegisterCallbackObjectQuality ............................................ 94
6.7.29 CG4_M_Capture_RegisterCallbackObjectPosition........................................... 95
6.7.30 CG4_M_Capture_RegisterCallbackDeviceIsConnected.................................... 96
6.7.31 CG4_CallbackPreviewImage ............................................................................ 97
6.7.32 CG4_CallbackResultImage .............................................................................. 98
6.7.33 CG4_CallbackFootSwitch................................................................................. 99
6.7.34 CG4_CallbackKeypad .................................................................................... 100
6.7.35 CG4_CallbackObjectQuality .......................................................................... 101
6.7.36 CG4_M_Capture_GetImageMask ................................................................... 102
6.7.37 CG4_M_Capture_SetAutoCapInfo .................................................................. 103
6.7.38 CG4_M_Capture_SetAutoCapArea ................................................................. 104
6.7.39 CG4_M_Capture_SetAutoCapFinMask ........................................................... 105
6.7.40 CG4_M_Control_CmdSetValue ...................................................................... 106
Contents v
Proprietary
7.6 ImageData ................................................................................................................. 109
7.7 CG4MScannerExist .................................................................................................... 110
7.8 CG4AutoCapInfo........................................................................................................ 110
Contents vi
Proprietary
1 Overview
The Cogent Fingerprint Capture (FPCaptureAccess) SDK provides a customizable interface for
the following Cogent fingerprint scanning devices:
CS500i scanner
CS500e scanner
CS500P scanner
CS1000P scanner
CS1000e scanner
CSD450, CSD450F scanner
CSD330, CSD330X scanner
CSD200 scanner CSD200i (CSD200 2013) scanner
The FPCaptureAccess SDK is a low-level SDK that provides the following functionality:
Operate each supported scanner,
The SDK is provided as a dynamic link library (DLL), and
Sample code (Visual C++ 6.0) and .Net wrapper are provided.
The FPCaptureAccess SDK is designed to be used by the OEM vendor so that they can build their
own graphical user interface, workflows, or image processing algorithms on the top of this SDK
and the corresponding drivers.
The SDK is provided as a DLL version with the sample code written in Visual C++ 6.0 as well as .Net
wrapper sample code. The SDK provides software programmers with all of the necessary
information for designing a complete biometric solution based on the 3M fingerprint/palm
scanner product line.
The interfaces of this SDK are designed to be open for support of new scanner devices as they
become available. This ensures that minimum effort is needed by the customer to integrate new
devices into an existing biometric solution.
2 Key Terms
This section describes key terms that are used throughout this Guide.
Term Description
2 - Key Terms 1
Proprietary
programming tools, and documentation.
Application Program Interface (API) An API is a set of routines, protocols, and tools for
building software applications.
3 System Requirements
The following minimum system requirements are necessary in order to use the SDK described
in this document:
Operating System:
Windows 2000 with Service Pack 4
Windows XP with Service Pack 3
Windows Vista
Windows 7 SP1 32-bit and 64-bit
Windows 8 32-bit and 64-bit (Exclude Windows RT)
Tools:
Microsoft Visual C++ 6.0, Microsoft Visual Stuido 2008
Hardware:
CPU: Core 2 Due 2.4 GHz
Memory:
1G or more memory for CS450, CS500i and CS500e
2G RAM or more memory for CS500P , CS1000P and CS1000e.
Graphics Adapter: Graphics card supporting 1024 x 768 x 24 bit colors with DirectDraw
Support, 8 MB video memory or above
PC Interface:
USB 2.0
USB 3.0 (exclude palm scanner model (CS500p)
IEEE 1394B for CS1000P, OHCI-compliant
Monitor: Supports 1024 x 768 displays. A 19-inch monitor is recommended for displaying a
resolution of 1280 x 1024. Touch-screen is an option.
3 - System Requirements 2
Proprietary
4 SDK Usage
Notes
Be sure nothing is on the platen during call CG4_Main_Initialize(CG4_M_Main_Initialize)/
CG4_Capture_Calibration(CG4_M_Capture_Calibration). During the time when the
application initializes the capture device, the optimal capture settings are determined by the
software through interactions with the hardware device. If the platen is not clear of debris
the resulting ‘calibration’ settings may not be optimal.
CG4_Capture_RegisterCallbackPreviewImage(OnPreviewImageAvailable)
CG4_Capture_RegisterCallbackResultImage(OnResultImageAvailable)
OnPreviewImageAvailable()
Application gets the running info within the
preview callback. This information applies
to rolled capture only.
CG4_Main_GetRunningInfo()
The rolled capture feature is enabled after
CG4_Capture_Start(1 object) the start function call
OnPreviewImageAvailable()
The SDK determines if the rolled capture is
CG4_Main_GetRunningInfo()
complete and sets the running info flags
Application checks running info to determine accordingly and stops the capture of new
if a rolled capture is complete images.
Signal(Capture)
CG4_Capture_TakeResultImage()
Signal(Stop Preview)
CG4_Capture_AcquireResultImage()
Signal(Capture)
OnResultImageAvailable()
The OnResultImageAvailable function is
called when the AcquireResultImage
ImageData function is invoked
The image data is returned as a parameter
of the OnResultImageAvailable() callback
interface
4 - SDK Usage 4
Proprietary
Application Capture SDK
Application SDK
Thread Thread
CG4_Capture_RegisterCallbackPreviewImage(OnPreviewImageAvailable)
CG4_Capture_RegisterCallbackResultImage(OnResultImageAvailable)
CG4_Capture_RegisterCallbackObjectQuality(OnObjectQuality)
OnPreviewImageAvailable callback is
CG4_Capture_SetMode(CG4_FLAT_RIGHT_FINGERS, AutoCapture=true) invoked after call to SetMode
Signal(Begin Preview)
OnPreviewImageAvailable()
CG4_Main_GetRunningInfo()
The auto-capture feature is enabled after
CG4_Capture_Start(4 objects) the start function call
Signal(Start Capture)
The preview callback is invoked repeatedly
until auto-capture or an the take image
function is invoked.
OnPreviewImageAvailable()
CG4_Main_GetRunningInfo()
The object quality callback is invoked when
the SDK capture criteria are met
OnObjectQuality()
Application manual capture criteria not met.
SDK auto-capture criteria met
Signal(Stop Preview)
Signal(Capture)
OnResultImageAvailable()
The OnResultImageAvailable function is
The image data is returned as a parameter called when the auto-capture criteria are
ImageData
of the OnResultImageAvailable() callback met
interface
4 - SDK Usage 5
Proprietary
Application Capture SDK
Application SDK
Thread Thread
CG4_Capture_RegisterCallbackPreviewImage(OnPreviewImageAvailable)
CG4_Capture_RegisterCallbackResultImage(OnResultImageAvailable)
CG4_Capture_RegisterCallbackObjectQuality(OnObjectQuality)
OnPreviewImageAvailable callback is
CG4_Capture_SetMode(CG4_FLAT_RIGHT_FINGERS, AutoCapture=false) invoked after call to SetMode
Signal(Begin Preview)
OnPreviewImageAvailable()
Signal(Start Capture)
The preview callback is invoked repeatedly
until auto-capture or an the take image
function is invoked.
OnPreviewImageAvailable()
CG4_Main_GetRunningInfo()
The object quality callback is invoked when
the SDK capture criteria are met
OnObjectQuality()
Application manual capture criteria met
Signal(Capture)
CG4_Capture_TakeResultImage()
Signal(Stop Preview)
CG4_Capture_AcquireResultImage()
Signal(Capture)
OnResultImageAvailable()
4 - SDK Usage 6
Proprietary
8. Initiate the result image acquisition is triggered automatically (auto capture) and/or
manually by CG4_ M_Capture_TakeResultImage().
9. Call CG4_M_Capture_AcquireResultImage() to acquire the result image. It might take
several seconds, expect a delay.
10. The result image that is passed as ImageData to the callback function
CG4_CallbackResultImage() can be obtained.
11. Repeat steps 2 through 10 to operate the other devices.
12. Call CG4_M_Main_DeInitializeAll() when finished using all of the devices.
CG4_M_Capture_RegisterCallbackPreviewImage(OnPreviewImageAvailable)
CG4_M_Capture_RegisterCallbackResultImage(OnResultImageAvailable)
OnPreviewImageAvailable()
Application gets the running info within the
preview callback. This information applies
to rolled capture only.
CG4_M_Main_GetRunningInfo()
The rolled capture feature is enabled after
CG4_M_Capture_Start(1 object) the start function call
OnPreviewImageAvailable()
The SDK determines if the rolled capture is
CG4_M_Main_GetRunningInfo()
complete and sets the running info flags
Application checks running info to determine accordingly and stops the capture of new
if a rolled capture is complete images.
Signal(Capture)
CG4_M_Capture_TakeResultImage()
Signal(Stop Preview)
CG4_M_Capture_AcquireResultImage()
Signal(Capture)
OnResultImageAvailable()
The OnResultImageAvailable function is
called when the AcquireResultImage
ImageData function is invoked
The image data is returned as a parameter
of the OnResultImageAvailable() callback
interface
4 - SDK Usage 7
Proprietary
Application Capture SDK
Application SDK
Thread Thread
CG4_M_Capture_RegisterCallbackPreviewImage(OnPreviewImageAvailable)
CG4_M_Capture_RegisterCallbackResultImage(OnResultImageAvailable)
CG4_M_Capture_RegisterCallbackObjectQuality(OnObjectQuality)
OnPreviewImageAvailable callback is
CG4_M_Capture_SetMode(CG4_FLAT_RIGHT_FINGERS, AutoCapture=true) invoked after call to SetMode
Signal(Begin Preview)
OnPreviewImageAvailable()
CG4_M_Main_GetRunningInfo()
The auto-capture feature is enabled after
CG4_M_Capture_Start(4 objects) the start function call
Signal(Start Capture)
The preview callback is invoked repeatedly
until auto-capture or an the take image
function is invoked.
OnPreviewImageAvailable()
CG4_M_Main_GetRunningInfo()
The object quality callback is invoked when
the SDK capture criteria are met
OnObjectQuality()
Application manual capture criteria not met.
SDK auto-capture criteria met
Signal(Stop Preview)
Signal(Capture)
OnResultImageAvailable()
The OnResultImageAvailable function is
The image data is returned as a parameter called when the auto-capture criteria are
ImageData
of the OnResultImageAvailable() callback met
interface
4 - SDK Usage 8
Proprietary
Application Capture SDK
Application SDK
Thread Thread
CG4_M_Capture_RegisterCallbackPreviewImage(OnPreviewImageAvailable)
CG4_M_Capture_RegisterCallbackResultImage(OnResultImageAvailable)
CG4_M_Capture_RegisterCallbackObjectQuality(OnObjectQuality)
OnPreviewImageAvailable callback is
CG4_M_Capture_SetMode(CG4_FLAT_RIGHT_FINGERS, AutoCapture=false) invoked after call to SetMode
Signal(Begin Preview)
OnPreviewImageAvailable()
Signal(Start Capture)
The preview callback is invoked repeatedly
until auto-capture or an the take image
function is invoked.
OnPreviewImageAvailable()
CG4_M_Main_GetRunningInfo()
The object quality callback is invoked when
the SDK capture criteria are met
OnObjectQuality()
Application manual capture criteria met
Signal(Capture)
CG4_M_Capture_TakeResultImage()
Signal(Stop Preview)
CG4_M_Capture_AcquireResultImage()
Signal(Capture)
OnResultImageAvailable()
int nRslt = 0;
CgRollParameters tCG4RollParm;
CG4ScannerType scannerType = CG4_SCANNER_CSD330;
// Calibrate device
nRslt = CG4_Capture_Calibration();
if (nRslt < CG4_STATUS_OK)
return –1;
When an application acquires fingerprints, it specifies the type of fingerprint it requires. Instead
of making the application define capture settings for each fingerprint type, the application can
simply request a particular fingerprint type. Please call CG4_Capture_SetMode to select the
correct acquisition type.
The application can get the current image from the scanner by calling the
CG4_CallbackPreviewImage function. This command passes back a data structure that
describes the image. The application may wish to the display the image; however, the
application must not spend too much time in the callback function because the scanner is
blocked waiting for the application to finish.
Note: The more time spent in the frame-grab callback function means the less of a frame rate
your application achieves. A low frame rate negatively affects the quality of a rolled
fingerprint.
The image received with the CG4_CallbackResultImage function reflects the final fingerprint
image as it is captured. In the case of rolled prints, the image contains the merged fingerprint
ridges. This image is known as the composite image.
Note: The scanner owns the image’s memory buffer. Do not keep pointers to this buffer
because the address of the buffer may change between fingerprint acquisitions.
//
// select correct acquisition type
//
int SetCurrentAcquistionType()
5 - Integrating with a Device 11
Proprietary
{
int nRslt = 0;
nRslt = CG4_Capture_SetMode(
m_capTypeApi,
m_ImgResolution,
m_bAutoCapture,
m_bAutoContrast,
&m_nFullImgWidth,
&m_nFullImgHeight,
&m_nBaseRslnX,
&m_nBaseRslnY);
if (nRslt != CG4_STATUS_OK)
return –1;
}
//
// start image acquisition
//
Int StartImageAcquistion()
{
Int nRslt = 0;
nRslt = CG4_Capture_Start(1);
if (nRslt == CG4_STATUS_OK)
{
nRslt = CG4_Capture_SetStartRollingFlag(TRUE);
}
Return nRslt;
}
//
// Preview image available notification.
//
void UserPreviewFuc(void* pContext, const ImageData image)
{
return;
}
//
// This notification is sent to indicate begin of result image
// acquisition..
//
void UserTakingFuc(void* pContext)
{
// …
}
//
// Result image acquisition completion notification.
//
void UserResultFuc(
void* pContext,
const int imageStatus,
const ImageData image,
const CG4ImageType imageType,
const int detectedOdbjects))
{
// …
int nRslt=0;
// Open a scanner
// ...
// ...
nRslt = CG4_Main_DeInitialize();
int nRslt=0;
CG4PropertyInfo info;
nRslt = CG4_Main_GetDeviceInfo(&info);
Function: There are three types of LEDs: finger LEDs, status LEDs, and extend LEDs. Each finger
LED or status LED value consists of one byte. Each extend LED value consists of 4-byte integers.
Extend LEDs are only for the CS500p/CS1000p/CS1000e/CSD330 scanner. Finger LED and
status LED are only for the CS500i/CS500e scanner.
Each bit controls one LED for finger LEDs. Each bit from 0 bit to 4 bit expresses the left fingers
LED, the left thumb LED, the right thumb LED, the right fingers LED, and two thumbs LED. High
3 bits are reserved. '0' turns on the LED, '1' turns off the LED.
For CS500p/CS1000p/CS1000e scanner, Each bit controls one LED for extend LEDs. First bytes
are for right hand, second bytes are for left hand. Each bit from 0 bit to 7 bit expresses the
thumb LED, the index LED, the middle LED, the ring LED, the small LED, the writer’s palm LED,
the lower palm LED, and the upper palm LED. '0' turns on the LED, '1' turns off the LED.
For CSD330 scanner, Each bit controls one LED for extend LEDs. The fourth byte is 0x40 for
default value. For the first bytes, each bit from 0 bit to 7 bit expresses the left thumb red LED,
the left thumb green LED, the left small red LED, the left small green LED, the left ring red LED,
the left ring green LED, the left middle red LED, the left middle green LED, For the second bytes,
each bit from 0 bit to 7 bit expresses the left index red LED, the left index green LED, the right
middle red LED, the right middle green LED, the right ring red LED, the right ring green LED, the
right index red LED, the right index green LED, For the third bytes, each bit from 0 bit to 3 bit
expresses the right small red LED, the right small green LED, the right thumb red LED, the right
thumb green LED, other bits a reserve.
For CSD330 scanner, Perhaps the following define constants will be more clear.
// Right Leds
const int CG_CSD330_RIGHT_THUMB_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x07ffff);
const int CG_CSD330_RIGHT_THUMB_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0bffff);
const int CG_CSD330_RIGHT_INDEX_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0f7fff);
const int CG_CSD330_RIGHT_INDEX_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fbfff);
const int CG_CSD330_RIGHT_MIDDLE_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ff7ff);
const int CG_CSD330_RIGHT_MIDDLE_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffbff);
const int CG_CSD330_RIGHT_RING_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fdfff);
const int CG_CSD330_RIGHT_RING_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fefff);
const int CG_CSD330_RIGHT_SMALL_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0dffff);
const int CG_CSD330_RIGHT_SMALL_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0effff);
// Lift Leds
const int CG_CSD330_LIFT_THUMB_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffffd);
const int CG_CSD330_LIFT_THUMB_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffffe);
const int CG_CSD330_LIFT_INDEX_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffdff);
const int CG_CSD330_LIFT_INDEX_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffeff);
const int CG_CSD330_LIFT_MIDDLE_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fff7f);
const int CG_CSD330_LIFT_MIDDLE_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fffbf);
5 - Integrating with a Device 15
Proprietary
const int CG_CSD330_LIFT_RING_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fffdf);
const int CG_CSD330_LIFT_RING_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0fffef);
const int CG_CSD330_LIFT_SMALL_GREEN = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffff7);
const int CG_CSD330_LIFT_SMALL_RED = (CG_CSD330_LIGHT_BASE_VALUE + 0x0ffffb);
The following code is an example of setting the status LEDs from left to right (e.g., "yellow, red,
green, off"):
int nRslt=0;
int ledValue = 0x1B;
The following code is an example of only turning on the right fingers LED, the other fingers
LEDs are turned off.
int nRslt=0;
int ledValue = 0xF7;
The following code is an example of only turning on the left writer’s palm LED; the other fingers
LEDs are turned off.
// For CSD330 scanner, turning on the left small red LED, the other finger
LEDs are turned off.
int nRslt=0;
const int CG_CSD330_LIGHT_BASE_VALUE = 0x40000000;
const int CG_CSD330_LIFT_SMALL_RED = (CG_CSD330_LIGHT_BASE_VALUE +
0x0ffffb);
nRslt = CG4_Controls_SetLEDs(CG4_LED_EXTEND, CG_CSD330_LIFT_SMALL_RED);
Note: The SDK controls the LED internally during the capture time, like showing the current
capture finger or the finger status. Rewriting your own LED control code might have conflicting
results.
int nRslt=0;
int BeepMode = 3;
5 - Integrating with a Device 16
Proprietary
nRslt = CG4_Controls_Beeper(BeepMode);
Function Definition
Description
This function is used to get a connection to a scanner.
Parameters
scannerExist [in/out] This is a connected scanner; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get the DLL version information.
Parameters
info [in/out] This is the DLL version information; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get the run-time information.
Parameters
info [in/out] This is the device run-time information; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to initialize the scanner.
Parameters
ScannerType [in] This is the scanner type; default value is CG4_SCANNER_CS500I.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to deinitialize the scanner.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to perform fast startup of the scanner.
Parameters
ScannerType [in] This is the scanner type; default value is CG4_SCANNER_CS500I.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to place the scanner in standby mode.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get detailed information about the scanner.
Parameters
info [in/out] This is basic device information; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the capture mode of the scanner. This function must be called
prior to calling CG4_Capture_Start().
Parameters
imageType [in] This is the image type to be captured.
resultWidth [in/out] This returns the width of the captured result image in pixels.
resultHeight [in/out] This returns the height of the captured result image in pixels.
baseResolutionX [in/out] This returns the horizontal base resolution of the image before
image processing has started.
baseResolutionY [in/out] This returns the vertical base resolution of the image before
image processing has started.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
If the AutoCapture flat is set to true, the SDK will auto-detect the fingers on the glass. If all
the required fingers are acceptable, it will auto-trigger the capture and take the resulting
image.
Function Definition
Description
This function is used to start the image acquisition.
Parameters
numberOfObjects [in] This is the number of expected fingertips in the image.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to abort the image acquisition.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
CG4_Capture_TakeResultImage();
Description
This function is used to initiate the manual result image acquisition.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
After this function call, the finger is not required on glass. Programmers need to call
another function CG4_Capture_AcquireResultImage to get the final result image.
Function Definition
CG4_Capture_AcquireResultImage();
Description
This function is used to acquire the result image. It might take a little time, up to 1.3
seconds on CS500P scanner. This function should be called immediately after
CG4_Capture_TakeResultImage function call.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to initiate the manual image acquisition.
Parameters
CapTypeApi [in] This is the image type of the active status LED.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
This function is only for CS500i/CS500e/CS500p scanner.
Function Definition
Description
This function is used to set the active status LEDs on the device.
Parameters
ledType [in] This is the image type of the active status LED.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
Some scanners do not have LED, so this function call might return an error code
“CG4_ERR_NOT_SUPPORTED”. For CS500i/CS500e, ledType can only be “CG4_LED_FINGER”
or “CG4_LED_STATUS”. For CS500p, ledType can only be “CG4_LED_EXTEND”. For other
scanners, this function should not be used.
Function Definition
Description
This function is used to send the beep pattern to the internal device beeper.
Parameters
BeepMode [in] This is the beeper mode (0…7).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to determine whether the captured flag is OK.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the start rolling flag.
Parameters
flag [in] This is the flag to start the capture of the rolled prints.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get the rolled parameters.
Parameters
para [in] This is the rolled construct parameter; memory provided by
caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the rolled parameters.
Parameters
para [in] This is the rolled construct parameter; memory provided by
caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to calibrate the scanner.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the footswitch information.
Parameters
hWnd [in] This is the Windows handler that is used to display the live
image.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback preview image information.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback taking result image information.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback result image information.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback footswitch information.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback keypad information.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback object quality information.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback object position information, which is to mark
the relative positions on preview image.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback function to indicate the current equipment
connectivity.
Parameters
callback [in] This is the pointer to the notification function.
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to preview the image available notification.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
image [in] This is the preview image (valid until the callback function is
exited).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the result of the image acquisition
completion (this is only valid if imageStatus ≥ LSCAN_STATUS_OK).
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
image [in] This is the preview image (valid until the callback function is
exited).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the message of the trigger
Footswitch.
Parameters
pContext [in] This is a caller defined context (e.g., handler object instance
pointer).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the message of the trigger
Keypad.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates fingertip quality change.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
fingerCountState [in] This is the finger count state (OK, too few, too many).
pQualityArray [in] This is a pointer to an array of finger tip quality states (array size
in quality count).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the device connectivity.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get rolling mask image.
Parameters
pImageMask [in/out] This is a rolling mask image; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set auto capture information.
Parameters
para [in] This is auto capture information.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the active area for auto capture, so that the SDK only detects the
fingers on the defined area. It’s defined as the whole capture area by default.
Parameters
bAutoCapArea [in] auto capture area flag.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the finger mask value for auto capture, which is used to control
the finger detection and LED on scanner panel.
Parameters
nFinMask [in] finger mask value.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
The default value of nFinMask is 0 for backward compatibility. When this value is 0, the API
does not use it to control LED and auto capture. In this case, the parameter
numberOfObjects in CG4_Capture_Start or CG4_M_Capture_Start function is used to control
the finger number detection in auto capture.
If the value is not 0, the lower 4 bits of nFinMask are used to control the finger number
detection and the LED from left to right. In this case, the parameter numberOfObjects in
CG4_Capture_Start or CG4_M_Capture_Start function is ignored.
For example:
0x0F means all 4 fingers should exist. If all four fingers are detected in auto capture, all LED
will be lit.
0x05 means the middle finger and little finger on right slap should exist.
Function Definition
Description
This function is used to enable or disable the feature options.
Parameters
dwCommandMask [in] Option masks
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
This function can be used to enable or disable the Halo Removal feature (software solution).
By default, this feature is disabled.
The following code provides an example of initializing two devices. First, the CS500e and
CSD330 scanners should be plugged into a PC.
int nRslt = 0;
CG4MScannerExist tScannerExist;
int nHandle500e = -1, nHandle330 = -1;
CgRollParameters tCG4RollParm;
Proprietary
if (-1 == nHandle500e)
… // some error handling, no 500e scanner detected
// Calibrate device
nRslt = CG4_M_Capture_Calibration(nHandle500e);
if (nRslt < CG4_STATUS_OK)
return –1;
if (-1 == nHandle330)
… // some error handling, no CSD330 scanner detected
if (tScannerExist.scannerType[1] != CG4_SCANNER_CSD330)
return –1;
nRslt = CG4_M_Main_Initialize(1, &nHandle330);
if (nRslt<CG4_STATUS_OK)
return –1;
Proprietary
nRslt = CG4_M_Capture_SetRollParameters(nHandle330, tCG4RollParm);
if (nRslt<CG4_STATUS_OK)
return –1;
// Calibrate device
nRslt = CG4_M_Capture_Calibration(nHandle330);
if (nRslt < CG4_STATUS_OK)
return –1;
When an application acquires fingerprints, it specifies the type of fingerprint it requires. Instead
of making the application define capture settings for each fingerprint type, the application can
simply request a particular fingerprint type. Please call CG4_M_Capture_SetMode to select the
correct acquisition type.
The application can get the current image from the scanner by calling the
CG4_M_CallbackPreviewImage function. This command passes back a data structure that
describes the image. The application may wish to display the image; however, the application
must not spend too much time in the callback function because the scanner is blocked waiting
for the application to finish.
Note: The more time spent in the frame-grab callback function, the lower the frame rate your
application achieves. A low frame rate negatively affects the quality of a rolled
fingerprint.
The image received with the CG4_M_CallbackResultImage function reflects the final fingerprint
image as it is captured. In the case of rolled prints, the image contains the stitched fingerprint
ridges. This image is known as the composite image.
Note: The scanner owns the image’s memory buffer. Do not keep pointers to this buffer
because the address of the buffer may change between fingerprint acquisitions.
Proprietary
6.2.4 Putting It All Together
//
// select correct acquisition type
//
int SetCurrentAcquistionType()
{
int nRslt = 0;
nRslt = CG4_M_Capture_SetMode(
Handle,//Device handle obtained by CG4_M_Main_Initialize()
m_capTypeApi,
m_ImgResolution,
m_bAutoCapture,
m_bAutoContrast,
&m_nFullImgWidth,
&m_nFullImgHeight,
&m_nBaseRslnX,
&m_nBaseRslnY);
if (nRslt != CG4_STATUS_OK)
return –1;
}
//
// start image acquisition
//
Int StartImageAcquistion()
{
Int nRslt = 0;
Return nRslt;
Proprietary
}
//
// Preview image available notification.
//
void UserPreviewFuc(void* pContext, const ImageData image)
{
return;
}
//
// This notification is sent to indicate begin of result image
// acquisition..
//
void UserTakingFuc(void* pContext)
{
// …
}
//
// Result image acquisition completion notification.
//
void UserResultFuc(
void* pContext,
const int imageStatus,
const ImageData image,
const CG4ImageType imageType,
const int detectedOdbjects))
{
// …
Proprietary
{
// Result image acquisition is done
CG4_M_Controls_Beeper(Handle, 3);
// use image to handle result image
// …
}
else
{
// Result image acquisition is failed
}
int nRslt=0;
// Open a scanner
// ...
// ...
// Open a scanner
// ...
// ...
nRslt = CG4_M_Main_DeInitializeAll();
Proprietary
6.4 Accessing Maintenance Data
The scanner places maintenance data in the device’s data store. Applications have access to this
data and can read the data from the device at any time. To read the data, call the function
CG4_M_Main_GetDeviceInfo. The following code shows an example:
int nRslt=0;
CG4PropertyInfo info;
Function: There are three types of LEDs: finger LEDs, status LEDs, and extend LEDs. Each finger
LED or status LED value consists of one byte. Each extend LED value consists of 4-byte integers.
Extend LEDs are only for CS500p scanner. Finger LED and status LED are only for
CS500i/CS500e scanner.
Each bit controls one LED for finger LEDs. Each bit from 0 bit to 4 bit expresses the left fingers
LED, the left thumb LED, the right thumb LED, the right fingers LED, and two thumbs LED. High
3 bits are reserved. '0' turns on the LED, '1' turns off the LED.
Each bit controls one LED for extend LEDs. First bytes are for right hand, second bytes are for
left hand. Each bit from 0 bit to 7 bit expresses the thumb LED, the index LED, the middle LED,
the ring LED, the small LED, the writer’s palm LED, the lower palm LED, and the upper palm
LED. '0' turns on the LED, '1' turns off the LED.
The following code is an example of setting the status LEDs from left to right (e.g., "yellow, red,
green, off"):
int nRslt=0;
int ledValue = 0x1B;
The following code is an example of only turning on the right fingers LED, the other fingers
LEDs are turned off.
int nRslt=0;
6 - Integrating with Multiple Devices 65
Proprietary
int ledValue = 0xF7;
The following code is an example of only turning on the left writer’s palm LED; the other fingers
LEDs are turned off.
int nRslt=0;
int ledValue = 0xFFDF;
nRslt = CG4_M_Controls_SetLEDs(Handle, CG4_LED_EXTEND, ledValue);
Note: The SDK controls the LED internally during the capture time, like showing the current
capture finger or the finger status. Rewriting your own LED control code might have
conflicting results.
int nRslt=0;
int BeepMode = 3;
Proprietary
6.7.1 CG4_M_Main_GetConnectedScanner
Function Definition
Description
This function is used to get connected scanner devices.
Parameters
scannerExist [in/out] This is connected scanner devices; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get the DLL version information.
Parameters
info [in/out] This is the DLL version information; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get the run-time information.
Parameters
handle [in] This is the device handle obtained by CG4_M_Main_Initialize().
info [in/out] This is the device run-time information; memory provided by caller.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to initialize the scanner.
Parameters
deviceIndex [in] Zero-based device index for device to init.
handle [in/out] This function returns device handle to be used for subsequent
function calls.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to deinitialize the scanner.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to deinitialize all currently initialized scanners.
Parameters
None
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to check if device is fully initialized.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get detailed information about the scanner.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the capture mode of the scanner. This function must be called
prior to calling CG4_M_Capture_Start ().
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
resultWidth [in/out] This returns the width of the captured result image in pixels.
resultHeight [in/out] This returns the height of the captured result image in pixels.
baseResolutionX [in/out] This returns the horizontal base resolution of the image before
image processing has started.
baseResolutionY [in/out] This returns the vertical base resolution of the image before
image processing has started.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
If the AutoCapture flag is set to true, the SDK will auto-detect the fingers on glass. If all the
required fingers are good, it will auto-trigger the capture and take the resulting image.
Function Definition
Description
This function is used to start the image acquisition.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to abort the image acquisition.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to initiate the manual result image acquisition.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
After this function is called, the finger is not required on the glass. Programmers need to
call another function CG4_M_Capture_AcquireResultImage to get the final result image.
Function Definition
Description
This function is used to acquire the result image. It might take a little time, up to 1.3
seconds on CS500P scanner. This function should be called immediately after
CG4_M_Capture_TakeResultImage function call.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set active status LEDs on device.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
CapTypeApi [in] This is the image type of the active status LED.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
This function is only for CS500i/CS500e/CS500p scanner.
Function Definition
Description
This function is used to set the active status LEDs on the device.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
ledType [in] This is the image type of the active status LED.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
Some scanners do not have LEDs, so this function call might return an error code
“CG4_ERR_NOT_SUPPORTED”. For CS500i/CS500e, ledType can only be “CG4_LED_FINGER”
or “CG4_LED_STATUS”. For CS500p, ledType can only be “CG4_LED_EXTEND”. For other
scanners, this function should not be used.
Function Definition
Description
This function is used to send the beep pattern to the internal device beeper.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to determine whether the captured flag is OK.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the start rolling flag.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
flag [in] This is the flag to start the capture of the rolled prints.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to get the rolled parameters.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the rolled parameters.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to calibrate the scanner.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the footswitch information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
hWnd [in] This is the Windows handler that is used to display the live
image.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback preview image information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback taking result image information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback result image information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback footswitch information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback keypad information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback object quality information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback object position information, which is to mark
the relative positions on preview image.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to register the callback function to notify the connectivity for specified
device.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
context [in] This is the pointer to the user context; this value is used as a
parameter for callback.
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to preview the image available notification.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
image [in] This is the preview image (valid until the callback function is
exited).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the result of the image acquisition
completion (this is only valid if imageStatus ≥ LSCAN_STATUS_OK).
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
image [in] This is the preview image (valid until the callback function is
exited).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the message of the trigger
Footswitch.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates the message of the trigger
Keypad.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to send a notification that indicates fingertip quality change.
Parameters
pContext [in] This is a caller-defined context (e.g., handler object instance
pointer).
fingerCountState [in] This is the finger count state (OK, too few, too many).
pQualityArray [in] This is a pointer to an array of finger tip quality states (array size
in quality count).
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
Get rolling mask image.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function sets auto capture information.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the active area of auto capture. The active area is set to the
whole capture area by default.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
None
Function Definition
Description
This function is used to set the finger mask value for auto capture, which is used to control
the finger detection and LED on scanner panel.
Parameters
handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
The default value of nFinMask is 0 for backward compatibility. When this value is 0, the API
does not use it to control LED and auto capture. In this case, the parameter
numberOfObjects in CG4_Capture_Start or CG4_M_Capture_Start function is used to
control the finger number detection in auto capture.
If the value is not 0, the lower 4 bits of nFinMask are used to control the finger number
detection and the LED from left to right. In this case, the parameter numberOfObjects in
CG4_Capture_Start or CG4_M_Capture_Start function is ignored.
For example:
0x0F means all 4 fingers should exist. If all four fingers are detected in auto capture, all LED
will be lit.
0x05 means the middle finger and little finger on right slap should exist.
Function Definition
Description
This function is used to enable and disable the options.
Parameters
Handle [in] Device handle obtained by CG4_M_Main_Initialize().
Return Values
CG4_STATUS_OK Success
< CG4_STATUS_OK Error: Please refer to Appendix A for the error code definitions.
Notes
This function can be used to enable or disable the Halo Removal feature (software solution).
By default, this feature is disabled.
7.1 CG4ScannerExist
Description
This data structure is used to return the connected scanners.
Members
int nDevConnected This is a count of the number of connected
scanners.
7.2 CG4ApiVersion
Description
This struct is used to describe the container that is used for holding the version
information.
Members
char Product[CG4_MAX_STR_LEN] This is the product version string.
7.3 CG4PropertyInfo
Description
Members
int nResolution This is the resolution (500 or 1000 ppi).
7.4 CG4RunningInfo
Description
This struct is used to describe the device running information.
Members
bool bIsInitialized This is the flag for initialize the device.
bool bIsCaptureOK This is the flag for determining if the capture is OK.
bool bIsStartRolling This is the flag to start capture of the rolled prints.
7.5 CgRollParameters
Description
This struct is used to describe the rolled construct parameters.
7.6 ImageData
Description
This struct is used as a container to hold image data together with meta information.
Members
void* Buffer This is a pointer to the image buffer.
7.7 CG4MScannerExist
Description
This struct is used get connected scanner devices.
Members
int nDevConnected This is the number of connected devices.
7.8 CG4AutoCapInfo
Description
This struct is used set auto capture information.
Members
int nLiveRes The resolution of Live image
int nAutoCap_GreyLevel This item control the minimum average grey level for
each fingerprint block (the default value is 230).
double dAutoCap_SquarePecent This item means how many percentage over the whole
int nAutoCap_Qua This item controls the fingerprint quality (the default
value is 12).
int nAutoCap_NoMoveFrames This item means how many still frames need to be
detected before trigger (the default value is 3).
int nAutoCap_MaxDevGrey This item controls the fingerprint gray level (the
default value is 15).
int nAutoCap_MaxDevSquare This item controls the fingerprint area shift between
two continuous image frames (the default value is
3000).
8.1 CG4ImageType
Description
This enumeration is used to describe the image types. The enumerations are used as
parameters for CG4_Capture_SetMode.
Enumerators
CG4_ROLL_SINGLE_FINGER This is the rolled fingerprint image.
8.2 CG4ImageResolution
Description
This enumeration is used to describe the image resolution types. They are used as
parameters for CG4_Capture_SetMode.
Enumerators
CG4_IMAGE_RESOLUTION_500 500 ppi
8.3 CG4LedType
Description
This enumeration is used to describe the LED field types.
Enumerators
CG4_LED_FINGER These are the LEDs for indicating the finger LEDs.
CG4_LED_STATUS These are the LEDs for indicating the status LEDs.
CG4_LED_EXTEND These are the LEDs for indicating the extend LEDs.
8.4 CG4ScannerType
Description
This enumeration is used to describe the scanner types.
Enumerators
CG4_SCANNER_CSD330 CSD330 scanner.
Enumerators
IMG_FORMAT_GRAY This is the grayscale image.
8.6 CG4ObjectQualityState
Description
This enumeration is used to describe the quality state definitions for detected finger/hand.
Enumerators
CG4_OBJECT_NOT_PRESENT Object not detected
8.7 CG4ObjectCountState
Description
This enumeration is used to describe the object/finger count state definitions.
Enumerators
CG4_OBJECT_COUNT_OK Object count is OK
8.8 CG4KeypadType
Description
This enumeration is used to describe the Keypad types.
Enumerators
CG4_KEYPAD_C_KEYS Keypad 'C' button
Name Description
Name Description
Name Description
Appendix A 119
Proprietary