<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sam Beauvois &#187; Libs</title>
	<atom:link href="http://www.sambeauvois.be/blog/category/libs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sambeauvois.be/blog</link>
	<description>general dev, .net and other stuff</description>
	<lastBuildDate>Tue, 31 Jan 2012 13:38:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>FreeImage and x64 projects : Yes you can !</title>
		<link>http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/</link>
		<comments>http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/#comments</comments>
		<pubDate>Fri, 14 May 2010 07:02:23 +0000</pubDate>
		<dc:creator>Sam Beauvois</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CPP]]></category>
		<category><![CDATA[Libs]]></category>

		<guid isPermaLink="false">http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/</guid>
		<description><![CDATA[A few words about FreeImage According to the website, FreeImage (http://freeimage.sourceforge.net) is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today&#8217;s multimedia applications. FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit versions of [...]]]></description>
			<content:encoded><![CDATA[<h3>A few words about FreeImage</h3>
<p>According to the website, FreeImage (<a href="http://freeimage.sourceforge.net" target="_blank">http://freeimage.sourceforge.net</a>) is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today&#8217;s multimedia applications.</p>
<p>FreeImage is easy to use, fast, multithreading safe, compatible with all <strong><span style="color: #ff0000; font-size: medium;">32-bit</span></strong> versions of Windows, and cross-platform (works both with Linux and Mac OS X).</p>
<p>FreeImage is written in C++ but can be used in .NET by using a wrapper (which is provided on the site in the download section)</p>
<h3>Using FreeImage in a .NET project</h3>
<p>To use FreeImage with a .NET project, you have to include the native C++ library (<span style="text-decoration: underline;"><strong>FreeImage.dll</strong></span>) in the same folder as the executable or in a folder contained in the PATH variable (“%WINDIR%\System32” can be a good choice).<br />
A good way to include the FreeImage dll in the executable’s folder is to add it to your visual studio projet, and set the Build Action property to “none” and the Copy to Output Directory property to “Copy always”</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb.png" border="0" alt="image" width="484" height="216" /></a></p>
<p>You have to add a reference to the wrapper library too, which is “<strong>FreeImageNET.dll</strong>”.</p>
<p>Now, using the library is easy.</p>
<p>Add an using directive:</p>
<pre class="brush: csharp; title: ;">using FreeImageAPI;</pre>
<p>Check if the library is available :</p>
<pre class="brush: csharp; title: ;">
if (!FreeImage.IsAvailable())
{
   Console.WriteLine(&quot;FreeImage.dll seems to be missing. Aborting&quot;);
   return;
}
</pre>
<p>Do something with your pictures:</p>
<pre class="brush: csharp; title: ;">

FIBITMAP myImage= new FIBITMAP();
myImage= FreeImage.Load( [parameters] );

// some smart actions
</pre>
<p>Don’t forget to dispose your images when finished to use them</p>
<pre class="brush: csharp; title: ;">
if (!myImage.IsNull
{
   FreeImage.Unload(myImage);
}
myImage.SetNull();
</pre>
<p>Well, this is nice but it still has a problem with that library (there is always one):</p>
<h3>And with a x64 project ?</h3>
<p>The executable you build has to be the same architecture as the library. The library is x86 so you can use it for win32 applications. What if you have (for some reasons) to build an x64 application?</p>
<p>In that case, you have to rebuild the library to target X64 architectures.</p>
<p>Here is how to do that with Visual Studio 2010 (I assume that it’s more or less the same procedure with other visual studio versions).</p>
<p>Grab the latest FreeImage sources on  the download site (go to the <a href="http://freeimage.sourceforge.net/download.html" target="_blank">http://freeimage.sourceforge.net/download.html</a> page and click to the link in the Source Distribution section. Once you have the sources, unzip the archive (obvious but&#8230;)</p>
<p>In the FreeImage folder there is a visual studio 2005 and a visual studio 2003 solutions, pick the 2005.</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image1.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb1.png" border="0" alt="image" width="484" height="337" /></a></p>
<p>Convert the solution</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image2.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb2.png" border="0" alt="image" width="484" height="465" /></a><br />
<a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image3.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb3.png" border="0" alt="image" width="484" height="465" /></a><br />
<a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image4.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb4.png" border="0" alt="image" width="484" height="465" /></a><br />
<a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image5.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb5.png" border="0" alt="image" width="484" height="465" /></a><br />
<a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image6.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb6.png" border="0" alt="image" width="484" height="290" /></a></p>
<p>Notice the compilation configuration</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image7.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb7.png" border="0" alt="image" width="484" height="68" /></a></p>
<p>By default, Win32 is set : we don’t want that !</p>
<p>Go to the Configuration Manager</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image8.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb8.png" border="0" alt="image" width="484" height="124" /></a><br />
<a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image9.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb9.png" border="0" alt="image" width="484" height="352" /></a></p>
<p>As you can see, all FreeImage libs are set to target the Win32 platform, we want 64 bits !</p>
<p>Add a new solution platform</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb10.png" border="0" alt="image" width="484" height="352" /></a></p>
<p>Choose to target the x64 platform</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image11.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb11.png" border="0" alt="image" width="484" height="363" /></a></p>
<p>Just select x64 then click OK</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image12.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb12.png" border="0" alt="image" width="484" height="352" /></a></p>
<p>Close the manager</p>
<p>Build the solution (keyboard shortcut : ctrl-shift-B).</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image13.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb13.png" border="0" alt="image" width="484" height="176" /></a></p>
<p>And at this point you will see that there is a problem, yes, you don’t really think it would be that easy <img src='http://www.sambeauvois.be/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image14.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb14.png" border="0" alt="image" width="484" height="103" /></a></p>
<p>It seems that the compilation encounters a problem especially with the “LibOpenJpeg” project</p>
<p>So, to be sure, try to compile the library one at the same time</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image15.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb15.png" border="0" alt="image" width="437" height="484" /></a></p>
<p>We see that it is the LibOpenJPEG the big source of problems :</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image16.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb16.png" border="0" alt="image" width="484" height="95" /></a></p>
<p>A quick Google search allows to find a post on the Google user group for OpenJPEG that helps:<br />
<a href="http://groups.google.com/group/openjpeg/browse_thread/thread/64b89cdb1a44bb3b/fd4db2f74c76db87?lnk=gst&amp;q=x64#fd4db2f74c76db87" target="_blank">http://groups.google.com/group/openjpeg/browse_thread/thread/64b89cdb1a44bb3b/fd4db2f74c76db87?lnk=gst&amp;q=x64#fd4db2f74c76db87</a></p>
<p>The problematic file is the “opj_include.h” wich use a keyword non supported by the x64 architecture (the &#8220;_asm” keyword if you want to know. It’s because the c++ compiler does not support inline x64 assembly)</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image17.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb17.png" border="0" alt="image" width="170" height="484" /></a></p>
<p>We have to change :</p>
<pre class="brush: cpp; title: ;">
/* MSVC does not have lrintf */
#ifdef _MSC_VER
static INLINE long lrintf(float f){
 int i;

 _asm{
 fld f
 fistp i
 };

 return i;
}
#endif
</pre>
<p>to</p>
<pre class="brush: cpp; title: ;">
/* MSVC does not have lrintf */
#ifdef _MSC_VER
static INLINE long lrintf(float f){
#ifdef _M_X64
	return (long)((f&gt;0.0f) ? (f + 0.5f):(f -0.5f));
#else
	int i;

	_asm{
		fld f
		fistp i
	};

	return i;
#endif
}
#endif
</pre>
<p>Now compile</p>
<p><a href="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image18.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.sambeauvois.be/blog/wp-content/uploads/2010/05/image_thumb18.png" border="0" alt="image" width="484" height="385" /></a></p>
<p>The project compiles pretty well, there is some remaining warnings . . . but it works.</p>
<p>Now you can use that library (mine can be downloaded at  <a href="http://www.sambeauvois.be/Demos/FreeImage/x64/FreeImageX64.zip" target="_blank">http://www.sambeauvois.be/Demos/FreeImage/x64/FreeImageX64.zip</a>) in your x64 applications</p>
<p>Attention anyway : the library will be slower !</p>
<h4>Additional links :</h4>
<p>FreeImage download page : <a title="http://freeimage.sourceforge.net/download.html" href="http://freeimage.sourceforge.net/download.html" target="_blank">http://freeimage.sourceforge.net/download.html</a><br />
FreeImage API documentation: <a href="http://freeimage.sourceforge.net/fnet/Index.html" target="_blank">http://freeimage.sourceforge.net/fnet/Index.html</a></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 8091px; width: 1px; height: 1px; overflow: hidden;"><!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG /> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:HyphenationZone>21</w:HyphenationZone> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>FR-BE</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:EnableOpenTypeKerning /> <w:DontFlipMirrorIndents /> <w:OverrideTableStyleHps /> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-520092929 1073786111 9 0 415 0;} @font-face 	{font-family:Consolas; 	panose-1:2 11 6 9 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-pitch:fixed; 	mso-font-signature:-520092929 1073806591 9 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page WordSection1 	{size:612.0pt 792.0pt; 	margin:70.85pt 70.85pt 70.85pt 70.85pt; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.WordSection1 	{page:WordSection1;} --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-parent:""; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin-top:0cm; 	mso-para-margin-right:0cm; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} --> <!--[endif]--></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: green;" lang="EN-US">/* MSVC does not have lrintf */</span><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue;" lang="EN-US">#ifdef</span><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> _MSC_VER</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue;" lang="EN-US">static</span><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> INLINE <span style="color: blue;">long</span> lrintf(<span style="color: blue;">float</span> f){</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue;" lang="EN-US">#ifdef</span><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> _M_X64</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span><span style="color: blue;">return</span> (<span style="color: blue;">long</span>)((f&gt;0.0f) ? (f + 0.5f):(f -0.5f));</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue;" lang="EN-US">#else</span><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span><span style="color: blue;">int</span> i;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span><span style="color: blue;">_asm</span>{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span>fld f</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span>fistp i</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span>};</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"><span> </span><span style="color: blue;">return</span> i;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue;" lang="EN-US">#endif</span><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas;" lang="EN-US">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 9.5pt; font-family: Consolas; color: blue;" lang="EN-US">#endif</span></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

