ippiMulCScale

ippiMulCScale

Hello,

I'm a new user with the IPP. I'm trying to do a scaled multiplication with a constant on ONLY the alpha channel of a color array. The color array is an ONE-DIMENSION array. The elements inside the color array are aligned in the following manner;RGBARGBARGBA...... Ihave tried alot of ways to do it, but still failed. Yet, it seems to be such a simple problem. Thanks.

Regards,

Kennant

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,

if you have step == with *4 (means no padding) you can use such code as an example:

roiSize.width = 1;
roiSize.height = width * height;

ippiMulC_8u_C1IRSfs(value, pSrcDst+3, 4, roiSize, scaleFactor);

If you have some padding, you can use something like that:

roiSize.width = 1;
roiSize.height = width;

for (i = 0; i < height; i ++)
{
ippiMulC_8u_C1IRSfs(value, pSrcDst+3, 4, roiSize, scaleFactor);
pSrcDst += step;
}

Regards,
Vladimir

Hi,

I have tried the following lines and failed. It seems that the multiplication is performed to the whole image in some strange way. I don't think I'm using any padding. The bottom of the page contains the actual code that I used. The "size" is the size of my 1Darray of pixels. Theheight of region of interest is the same as"size" and thewidth is 1 since it's a 1D array.I have set the step to be 8 because the color of the pixels contains 4 channels (R, G, B and A) andit uses 2 bytes to store each 16-bit unsigned integer. I have added 3 to both the source and destination pointers so that it only performs the multiplication to the alpha channels. Thank you very much for your help.

IppiSize roi = {1, size};

ippiMulCScale_16u_C1R(((const Ipp16u*)inputColorTile.GetDataArray()) + 3, 8, (Ipp16u)factor, ((Ipp16u*)inputColorTile.GetDataArray()) + 3, 8, roi);

Regards,

Kennant

Leave a Comment

Please sign in to add a comment. Not a member? Join today