Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Need an example on ippiAlphaComp

udi
Beginner
496 Views
Hi,
I have 2 32bit ( 4channels ) images.

I tried to compose a new image, I wanted the first image will be the background the second will be a semi transparent foregroung.

Everything I did, didn't work.

Any code example somewhere ?

Thanks in advance.

Udi Raz
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
496 Views

Dear Udi,

could you please take a look on IPP manual you get within IPP installation? For example, ippiman.pdf, chapter5 Image Arithmetic and Logical Operations, article Alpha Composition describes in some details ippiAlphaComp functions and contains simple sample how to call this function:

Code:

IppStatus acomp( void ) {
Ipp8u imga[8*8], imgb[8*8], imgc[8*8];
IppiSize roi = { 8, 8 };
IppStatus st;
ippiImageRamp_8u_C1R( imga, 8, roi, 0, 1, ippAxsHorizontal );
ippiImageRamp_8u_C1R( imgb, 8, roi, 0, 2, ippAxsHorizontal );
st = ippiAlphaCompC_8u_C1R( imga, 8, 255/3, imgb, 8, 255, imgc, 8, roi,
ippAlphaOver );
printf( "over: a=%d,A=255/3; b=%d,B=255; c=%d //
c=a*A+b*(1-A)*B
",imga[6],imgb[6],imgc[6] );
return st;
}
Output
over: a=6,A=255/3; b=12,B=255; c=10 // c=a*A+b*B*(1-A)


Regards,
Vladimir

0 Kudos
jiangdingfeng
Beginner
496 Views

Hi,I also tired to compose 4 images(YUV420,cif) to a new image(YUV420,4cif),I wanted each image display a quarter in new image.

But I don't know how to do it by IPP lib.Can ereryone tell me?Thank you very much!

0 Kudos
Vladimir_Dudnik
Employee
496 Views

It seems for me that you are talking about different thing. As far as I get it you want to copy four small images in one place in such a way to form new and bigger image rather than do alpha blending, discussed in this thread. Is that correct?

Vladimir

0 Kudos
Reply