<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic simple image rectangle fillings in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857433#M7370</link>
    <description>I'm trying to find the best functions to achieve these pretty basic operations (in order to replace my own old functions - I'd like to get a little speedup):&lt;BR /&gt;&lt;BR /&gt;-filling a rectangle with constant color, with blending&lt;BR /&gt;-additive blending with constant color offset, but in both directions (like, -5 on blue, +3 on green, -100 on red)&lt;BR /&gt;&lt;BR /&gt;..but I'm not finding anything useful in IPP.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The rectangle filling would require some kind of block Mul+Add, and surely there's a Mul &amp;amp; Add, but wouldn't it be worth having both at once? Especially since a mul followed by an add raises the problem of precision - I'd prefer the add before the scaling.&lt;BR /&gt;&lt;BR /&gt;As for the additive blending.. there's an Add, a Sub, but no bipolar version of those, for 8u that is. Here too I'd have to use 2 functions.&lt;BR /&gt;&lt;BR /&gt;I also looked for lookup table functions, but I'm only finding complex ones, nothing that would simply map like with a palette (there's a palette function, but only formonochrome sources). And anyway, I don't think it'd be worth using a lookup table to do simple blending.&lt;BR /&gt;&lt;BR /&gt;Last option would be to fill a line, then use alpha compositing with it as a source. But I'm wondering here: would the IPP functions like a srcStep parameter set to zero (meaning, repeating the same line over &amp;amp; over)?&lt;BR /&gt;Edit: they actually work with srcStep set to zero, however AlphaComp isn't very fast.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have my own MMX functions for the above already, but only for 8bit RGBA, as it's much simpler. I need them for 8bit RGB, and it's pretty complex to do optimized ones. I guess it'd have to process in short lines of 48components (=3*16 =8*6 (if MMX)=16*3 (if SSE2)) to be the most efficient, but aligning all this properly.. that sounds painful &amp;amp; boring.&lt;BR /&gt;&lt;BR /&gt;Also, are the functions IppiAddC_8u_C4IRSfs &amp;amp; IppiMulC_8u_C3IRSfs using SSE2's16-byte packed operationswhen available? The ScaleFactor in most of those functions would hint that 8bit versions may be done in 16bit accuracy?&lt;BR /&gt;&lt;BR /&gt;Edit: to answer part of this, it looks like those functions are faster when ScaleFactor is zero. But I traced the code and couldn't find out if they were using MMX or SSE (saw nothing of those, but maybe I traced wrong).&lt;BR /&gt;But they look faster than my functions, so I guess I can call IppiAddC &amp;amp; then IppiSubC.</description>
    <pubDate>Sun, 25 Jan 2009 11:50:06 GMT</pubDate>
    <dc:creator>gol</dc:creator>
    <dc:date>2009-01-25T11:50:06Z</dc:date>
    <item>
      <title>simple image rectangle fillings</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857433#M7370</link>
      <description>I'm trying to find the best functions to achieve these pretty basic operations (in order to replace my own old functions - I'd like to get a little speedup):&lt;BR /&gt;&lt;BR /&gt;-filling a rectangle with constant color, with blending&lt;BR /&gt;-additive blending with constant color offset, but in both directions (like, -5 on blue, +3 on green, -100 on red)&lt;BR /&gt;&lt;BR /&gt;..but I'm not finding anything useful in IPP.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The rectangle filling would require some kind of block Mul+Add, and surely there's a Mul &amp;amp; Add, but wouldn't it be worth having both at once? Especially since a mul followed by an add raises the problem of precision - I'd prefer the add before the scaling.&lt;BR /&gt;&lt;BR /&gt;As for the additive blending.. there's an Add, a Sub, but no bipolar version of those, for 8u that is. Here too I'd have to use 2 functions.&lt;BR /&gt;&lt;BR /&gt;I also looked for lookup table functions, but I'm only finding complex ones, nothing that would simply map like with a palette (there's a palette function, but only formonochrome sources). And anyway, I don't think it'd be worth using a lookup table to do simple blending.&lt;BR /&gt;&lt;BR /&gt;Last option would be to fill a line, then use alpha compositing with it as a source. But I'm wondering here: would the IPP functions like a srcStep parameter set to zero (meaning, repeating the same line over &amp;amp; over)?&lt;BR /&gt;Edit: they actually work with srcStep set to zero, however AlphaComp isn't very fast.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have my own MMX functions for the above already, but only for 8bit RGBA, as it's much simpler. I need them for 8bit RGB, and it's pretty complex to do optimized ones. I guess it'd have to process in short lines of 48components (=3*16 =8*6 (if MMX)=16*3 (if SSE2)) to be the most efficient, but aligning all this properly.. that sounds painful &amp;amp; boring.&lt;BR /&gt;&lt;BR /&gt;Also, are the functions IppiAddC_8u_C4IRSfs &amp;amp; IppiMulC_8u_C3IRSfs using SSE2's16-byte packed operationswhen available? The ScaleFactor in most of those functions would hint that 8bit versions may be done in 16bit accuracy?&lt;BR /&gt;&lt;BR /&gt;Edit: to answer part of this, it looks like those functions are faster when ScaleFactor is zero. But I traced the code and couldn't find out if they were using MMX or SSE (saw nothing of those, but maybe I traced wrong).&lt;BR /&gt;But they look faster than my functions, so I guess I can call IppiAddC &amp;amp; then IppiSubC.</description>
      <pubDate>Sun, 25 Jan 2009 11:50:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857433#M7370</guid>
      <dc:creator>gol</dc:creator>
      <dc:date>2009-01-25T11:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: simple image rectangle fillings</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857434#M7371</link>
      <description>&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;did you notice AlphaComposition functions in IPP?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;/* /////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;// Alpha Compositing Operations&lt;BR /&gt;///////////////////////////////////////////////////////////////////////////// */&lt;BR /&gt;/*&lt;BR /&gt;// Contents:&lt;BR /&gt;// ippiAlphaPremul_8u_AC4R, ippiAlphaPremul_16u_AC4R&lt;BR /&gt;// ippiAlphaPremul_8u_AC4IR, ippiAlphaPremul_16u_AC4IR&lt;BR /&gt;// ippiAlphaPremul_8u_AP4R, ippiAlphaPremul_16u_AP4R&lt;BR /&gt;// ippiAlphaPremul_8u_AP4IR, ippiAlphaPremul_16u_AP4IR&lt;BR /&gt;// Pre-multiplies pixel values of an image by its alpha values.&lt;/P&gt;
&lt;P&gt;// ippiAlphaPremulC_8u_AC4R, ippiAlphaPremulC_16u_AC4R&lt;BR /&gt;// ippiAlphaPremulC_8u_AC4IR, ippiAlphaPremulC_16u_AC4IR&lt;BR /&gt;// ippiAlphaPremulC_8u_AP4R, ippiAlphaPremulC_16u_AP4R&lt;BR /&gt;// ippiAlphaPremulC_8u_AP4IR, ippiAlphaPremulC_16u_AP4IR&lt;BR /&gt;// ippiAlphaPremulC_8u_C4R, ippiAlphaPremulC_16u_C4R&lt;BR /&gt;// ippiAlphaPremulC_8u_C4IR, ippiAlphaPremulC_16u_C4IR&lt;BR /&gt;// ippiAlphaPremulC_8u_C3R, ippiAlphaPremulC_16u_C3R&lt;BR /&gt;// ippiAlphaPremulC_8u_C3IR, ippiAlphaPremulC_16u_C3IR&lt;BR /&gt;// ippiAlphaPremulC_8u_C1R, ippiAlphaPremulC_16u_C1R&lt;BR /&gt;// ippiAlphaPremulC_8u_C1IR, ippiAlphaPremulC_16u_C1IR&lt;BR /&gt;// Pre-multiplies pixel values of an image by constant alpha values.&lt;BR /&gt;//&lt;BR /&gt;// ippiAlphaComp_8u_AC4R, ippiAlphaComp_16u_AC4R&lt;BR /&gt;// ippiAlphaComp_8u_AC1R, ippiAlphaComp_16u_AC1R&lt;BR /&gt;// Combines two images using alpha values of both images&lt;BR /&gt;//&lt;BR /&gt;// ippiAlphaCompC_8u_AC4R, ippiAlphaCompC_16u_AC4R&lt;BR /&gt;// ippiAlphaCompC_8u_AP4R, ippiAlphaCompC_16u_AP4R&lt;BR /&gt;// ippiAlphaCompC_8u_C4R, ippiAlphaCompC_16u_C4R&lt;BR /&gt;// ippiAlphaCompC_8u_C3R, ippiAlphaCompC_16u_C3R&lt;BR /&gt;// ippiAlphaCompC_8u_C1R, ippiAlphaCompC_16u_C1R&lt;BR /&gt;// Combines two images using constant alpha values&lt;BR /&gt;//&lt;BR /&gt;// Types of compositing operation (alphaType)&lt;BR /&gt;// OVER ippAlphaOver ippAlphaOverPremul&lt;BR /&gt;// IN ippAlphaIn ippAlphaInPremul&lt;BR /&gt;// OUT ippAlphaOut ippAlphaOutPremul&lt;BR /&gt;// ATOP ippAlphaATop ippAlphaATopPremul&lt;BR /&gt;// XOR ippAlphaXor ippAlphaXorPremul&lt;BR /&gt;// PLUS ippAlphaPlus ippAlphaPlusPremul&lt;BR /&gt;//&lt;BR /&gt;// Type result pixel result pixel (Premul) result alpha&lt;BR /&gt;// OVER aA*A+(1-aA)*aB*B A+(1-aA)*B aA+(1-aA)*aB&lt;BR /&gt;// IN aA*A*aB A*aB aA*aB&lt;BR /&gt;// OUT aA*A*(1-aB) A*(1-aB) aA*(1-aB)&lt;BR /&gt;// ATOP aA*A*aB+(1-aA)*aB*B A*aB+(1-aA)*B aA*aB+(1-aA)*aB&lt;BR /&gt;// XOR aA*A*(1-aB)+(1-aA)*aB*B A*(1-aB)+(1-aA)*B aA*(1-aB)+(1-aA)*aB&lt;BR /&gt;// PLUS aA*A+aB*B A+B aA+aB&lt;BR /&gt;// Here 1 corresponds significance VAL_MAX, multiplication is performed&lt;BR /&gt;// with scaling&lt;BR /&gt;// X * Y =&amp;gt; (X * Y) / VAL_MAX&lt;BR /&gt;// and VAL_MAX is the maximum presentable pixel value:&lt;BR /&gt;// VAL_MAX == IPP_MAX_8U for 8u&lt;BR /&gt;// VAL_MAX == IPP_MAX_16U for 16u&lt;BR /&gt;*/&lt;/P&gt;
&lt;P&gt;/* /////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;// Name: ippiAlphaPremul_8u_AC4R, ippiAlphaPremul_16u_AC4R&lt;BR /&gt;// ippiAlphaPremul_8u_AC4IR, ippiAlphaPremul_16u_AC4IR&lt;BR /&gt;// ippiAlphaPremul_8u_AP4R, ippiAlphaPremul_16u_AP4R&lt;BR /&gt;// ippiAlphaPremul_8u_AP4IR, ippiAlphaPremul_16u_AP4IR&lt;BR /&gt;//&lt;BR /&gt;// Purpose: Pre-multiplies pixel values of an image by its alpha values&lt;BR /&gt;// for 4-channel images&lt;BR /&gt;// For channels 1-3&lt;BR /&gt;// dst_pixel = (src_pixel * src_alpha) / VAL_MAX&lt;BR /&gt;// For alpha-channel (channel 4)&lt;BR /&gt;// dst_alpha = src_alpha&lt;BR /&gt;// Parameters:&lt;BR /&gt;// pSrc Pointer to the source image for pixel-order data,&lt;BR /&gt;// array of pointers to separate source color planes for planar data&lt;BR /&gt;// srcStep Step through the source image&lt;BR /&gt;// pDst Pointer to the destination image for pixel-order data,&lt;BR /&gt;// array of pointers to separate destination color planes for planar data&lt;BR /&gt;// dstStep Step through the destination image&lt;BR /&gt;// pSrcDst Pointer to the source/destination image, or array of pointers&lt;BR /&gt;// to separate source/destination color planes for in-place functions&lt;BR /&gt;// srcDstStep Step through the source/destination image for in-place functions&lt;BR /&gt;// roiSize Size of the source and destination ROI&lt;BR /&gt;// Returns:&lt;BR /&gt;// ippStsNoErr No errors&lt;BR /&gt;// ippStsNullPtrErr pSrc == NULL, or pDst == NULL, or pSrcDst == NULL&lt;BR /&gt;// ippStsSizeErr The roiSize has a field with negative or zero value&lt;BR /&gt;*/&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Mon, 09 Feb 2009 18:31:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857434#M7371</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2009-02-09T18:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: simple image rectangle fillings</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857435#M7372</link>
      <description>&lt;DIV style="margin:0px;"&gt;Yes, but as I wrote those are slower than the other functions, if you only want to fill with a color with blending.&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Feb 2009 00:22:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857435#M7372</guid>
      <dc:creator>gol</dc:creator>
      <dc:date>2009-02-11T00:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: simple image rectangle fillings</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857436#M7373</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Then you are correct, we do not have that specific functionality. As usually, please feel free to submit your feature request to &lt;A href="https://community.intel.com/premier.intel.com"&gt;Intel Premier Support&lt;/A&gt;, where it will be reviewed at the next IPP versions planning stage&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Feb 2009 15:42:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/simple-image-rectangle-fillings/m-p/857436#M7373</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2009-02-11T15:42:49Z</dc:date>
    </item>
  </channel>
</rss>

