<?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 Re: Rotating Indexed Bitmaps? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995858#M22904</link>
    <description>&lt;DIV&gt;&lt;FONT size="2"&gt;
&lt;P&gt;We had similar problem before, we create a function ChangePalette to change the Palette entries everytime we need to display the image. It seems working fine.&lt;/P&gt;
&lt;P&gt;If this method has any problem, please let us know. thanks!&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;private&lt;/FONT&gt;&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;void&lt;/FONT&gt;&lt;FONT size="2"&gt; ChangePalette(Bitmap bmp)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;if&lt;/FONT&gt;&lt;FONT size="2"&gt;( bmp.PixelFormat == PixelFormat.Format8bppIndexed )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;ColorPalette greyPal = bmp.Palette; &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; length = greyPal.Entries.Length;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;for&lt;/FONT&gt;&lt;FONT size="2"&gt;(&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; i = 0;i &amp;lt; length;i++) &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;greyPal.Entries&lt;I&gt; = Color.FromArgb(i,i,i); &lt;/I&gt;&lt;/P&gt;
&lt;P&gt;bmp.Palette = greyPal;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 19 Feb 2005 00:10:59 GMT</pubDate>
    <dc:creator>l_luo</dc:creator>
    <dc:date>2005-02-19T00:10:59Z</dc:date>
    <item>
      <title>Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995851#M22897</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Hi all&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;I have an indexedbitmap which I want to rotate using IPP, but I do not know which IPP function I should use.I tried to use ippiRotateCenter_8u_C1R, since this seemed the most suitable from what was offered. This results in a rotated bitmap, but all colours are mixed up, so the result is not usable. &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Does anyone know if there is a function I could use to rotate indexed (palette) bitmapswithout converting the bitmap type first. (Or confirm to me that there is not suc function in the IPP)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;Thanks already Bob&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Feb 2005 19:45:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995851#M22897</guid>
      <dc:creator>bob_peters</dc:creator>
      <dc:date>2005-02-09T19:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995852#M22898</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;HI Bob,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;seems you are talking about image with palette, right? You know, palettized images consist from two parts, palette (which contains info about actual color for any particular index) and array of indexes, which represents pixels (remember, actual color info is stored in palette). So, to rotate such image, you need to rotate this array of indexes, but you do not need to rotate palette itself. Note, if rotate operation will change any index value (due to interpolation, for example) you'll got unpredictable changes in color of your image. Actually it is better to convert palettized image to true color representation, rotate it, and convert it back to palletized image, but such set of operations take long time.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Regards,&lt;/DIV&gt;
&lt;DIV&gt; Vladimir&lt;/DIV&gt;&lt;P&gt;Message Edited by vdudnik on &lt;SPAN class="date_text"&gt;02-09-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:52 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2005 01:48:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995852#M22898</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2005-02-10T01:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995853#M22899</link>
      <description>&lt;DIV&gt;Hi Vladimir&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks for your reply.&lt;/DIV&gt;
&lt;DIV&gt;Indeed I am talking about palette bitmaps.&lt;/DIV&gt;
&lt;DIV&gt;Iam working in C# and I provided the bitmapdata.scan0 as a parameter to the rotate function. I assume that that parameter is not pointing to the palette, but to the pixel data.&lt;/DIV&gt;
&lt;DIV&gt;Please correct me if I am wrong.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;IppStatus st = &lt;FONT size="2"&gt;ippiRotateCenter_8u_C1R&lt;/FONT&gt;( bmpsrcdata.Scan0, &lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;new&lt;/FONT&gt;&lt;FONT size="2"&gt; IppiSize(srcBitmap.Width,srcBitmap.Height), bmpsrcdata.Stride, &lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;new&lt;/FONT&gt;&lt;FONT size="2"&gt; IppiRect(0,0, srcBitmap.Width,srcBitmap.Height), bmpdstdata.Scan0, bmpdstdata.Stride, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;new&lt;/FONT&gt;&lt;FONT size="2"&gt; IppiRect(0,0,srcBitmap.Width,srcBitmap.Height), &lt;BR /&gt;angle, 0.5*srcBitmap.Width, 0.5*srcBitmap.Height, 1&lt;/FONT&gt;&lt;FONT size="2"&gt;);&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Interpolation should also not be the problem I am facing, since all colors are mixed up, and some of the original colors do not even appear.If I rotate the mixed up bitmap agian the colors do however remain the same.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Well for now I will transfer the bitmaps to true colors, because then at least it works fine.If you just happen to know the problem please let me now. Anyhow thanks for your time already.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Kind regards Bob&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;p.s. GDI plus also seems to require me to transfer the image to true color. Before it can apply rotation on it.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Feb 2005 15:59:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995853#M22899</guid>
      <dc:creator>bob_peters</dc:creator>
      <dc:date>2005-02-10T15:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995854#M22900</link>
      <description>&lt;DIV&gt;Hello, &lt;/DIV&gt;
&lt;DIV&gt;i don"t have any documentation with me at the moment of this reply, but here are some oppinions:&lt;/DIV&gt;
&lt;DIV&gt;- indeed bmpSrcData.scan0 - points to the pixel data. Ifyou need the pallete of the bitmap, there is a method from Bitmap class: GetPallete() or GetPalleteData().. or smth like that.&lt;/DIV&gt;
&lt;DIV&gt;- the colors are mixed up because of the interpolation. I think you can get better results if you use the interpolation method Nearest Neighbour. ( i know it is available for some operation, but i don"t know if it is for Rotate - i will check). The nearest neighbour method is not mixing the indexes in the image while rotating, but use the one of indexes of the corresponding neighbouring pixels. This results in a loss of quality, but at least, you have the same colors. You should decide if this approach is appropriate for you or not. &lt;/DIV&gt;
&lt;DIV&gt;My suggestion is that:&lt;/DIV&gt;
&lt;DIV&gt;- if the speed is more important than some artifacts that might appear in the rotated image, then you could try rotate with NearestNeighbour method. &lt;/DIV&gt;
&lt;DIV&gt;- if quality is more important than speed, then convert the image to ARGB color image, and then rotate.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Regards and success&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Feb 2005 05:21:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995854#M22900</guid>
      <dc:creator>rrogojanu</dc:creator>
      <dc:date>2005-02-11T05:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995855#M22901</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I tried to use Nearest Neighbor and all other interpolation methods, but still it distorts all colors upon rotating. The image is not blurred, but the colours simply change. The images I use consist of simple lines, and the colours of those lines change after the first rotation. From then on they remain fixed during future rotations. So it looks like the bitmaps are erroneous, but that also seems strange, since viewing them in different paint programs and converting them to 32 bppworks ok.&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Feb 2005 17:43:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995855#M22901</guid>
      <dc:creator>bob_peters</dc:creator>
      <dc:date>2005-02-11T17:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995856#M22902</link>
      <description>&lt;DIV&gt;maybe some of these guys could tell us if Nearest Neighbour interpolation method is altering indexes or not.. &lt;/DIV&gt;
&lt;DIV&gt;i think it should not... i did not try, though.&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Feb 2005 21:08:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995856#M22902</guid>
      <dc:creator>rrogojanu</dc:creator>
      <dc:date>2005-02-14T21:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995857#M22903</link>
      <description>&lt;DIV&gt;Hi,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;yes, that's correct Nearest Neighbour interpolation should not change index values.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Regards,&lt;/DIV&gt;
&lt;DIV&gt; Vladimir&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 Feb 2005 07:45:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995857#M22903</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2005-02-18T07:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating Indexed Bitmaps?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995858#M22904</link>
      <description>&lt;DIV&gt;&lt;FONT size="2"&gt;
&lt;P&gt;We had similar problem before, we create a function ChangePalette to change the Palette entries everytime we need to display the image. It seems working fine.&lt;/P&gt;
&lt;P&gt;If this method has any problem, please let us know. thanks!&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;private&lt;/FONT&gt;&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;void&lt;/FONT&gt;&lt;FONT size="2"&gt; ChangePalette(Bitmap bmp)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;if&lt;/FONT&gt;&lt;FONT size="2"&gt;( bmp.PixelFormat == PixelFormat.Format8bppIndexed )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;ColorPalette greyPal = bmp.Palette; &lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; length = greyPal.Entries.Length;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;for&lt;/FONT&gt;&lt;FONT size="2"&gt;(&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; i = 0;i &amp;lt; length;i++) &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;greyPal.Entries&lt;I&gt; = Color.FromArgb(i,i,i); &lt;/I&gt;&lt;/P&gt;
&lt;P&gt;bmp.Palette = greyPal;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 19 Feb 2005 00:10:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Rotating-Indexed-Bitmaps/m-p/995858#M22904</guid>
      <dc:creator>l_luo</dc:creator>
      <dc:date>2005-02-19T00:10:59Z</dc:date>
    </item>
  </channel>
</rss>

