.. index:: 
  !FaceTemplate.toBdt Method
  
.. _id3_face_face_template_to_bdt_class_method:

===============================================================================
FaceTemplate.toBdt Method
===============================================================================

Module: :ref:`FaceTemplate<id3_face_face_template_class>`

Definition
----------

Exports the face template object to a Biometric Data Template (BDT) buffer.

This buffer can only be used with id3 Face Match on Card specific implementations to verify a face template.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        to_bdt(self) -> bytearray

      **Returns**

        .. line-block::

          ``bytearray``
          A buffer that receives the biometric data template.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        Uint8List toBdt()

      **Returns**

        .. line-block::

          ``Uint8List``
          A buffer that receives the biometric data template.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public byte[] ToBdt()

      **Returns**

        .. line-block::

          ``byte[]``
          A buffer that receives the biometric data template.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public byte[] toBdt() throws FaceException

      **Returns**

        .. line-block::

          ``byte[]``
          A buffer that receives the biometric data template.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func toBdt() throws -> [UInt8]

      **Returns**

        .. line-block::

          ``[UInt8]``
          A buffer that receives the biometric data template.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3FaceTemplate_ToBdt (
            ID3_FACE_TEMPLATE hFaceTemplate, 
            unsigned char * data, 
            int * dataSize)

      **Parameters**

        .. line-block::

          ``hFaceTemplate`` :ref:`ID3_FACE_TEMPLATE<id3_face_face_template_class>`
          :guilabel:`in` Handle to the FaceTemplate object.

          ``data`` unsigned char *
          :guilabel:`out` A buffer that receives the biometric data template.

          ``dataSize`` int *
          :guilabel:`in` Size of the 'data' buffer. Receives the number of elements in the 'data' array.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


