Opencv 3.1 project on GR-PEACH board

Fork of gr-peach-opencv-project by the do

Embed: (wiki syntax)

« Back to documentation index

DirectX interoperability

DirectX interoperability
[Core functionality]

Functions

CV_EXPORTS Context & initializeContextFromD3D11Device (ID3D11Device *pD3D11Device)
 Creates OpenCL context from D3D11 device.
CV_EXPORTS Context & initializeContextFromD3D10Device (ID3D10Device *pD3D10Device)
 Creates OpenCL context from D3D10 device.
CV_EXPORTS Context & initializeContextFromDirect3DDevice9Ex (IDirect3DDevice9Ex *pDirect3DDevice9Ex)
 Creates OpenCL context from Direct3DDevice9Ex device.
CV_EXPORTS Context & initializeContextFromDirect3DDevice9 (IDirect3DDevice9 *pDirect3DDevice9)
 Creates OpenCL context from Direct3DDevice9 device.
CV_EXPORTS void convertToD3D11Texture2D (InputArray src, ID3D11Texture2D *pD3D11Texture2D)
 Converts InputArray to ID3D11Texture2D.
CV_EXPORTS void convertFromD3D11Texture2D (ID3D11Texture2D *pD3D11Texture2D, OutputArray dst)
 Converts ID3D11Texture2D to OutputArray.
CV_EXPORTS void convertToD3D10Texture2D (InputArray src, ID3D10Texture2D *pD3D10Texture2D)
 Converts InputArray to ID3D10Texture2D.
CV_EXPORTS void convertFromD3D10Texture2D (ID3D10Texture2D *pD3D10Texture2D, OutputArray dst)
 Converts ID3D10Texture2D to OutputArray.
CV_EXPORTS void convertToDirect3DSurface9 (InputArray src, IDirect3DSurface9 *pDirect3DSurface9, void *surfaceSharedHandle=NULL)
 Converts InputArray to IDirect3DSurface9.
CV_EXPORTS void convertFromDirect3DSurface9 (IDirect3DSurface9 *pDirect3DSurface9, OutputArray dst, void *surfaceSharedHandle=NULL)
 Converts IDirect3DSurface9 to OutputArray.
CV_EXPORTS int getTypeFromDXGI_FORMAT (const int iDXGI_FORMAT)
 Get OpenCV type from DirectX type.
CV_EXPORTS int getTypeFromD3DFORMAT (const int iD3DFORMAT)
 Get OpenCV type from DirectX type.

Function Documentation

void convertFromD3D10Texture2D ( ID3D10Texture2D *  pD3D10Texture2D,
OutputArray  dst 
)

Converts ID3D10Texture2D to OutputArray.

Note:
Note: function does memory copy from pD3D10Texture2D to dst
Parameters:
pD3D10Texture2D- source D3D10 texture
dst- destination OutputArray

Definition at line 1064 of file directx.cpp.

void convertFromD3D11Texture2D ( ID3D11Texture2D *  pD3D11Texture2D,
OutputArray  dst 
)

Converts ID3D11Texture2D to OutputArray.

If input texture format is DXGI_FORMAT_NV12 then data will be upsampled and color-converted to BGR format.

Note:
Note: Destination matrix will be re-allocated if it has not enough memory to match texture size. function does memory copy from pD3D11Texture2D to dst
Parameters:
pD3D11Texture2D- source D3D11 texture
dst- destination OutputArray

Definition at line 872 of file directx.cpp.

void convertFromDirect3DSurface9 ( IDirect3DSurface9 *  pDirect3DSurface9,
OutputArray  dst,
void *  surfaceSharedHandle = NULL 
)

Converts IDirect3DSurface9 to OutputArray.

Note:
Note: function does memory copy from pDirect3DSurface9 to dst
Parameters:
pDirect3DSurface9- source D3D10 texture
dst- destination OutputArray
surfaceSharedHandle- shared handle

Definition at line 1219 of file directx.cpp.

void convertToD3D10Texture2D ( InputArray  src,
ID3D10Texture2D *  pD3D10Texture2D 
)

Converts InputArray to ID3D10Texture2D.

Note:
Note: function does memory copy from src to pD3D10Texture2D
Parameters:
src- source InputArray
pD3D10Texture2D- destination D3D10 texture

Definition at line 1003 of file directx.cpp.

void convertToD3D11Texture2D ( InputArray  src,
ID3D11Texture2D *  pD3D11Texture2D 
)

Converts InputArray to ID3D11Texture2D.

If destination texture format is DXGI_FORMAT_NV12 then input UMat expected to be in BGR format and data will be downsampled and color-converted to NV12.

Note:
Note: Destination texture must be allocated by application. Function does memory copy from src to pD3D11Texture2D
Parameters:
src- source InputArray
pD3D11Texture2D- destination D3D11 texture

Definition at line 765 of file directx.cpp.

void convertToDirect3DSurface9 ( InputArray  src,
IDirect3DSurface9 *  pDirect3DSurface9,
void *  surfaceSharedHandle = NULL 
)

Converts InputArray to IDirect3DSurface9.

Note:
Note: function does memory copy from src to pDirect3DSurface9
Parameters:
src- source InputArray
pDirect3DSurface9- destination D3D10 texture
surfaceSharedHandle- shared handle

Definition at line 1151 of file directx.cpp.

int getTypeFromD3DFORMAT ( const int  iD3DFORMAT )

Get OpenCV type from DirectX type.

Parameters:
iD3DFORMAT- enum D3DTYPE for D3D9
Returns:
OpenCV type or -1 if there is no equivalent

Definition at line 180 of file directx.cpp.

int getTypeFromDXGI_FORMAT ( const int  iDXGI_FORMAT )

Get OpenCV type from DirectX type.

Parameters:
iDXGI_FORMAT- enum DXGI_FORMAT for D3D10/D3D11
Returns:
OpenCV type or -1 if there is no equivalent

Definition at line 62 of file directx.cpp.

cv::ocl::Context & initializeContextFromD3D10Device ( ID3D10Device *  pD3D10Device )

Creates OpenCL context from D3D10 device.

Parameters:
pD3D10Device- pointer to D3D10 device
Returns:
Returns reference to OpenCL Context

Definition at line 351 of file directx.cpp.

cv::ocl::Context & initializeContextFromD3D11Device ( ID3D11Device *  pD3D11Device )

Creates OpenCL context from D3D11 device.

Parameters:
pD3D11Device- pointer to D3D11 device
Returns:
Returns reference to OpenCL Context

Definition at line 243 of file directx.cpp.

cv::ocl::Context & initializeContextFromDirect3DDevice9 ( IDirect3DDevice9 *  pDirect3DDevice9 )

Creates OpenCL context from Direct3DDevice9 device.

Parameters:
pDirect3DDevice9- pointer to Direct3Device9 device
Returns:
Returns reference to OpenCL Context

Definition at line 569 of file directx.cpp.

cv::ocl::Context & initializeContextFromDirect3DDevice9Ex ( IDirect3DDevice9Ex *  pDirect3DDevice9Ex )

Creates OpenCL context from Direct3DDevice9Ex device.

Parameters:
pDirect3DDevice9Ex- pointer to Direct3DDevice9Ex device
Returns:
Returns reference to OpenCL Context

Definition at line 459 of file directx.cpp.