diff options
author | scuri <scuri> | 2008-11-18 20:38:20 +0000 |
---|---|---|
committer | scuri <scuri> | 2008-11-18 20:38:20 +0000 |
commit | fe2133a967f4fd3ddf007c4b2f6cdf457d556b08 (patch) | |
tree | 57db7ee1c088eb9a861bc249b2d80b04771f552e | |
parent | 950d6181e32222c659df5720752dc43f0e92b8b6 (diff) |
*** empty log message ***
-rw-r--r-- | html/en/history.html | 2 | ||||
-rw-r--r-- | mak.vc9/im.sln | 20 | ||||
-rw-r--r-- | src/im_converttype.cpp | 10 | ||||
-rw-r--r-- | test/im_info.vcproj | 13 |
4 files changed, 26 insertions, 19 deletions
diff --git a/html/en/history.html b/html/en/history.html index fe1979b..6030df2 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -18,6 +18,8 @@ internally. HSI space now uses S already normalized between 0-Smax.</li> <li><span style="color: #FF0000">Fixed:</span> <strong>imColorHSI2RGB</strong> conversion.</li> + <li><span style="color: #FF0000">Fixed:</span> <strong>imConvertDataType</strong> + when converting a floating point to integer, there were rounding problems.</li> </ul> <h3 dir="ltr">Version 3.4 (14/Oct/2008)</h3> <ul> diff --git a/mak.vc9/im.sln b/mak.vc9/im.sln index 99f2388..2a854ee 100644 --- a/mak.vc9/im.sln +++ b/mak.vc9/im.sln @@ -26,6 +26,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imlua_process5", "imlua_pro EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "im_ecw", "im_ecw.vcproj", "{CB86E507-6B6C-4FDF-9B6D-27AA123AE463}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imlab", "..\..\imlab\mak.vc9\imlab.vcproj", "{C0E4757A-8A78-48C1-B507-E2A95AA18B25}" + ProjectSection(ProjectDependencies) = postProject + {5A761929-07C3-48BD-8E4A-B37EC5C72C42} = {5A761929-07C3-48BD-8E4A-B37EC5C72C42} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -105,13 +110,14 @@ Global {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Release|Win32.ActiveCfg = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Release|Win32.Build.0 = Debug|Win32 {CB86E507-6B6C-4FDF-9B6D-27AA123AE463}.Release|x64.ActiveCfg = Debug|Win32 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|Win32.ActiveCfg = Debug|Win32 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|Win32.Build.0 = Debug|Win32 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|x64.ActiveCfg = Debug|x64 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Debug|x64.Build.0 = Debug|x64 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Release|Win32.ActiveCfg = Debug|x64 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Release|x64.ActiveCfg = Debug|x64 - {909637FA-8229-45A9-9F42-53D8ED5F91C5}.Release|x64.Build.0 = Debug|x64 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Debug|Win32.ActiveCfg = Debug|Win32 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Debug|Win32.Build.0 = Debug|Win32 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Debug|x64.ActiveCfg = Debug|x64 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Debug|x64.Build.0 = Debug|x64 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Release|Win32.ActiveCfg = Release|Win32 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Release|Win32.Build.0 = Release|Win32 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Release|x64.ActiveCfg = Release|x64 + {C0E4757A-8A78-48C1-B507-E2A95AA18B25}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/im_converttype.cpp b/src/im_converttype.cpp index c8816ef..0c3d801 100644 --- a/src/im_converttype.cpp +++ b/src/im_converttype.cpp @@ -2,7 +2,7 @@ * \brief Image Data Type Conversion * * See Copyright Notice in im_lib.h - * $Id: im_converttype.cpp,v 1.1 2008/10/17 06:10:16 scuri Exp $ + * $Id: im_converttype.cpp,v 1.2 2008/11/18 20:38:21 scuri Exp $ */ #include "im.h" @@ -314,6 +314,9 @@ int iDemoteReal2Int(int count, const float *src_map, DSTT *dst_map, float gamma, else value = (*src_map++ - min)/range; + if (i==3603) + i=i; + // Now 0 <= value <= 1 (if min-max are correct) if (value >= 1) @@ -323,9 +326,10 @@ int iDemoteReal2Int(int count, const float *src_map, DSTT *dst_map, float gamma, else { value = iGammaFunc(factor, (float)dst_min, gamma, value); - if (value >= dst_max) + int ivalue = imRound(value); + if (ivalue >= dst_max) *dst_map++ = dst_max; - else if (value <= dst_min) + else if (ivalue <= dst_min) *dst_map++ = dst_min; else *dst_map++ = (DSTT)imRound(value - 0.5f); diff --git a/test/im_info.vcproj b/test/im_info.vcproj index e78ee5a..76d7eac 100644 --- a/test/im_info.vcproj +++ b/test/im_info.vcproj @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="8.00" + Version="9,00" Name="im_info" ProjectGUID="{909637FA-8229-45A9-9F42-53D8ED5F91C5}" Keyword="Win32Proj" + TargetFrameworkVersion="0" > <Platforms> <Platform @@ -40,7 +41,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="../../include" + AdditionalIncludeDirectories="../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -64,7 +65,7 @@ AdditionalDependencies="im.lib" OutputFile="$(OutDir)/im_info.exe" LinkIncremental="2" - AdditionalLibraryDirectories="C:\APP\LNG\WMFSDK9\lib;../../lib" + AdditionalLibraryDirectories="D:\LNG\WMFSDK9\lib;../lib" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)/im_info.pdb" SubSystem="1" @@ -89,9 +90,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> @@ -165,9 +163,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> |