Hello,
IPP provides AC4 and C4 functions to work with 4-channel images. According
IPP Reference Manual functions with 'A'descriptor do not process alpha channel in source image and do not pass alpha values to destination image. You may need to use ippiConvert_8u16u_C4R function instead.
I would recommend consideringcode like this
Ipp16u* imgResult = 0;
Ipp8u* imgMain = 0;
intm_Step;
int r_Step;
IppiSize size;
size.width = 620;
size.height = 470;
// IPP provides auxiliary functions to allocate aligned memory for 2D buffers
Ipp8u* imgMain = ippiMalloc_8u_C4(size.width, size.height,&m_Step);
Ipp16* imgResult = ippiMalloc_16u_C4(size.width, size.height,&r_Step);
... your code to load 3-channel image ...
// copy your 3-channel image to 4-channel 2D buffer, leave alpha not initialized
ippiCopy_8u_C3AC4R((Ipp8u *)image[0]->imageData, image[0]->widthStep, imgMain, size.width * 4, size);
// initialize alpha channel with constant value (need toshift imgMain pointer to desired channel)
ippiSet_8u_C4CR(128,imgMain+3,size.width*4,m_Step);
// convert all four channels from 8 bit to 16 bits
ippiConvert_8u16u_C4R(imgMain,m_Step,imgResult,r_Step,size);
... subsequent processing ...
// free allocated memory with appropriate deallocation functions
ippiFree(..)
Regards,
Vladimir