.. index:: 
  !DetectedFace.toBuffer Method
  
.. _id3_face_detected_face_to_buffer_class_method:

===============================================================================
DetectedFace.toBuffer Method
===============================================================================

Module: :ref:`DetectedFace<id3_face_detected_face_class>`

Definition
----------

Exports the face object to a buffer.


.. tab-set::

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

      .. code:: Python

        to_buffer(self) -> bytearray

      **Returns**

        .. line-block::

          ``bytearray``
          The buffer to which the face object is exported.

      **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 toBuffer()

      **Returns**

        .. line-block::

          ``Uint8List``
          The buffer to which the face object is exported.

      **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[] ToBuffer()

      **Returns**

        .. line-block::

          ``byte[]``
          The buffer to which the face object is exported.

      **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[] toBuffer() throws FaceException

      **Returns**

        .. line-block::

          ``byte[]``
          The buffer to which the face object is exported.

      **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 toBuffer() throws -> [UInt8]

      **Returns**

        .. line-block::

          ``[UInt8]``
          The buffer to which the face object is exported.

      **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 id3DetectedFace_ToBuffer (
            ID3_DETECTED_FACE hDetectedFace, 
            unsigned char * data, 
            int * dataSize)

      **Parameters**

        .. line-block::

          ``hDetectedFace`` :ref:`ID3_DETECTED_FACE<id3_face_detected_face_class>`
          :guilabel:`in` Handle to the DetectedFace object.

          ``data`` unsigned char *
          :guilabel:`out` The buffer to which the face object is exported.

          ``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.


