From CUVI Wiki
Revision as of 18:34, 18 April 2013 by Jawad (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Converts image pixel values from one data type to another. It uses dataBits field of CuviImage to decide the number of bits of the destination image while the destination CuviImage decides the container. For example we want to convert an 8-bit input image to 15-bit image than the dataBits field of destination image will be 15 and container/datatype of destination image will be 16.


CuviStatus bitConversion(const CuviImage& src,
                         CuviImage& dst,
                         const CuviStream& stream = CuviStream());


Name Type Description
src const CuviImage& Input Image
dst CuviImage& Output Image
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8u 8u
8u 16u
16u 16u
16u 8u


16-bit Image in 16-bit container
15-bit image in 16-bit container


CuviImage gimg = cuvi::io::loadImage(path);

CuviImage gout(gimg.size(),CUVI_DEPTH_16U, gimg.channels());

//Telling that input image has a depth of 7-bit

//Convert 7-bit image into 15-bit image