減色プログラム
Révision | 50320da65b4814ba8c5938cd5cab082b8655f468 (tree) |
---|---|
l'heure | 2011-05-22 12:52:23 |
Auteur | beru <berupon@gmai...> |
Commiter | beru |
changed visual studio file directory.
added vs2010 project.
fixed file load error check.
@@ -62,6 +62,10 @@ int _tmain(int argc, _TCHAR* argv[]) | ||
62 | 62 | sdxor156(time(NULL)); |
63 | 63 | ImageInfo imageInfo; |
64 | 64 | FILE* f = _tfopen(argv[1], _T("rb")); |
65 | + if (!f) { | |
66 | + puts("failed to open file\n"); | |
67 | + return 0; | |
68 | + } | |
65 | 69 | File file(f); |
66 | 70 | if (!ReadImageInfo(file, imageInfo)) { |
67 | 71 | puts("failed to open image\n"); |
@@ -44,7 +44,7 @@ | ||
44 | 44 | <Tool |
45 | 45 | Name="VCCLCompilerTool" |
46 | 46 | Optimization="0" |
47 | - AdditionalIncludeDirectories="./" | |
47 | + AdditionalIncludeDirectories="../" | |
48 | 48 | PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" |
49 | 49 | MinimalRebuild="true" |
50 | 50 | BasicRuntimeChecks="3" |
@@ -93,12 +93,11 @@ | ||
93 | 93 | /> |
94 | 94 | </Configuration> |
95 | 95 | <Configuration |
96 | - Name="Release|Win32" | |
97 | - OutputDirectory="$(SolutionDir)$(ConfigurationName)" | |
98 | - IntermediateDirectory="$(ConfigurationName)" | |
96 | + Name="Debug|x64" | |
97 | + OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" | |
98 | + IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" | |
99 | 99 | ConfigurationType="1" |
100 | 100 | CharacterSet="1" |
101 | - WholeProgramOptimization="1" | |
102 | 101 | > |
103 | 102 | <Tool |
104 | 103 | Name="VCPreBuildEventTool" |
@@ -114,20 +113,17 @@ | ||
114 | 113 | /> |
115 | 114 | <Tool |
116 | 115 | Name="VCMIDLTool" |
116 | + TargetEnvironment="3" | |
117 | 117 | /> |
118 | 118 | <Tool |
119 | 119 | Name="VCCLCompilerTool" |
120 | - Optimization="2" | |
121 | - EnableIntrinsicFunctions="true" | |
120 | + Optimization="0" | |
122 | 121 | AdditionalIncludeDirectories="./" |
123 | - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" | |
124 | - RuntimeLibrary="0" | |
125 | - BufferSecurityCheck="false" | |
126 | - EnableFunctionLevelLinking="true" | |
127 | - EnableEnhancedInstructionSet="2" | |
128 | - FloatingPointModel="2" | |
122 | + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" | |
123 | + MinimalRebuild="true" | |
124 | + BasicRuntimeChecks="3" | |
125 | + RuntimeLibrary="3" | |
129 | 126 | UsePrecompiledHeader="2" |
130 | - BrowseInformation="1" | |
131 | 127 | WarningLevel="3" |
132 | 128 | DebugInformationFormat="3" |
133 | 129 | ForcedIncludeFiles="common.h" |
@@ -143,13 +139,10 @@ | ||
143 | 139 | /> |
144 | 140 | <Tool |
145 | 141 | Name="VCLinkerTool" |
146 | - LinkIncremental="1" | |
142 | + LinkIncremental="2" | |
147 | 143 | GenerateDebugInformation="true" |
148 | 144 | SubSystem="1" |
149 | - OptimizeReferences="2" | |
150 | - EnableCOMDATFolding="2" | |
151 | - RandomizedBaseAddress="1" | |
152 | - TargetMachine="1" | |
145 | + TargetMachine="17" | |
153 | 146 | /> |
154 | 147 | <Tool |
155 | 148 | Name="VCALinkTool" |
@@ -174,11 +167,12 @@ | ||
174 | 167 | /> |
175 | 168 | </Configuration> |
176 | 169 | <Configuration |
177 | - Name="Debug|x64" | |
178 | - OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" | |
179 | - IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" | |
170 | + Name="Release|Win32" | |
171 | + OutputDirectory="$(SolutionDir)$(ConfigurationName)" | |
172 | + IntermediateDirectory="$(ConfigurationName)" | |
180 | 173 | ConfigurationType="1" |
181 | 174 | CharacterSet="1" |
175 | + WholeProgramOptimization="1" | |
182 | 176 | > |
183 | 177 | <Tool |
184 | 178 | Name="VCPreBuildEventTool" |
@@ -194,17 +188,20 @@ | ||
194 | 188 | /> |
195 | 189 | <Tool |
196 | 190 | Name="VCMIDLTool" |
197 | - TargetEnvironment="3" | |
198 | 191 | /> |
199 | 192 | <Tool |
200 | 193 | Name="VCCLCompilerTool" |
201 | - Optimization="0" | |
202 | - AdditionalIncludeDirectories="./" | |
203 | - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" | |
204 | - MinimalRebuild="true" | |
205 | - BasicRuntimeChecks="3" | |
206 | - RuntimeLibrary="3" | |
194 | + Optimization="2" | |
195 | + EnableIntrinsicFunctions="true" | |
196 | + AdditionalIncludeDirectories="../" | |
197 | + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" | |
198 | + RuntimeLibrary="0" | |
199 | + BufferSecurityCheck="false" | |
200 | + EnableFunctionLevelLinking="true" | |
201 | + EnableEnhancedInstructionSet="2" | |
202 | + FloatingPointModel="2" | |
207 | 203 | UsePrecompiledHeader="2" |
204 | + BrowseInformation="1" | |
208 | 205 | WarningLevel="3" |
209 | 206 | DebugInformationFormat="3" |
210 | 207 | ForcedIncludeFiles="common.h" |
@@ -220,10 +217,13 @@ | ||
220 | 217 | /> |
221 | 218 | <Tool |
222 | 219 | Name="VCLinkerTool" |
223 | - LinkIncremental="2" | |
220 | + LinkIncremental="1" | |
224 | 221 | GenerateDebugInformation="true" |
225 | 222 | SubSystem="1" |
226 | - TargetMachine="17" | |
223 | + OptimizeReferences="2" | |
224 | + EnableCOMDATFolding="2" | |
225 | + RandomizedBaseAddress="1" | |
226 | + TargetMachine="1" | |
227 | 227 | /> |
228 | 228 | <Tool |
229 | 229 | Name="VCALinkTool" |
@@ -339,23 +339,23 @@ | ||
339 | 339 | UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" |
340 | 340 | > |
341 | 341 | <File |
342 | - RelativePath=".\Color4f.cpp" | |
342 | + RelativePath="..\Color4f.cpp" | |
343 | 343 | > |
344 | 344 | </File> |
345 | 345 | <File |
346 | - RelativePath=".\lib.cpp" | |
346 | + RelativePath="..\lib.cpp" | |
347 | 347 | > |
348 | 348 | </File> |
349 | 349 | <File |
350 | - RelativePath=".\main.cpp" | |
350 | + RelativePath="..\main.cpp" | |
351 | 351 | > |
352 | 352 | </File> |
353 | 353 | <File |
354 | - RelativePath=".\quantize.cpp" | |
354 | + RelativePath="..\quantize.cpp" | |
355 | 355 | > |
356 | 356 | </File> |
357 | 357 | <File |
358 | - RelativePath=".\stdafx.cpp" | |
358 | + RelativePath="..\stdafx.cpp" | |
359 | 359 | > |
360 | 360 | <FileConfiguration |
361 | 361 | Name="Debug|Win32" |
@@ -373,22 +373,6 @@ | ||
373 | 373 | UsePrecompiledHeader="1" |
374 | 374 | /> |
375 | 375 | </FileConfiguration> |
376 | - <FileConfiguration | |
377 | - Name="Debug|x64" | |
378 | - > | |
379 | - <Tool | |
380 | - Name="VCCLCompilerTool" | |
381 | - UsePrecompiledHeader="1" | |
382 | - /> | |
383 | - </FileConfiguration> | |
384 | - <FileConfiguration | |
385 | - Name="Release|x64" | |
386 | - > | |
387 | - <Tool | |
388 | - Name="VCCLCompilerTool" | |
389 | - UsePrecompiledHeader="1" | |
390 | - /> | |
391 | - </FileConfiguration> | |
392 | 376 | </File> |
393 | 377 | </Filter> |
394 | 378 | <Filter |
@@ -397,39 +381,39 @@ | ||
397 | 381 | UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" |
398 | 382 | > |
399 | 383 | <File |
400 | - RelativePath=".\Array.h" | |
384 | + RelativePath="..\Array.h" | |
401 | 385 | > |
402 | 386 | </File> |
403 | 387 | <File |
404 | - RelativePath=".\Color4d.h" | |
388 | + RelativePath="..\Color4d.h" | |
405 | 389 | > |
406 | 390 | </File> |
407 | 391 | <File |
408 | - RelativePath=".\Color4f.h" | |
392 | + RelativePath="..\Color4f.h" | |
409 | 393 | > |
410 | 394 | </File> |
411 | 395 | <File |
412 | - RelativePath=".\common.h" | |
396 | + RelativePath="..\common.h" | |
413 | 397 | > |
414 | 398 | </File> |
415 | 399 | <File |
416 | - RelativePath=".\dxor.h" | |
400 | + RelativePath="..\dxor.h" | |
417 | 401 | > |
418 | 402 | </File> |
419 | 403 | <File |
420 | - RelativePath=".\quantize.h" | |
404 | + RelativePath="..\quantize.h" | |
421 | 405 | > |
422 | 406 | </File> |
423 | 407 | <File |
424 | - RelativePath=".\stdafx.h" | |
408 | + RelativePath="..\stdafx.h" | |
425 | 409 | > |
426 | 410 | </File> |
427 | 411 | <File |
428 | - RelativePath=".\stdint.h" | |
412 | + RelativePath="..\stdint.h" | |
429 | 413 | > |
430 | 414 | </File> |
431 | 415 | <File |
432 | - RelativePath=".\targetver.h" | |
416 | + RelativePath="..\targetver.h" | |
433 | 417 | > |
434 | 418 | </File> |
435 | 419 | </Filter> |
@@ -437,7 +421,7 @@ | ||
437 | 421 | Name="ReadImage" |
438 | 422 | > |
439 | 423 | <File |
440 | - RelativePath=".\ReadImage\File.cpp" | |
424 | + RelativePath="..\ReadImage\File.cpp" | |
441 | 425 | > |
442 | 426 | <FileConfiguration |
443 | 427 | Name="Debug|Win32" |
@@ -455,33 +439,17 @@ | ||
455 | 439 | UsePrecompiledHeader="0" |
456 | 440 | /> |
457 | 441 | </FileConfiguration> |
458 | - <FileConfiguration | |
459 | - Name="Debug|x64" | |
460 | - > | |
461 | - <Tool | |
462 | - Name="VCCLCompilerTool" | |
463 | - UsePrecompiledHeader="0" | |
464 | - /> | |
465 | - </FileConfiguration> | |
466 | - <FileConfiguration | |
467 | - Name="Release|x64" | |
468 | - > | |
469 | - <Tool | |
470 | - Name="VCCLCompilerTool" | |
471 | - UsePrecompiledHeader="0" | |
472 | - /> | |
473 | - </FileConfiguration> | |
474 | 442 | </File> |
475 | 443 | <File |
476 | - RelativePath=".\ReadImage\File.h" | |
444 | + RelativePath="..\ReadImage\File.h" | |
477 | 445 | > |
478 | 446 | </File> |
479 | 447 | <File |
480 | - RelativePath=".\ReadImage\IFile.h" | |
448 | + RelativePath="..\ReadImage\IFile.h" | |
481 | 449 | > |
482 | 450 | </File> |
483 | 451 | <File |
484 | - RelativePath=".\ReadImage\ReadImage.cpp" | |
452 | + RelativePath="..\ReadImage\ReadImage.cpp" | |
485 | 453 | > |
486 | 454 | <FileConfiguration |
487 | 455 | Name="Debug|Win32" |
@@ -499,25 +467,9 @@ | ||
499 | 467 | UsePrecompiledHeader="0" |
500 | 468 | /> |
501 | 469 | </FileConfiguration> |
502 | - <FileConfiguration | |
503 | - Name="Debug|x64" | |
504 | - > | |
505 | - <Tool | |
506 | - Name="VCCLCompilerTool" | |
507 | - UsePrecompiledHeader="0" | |
508 | - /> | |
509 | - </FileConfiguration> | |
510 | - <FileConfiguration | |
511 | - Name="Release|x64" | |
512 | - > | |
513 | - <Tool | |
514 | - Name="VCCLCompilerTool" | |
515 | - UsePrecompiledHeader="0" | |
516 | - /> | |
517 | - </FileConfiguration> | |
518 | 470 | </File> |
519 | 471 | <File |
520 | - RelativePath=".\ReadImage\ReadImage.h" | |
472 | + RelativePath="..\ReadImage\ReadImage.h" | |
521 | 473 | > |
522 | 474 | </File> |
523 | 475 | </Filter> |
@@ -0,0 +1,20 @@ | ||
1 | + | |
2 | +Microsoft Visual Studio Solution File, Format Version 11.00 | |
3 | +# Visual C++ Express 2010 | |
4 | +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "color_quantizer", "color_quantizer.vcxproj", "{62F96413-B60A-41BB-8B9A-9A79CAF8C84A}" | |
5 | +EndProject | |
6 | +Global | |
7 | + GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
8 | + Debug|Win32 = Debug|Win32 | |
9 | + Release|Win32 = Release|Win32 | |
10 | + EndGlobalSection | |
11 | + GlobalSection(ProjectConfigurationPlatforms) = postSolution | |
12 | + {62F96413-B60A-41BB-8B9A-9A79CAF8C84A}.Debug|Win32.ActiveCfg = Debug|Win32 | |
13 | + {62F96413-B60A-41BB-8B9A-9A79CAF8C84A}.Debug|Win32.Build.0 = Debug|Win32 | |
14 | + {62F96413-B60A-41BB-8B9A-9A79CAF8C84A}.Release|Win32.ActiveCfg = Release|Win32 | |
15 | + {62F96413-B60A-41BB-8B9A-9A79CAF8C84A}.Release|Win32.Build.0 = Release|Win32 | |
16 | + EndGlobalSection | |
17 | + GlobalSection(SolutionProperties) = preSolution | |
18 | + HideSolutionNode = FALSE | |
19 | + EndGlobalSection | |
20 | +EndGlobal |
@@ -0,0 +1,110 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
3 | + <ItemGroup Label="ProjectConfigurations"> | |
4 | + <ProjectConfiguration Include="Debug|Win32"> | |
5 | + <Configuration>Debug</Configuration> | |
6 | + <Platform>Win32</Platform> | |
7 | + </ProjectConfiguration> | |
8 | + <ProjectConfiguration Include="Release|Win32"> | |
9 | + <Configuration>Release</Configuration> | |
10 | + <Platform>Win32</Platform> | |
11 | + </ProjectConfiguration> | |
12 | + </ItemGroup> | |
13 | + <PropertyGroup Label="Globals"> | |
14 | + <ProjectGuid>{62F96413-B60A-41BB-8B9A-9A79CAF8C84A}</ProjectGuid> | |
15 | + <Keyword>Win32Proj</Keyword> | |
16 | + <RootNamespace>color_quantizer</RootNamespace> | |
17 | + <ProjectName>color_quantizer</ProjectName> | |
18 | + </PropertyGroup> | |
19 | + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |
20 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |
21 | + <ConfigurationType>Application</ConfigurationType> | |
22 | + <UseDebugLibraries>true</UseDebugLibraries> | |
23 | + <CharacterSet>Unicode</CharacterSet> | |
24 | + </PropertyGroup> | |
25 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |
26 | + <ConfigurationType>Application</ConfigurationType> | |
27 | + <UseDebugLibraries>false</UseDebugLibraries> | |
28 | + <WholeProgramOptimization>true</WholeProgramOptimization> | |
29 | + <CharacterSet>Unicode</CharacterSet> | |
30 | + </PropertyGroup> | |
31 | + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |
32 | + <ImportGroup Label="ExtensionSettings"> | |
33 | + </ImportGroup> | |
34 | + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
35 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
36 | + </ImportGroup> | |
37 | + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
38 | + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
39 | + </ImportGroup> | |
40 | + <PropertyGroup Label="UserMacros" /> | |
41 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
42 | + <LinkIncremental>true</LinkIncremental> | |
43 | + </PropertyGroup> | |
44 | + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
45 | + <LinkIncremental>false</LinkIncremental> | |
46 | + </PropertyGroup> | |
47 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
48 | + <ClCompile> | |
49 | + <PrecompiledHeader> | |
50 | + </PrecompiledHeader> | |
51 | + <WarningLevel>Level3</WarningLevel> | |
52 | + <Optimization>Disabled</Optimization> | |
53 | + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
54 | + <AdditionalIncludeDirectories>../</AdditionalIncludeDirectories> | |
55 | + <BrowseInformation>true</BrowseInformation> | |
56 | + <MultiProcessorCompilation>true</MultiProcessorCompilation> | |
57 | + <ForcedIncludeFiles>common.h</ForcedIncludeFiles> | |
58 | + </ClCompile> | |
59 | + <Link> | |
60 | + <SubSystem>Console</SubSystem> | |
61 | + <GenerateDebugInformation>true</GenerateDebugInformation> | |
62 | + </Link> | |
63 | + </ItemDefinitionGroup> | |
64 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
65 | + <ClCompile> | |
66 | + <WarningLevel>Level3</WarningLevel> | |
67 | + <PrecompiledHeader> | |
68 | + </PrecompiledHeader> | |
69 | + <Optimization>MaxSpeed</Optimization> | |
70 | + <FunctionLevelLinking>true</FunctionLevelLinking> | |
71 | + <IntrinsicFunctions>true</IntrinsicFunctions> | |
72 | + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
73 | + <AdditionalIncludeDirectories>../</AdditionalIncludeDirectories> | |
74 | + <BufferSecurityCheck>false</BufferSecurityCheck> | |
75 | + <FloatingPointModel>Fast</FloatingPointModel> | |
76 | + <MultiProcessorCompilation>true</MultiProcessorCompilation> | |
77 | + <ForcedIncludeFiles>common.h</ForcedIncludeFiles> | |
78 | + </ClCompile> | |
79 | + <Link> | |
80 | + <SubSystem>Console</SubSystem> | |
81 | + <GenerateDebugInformation>true</GenerateDebugInformation> | |
82 | + <EnableCOMDATFolding>true</EnableCOMDATFolding> | |
83 | + <OptimizeReferences>true</OptimizeReferences> | |
84 | + </Link> | |
85 | + </ItemDefinitionGroup> | |
86 | + <ItemGroup> | |
87 | + <ClCompile Include="..\lib.cpp" /> | |
88 | + <ClCompile Include="..\main.cpp" /> | |
89 | + <ClCompile Include="..\quantize.cpp" /> | |
90 | + <ClCompile Include="..\ReadImage\File.cpp" /> | |
91 | + <ClCompile Include="..\ReadImage\ReadImage.cpp" /> | |
92 | + <ClCompile Include="..\stdafx.cpp" /> | |
93 | + </ItemGroup> | |
94 | + <ItemGroup> | |
95 | + <ClInclude Include="..\Array.h" /> | |
96 | + <ClInclude Include="..\Color4d.h" /> | |
97 | + <ClInclude Include="..\common.h" /> | |
98 | + <ClInclude Include="..\dxor.h" /> | |
99 | + <ClInclude Include="..\quantize.h" /> | |
100 | + <ClInclude Include="..\ReadImage\File.h" /> | |
101 | + <ClInclude Include="..\ReadImage\IFile.h" /> | |
102 | + <ClInclude Include="..\ReadImage\ReadImage.h" /> | |
103 | + <ClInclude Include="..\stdafx.h" /> | |
104 | + <ClInclude Include="..\stdint.h" /> | |
105 | + <ClInclude Include="..\targetver.h" /> | |
106 | + </ItemGroup> | |
107 | + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |
108 | + <ImportGroup Label="ExtensionTargets"> | |
109 | + </ImportGroup> | |
110 | +</Project> | |
\ No newline at end of file |