- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My program need to adjust the alpha value of a image by increasing or decreasing some percent,such as increase 15% alpha,the new value is 1.15*alpha.But which function in IPP can implement it?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
pango,
I'm assuming RGBA and Ipp8u data.
You might tryippiMulC_8u_C4RSfs.It will only work if you can express the factor as a fraction with a 2^n denominator. Use {1.0, 1.0, 1.0, factor*scale} as the value.
For example, for MulC, you can use {1.0, 1.0, 1.0, 147} with a scaleFactor of 7 (so the scale is 2^7=128). This should multiply the alpha channel by 1.148.
You'll have to determine whether the extra 3 multiplications by 1.0 still result in a performance increase. It's not easy to multiply every fourth value efficientlyusing SIMD.
I came up with a bunch oftricks like this in the IPP book, although I did find that frequently it took some work and tweaking to get a performance gain.
Stewart

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page