• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

減色プログラム


Commit MetaInfo

Révision50320da65b4814ba8c5938cd5cab082b8655f468 (tree)
l'heure2011-05-22 12:52:23
Auteurberu <berupon@gmai...>
Commiterberu

Message de Log

changed visual studio file directory.
added vs2010 project.
fixed file load error check.

Change Summary

Modification

--- a/main.cpp
+++ b/main.cpp
@@ -62,6 +62,10 @@ int _tmain(int argc, _TCHAR* argv[])
6262 sdxor156(time(NULL));
6363 ImageInfo imageInfo;
6464 FILE* f = _tfopen(argv[1], _T("rb"));
65+ if (!f) {
66+ puts("failed to open file\n");
67+ return 0;
68+ }
6569 File file(f);
6670 if (!ReadImageInfo(file, imageInfo)) {
6771 puts("failed to open image\n");
--- a/color_quantizer.vcproj
+++ b/vs2008/color_quantizer.vcproj
@@ -44,7 +44,7 @@
4444 <Tool
4545 Name="VCCLCompilerTool"
4646 Optimization="0"
47- AdditionalIncludeDirectories="./"
47+ AdditionalIncludeDirectories="../"
4848 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
4949 MinimalRebuild="true"
5050 BasicRuntimeChecks="3"
@@ -93,12 +93,11 @@
9393 />
9494 </Configuration>
9595 <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)"
9999 ConfigurationType="1"
100100 CharacterSet="1"
101- WholeProgramOptimization="1"
102101 >
103102 <Tool
104103 Name="VCPreBuildEventTool"
@@ -114,20 +113,17 @@
114113 />
115114 <Tool
116115 Name="VCMIDLTool"
116+ TargetEnvironment="3"
117117 />
118118 <Tool
119119 Name="VCCLCompilerTool"
120- Optimization="2"
121- EnableIntrinsicFunctions="true"
120+ Optimization="0"
122121 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"
129126 UsePrecompiledHeader="2"
130- BrowseInformation="1"
131127 WarningLevel="3"
132128 DebugInformationFormat="3"
133129 ForcedIncludeFiles="common.h"
@@ -143,13 +139,10 @@
143139 />
144140 <Tool
145141 Name="VCLinkerTool"
146- LinkIncremental="1"
142+ LinkIncremental="2"
147143 GenerateDebugInformation="true"
148144 SubSystem="1"
149- OptimizeReferences="2"
150- EnableCOMDATFolding="2"
151- RandomizedBaseAddress="1"
152- TargetMachine="1"
145+ TargetMachine="17"
153146 />
154147 <Tool
155148 Name="VCALinkTool"
@@ -174,11 +167,12 @@
174167 />
175168 </Configuration>
176169 <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)"
180173 ConfigurationType="1"
181174 CharacterSet="1"
175+ WholeProgramOptimization="1"
182176 >
183177 <Tool
184178 Name="VCPreBuildEventTool"
@@ -194,17 +188,20 @@
194188 />
195189 <Tool
196190 Name="VCMIDLTool"
197- TargetEnvironment="3"
198191 />
199192 <Tool
200193 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"
207203 UsePrecompiledHeader="2"
204+ BrowseInformation="1"
208205 WarningLevel="3"
209206 DebugInformationFormat="3"
210207 ForcedIncludeFiles="common.h"
@@ -220,10 +217,13 @@
220217 />
221218 <Tool
222219 Name="VCLinkerTool"
223- LinkIncremental="2"
220+ LinkIncremental="1"
224221 GenerateDebugInformation="true"
225222 SubSystem="1"
226- TargetMachine="17"
223+ OptimizeReferences="2"
224+ EnableCOMDATFolding="2"
225+ RandomizedBaseAddress="1"
226+ TargetMachine="1"
227227 />
228228 <Tool
229229 Name="VCALinkTool"
@@ -339,23 +339,23 @@
339339 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
340340 >
341341 <File
342- RelativePath=".\Color4f.cpp"
342+ RelativePath="..\Color4f.cpp"
343343 >
344344 </File>
345345 <File
346- RelativePath=".\lib.cpp"
346+ RelativePath="..\lib.cpp"
347347 >
348348 </File>
349349 <File
350- RelativePath=".\main.cpp"
350+ RelativePath="..\main.cpp"
351351 >
352352 </File>
353353 <File
354- RelativePath=".\quantize.cpp"
354+ RelativePath="..\quantize.cpp"
355355 >
356356 </File>
357357 <File
358- RelativePath=".\stdafx.cpp"
358+ RelativePath="..\stdafx.cpp"
359359 >
360360 <FileConfiguration
361361 Name="Debug|Win32"
@@ -373,22 +373,6 @@
373373 UsePrecompiledHeader="1"
374374 />
375375 </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>
392376 </File>
393377 </Filter>
394378 <Filter
@@ -397,39 +381,39 @@
397381 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
398382 >
399383 <File
400- RelativePath=".\Array.h"
384+ RelativePath="..\Array.h"
401385 >
402386 </File>
403387 <File
404- RelativePath=".\Color4d.h"
388+ RelativePath="..\Color4d.h"
405389 >
406390 </File>
407391 <File
408- RelativePath=".\Color4f.h"
392+ RelativePath="..\Color4f.h"
409393 >
410394 </File>
411395 <File
412- RelativePath=".\common.h"
396+ RelativePath="..\common.h"
413397 >
414398 </File>
415399 <File
416- RelativePath=".\dxor.h"
400+ RelativePath="..\dxor.h"
417401 >
418402 </File>
419403 <File
420- RelativePath=".\quantize.h"
404+ RelativePath="..\quantize.h"
421405 >
422406 </File>
423407 <File
424- RelativePath=".\stdafx.h"
408+ RelativePath="..\stdafx.h"
425409 >
426410 </File>
427411 <File
428- RelativePath=".\stdint.h"
412+ RelativePath="..\stdint.h"
429413 >
430414 </File>
431415 <File
432- RelativePath=".\targetver.h"
416+ RelativePath="..\targetver.h"
433417 >
434418 </File>
435419 </Filter>
@@ -437,7 +421,7 @@
437421 Name="ReadImage"
438422 >
439423 <File
440- RelativePath=".\ReadImage\File.cpp"
424+ RelativePath="..\ReadImage\File.cpp"
441425 >
442426 <FileConfiguration
443427 Name="Debug|Win32"
@@ -455,33 +439,17 @@
455439 UsePrecompiledHeader="0"
456440 />
457441 </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>
474442 </File>
475443 <File
476- RelativePath=".\ReadImage\File.h"
444+ RelativePath="..\ReadImage\File.h"
477445 >
478446 </File>
479447 <File
480- RelativePath=".\ReadImage\IFile.h"
448+ RelativePath="..\ReadImage\IFile.h"
481449 >
482450 </File>
483451 <File
484- RelativePath=".\ReadImage\ReadImage.cpp"
452+ RelativePath="..\ReadImage\ReadImage.cpp"
485453 >
486454 <FileConfiguration
487455 Name="Debug|Win32"
@@ -499,25 +467,9 @@
499467 UsePrecompiledHeader="0"
500468 />
501469 </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>
518470 </File>
519471 <File
520- RelativePath=".\ReadImage\ReadImage.h"
472+ RelativePath="..\ReadImage\ReadImage.h"
521473 >
522474 </File>
523475 </Filter>
--- /dev/null
+++ b/vs2010/color_quantizer.sln
@@ -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
--- /dev/null
+++ b/vs2010/color_quantizer.vcxproj
@@ -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