.. index:: 
  !FacePad.detectAttackSupport Method
  
.. _id3_face_face_pad_detect_attack_support_class_method:

===============================================================================
FacePad.detectAttackSupport Method
===============================================================================

Module: :ref:`FacePad<id3_face_face_pad_class>`

Definition
----------

Detects if an attack support surrounds the detected face.

The recommended usage is to consider the image to be an attack as soon as an attack support is detected.

.. important:: Loading the ``FaceAttackSupportDetector`` model is required to use this function.


.. tab-set::

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

      .. code:: Python

        detect_attack_support(self, image: Image, detected_face: DetectedFace) -> DetectedFaceAttackSupport

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detected_face`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`DetectedFaceAttackSupport<id3_face_detected_face_attack_support_struct>`
          The detected face attack support.

      **Exceptions**

        .. line-block::

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


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

      .. code:: Dart

        DetectedFaceAttackSupport detectAttackSupport(Image image, DetectedFace detectedFace)

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`DetectedFaceAttackSupport<id3_face_detected_face_attack_support_struct>`
          The detected face attack support.

      **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 DetectedFaceAttackSupport DetectAttackSupport(Image image, DetectedFace detectedFace)

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`DetectedFaceAttackSupport<id3_face_detected_face_attack_support_struct>`
          The detected face attack support.

      **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 DetectedFaceAttackSupport detectAttackSupport(Image image, DetectedFace detectedFace) throws FaceException

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`DetectedFaceAttackSupport<id3_face_detected_face_attack_support_struct>`
          The detected face attack support.

      **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 detectAttackSupport(image: Image, detectedFace: DetectedFace) throws -> DetectedFaceAttackSupport

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.


      **Returns**

        .. line-block::

          :ref:`DetectedFaceAttackSupport<id3_face_detected_face_attack_support_struct>`
          The detected face attack support.

      **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 id3FacePad_DetectAttackSupport (
            ID3_FACE_PAD hFacePad, 
            ID3_FACE_IMAGE hImage, 
            ID3_DETECTED_FACE hDetectedFace, 
            id3DetectedFaceAttackSupport * sDetectedFaceAttackSupport)

      **Parameters**

        .. line-block::

          ``hFacePad`` :ref:`ID3_FACE_PAD<id3_face_face_pad_class>`
          :guilabel:`in` Handle to the FacePad object.

          ``hImage`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``hDetectedFace`` :ref:`ID3_DETECTED_FACE<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``sDetectedFaceAttackSupport`` :ref:`id3DetectedFaceAttackSupport *<id3_face_detected_face_attack_support_struct>`
          :guilabel:`out` The detected face attack support.


      **Returns**

        .. line-block::

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


