.. index:: 
  !PortraitProcessor.detectPresentationAttack Method
  
.. _id3_face_portrait_processor_detect_presentation_attack_class_method:

===============================================================================
PortraitProcessor.detectPresentationAttack Method
===============================================================================

Module: :ref:`PortraitProcessor<id3_face_portrait_processor_class>`

Definition
----------

Detects a possible presentation attack.

.. important:: This method requires the ``FaceColorBasedPad`` models to be loaded.


.. tab-set::

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

      .. code:: Python

        detect_presentation_attack(self, portrait: Portrait) -> None

      **Parameters**

        .. line-block::

          ``portrait`` :ref:`Portrait<id3_face_portrait_class>`
          :guilabel:`in` The portrait.


      **Exceptions**

        .. line-block::

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


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

      .. code:: Dart

        void detectPresentationAttack(Portrait portrait)

      **Parameters**

        .. line-block::

          ``portrait`` :ref:`Portrait<id3_face_portrait_class>`
          :guilabel:`in` The portrait.


      **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 void DetectPresentationAttack(Portrait portrait)

      **Parameters**

        .. line-block::

          ``portrait`` :ref:`Portrait<id3_face_portrait_class>`
          :guilabel:`in` The portrait.


      **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 void detectPresentationAttack(Portrait portrait) throws FaceException

      **Parameters**

        .. line-block::

          ``portrait`` :ref:`Portrait<id3_face_portrait_class>`
          :guilabel:`in` The portrait.


      **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 detectPresentationAttack(portrait: Portrait) throws

      **Parameters**

        .. line-block::

          ``portrait`` :ref:`Portrait<id3_face_portrait_class>`
          :guilabel:`in` The portrait.


      **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 id3FacePortraitProcessor_DetectPresentationAttack (
            ID3_FACE_PORTRAIT_PROCESSOR hPortraitProcessor, 
            ID3_FACE_PORTRAIT hPortrait)

      **Parameters**

        .. line-block::

          ``hPortraitProcessor`` :ref:`ID3_FACE_PORTRAIT_PROCESSOR<id3_face_portrait_processor_class>`
          :guilabel:`in` Handle to the PortraitProcessor object.

          ``hPortrait`` :ref:`ID3_FACE_PORTRAIT<id3_face_portrait_class>`
          :guilabel:`in` The portrait.


      **Returns**

        .. line-block::

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


