.. index:: 
  !FaceTemplate.fromBuffer Method
  
.. _id3_face_face_template_from_buffer_class_method:

===============================================================================
FaceTemplate.fromBuffer Method
===============================================================================

Module: :ref:`FaceTemplate<id3_face_face_template_class>`

Definition
----------

Imports the face template object from a buffer.


.. tab-set::

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

      .. code:: Python

        @staticmethod
        from_buffer(data: bytearray) -> FaceTemplate

      **Parameters**

        .. line-block::

          ``data`` bytearray
          :guilabel:`in` Buffer to import the face template object from.


      **Returns**

        .. line-block::

          :ref:`FaceTemplate<id3_face_face_template_class>`
          The newly created face 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

        static FaceTemplate fromBuffer(Uint8List? data)

      **Parameters**

        .. line-block::

          ``data`` Uint8List
          :guilabel:`in` Buffer to import the face template object from.


      **Returns**

        .. line-block::

          :ref:`FaceTemplate<id3_face_face_template_class>`
          The newly created face 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 static FaceTemplate FromBuffer(byte[] data)

      **Parameters**

        .. line-block::

          ``data`` byte[]
          :guilabel:`in` Buffer to import the face template object from.


      **Returns**

        .. line-block::

          :ref:`FaceTemplate<id3_face_face_template_class>`
          The newly created face 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 static FaceTemplate fromBuffer(byte[] data) throws FaceException

      **Parameters**

        .. line-block::

          ``data`` byte[]
          :guilabel:`in` Buffer to import the face template object from.


      **Returns**

        .. line-block::

          :ref:`FaceTemplate<id3_face_face_template_class>`
          The newly created face 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 static func fromBuffer(data: [UInt8]) throws -> FaceTemplate

      **Parameters**

        .. line-block::

          ``data`` [UInt8]
          :guilabel:`in` Buffer to import the face template object from.


      **Returns**

        .. line-block::

          :ref:`FaceTemplate<id3_face_face_template_class>`
          The newly created face 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_FromBuffer (
            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:`in` Buffer to import the face template object from.

          ``dataSize`` int
          :guilabel:`in` Size of the 'data' buffer.


      **Returns**

        .. line-block::

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


