Added SharedMatrix
[profile/ivi/opencv.git] / modules / core / doc / ipp_async_converters.rst
1 IntelĀ® IPP Asynchronous C/C++ Converters
2 ========================================
3
4 .. highlight:: cpp
5
6 General Information
7 -------------------
8
9 This section describes conversion between OpenCV and `IntelĀ® IPP Asynchronous C/C++ <http://software.intel.com/en-us/intel-ipp-preview>`_ library.
10 `Getting Started Guide <http://registrationcenter.intel.com/irc_nas/3727/ipp_async_get_started.htm>`_ help you to install the library, configure header and library build paths.
11
12 hpp::getHpp
13 -----------
14 Create ``hppiMatrix`` from ``Mat``.
15
16 .. ocv:function:: hppiMatrix* hpp::getHpp(const Mat& src, hppAccel accel)
17
18     :param src: input matrix.
19     :param accel: accelerator instance. Supports type:
20
21             * **HPP_ACCEL_TYPE_CPU** - accelerated by optimized CPU instructions.
22
23             * **HPP_ACCEL_TYPE_GPU** - accelerated by GPU programmable units or fixed-function accelerators.
24
25             * **HPP_ACCEL_TYPE_ANY** - any acceleration or no acceleration available.
26
27 This function allocates and initializes the ``hppiMatrix`` that has the same size and type as input matrix, returns the ``hppiMatrix*``.
28
29 If you want to use zero-copy for GPU you should to have 4KB aligned matrix data. See details `hppiCreateSharedMatrix <http://software.intel.com/ru-ru/node/501697>`_.
30
31 Supports ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32S``, ``CV_32F``, ``CV_64F``.
32
33 .. note:: The ``hppiMatrix`` pointer to the image buffer in system memory refers to the ``src.data``. Control the lifetime of the matrix and don't change its data, if there is no special need.
34 .. seealso:: :ref:`howToUseIPPAconversion`, :ocv:func:`hpp::getMat`
35
36
37 hpp::getMat
38 -----------
39 Create ``Mat`` from ``hppiMatrix``.
40
41 .. ocv:function:: Mat hpp::getMat(hppiMatrix* src, hppAccel accel, int cn)
42
43     :param src: input hppiMatrix.
44
45     :param accel: accelerator instance (see :ocv:func:`hpp::getHpp` for the list of acceleration framework types).
46
47     :param cn: number of channels.
48
49 This function allocates and initializes the ``Mat`` that has the same size and type as input matrix.
50 Supports ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32S``, ``CV_32F``, ``CV_64F``.
51
52 .. seealso:: :ref:`howToUseIPPAconversion`, :ocv:func:`hpp::copyHppToMat`, :ocv:func:`hpp::getHpp`.
53
54
55 hpp::copyHppToMat
56 -----------------
57 Convert ``hppiMatrix`` to ``Mat``.
58
59 .. ocv:function:: void hpp::copyHppToMat(hppiMatrix* src, Mat& dst, hppAccel accel, int cn)
60
61     :param src: input hppiMatrix.
62
63     :param dst: output matrix.
64
65     :param accel: accelerator instance (see :ocv:func:`hpp::getHpp` for the list of acceleration framework types).
66
67     :param cn: number of channels.
68
69 This function allocates and initializes new matrix (if needed) that has the same size and type as input matrix.
70 Supports ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32S``, ``CV_32F``, ``CV_64F``.
71
72 .. seealso:: :ref:`howToUseIPPAconversion`, :ocv:func:`hpp::getMat`, :ocv:func:`hpp::getHpp`.