.. index:: 
  !Image.toRawBuffer Method
  
.. _id3_face_image_to_raw_buffer_class_method:

===============================================================================
Image.toRawBuffer Method
===============================================================================

Module: :ref:`Image<id3_face_image_class>`

Definition
----------

Copies image pixels in the specified format into a buffer.


.. tab-set::

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

      .. code:: Python

        to_raw_buffer(self, pixel_format: PixelFormat, buffer: ImageBuffer) -> None

      **Parameters**

        .. line-block::

          ``pixel_format`` :ref:`PixelFormat<id3_face_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_face_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **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 toRawBuffer(PixelFormat pixelFormat, ImageBuffer buffer)

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_face_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_face_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **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 ToRawBuffer(PixelFormat pixelFormat, ImageBuffer buffer)

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_face_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_face_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **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 toRawBuffer(PixelFormat pixelFormat, ImageBuffer buffer) throws FaceException

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_face_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_face_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **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 toRawBuffer(pixelFormat: PixelFormat, buffer: ImageBuffer) throws

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_face_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_face_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **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 id3FaceImage_ToRawBuffer (
            ID3_FACE_IMAGE hImage, 
            id3FacePixelFormat ePixelFormat, 
            ID3_FACE_IMAGE_BUFFER hBuffer)

      **Parameters**

        .. line-block::

          ``hImage`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`in` Handle to the Image object.

          ``ePixelFormat`` :ref:`id3FacePixelFormat<id3_face_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``hBuffer`` :ref:`ID3_FACE_IMAGE_BUFFER<id3_face_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Returns**

        .. line-block::

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


