Image I/O & Framework
From CUVI Wiki
CUVI sdlksljfdks;dlks kdsldks
Using CUVI with C++
CuviImage
CuviImage is a C++ class to hold image data on the device. It has all the essential members to hold image information as well as methods to create and move image to and from device. The CuviImage members include:
Member name | Type | Description |
---|---|---|
data | void* | Data pointer containing the image pixel values on device |
width | Cuvi32u | Image width in pixels |
height | Cuvi32u | Image height in pixels |
pitch | size_t | Image pitch/widthstep in bytes |
depth | Cuvi32u | Defines the data container for the image. A depth of '8' creates CuviImage of type Cuvi8u |
nChannels | Cuvi32u | Number of channels in image |
isSigned | bool | Specifies if the image also contains negative values. (float is an exception) |
isInitialized | bool | Specifies if the image has successfully been created on the device |
channelSequence | CuviChannelSeq | Specifies the arrangement of image channels like RGB and BGR |
Methods dskjsf as dfsl All methods except constructors and destructor returns CuviStatus
Method | Description |
---|---|
CuviImage() | Default constructor. Initializes all members with 0 |
CuviImage(CuviSize size, Cuvi32u depth, Cuvi32u channels); | Creates a CuviImage of specified size, depth and channels. Throws exception if memory allocation on device fails. |
CuviImage(const CuviImage&); | Creates a copy of existing CuviImage |
CuviImage(const CuviMat&); | Creates a copy of existing CuviMat |
CuviStatus upload(void* pSrcHost, size_t srcPitch, CuviStream* stream = NULL); | Copy image data from host memory to CuviImage. This function also supports async operation |
CuviStatus download(void* pDstHost, size_t dstPitch, CuviStream* stream = NULL); | Copy image data from CuviImage to host memory. |
CuviStatus show(char* title = "CUVI Image",int milliseconds = 0); | Render CuviImage on screen for a specified amount of time |
~CuviImage(); | CuviImage destructor. Throws an exception in case of failure |