//CVG_LicenseBegin==============================================================
//
// Copyright@ GET 2005 (Groupe des Ecoles de Telecom)
// http://www.get-telecom.fr/
//
// This software is a GPU accelerated library for computer-vision. It
// supports an OPENCV-like extensible interface for easily porting OPENCV
// applications.
//
// Contacts:
// GpuCV core team: gpucv@picoforge.int-evry.fr
// GpuCV developers newsgroup: gpucv-developers@picoforge.int-evry.fr
//
// Project's Home Page:
// https://picoforge.int-evry.fr/cgi-bin/twiki/view/Gpucv/Web/WebHome
//
// This software is governed by the CeCILL license under French law and
// abiding by the rules of distribution of free software. You can use,
// modify and/ or redistribute the software under the terms of the CeCILL
// license as circulated by CEA, CNRS and INRIA at the following URL
// "http://www.cecill.info".
//
//================================================================CVG_LicenseEnd
/** \brief Includes Some C wrapper functions to access some GpuCV CPP objects from CUDA .cu files.
* \author Yannick Allusse
* \version CUDA 1.1 and GpuCV 4.1 rev 206
*/
#ifndef __GPUCV_CUDA_WRAPPER_C_H
#define __GPUCV_CUDA_WRAPPER_C_H
#include <GPUCVCuda/gcu_runtime_api_wrapper.h>
#include <cxtypes.h>
//#include
#if _GPUCV_COMPILE_CUDA
#ifdef __cplusplus
extern "C"{
#endif
/**
\sa CUmemorytype_enum
*/
enum GCU_IO_TYPE
{
GCU_INPUT,
GCU_OUTPUT
};
/** \brief Pre-process a data object and load it into the requested CUDA memory.
Pre-process a data object before a CUDA operator. It affects a I/O type to it and make sure the data are copied into the
correct CUDA memory zone (_cudaMemoryType). If the zone is a CUDA array, a channel descriptor can be specified to use texture memory.
\param _img -> Pointer to the input object(ex: IplImage or Cvmat).
\param _iotype -> [GCU_INPUT|GCU_OUTPUT].
\param _cudaMemoryType -> Memory type, see CUmemorytype_enum.
\param _channelDesc -> Optional channel descriptor when _cudaMemoryType==CU_MEMORYTYPE_ARRAY.
* \sa gcuPostProcess(), gcuGetPitch().
* \author Yannick Allusse
* \version CUDA 1.1 and GpuCV 4.1 rev 261
*/
void* gcuPreProcess(void * _img, GCU_IO_TYPE _iotype, int _cudaMemoryType=0, cudaChannelFormatDesc* _channelDesc=NULL);
/** \brief Post-process a data object and copy result to CPU if required.
Post-process a data object after a CUDA operator. Data might be copied to CPU if object options is specified.
\param _img -> Pointer to the input object(ex: IplImage or Cvmat).
* \sa gcuPreProcess(), gcuGetPitch().
* \author Yannick Allusse
* \version CUDA 1.1 and GpuCV 4.1 rev 261
*/
bool gcuPostProcess(void * _img);
/** \brief Return the pitch size of a data object.
\param _img -> Pointer to the input object(ex: IplImage or Cvmat).
* \sa gcuPreProcess(), gcuPostProcess().
* \author Yannick Allusse
* \version CUDA 1.1 and GpuCV 4.1 rev 261
*/
size_t gcuGetPitch(void * _img);
void gcuSetReshapeObj(void * _img,int _cudaMemoryType, int _newChannels);
void gcuUnsetReshapeObj(void * _img,int _cudaMemoryType);
CvSize gcuGetDataDscSize(void * _img,int _cudaMemoryType);
bool FindBestLoad(unsigned int _size, unsigned int & _blockNbr, unsigned int & _ThreadNbr, unsigned int & _ThreadWidth);
#ifdef __cplusplus
}
#endif
#endif //_GPUCV_COMPILE_CUDA
#endif //__GPUCV_CUDA_WRAPPER_C_H
|