Griaule Biometrics

Home » GrCovertTemplate

GrCovertTemplate

The Fingerprint SDK library must have been previously initialized.
The template array must be already allocated. The recommended size is GR_MAX_SIZE_TEMPLATE bytes.

Prerequisites The template array must be already allocated. The recommended size is GR_MAX_SIZE_TEMPLATE bytes.

Return On success, GR_OK is returned.
On failure, the appropriate error code is returned.

Parameters

[in] oldTpt

The template to convert.

[out] newTpt

The converted template.

[in,out] newTptSize

[in]The maximum size in bytes of the byte array supplied.
[out] The size in bytes of the converted template.

[in] context

Context in which the extraction will be performed.

[in] format

The template format to be used.

Declaration

C++

int __stdcall GrConvertTemplate(char* oldTpt, char* newTpt, int* newTptSize, int context, int format);

Delphi

function GrConvertTemplate(oldTpt: Pchar; newTpt: PChar; var newTptSize: Integer; context: Integer; format: Integer): Integer; stdcall;

Sample Code

C++

int result;
// set current buffer size for the extract template
_newTpt->_size = GR_MAX_SIZE_TEMPLATE;
result = GrConvertTemplate((char*)_oldTpt, (char*)_newTpt->_tpt, &_newTpt->_size, GR_DEFAULT_CONTEXT, GR_FORMAT_DEFAULT);

// if error, set template size to 0
if (result < 0){
// Result < 0 => conversion problem
_newTpt->_size = 0;
}


Delphi



Var
ret: Integer;
Begin
// set current buffer size for the extract template
newTemplate.size := GR_MAX_SIZE_TEMPLATE;
ret := GrConvertTemplate(oldTemplate.tpt, newTemplate.tpt, newTemplate.size, GR_DEFAULT_CONTEXT, GR_FORMAT_DEFAULT);
// if error, set template size to 0
// Result < 0 => conversion problem
if (ret < 0 ) then
newTemplate.size := 0;
End;