I have a 16u RGBA image and a 16u one-channel grayscale image. The grayscale image must be set as the alpha channel of the RGBA image.
One would think this is an easy task, but the RGBA image is (and has to be) premultiplied, for compatibility with CoreGraphics on Mac OS X. In fact, I don't see a fast way to accomplish this using IPP. Any hints (or future new functions) are welcome.
For 8u images, I call vImageUnpremultiplyData_ARGB8888, ippiCopy_8u_C1C4R and vImagePremultiplyData_ARGB8888. For 32f images, I call vImageUnpremultiplyData_RGBAFFFF, ippiCopy_32f_C1C4R and vImagePremultiplyData_RGBAFFFF. This method works fast. The vImage functions are from Apple's vImage framework https://developer.apple.com/documentation/accelerate. There are no 16u vImage functions to do this.
The question remains how to do this with IPP and for 16u.
Regards,
Adriaan van Os