HGGitLab

Commit 91d3e6f4 authored by luoliangyi's avatar luoliangyi

将release目录删除,放到新的仓库

parent 0e487eb1
Pipeline #19 canceled with stages
...@@ -6,4 +6,3 @@ ...@@ -6,4 +6,3 @@
/third_party /third_party
/build /build
/build-qt /build-qt
/release
\ No newline at end of file
...@@ -21,17 +21,17 @@ RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico ...@@ -21,17 +21,17 @@ RC_ICONS = ../../../app/scanner/image_rsc/logo/logo.ico
win32 { win32 {
contains(QT_ARCH, i386) { contains(QT_ARCH, i386) {
LIBS += -L../../../release/lib/windows/x86 -lHGBase -lHGImgFmt -lHGImgProc -lhgsane LIBS += -L../../../../Release/lib/windows/x86 -lHGBase -lHGImgFmt -lHGImgProc -lhgsane
CONFIG(release, debug|release) { CONFIG(release, debug|release) {
DESTDIR = ../../../release/bin/windows/x86/ DESTDIR = ../../../../Release/bin/windows/x86/
} }
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
} }
} else { } else {
LIBS += -L../../../release/lib/windows/x64 -lHGBase -lHGImgFmt -lHGImgProc -lhgsane LIBS += -L../../../../Release/lib/windows/x64 -lHGBase -lHGImgFmt -lHGImgProc -lhgsane
CONFIG(release, debug|release) { CONFIG(release, debug|release) {
DESTDIR = ../../../release/bin/windows/x64/ DESTDIR = ../../../../Release/bin/windows/x64/
} }
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
......
...@@ -167,10 +167,10 @@ ...@@ -167,10 +167,10 @@
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGBase.lib $(SolutionDir)..\..\release\lib\windows\x86\ <Command>copy $(OutDir)HGBase.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\
copy $(OutDir)HGBase.lib $(SolutionDir)..\..\release\lib\windows\x86\libHGBase.a copy $(OutDir)HGBase.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\libHGBase.a
copy $(OutDir)HGBase.dll $(SolutionDir)..\..\release\bin\windows\x86\ copy $(OutDir)HGBase.dll $(SolutionDir)..\..\..\Release\bin\windows\x86\
copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\release\include\base\</Command> copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\..\Release\include\base\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -218,10 +218,10 @@ copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\release\include\base\</Com ...@@ -218,10 +218,10 @@ copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\release\include\base\</Com
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGBase.lib $(SolutionDir)..\..\release\lib\windows\x64\ <Command>copy $(OutDir)HGBase.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\
copy $(OutDir)HGBase.lib $(SolutionDir)..\..\release\lib\windows\x64\libHGBase.a copy $(OutDir)HGBase.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\libHGBase.a
copy $(OutDir)HGBase.dll $(SolutionDir)..\..\release\bin\windows\x64\ copy $(OutDir)HGBase.dll $(SolutionDir)..\..\..\Release\bin\windows\x64\
copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\release\include\base\</Command> copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\..\Release\include\base\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -153,10 +153,10 @@ ...@@ -153,10 +153,10 @@
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\release\lib\windows\x86\ <Command>copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\
copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\release\lib\windows\x86\libHGImgFmt.a copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\libHGImgFmt.a
copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\release\bin\windows\x86\ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\Release\bin\windows\x86\
copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\release\include\imgfmt\</Command> copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\..\Release\include\imgfmt\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -205,10 +205,10 @@ copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\release\include\imgfmt\< ...@@ -205,10 +205,10 @@ copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\release\include\imgfmt\<
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\release\lib\windows\x64\ <Command>copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\
copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\release\lib\windows\x64\libHGImgFmt.a copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\libHGImgFmt.a
copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\release\bin\windows\x64\ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\Release\bin\windows\x64\
copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\release\include\imgfmt\</Command> copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\..\Release\include\imgfmt\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -139,10 +139,10 @@ ...@@ -139,10 +139,10 @@
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\release\lib\windows\x86\ <Command>copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\
copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\release\lib\windows\x86\libHGImgProc.a copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\libHGImgProc.a
copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\release\bin\windows\x86\ copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\..\Release\bin\windows\x86\
copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\release\include\imgproc\</Command> copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\..\Release\include\imgproc\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -189,10 +189,10 @@ copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\release\include\imgproc ...@@ -189,10 +189,10 @@ copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\release\include\imgproc
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\release\lib\windows\x64\ <Command>copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\
copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\release\lib\windows\x64\libHGImgProc.a copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\libHGImgProc.a
copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\release\bin\windows\x64\ copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\..\Release\bin\windows\x64\
copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\release\include\imgproc\</Command> copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\..\Release\include\imgproc\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -137,10 +137,10 @@ ...@@ -137,10 +137,10 @@
<AdditionalDependencies>../Release/HGBase.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>../Release/HGBase.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\release\lib\windows\x86\ <Command>copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\
copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\release\lib\windows\x86\libHGSaneUser.a copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\libHGSaneUser.a
copy $(OutDir)HGSaneUser.dll $(SolutionDir)..\..\release\bin\windows\x86\ copy $(OutDir)HGSaneUser.dll $(SolutionDir)..\..\..\Release\bin\windows\x86\
copy $(SolutionDir)..\..\sane_user\*.h $(SolutionDir)..\..\release\include\sane_user\</Command> copy $(SolutionDir)..\..\sane_user\*.h $(SolutionDir)..\..\..\Release\include\sane_user\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -186,10 +186,10 @@ copy $(SolutionDir)..\..\sane_user\*.h $(SolutionDir)..\..\release\include\sane_ ...@@ -186,10 +186,10 @@ copy $(SolutionDir)..\..\sane_user\*.h $(SolutionDir)..\..\release\include\sane_
<AdditionalDependencies>../x64/Release/HGBase.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>../x64/Release/HGBase.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\release\lib\windows\x64\ <Command>copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\
copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\release\lib\windows\x64\libHGSaneUser.a copy $(OutDir)HGSaneUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\libHGSaneUser.a
copy $(OutDir)HGSaneUser.dll $(SolutionDir)..\..\release\bin\windows\x64\ copy $(OutDir)HGSaneUser.dll $(SolutionDir)..\..\..\Release\bin\windows\x64\
copy $(SolutionDir)..\..\sane_user\*.h $(SolutionDir)..\..\release\include\sane_user\</Command> copy $(SolutionDir)..\..\sane_user\*.h $(SolutionDir)..\..\..\Release\include\sane_user\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -138,10 +138,10 @@ ...@@ -138,10 +138,10 @@
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\release\lib\windows\x86\ <Command>copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\
copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\release\lib\windows\x86\libHGTwainUser.a copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x86\libHGTwainUser.a
copy $(OutDir)HGTwainUser.dll $(SolutionDir)..\..\release\bin\windows\x86\ copy $(OutDir)HGTwainUser.dll $(SolutionDir)..\..\..\Release\bin\windows\x86\
copy $(SolutionDir)..\..\twain_user\*.h $(SolutionDir)..\..\release\include\twain_user\</Command> copy $(SolutionDir)..\..\twain_user\*.h $(SolutionDir)..\..\..\Release\include\twain_user\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -187,10 +187,10 @@ copy $(SolutionDir)..\..\twain_user\*.h $(SolutionDir)..\..\release\include\twai ...@@ -187,10 +187,10 @@ copy $(SolutionDir)..\..\twain_user\*.h $(SolutionDir)..\..\release\include\twai
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\release\lib\windows\x64\ <Command>copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\
copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\release\lib\windows\x64\libHGTwainUser.a copy $(OutDir)HGTwainUser.lib $(SolutionDir)..\..\..\Release\lib\windows\x64\libHGTwainUser.a
copy $(OutDir)HGTwainUser.dll $(SolutionDir)..\..\release\bin\windows\x64\ copy $(OutDir)HGTwainUser.dll $(SolutionDir)..\..\..\Release\bin\windows\x64\
copy $(SolutionDir)..\..\twain_user\*.h $(SolutionDir)..\..\release\include\twain_user\</Command> copy $(SolutionDir)..\..\twain_user\*.h $(SolutionDir)..\..\..\Release\include\twain_user\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -119,12 +119,12 @@ ...@@ -119,12 +119,12 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../release/include/;../../../third_party/sane/;../../../third_party/libzip/windows/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/sane/;../../../third_party/libzip/windows/include;../../../../Release/include/sane/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>../Debug/HGBase.lib;../Debug/HGImgFmt.lib;../../../release/lib/windows/x86/hgsane.lib;../../../third_party/zlib/windows/lib/x86/zlib.lib;../../../third_party/libzip/windows/lib/x86/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>../Debug/HGBase.lib;../Debug/HGImgFmt.lib;../../../../Release/lib/windows/x86/hgsane.lib;../../../third_party/zlib/windows/lib/x86/zlib.lib;../../../third_party/libzip/windows/lib/x86/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/ignore:4098,4075 /LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/ignore:4098,4075 /LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
...@@ -137,18 +137,18 @@ ...@@ -137,18 +137,18 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../release/include/;../../../third_party/sane/;../../../third_party/libzip/windows/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/sane/;../../../third_party/libzip/windows/include;../../../../Release/include/sane/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>../Release/HGBase.lib;../Release/HGImgFmt.lib;../../../release/lib/windows/x86/hgsane.lib;../../../third_party/zlib/windows/lib/x86/zlib.lib;../../../third_party/libzip/windows/lib/x86/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>../Release/HGBase.lib;../Release/HGImgFmt.lib;../../../../Release/lib/windows/x86/hgsane.lib;../../../third_party/zlib/windows/lib/x86/zlib.lib;../../../third_party/libzip/windows/lib/x86/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGWebService.exe $(SolutionDir)..\..\release\bin\windows\x86\</Command> <Command>copy $(OutDir)HGWebService.exe $(SolutionDir)..\..\..\Release\bin\windows\x86\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -158,12 +158,12 @@ ...@@ -158,12 +158,12 @@
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../release/include/;../../../third_party/sane/;../../../third_party/libzip/windows/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/sane/;../../../third_party/libzip/windows/include;../../../../Release/include/sane/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>../x64/Debug/HGBase.lib;../x64/Debug/HGImgFmt.lib;../../../release/lib/windows/x64/hgsane.lib;../../../third_party/zlib/windows/lib/x64/zlib.lib;../../../third_party/libzip/windows/lib/x64/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>../x64/Debug/HGBase.lib;../x64/Debug/HGImgFmt.lib;../../../../Release/lib/windows/x64/hgsane.lib;../../../third_party/zlib/windows/lib/x64/zlib.lib;../../../third_party/libzip/windows/lib/x64/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/ignore:4098,4075 /LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/ignore:4098,4075 /LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
...@@ -176,18 +176,18 @@ ...@@ -176,18 +176,18 @@
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../release/include/;../../../third_party/sane/;../../../third_party/libzip/windows/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/sane/;../../../third_party/libzip/windows/include;../../../../Release/include/sane/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>../x64/Release/HGBase.lib;../x64/Release/HGImgFmt.lib;../../../release/lib/windows/x64/hgsane.lib;../../../third_party/zlib/windows/lib/x64/zlib.lib;../../../third_party/libzip/windows/lib/x64/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>../x64/Release/HGBase.lib;../x64/Release/HGImgFmt.lib;../../../../Release/lib/windows/x64/hgsane.lib;../../../third_party/zlib/windows/lib/x64/zlib.lib;../../../third_party/libzip/windows/lib/x64/zip.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>copy $(OutDir)HGWebService.exe $(SolutionDir)..\..\release\bin\windows\x64\</Command> <Command>copy $(OutDir)HGWebService.exe $(SolutionDir)..\..\..\Release\bin\windows\x64\</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "华高扫描仪软件"
#define MyAppVersion "2.0.0.1"
#define MyAppSetupName "HuagoScanApp_Setup"
#define MyAppDefSetupDir "HuagoScan"
#define MyAppPublisher "宁波华高信息科技有限公司"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{7076DC53-5C2F-4216-9783-2A6F954FEB3E}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppDefSetupDir}
DefaultGroupName={#MyAppName}
VersionInfoVersion={#MyAppVersion}
OutputDir=.\
OutputBaseFilename={#MyAppSetupName}
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=yes
UninstallIconFile=uninstall.ico
SetupIconFile=logo.ico
LicenseFile=
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/Chinese.isl"
[Files]
; app
Source: ".\logo.ico"; DestDir: "{app}\"; Flags: ignoreversion
Source: ".\HuaGoScan_App_Help_manual.pdf"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\iconengines\*"; DestDir: "{app}\iconengines\"; Flags: ignoreversion
Source: "..\x86\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion
Source: "..\x86\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion
Source: "..\x86\styles\*"; DestDir: "{app}\styles\"; Flags: ignoreversion
Source: "..\x86\translations\*"; DestDir: "{app}\translations\"; Flags: ignoreversion
Source: "..\x86\D3Dcompiler_47.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\libEGL.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\libGLESV2.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\msvcp140.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\opengl32sw.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\Qt5Core.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\Qt5Gui.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\Qt5Svg.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\Qt5Widgets.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\vcruntime140.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\HGBase.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\HGImgFmt.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\HGImgProc.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\hgsane.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\hgscanner.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\HGScanner.exe"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\libmupdf.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\pdflib.dll"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
[Icons]
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\HGScanner.exe"
Name: "{group}\{#MyAppName}"; Filename: "{app}\HGScanner.exe"
Name: "{group}\华高扫描仪软件帮助文档"; Filename: "{app}\HuaGoScan_App_Help_manual.pdf"
Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[Registry]
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "AppDirectory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\HuaGoScan"; ValueType: string; ValueName: "Application"; ValueData: "{app}\HGScanner.exe"; Flags: uninsdeletekey
[Code]
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
if (IsWin64()) then begin
SubKeyName := 'Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1';
RegWriteStringValue(HKLM64,SubKeyName,'DisplayIcon',iconPath);
end else begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{7076DC53-5C2F-4216-9783-2A6F954FEB3E}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\logo.ico'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep);
begin
if CurUninstallStep = usDone then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end;
[Run]
Filename: "{app}\HGScanner.exe"; Description: "{cm:LaunchProgram, {#MyAppName}}"; Flags: postinstall nowait skipifsilent
\ No newline at end of file
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "华高TWAIN"
#define MyAppVersion "2.0.0.1"
#define MyAppSetupName "HuagoScanTwain_Setup"
#define MyAppPublisher "宁波华高信息科技有限公司"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{A69BBD28-5199-4DD9-870B-4738B99104B0}
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
DefaultGroupName={#MyAppName}
DefaultDirName={win}\twain_32\huagoscan\
OutputDir=.\
OutputBaseFilename={#MyAppSetupName}
Compression=lzma
AppPublisher={#MyAppPublisher}
SolidCompression=yes
UninstallIconFile=uninstall.ico
SetupIconFile=logo.ico
LicenseFile=
DisableDirPage=yes
[Languages]
Name: "zn"; MessagesFile: "compiler:Languages/Chinese.isl"
[Files]
; app
Source: ".\logo.ico"; DestDir: "{app}\"; Flags: ignoreversion
; twain
Source: "..\x86\hgsane.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\hgscanner.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\huagaotwain.ds"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\msvcp140.dll"; DestDir: "{app}\"; Flags: ignoreversion
Source: "..\x86\vcruntime140.dll"; DestDir: "{app}\"; Flags: ignoreversion
[INI]
[Icons]
Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}";
[Code]
function SetUninstallIcon(iconPath:string): Boolean;
var
InstalledVersion,SubKeyName: String;
begin
if (IsWin64()) then begin
SubKeyName := 'Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{A69BBD28-5199-4DD9-870B-4738B99104B0}_is1';
RegWriteStringValue(HKLM64,SubKeyName,'DisplayIcon',iconPath);
end else begin
SubKeyName := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{A69BBD28-5199-4DD9-870B-4738B99104B0}_is1';
RegWriteStringValue(HKLM,SubKeyName,'DisplayIcon',iconPath);
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
SetUninstallIcon(ExpandConstant('{app}\logo.ico'));
end;
end;
\ No newline at end of file
#ifndef __HGBASE_H__
#define __HGBASE_H__
#include "HGDef.h"
#include "HGBaseErr.h"
#include "HGBase64.h"
#include "HGDes.h"
#include "HGMd5.h"
#include "HGLock.h"
#include "HGEvent.h"
#include "HGDll.h"
#include "HGLog.h"
#include "HGConsole.h"
#include "HGBuffer.h"
#include "HGImage.h"
#include "HGThread.h"
#include "HGUtility.h"
#include "HGInfo.h"
#endif /* __HGBASE_H__ */
\ No newline at end of file
#ifndef __HGBASE64_H__
#define __HGBASE64_H__
#include "HGDef.h"
#include "HGBaseErr.h"
/* Base64编码
* 参数:
* 1) originalData: in, 原始数据地址
* 2) originalSize: in, 原始数据长度
* 3) base64Data: out, base64地址
* 4) base64Size: out, 编码后base64长度
* 说明:
* 1) 该函数的调用需要分两次,第一次base64Data为NULL,base64Size不为NULL, 获取编码后base64长度
* 2) 分配足够的内存后,然后调用第二次,此时base64Data为分配的地址
*/
HGEXPORT HGResult HGAPI HGBase_Base64Encode(const HGByte* originalData, HGSize originalSize,
HGByte* base64Data, HGSize* base64Size);
/* Base64解码
* 参数:
* 1) base64Data: in, base64地址
* 2) base64Size: in, base64长度
* 3) originalData: out, 原始数据地址
* 4) originalSize: out, 解码后原始数据长度
* 说明:
* 1) 该函数的调用需要分两次,第一次originalData为NULL,originalSize不为NULL, 获取解码后原始数据长度
* 2) 分配足够的内存后,然后调用第二次,此时originalData为分配的地址
* 3) base64Data中的数据必须是标准Base64字符, 不能有其他字符,比如\r或\n等
*/
HGEXPORT HGResult HGAPI HGBase_Base64Decode(const HGByte* base64Data, HGSize base64Size,
HGByte* originalData, HGSize* originalSize);
#endif /* __HGBASE64_H__ */
\ No newline at end of file
#ifndef __HGBASEERR_H__
#define __HGBASEERR_H__
/* 无错误 */
#define HGBASE_ERR_OK 0x00000000L
/* 一般错误 */
#define HGBASE_ERR_FAIL 0x00000001L
/* 内存不足 */
#define HGBASE_ERR_OUTOFMEMORY 0x00000002L
/* 参数非法 */
#define HGBASE_ERR_INVALIDARG 0x00000003L
/* 无访问权限 */
#define HGBASE_ERR_ACCESSDENIED 0x00000004L
/* 数据非法 */
#define HGBASE_ERR_INVALIDDATA 0x00000005L
/* 未实现 */
#define HGBASE_ERR_NOTIMPL 0x00000006L
/* 不支持该功能 */
#define HGBASE_ERR_NOTSUPPORT 0x00000007L
/* 超时 */
#define HGBASE_ERR_TIMEOUT 0x00000008L
#endif /* __HGBASEERR_H__ */
\ No newline at end of file
#ifndef __HGBUFFER_H__
#define __HGBUFFER_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGBuffer);
/* 创建新的缓冲区
* 参数:
* 1) size: in, 缓冲区大小, 单位字节
* 2) buffer: out, 新缓冲区句柄
* 说明:
* 1) 内部会分配size字节大小的内存
*/
HGEXPORT HGResult HGAPI HGBase_CreateBuffer(HGUSize size, HGBuffer* buffer);
/* 通过已有数据创建新的缓冲区
* 参数:
* 1) data: in, 已有的数据地址
* 2) size: in, 已有的数据大小, 单位字节
* 3) buffer: out, 新缓冲区句柄
* 说明:
* 1) 内部会分配size字节大小的内存, 新的缓冲区创建完成时, 会将data中的数据拷贝过去
*/
HGEXPORT HGResult HGAPI HGBase_CreateBufferFromData(const HGByte* data, HGUSize size, HGBuffer* buffer);
/* 通过已有数据创建新的缓冲区(不分配内存, 不拷贝数据)
* 参数:
* 1) data: in, 已有的数据地址
* 2) size: in, 已有的数据大小, 单位字节
* 3) buffer: out, 新缓冲区句柄
* 说明:
* 1) 内部不会分配内存, 将直接使用原始数据
* 2) 需保证缓冲区销毁前原始数据一直有效
*/
HGEXPORT HGResult HGAPI HGBase_CreateBufferWithData(HGByte* data, HGUSize size, HGBuffer* buffer);
/* 通过现有缓冲区创建新的缓冲区
* 参数:
* 1) srcBuffer: in, 已有缓冲区
* 2) buffer: out, 新缓冲区句柄
* 说明:
* 1) 内部会分配现有缓冲区的size字节大小的内存, 新缓冲区创建完成时, 会将现有缓冲区中的数据拷贝过去
*/
HGEXPORT HGResult HGAPI HGBase_CloneBuffer(HGBuffer srcBuffer, HGBuffer* buffer);
/* 销毁缓冲区
* 参数:
* 1) buffer: in, 缓冲区句柄
* 说明:
* 1) 如果内部分配了内存, 销毁的时候会自动释放该内存
*/
HGEXPORT HGResult HGAPI HGBase_DestroyBuffer(HGBuffer buffer);
/* 获取缓冲区数据地址
* 参数:
* 1) buffer: in, 缓冲区句柄
* 2) data: out, 数据地址
* 说明:
* 1) 如果内部分配了内存, 返回的是分配的内存地址
* 2) 如果内部没有分配内存, 返回的则是原始数据的地址
*/
HGEXPORT HGResult HGAPI HGBase_GetBufferData(HGBuffer buffer, HGByte** data);
/* 获取缓冲区数据大小
* 参数:
* 1) buffer: in, 缓冲区句柄
* 2) size: out, 数据长度
* 说明:
* 1) 如果内部分配了内存, 返回的是分配的内存大小
* 2) 如果内部没有分配内存, 返回的则是原始数据的大小
*/
HGEXPORT HGResult HGAPI HGBase_GetBufferSize(HGBuffer buffer, HGUSize* size);
#endif /* __HGBUFFER_H__ */
\ No newline at end of file
#ifndef __HGCONSOLE_H__
#define __HGCONSOLE_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGConsole);
/* 开启控制台
* 参数:
* 1) log: out, 控制台句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_OpenConsole(HGConsole *console);
/* 关闭控制台
* 参数:
* 1) log: in, 控制台句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_CloseConsole(HGConsole console);
/* 写控制台信息
* 参数:
* 1) log: in, 控制台句柄
* 2) info: in, 信息, 一次一行, info无需加换行符
* 说明:
* 1) 该函数不是线程安全的, 在不同线程调用的时候, 需要加锁
*/
HGEXPORT HGResult HGAPI HGBase_WriteConsole(HGConsole console, const HGChar* info);
#endif /* __HGCONSOLE_H__ */
\ No newline at end of file
#ifndef __HGDEF_H__
#define __HGDEF_H__
/****************************************************************************
* Platform Dependent Definitions and Typedefs *
****************************************************************************/
/* Microsoft C/C++ Compiler */
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) || defined (_WINDOWS)
#define HG_CMP_MSC
#if defined(_WIN64) || defined(WIN64)
#define HG_64BIT
#elif defined(_WIN32) || defined(WIN32)
#define HG_32BIT
#endif
/* Apple Compiler (which is GNU now) */
#elif defined(__APPLE__)
#define HG_CMP_XCODE
#define HG_64BIT
/* GNU C/C++ Compiler */
#elif defined(__GNUC__)
#define HG_CMP_GNU
#if defined(__alpha__) || defined(__ia64__) || defined(__ppc64__) || defined(__s390x__) || defined(__x86_64__)
#define HG_64BIT
#else
#define HG_32BIT
#endif
/* Unrecognized */
#else
#error Unrecognized compiler
#endif
#if defined(HG_CMP_MSC)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif
/* type defines */
typedef char HGChar;
typedef unsigned char HGByte;
typedef short HGShort;
typedef unsigned short HGUShort;
typedef int HGInt;
typedef unsigned int HGUInt;
typedef long long HGLonglong;
typedef unsigned long long HGULonglong;
typedef void* HGPointer;
typedef HGInt HGBool;
typedef float HGFloat;
typedef double HGDouble;
#ifdef HG_64BIT
typedef HGLonglong HGSize;
typedef HGULonglong HGUSize;
#else
typedef HGInt HGSize;
typedef HGUInt HGUSize;
#endif
/* error code */
typedef HGUInt HGResult;
#define HGTRUE 1
#define HGFALSE 0
#ifndef HGMAX
#define HGMAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef HGMIN
#define HGMIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
#if defined(HG_CMP_MSC)
#ifdef __cplusplus
#define HGEXPORT extern "C"
#else
#define HGEXPORT
#endif /* __cplusplus */
#define HGAPI __stdcall
#define HGAPIV __cdecl
#else
#ifdef __cplusplus
#define HGEXPORT extern "C" __attribute ((visibility("default")))
#else
#define HGEXPORT __attribute ((visibility("default")))
#endif /* __cplusplus */
#define HGAPI
#define HGAPIV
#endif
#define HG_DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name
typedef struct
{
HGInt left;
HGInt top;
HGInt right;
HGInt bottom;
}HGRect;
typedef struct
{
HGFloat left;
HGFloat top;
HGFloat right;
HGFloat bottom;
}HGRectF;
typedef struct
{
HGInt x;
HGInt y;
}HGPoint;
typedef struct
{
HGFloat x;
HGFloat y;
}HGPointF;
#endif /* __HGDEF_H__ */
#ifndef __HGDES_H__
#define __HGDES_H__
#include "HGDef.h"
#include "HGBaseErr.h"
/* DES加密
* 参数:
* 1) data: in, out, 明文
* 2) size: in, 明文尺寸, 必须是8的倍数
* 3) key: in, 加密密钥, 为8字节数组
* 说明:
* 1) 加密后的密文会覆盖明文,如果需要保留明文,需要提前保存
*/
HGEXPORT HGResult HGAPI HGBase_DesEncrypt(HGByte* data, HGUInt size, const HGByte* key);
/* DES解密
* 参数:
* 1) data: in, out, 密文
* 2) size: in, 密文尺寸, 必须是8的倍数
* 3) key: in, 解密密钥, 为8字节数组
* 说明:
* 1) 解密后的明文会覆盖密文,如果需要保留密文,需要提前保存
*/
HGEXPORT HGResult HGAPI HGBase_DesDecrypt(HGByte* data, HGUInt size, const HGByte* key);
#endif /* __HGDES_H__ */
\ No newline at end of file
#ifndef __HGDLL_H__
#define __HGDLL_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGDll);
/* 加载DLL
* 参数:
* 1) fileName: in, dll/so文件路径, 可以是绝对路径或相对路径
* 2) dll: out, DLL句柄
* 说明:
* 1) 在windows系统上, fileName需要是GBK编码
* 2) 在linux系统上, fileName需要是UTF8编码
*/
HGEXPORT HGResult HGAPI HGBase_CreateDll(const HGChar* fileName, HGDll* dll);
/* 销毁DLL
* 参数:
* 1) dll: in, DLL句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_DestroyDll(HGDll dll);
/* 查找函数地址
* 参数:
* 1) dll: in, DLL句柄
* 2) symbol: in, 函数名
* 3) func: out, 函数地址
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_GetDllProcAddress(HGDll dll, const HGChar* symbol, HGPointer* func);
#endif /* __HGDLL_H__ */
\ No newline at end of file
#ifndef __HGEVENT_H__
#define __HGEVENT_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGEvent);
/* 创建事件
* 参数:
* 1) manualReset: in, 是否手动设置
* 2) initState: in, 初始化时是否有信号
* 3) event: out, 事件句柄
* 说明:
* 1) 当manualReset为HGTRUE时, HGBase_WaitEvent和HGBase_WaitEventTimeout调用后, 事件仍然为有信号
* 2) 当manualReset为HGFALSE时, HGBase_WaitEvent和HGBase_WaitEventTimeout调用后, 事件为无信号
*/
HGEXPORT HGResult HGAPI HGBase_CreateEvent(HGBool manualReset, HGBool initState, HGEvent* event);
/* 销毁事件
* 参数:
* 1) event: in, 事件句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_DestroyEvent(HGEvent event);
/* 无限等待事件
* 参数:
* 1) event: in, 事件句柄
* 说明:
* 1) 如果创建时的manualReset为HGTRUE, 返回前不会将事件置为无信号;否则,返回前会将事件置为无信号
*/
HGEXPORT HGResult HGAPI HGBase_WaitEvent(HGEvent event);
/* 等待事件, 带超时时间
* 参数:
* 1) event: in, 事件句柄
* 2) milliseconds: in, 超时时间, 毫秒
* 说明:
* 1) 在milliseconds时间内如果事件有信号,立即返回
* 2) 如果一直无信号, 在milliseconds毫秒后也立即返回, 返回值为HGBASE_ERR_WAIT_TIMEOUT
* 3) 如果创建时的manualReset为HGTRUE, 返回前不会将事件置为无信号;否则,返回前会将事件置为无信号
*/
HGEXPORT HGResult HGAPI HGBase_WaitEventTimeout(HGEvent event, HGUInt milliseconds);
/* 使事件有信号
* 参数:
* 1) event: in, 事件句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_SetEvent(HGEvent event);
/* 使事件无信号
* 参数:
* 1) event: in, 事件句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_ResetEvent(HGEvent event);
#endif /* __HGEVENT_H__ */
\ No newline at end of file
This diff is collapsed.
#ifndef __HGINC_H__
#define __HGINC_H__
#include <stddef.h>
#include <stdint.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>
#include <malloc.h>
#include <stdarg.h>
#if defined(HG_CMP_MSC)
#include <windows.h>
#include <WinSock2.h>
#else
#include <sys/time.h>
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <dlfcn.h>
#include <iconv.h>
#endif
#endif /* __HGINC_H__ */
#ifndef __HGINFO_H__
#define __HGINFO_H__
#include "HGDef.h"
#include "HGBaseErr.h"
/* 致命错误 */
#define HGBASE_INFOTYPE_FATAL 1L
/* 一般错误 */
#define HGBASE_INFOTYPE_ERROR 2L
/* 警告 */
#define HGBASE_INFOTYPE_WARNING 4L
/* 一般描述信息 */
#define HGBASE_INFOTYPE_DESC 8L
/* 调试信息 */
#define HGBASE_INFOTYPE_DEBUG 16L
/* 启用日志/控制台信息
*/
HGEXPORT HGResult HGAPI HGBase_EnableInfo();
/* 禁用日志/控制台信息
*/
HGEXPORT HGResult HGAPI HGBase_DisableInfo();
/* 写日志/控制台信息
* 参数:
* 1) type: in, 信息类型, 参见HGBASE_INFOTYPE_*
* 2) format: in, 信息格式
* 说明:
* 1) 信息的完整输出行: [日期-时间] [进程号/线程号] [信息类型] [信息]
* 2) 信息的实际输出行取决于HGGlobal.ini的配置
*/
HGEXPORT HGResult HGAPIV HGBase_WriteInfo(HGUInt type, const HGChar* format, ...);
#endif /* __HGINFO_H__ */
\ No newline at end of file
#ifndef __HGLOCK_H__
#define __HGLOCK_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGLock);
/* 创建互斥锁
* 参数:
* 1) lock: out, 互斥锁句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_CreateLock(HGLock* lock);
/* 销毁互斥锁
* 参数:
* 1) lock: in, 互斥锁句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_DestroyLock(HGLock lock);
/* 加锁
* 参数:
* 1) lock: in, 互斥锁句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_EnterLock(HGLock lock);
/* 解锁
* 参数:
* 1) lock: in, 互斥锁句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_LeaveLock(HGLock lock);
#endif /* __HGLOCK_H__ */
\ No newline at end of file
#ifndef __HGLOG_H__
#define __HGLOG_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGLog);
/* 开启日志
* 参数:
* 1) fileName: in, 文件名
* 2) log: out, 日志句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_OpenLog(const HGChar* fileName, HGLog* log);
/* 关闭日志
* 参数:
* 1) log: in, 日志句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_CloseLog(HGLog log);
/* 获取日志文件大小
* 参数:
* 1) log: in, 日志句柄
* 2) size: out, 日志文件大小
* 说明:
* 1) 每次写入日志信息后,可以用该函数检查日志文件的大小,当日志文件足够大时,可以关闭该日志句柄,在新的日志文件上重新打开
*/
HGEXPORT HGResult HGAPI HGBase_GetLogFileSize(HGLog log, HGLonglong* size);
/* 写日志信息
* 参数:
* 1) log: in, 日志句柄
* 2) info: in, 信息, 一次一行, info无需加换行符
* 说明:
* 1) 该函数不是线程安全的, 在不同进程或不同线程调用的时候, 需要加锁
*/
HGEXPORT HGResult HGAPI HGBase_WriteLog(HGLog log, const HGChar* info);
#endif /* __HGLOG_H__ */
\ No newline at end of file
#ifndef __HGMD5_H__
#define __HGMD5_H__
#include "HGDef.h"
#include "HGBaseErr.h"
/* 生成MD5值
* 参数:
* 1) data: in, 数据地址
* 2) size: in, 数据长度
* 3) md5: out, md5值, 必须至少分配16字节
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_MakeMd5(const HGByte* data, HGUInt size, HGByte* md5);
#endif /* __HGMD5_H__ */
\ No newline at end of file
#ifndef __HGTHREAD_H__
#define __HGTHREAD_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGThread);
/* 线程回调函数
* 参数:
* 1) thread: in, 线程句柄
* 2) param: in, 回调参数
* 说明:
*/
typedef void (*HGThreadFunc)(HGThread thread, HGPointer param);
/* 开启线程
* 参数:
* 1) func: in, 线程回调函数
* 2) param: in, 回调参数
* 3) thread: out, 线程句柄
* 说明:
*/
HGEXPORT HGResult HGAPI HGBase_OpenThread(HGThreadFunc func, HGPointer param, HGThread *thread);
/* 关闭线程
* 参数:
* 1) thread: in, 线程句柄
* 说明:
* 1) 该函数会等待线程正常结束, 如果线程阻塞, 该函数也会阻塞
*/
HGEXPORT HGResult HGAPI HGBase_CloseThread(HGThread thread);
#endif /* __HGTHREAD_H__ */
\ No newline at end of file
#ifndef __HGUTILITY_H__
#define __HGUTILITY_H__
#include "HGDef.h"
#include "HGBaseErr.h"
/* 获取系统临时文件目录
*/
HGEXPORT HGResult HGAPI HGBase_GetTmpPath(HGChar* path, HGUInt maxLen);
/* 获取进程的当前工作目录
*/
HGEXPORT HGResult HGAPI HGBase_GetCurrentDir(HGChar* dir, HGUInt maxLen);
/* 设置进程的当前工作目录
*/
HGEXPORT HGResult HGAPI HGBase_SetCurrentDir(const HGChar* dir);
/* 创建目录
* 该函数可以创建多级目录
*/
HGEXPORT HGResult HGAPI HGBase_CreateDir(const HGChar* dir);
/* 删除目录
* 该函数只能用于删除空目录
*/
HGEXPORT HGResult HGAPI HGBase_DeleteDir(const HGChar* dir);
/* 删除文件
*/
HGEXPORT HGResult HGAPI HGBase_DeleteFile(const HGChar* fileName);
/* 获取模块名称
*/
HGEXPORT HGResult HGAPI HGBase_GetModuleName(HGPointer addr, HGChar* name, HGUInt maxLen);
/* 获取UUID
*/
HGEXPORT HGResult HGAPI HGBase_GetUuid(HGChar* uuid, HGUInt maxLen);
/* 获取临时文件名
*/
HGEXPORT HGResult HGAPI HGBase_GetTmpFileName(HGChar* fileName, HGUInt maxLen);
/* 获取配置文件路径
*/
HGEXPORT HGResult HGAPI HGBase_GetConfigPath(HGChar* configPath, HGUInt maxLen);
/* 获取日志文件路径
*/
HGEXPORT HGResult HGAPI HGBase_GetLogFilePath(HGChar* logFilePath, HGUInt maxLen);
/* 获取文档路径
*/
HGEXPORT HGResult HGAPI HGBase_GetDocumentsPath(HGChar* documentsPath, HGUInt maxLen);
/* 获取进程名
*/
HGEXPORT HGResult HGAPI HGBase_GetProcessName(HGChar* name, HGUInt maxLen);
/* 通过文件全路径获取文件名
*/
HGEXPORT HGResult HGAPI HGBase_GetFileName(const HGChar *filePath, HGChar* name, HGUInt maxLen);
/* 设置ini文件的值
*/
HGEXPORT HGResult HGAPI HGBase_SetProfileInt(const HGChar* fileName, const HGChar* appName,
const HGChar* keyName, HGInt value);
/* 设置ini文件的值
*/
HGEXPORT HGResult HGAPI HGBase_SetProfileString(const HGChar* fileName, const HGChar* appName,
const HGChar* keyName, const HGChar *value);
/* 获取ini文件的值
*/
HGEXPORT HGResult HGAPI HGBase_GetProfileInt(const HGChar* fileName, const HGChar* appName,
const HGChar* keyName, HGInt def, HGInt* value);
/* 获取ini文件的值
*/
HGEXPORT HGResult HGAPI HGBase_GetProfileString(const HGChar* fileName, const HGChar* appName,
const HGChar* keyName, const HGChar* def, HGChar* value, HGUInt maxLen);
/* 将文件名标准化 */
HGEXPORT HGResult HGAPI HGBase_StandardiseFileName(const HGChar* fileName, HGChar *result, HGUInt maxLen);
#endif /* __HGUTILITY_H__ */
\ No newline at end of file
#ifndef __HGBMP_H__
#define __HGBMP_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
typedef struct
{
HGUInt width;
HGUInt height;
HGUShort bitCount;
HGUInt compression;
HGUInt xPelsPerMeter;
HGUInt yPelsPerMeter;
}HGBmpLoadInfo;
typedef struct
{
HGUInt xPelsPerMeter;
HGUInt yPelsPerMeter;
}HGBmpSaveInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckBmpFile(const HGChar* fileName, HGBool* isBmp);
HGEXPORT HGResult HGAPI HGImgFmt_LoadBmpImage(const HGChar* fileName, HGBmpLoadInfo* info,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_SaveBmpImage(HGImage image, const HGBmpSaveInfo* info, const HGChar* fileName);
#endif /* __HGBMP_H__ */
\ No newline at end of file
#ifndef __HGIMGFMT_H__
#define __HGIMGFMT_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
HG_DECLARE_HANDLE(HGImgFmtReader);
HG_DECLARE_HANDLE(HGImgFmtWriter);
/* JPEG */
#define HGIMGFMT_TYPE_JPEG 1L
/* BMP */
#define HGIMGFMT_TYPE_BMP 2L
/* PNG */
#define HGIMGFMT_TYPE_PNG 3L
/* TIFF */
#define HGIMGFMT_TYPE_TIFF 4L
/* PDF */
#define HGIMGFMT_TYPE_PDF 5L
/* OFD */
#define HGIMGFMT_TYPE_OFD 6L
typedef struct
{
HGUInt width;
HGUInt height;
HGUInt bpp;
HGUInt xDpi;
HGUInt yDpi;
}HGImgFmtLoadInfo;
typedef struct
{
HGUInt xDpi;
HGUInt yDpi;
}HGImgFmtSaveInfo;
HGEXPORT HGResult HGAPI HGImgFmt_GetImgFmtType(const HGChar* fileName, HGUInt* fmtType);
HGEXPORT HGResult HGAPI HGImgFmt_GetImgFmtTypeFromFileName(const HGChar* fileName, HGUInt* fmtType);
HGEXPORT HGResult HGAPI HGImgFmt_IsMultiImgFmtType(HGUInt fmtType, HGBool *isMulti);
HGEXPORT HGResult HGAPI HGImgFmt_LoadImage(const HGChar *fileName, HGUInt fmtType, HGImgFmtLoadInfo *info,
HGUInt imgType, HGUInt imgOrigin, HGImage *image);
HGEXPORT HGResult HGAPI HGImgFmt_SaveImage(HGImage image, HGUInt fmtType, const HGImgFmtSaveInfo *info, HGUInt quality, const HGChar *fileName);
HGEXPORT HGResult HGAPI HGImgFmt_OpenImageReader(const HGChar *fileName, HGUInt fmtType, HGImgFmtReader *reader);
HGEXPORT HGResult HGAPI HGImgFmt_CloseImageReader(HGImgFmtReader reader);
HGEXPORT HGResult HGAPI HGImgFmt_GetImagePageCount(HGImgFmtReader reader, HGUInt *count);
HGEXPORT HGResult HGAPI HGImgFmt_LoadImageFromReader(HGImgFmtReader reader, HGUInt index, HGImgFmtLoadInfo *info,
HGUInt imgType, HGUInt imgOrigin, HGImage *image);
HGEXPORT HGResult HGAPI HGImgFmt_OpenImageWriter(const HGChar *fileName, HGUInt fmtType, HGImgFmtWriter *writer);
HGEXPORT HGResult HGAPI HGImgFmt_CloseImageWriter(HGImgFmtWriter writer);
HGEXPORT HGResult HGAPI HGImgFmt_SaveImageToWriter(HGImgFmtWriter writer, HGImage image, const HGImgFmtSaveInfo *info, HGUInt quality);
#endif /* __HGIMGFMT_H__ */
\ No newline at end of file
#ifndef __HGIMGFMTERR_H__
#define __HGIMGFMTERR_H__
/* 一般错误 */
#define HGIMGFMT_ERR_FAIL 0x00002001L
#endif /* __HGIMGFMTERR_H__ */
\ No newline at end of file
#ifndef __HGJPEG_H__
#define __HGJPEG_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
#include "../base/HGBuffer.h"
typedef struct
{
HGUInt width;
HGUInt height;
HGUInt numComponents;
HGUInt colorSpace;
HGByte densityUnit;
HGUShort xDensity;
HGUShort yDensity;
}HGJpegLoadInfo;
typedef struct
{
HGByte densityUnit;
HGUShort xDensity;
HGUShort yDensity;
}HGJpegSaveInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckJpegFile(const HGChar* fileName, HGBool *isJpeg);
HGEXPORT HGResult HGAPI HGImgFmt_LoadJpegImage(const HGChar* fileName, HGJpegLoadInfo* info,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_LoadJpegImageFromBuffer(HGBuffer buffer, HGJpegLoadInfo* info,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_SaveJpegImage(HGImage image, const HGJpegSaveInfo* info, HGUInt quality, const HGChar* fileName);
HGEXPORT HGResult HGAPI HGImgFmt_SaveJpegImageToBuffer(HGImage image, const HGJpegSaveInfo* info, HGUInt quality, HGBuffer *buffer);
#endif /* __HGJPEG_H__ */
\ No newline at end of file
#ifndef __HGOFD_H__
#define __HGOFD_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
#include "HGJpeg.h"
HG_DECLARE_HANDLE(HGOfdReader);
HG_DECLARE_HANDLE(HGOfdImageWriter);
typedef struct
{
HGUInt width;
HGUInt height;
}HGOfdPageInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckOfdFile(const HGChar* fileName, HGBool* isOfd);
HGEXPORT HGResult HGAPI HGImgFmt_OpenOfdReader(const HGChar* fileName, HGOfdReader* reader);
HGEXPORT HGResult HGAPI HGImgFmt_CloseOfdReader(HGOfdReader reader);
HGEXPORT HGResult HGAPI HGImgFmt_GetOfdPageCount(HGOfdReader reader, HGUInt* count);
HGEXPORT HGResult HGAPI HGImgFmt_GetOfdPageInfo(HGOfdReader reader, HGUInt page, HGOfdPageInfo* info);
HGEXPORT HGResult HGAPI HGImgFmt_LoadImageFromOfdReader(HGOfdReader reader, HGUInt page, HGFloat xScale, HGFloat yScale,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_OpenOfdImageWriter(const HGChar* fileName, HGOfdImageWriter* writer);
HGEXPORT HGResult HGAPI HGImgFmt_CloseOfdImageWriter(HGOfdImageWriter writer);
HGEXPORT HGResult HGAPI HGImgFmt_SaveJpegImageToOfdImageWriter(HGOfdImageWriter writer, HGImage image, const HGJpegSaveInfo* info, HGUInt quality);
#endif /* __HGOFD_H__ */
\ No newline at end of file
#ifndef __HGPDF_H__
#define __HGPDF_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
#include "HGJpeg.h"
HG_DECLARE_HANDLE(HGPdfReader);
HG_DECLARE_HANDLE(HGPdfImageWriter);
typedef struct
{
HGUInt width;
HGUInt height;
}HGPdfPageInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckPdfFile(const HGChar* fileName, HGBool* isPdf);
HGEXPORT HGResult HGAPI HGImgFmt_OpenPdfReader(const HGChar* fileName, HGPdfReader* reader);
HGEXPORT HGResult HGAPI HGImgFmt_ClosePdfReader(HGPdfReader reader);
HGEXPORT HGResult HGAPI HGImgFmt_GetPdfPageCount(HGPdfReader reader, HGUInt* count);
HGEXPORT HGResult HGAPI HGImgFmt_GetPdfPageInfo(HGPdfReader reader, HGUInt page, HGPdfPageInfo *info);
HGEXPORT HGResult HGAPI HGImgFmt_LoadImageFromPdfReader(HGPdfReader reader, HGUInt page, HGFloat xScale, HGFloat yScale,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_OpenPdfImageWriter(const HGChar* fileName, HGPdfImageWriter* writer);
HGEXPORT HGResult HGAPI HGImgFmt_ClosePdfImageWriter(HGPdfImageWriter writer);
HGEXPORT HGResult HGAPI HGImgFmt_SaveJpegImageToPdfImageWriter(HGPdfImageWriter writer, HGImage image, const HGJpegSaveInfo* info, HGUInt quality);
#endif /* __HGPDF_H__ */
\ No newline at end of file
#ifndef __HGPNG_H__
#define __HGPNG_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
typedef struct
{
HGUInt width;
HGUInt height;
HGByte bitDepth;
HGByte colorType;
HGByte channels;
HGByte filterType;
HGByte InterlaceType;
HGByte compressionType;
HGByte pixelDepth;
HGByte physUnitType;
HGUInt xPixelsPerUnit;
HGUInt yPixelsPerUnit;
}HGPngLoadInfo;
typedef struct
{
HGByte physUnitType;
HGUInt xPixelsPerUnit;
HGUInt yPixelsPerUnit;
}HGPngSaveInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckPngFile(const HGChar* fileName, HGBool* isPng);
HGEXPORT HGResult HGAPI HGImgFmt_LoadPngImage(const HGChar* fileName, HGPngLoadInfo* info,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_SavePngImage(HGImage image, const HGPngSaveInfo* info, const HGChar* fileName);
#endif /* __HGPNG_H__ */
\ No newline at end of file
#ifndef __HGTIFF_H__
#define __HGTIFF_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgFmtErr.h"
#include "../base/HGImage.h"
HG_DECLARE_HANDLE(HGTiffReader);
HG_DECLARE_HANDLE(HGTiffWriter);
typedef struct
{
HGUInt width;
HGUInt height;
HGUShort bitsPerSample;
HGUShort samplesPerPixel;
HGUShort compression;
HGUShort resolutionUnit;
HGFloat xResolution;
HGFloat yResolution;
}UPTiffLoadInfo;
typedef struct
{
HGUShort resolutionUnit;
HGFloat xResolution;
HGFloat yResolution;
}UPTiffSaveInfo;
HGEXPORT HGResult HGAPI HGImgFmt_CheckTiffFile(const HGChar* fileName, HGBool* isTiff);
HGEXPORT HGResult HGAPI HGImgFmt_OpenTiffReader(const HGChar* fileName, HGTiffReader* reader);
HGEXPORT HGResult HGAPI HGImgFmt_CloseTiffReader(HGTiffReader reader);
HGEXPORT HGResult HGAPI HGImgFmt_GetTiffPageCount(HGTiffReader reader, HGUInt* count);
HGEXPORT HGResult HGAPI HGImgFmt_LoadImageFromTiffReader(HGTiffReader reader, HGUInt index, UPTiffLoadInfo* info,
HGUInt imgType, HGUInt imgOrigin, HGImage* image);
HGEXPORT HGResult HGAPI HGImgFmt_OpenTiffWriter(const HGChar* fileName, HGTiffWriter* writer);
HGEXPORT HGResult HGAPI HGImgFmt_CloseTiffWriter(HGTiffWriter writer);
HGEXPORT HGResult HGAPI HGImgFmt_SaveImageToTiffWriter(HGTiffWriter writer, HGImage image, const UPTiffSaveInfo* info);
#endif /* __HGTIFF_H__ */
\ No newline at end of file
#ifndef __HGIMGPROC_H__
#define __HGIMGPROC_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGImgProcErr.h"
#include "../base/HGImage.h"
/* 最近邻插值 */
#define HGIMGPROC_INTERPOTYPE_NN 1L
/* 双线性插值 */
#define HGIMGPROC_INTERPOTYPE_LINEAR 2L
/* 纠偏参数 */
typedef struct
{
/* 填充 */
HGBool fillBlank;
HGBool convex;
HGBool colorBlank;
/* 其他参数 */
HGBool useParam;
HGDouble threshold;
HGInt noise;
HGInt indent;
}HGImgDeskewParam;
/* 图像缩放
* 参数:
* 1) image: in, 源图像句柄
* 2) destImage: in, 目标图像句柄
* 3) interpolation: in, 插值方式, 参见HGIMGPROC_INTERPOTYPE_*
* 说明:
* 1) 操作的只是图像的ROI区域
* 2) 源图像和目标图像的type必须一样
* 3) 自动处理origon不一致的情况
* 4) image和destImage不能是同一个句柄
*/
HGEXPORT HGResult HGAPI HGImgProc_ResizeImage(HGImage image, HGImage destImage, HGUInt interp);
/*
* 图像色彩调整
* 1) image: in, 源图像句柄
* 2) destImage: in, 目标图像句柄
* 3) brightness: in, 亮度增加值, -255至255之间
* 4) contrast: in, 对比度增加值, -127至127之间
* 5) gamma: 伽马增加值, 0.1至5.0之间
* 说明:
* 1) 操作的只是图像的ROI区域, ROI区域的大小必须一致
* 2) 源图像和目标图像的type必须一样
* 3) 自动处理origon不一致的情况
* 4) image和destImage可以是同一个句柄
*/
HGEXPORT HGResult HGAPI HGImgProc_ImageAdjustColors(HGImage image, HGImage destImage,
HGInt brightness, HGInt contrast, HGFloat gamma);
/*
* 图像纠偏
* 1) image: in, 图像句柄
* 2) autoCrop: in, 是否自动裁剪, 为HGTRUE则忽略destWidth和destHeight
* 3) deskew: in, 是否纠偏
* 4) param: in, 纠偏参数, 为NULL时使用默认参数
* 5) destWidth: in, 目标图像宽度
* 6) destHeight: in, 目标图像高度
* 7) destType: in, 目标图像类型
* 8) destOrigin: in, 目标图像数据排列方式
* 9) destImage: out, 输出的目标图像句柄
* * 说明:
* 1) 操作的只是image的ROI区域
* 2) 目前只支持image的类型为HGBASE_IMGTYPE_GRAY和HGBASE_IMGTYPE_RGB
*/
HGEXPORT HGResult HGAPI HGImgProc_ImageDeskew(HGImage image, HGBool autoCrop, HGBool deskew, const HGImgDeskewParam* param,
HGUInt destWidth, HGUInt destHeight, HGUInt destType, HGUInt destOrigin, HGImage* destImage);
#endif /* __HGIMGPROC_H__ */
\ No newline at end of file
#ifndef __HGIMGPROCERR_H__
#define __HGIMGPROCERR_H__
/* 一般错误 */
#define HGIMGPROC_ERR_FAIL 0x00003001L
#endif /* __HGIMGPROCERR_H__ */
\ No newline at end of file
This diff is collapsed.
#ifndef __HGSANE_H__
#define __HGSANE_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGSaneErr.h"
#include "../base/HGImage.h"
HG_DECLARE_HANDLE(HGSaneManager);
HG_DECLARE_HANDLE(HGSaneDevice);
#define HGSANE_DEVEVENT_UNKNOWN 0L
#define HGSANE_DEVEVENT_IMGREADY 1L
#define HGSANE_DEVEVENT_ERROR 2L
/* Sane设备事件回调
*/
typedef void (HGAPI* HGSane_DeviceEventCallback)(HGSaneDevice dev, HGUInt event, HGPointer param);
HGEXPORT HGResult HGAPI HGSane_CreateManager(const HGChar *sanePath, HGSaneManager* mgr);
HGEXPORT HGResult HGAPI HGSane_DestroyManager(HGSaneManager mgr);
HGEXPORT HGResult HGAPI HGSane_GetDeviceCount(HGSaneManager mgr, HGUInt *count);
HGEXPORT HGResult HGAPI HGSane_GetDeviceName(HGSaneManager mgr, HGUInt index, HGChar *name, HGUInt maxLen);
HGEXPORT HGResult HGAPI HGSane_OpenDevice(HGSaneManager mgr, HGUInt index, HGSaneDevice *dev);
HGEXPORT HGResult HGAPI HGSane_CloseDevice(HGSaneDevice dev);
HGEXPORT HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGSane_DeviceEventCallback func, HGPointer param);
HGEXPORT HGResult HGAPI HGSane_StopDevice(HGSaneDevice dev);
HGEXPORT HGResult HGAPI HGSane_GetImage(HGSaneDevice dev, HGUInt type, HGUInt origin, HGImage* image);
#endif /* __HGSANE_H__ */
\ No newline at end of file
#ifndef __HGSANEERR_H__
#define __HGSANEERR_H__
/* 一般错误 */
#define HGSANE_ERR_FAIL 0x00004001L
#endif /* __HGSANEERR_H__ */
\ No newline at end of file
#ifndef __HGTWAIN_H__
#define __HGTWAIN_H__
#include "../base/HGDef.h"
#include "../base/HGBaseErr.h"
#include "HGTwainErr.h"
#include "../base/HGImage.h"
HG_DECLARE_HANDLE(HGTwainDSM);
HG_DECLARE_HANDLE(HGTwainDS);
/* 能力 */
#define HGTWAIN_DSCAP_DUPLEX 1L
#define HGTWAIN_DSCAP_DUPLEXENABLED 2L
#define HGTWAIN_DSCAP_XFERCOUNT 3L
/* 未知事件, 可能是该库未进行处理的事件 */
#define HGTWAIN_DSEVENT_UNKNOWN 0L
#define HGTWAIN_DSEVENT_XFERREADY 1L
#define HGTWAIN_DSEVENT_CLOSEDSREQ 2L
#define HGTWAIN_DSEVENT_CLOSEDSOK 3L
/* twain事件回调
* 参数:
* 1) ds: in, DS句柄
* 2) event: in, 事件, 参见HGTWAIN_DSEVENT_*
* 3) param: in, 回调参数
* 说明:
* 1) 如果event为HGTWAIN_EVENT_XFERREADY, TWAIN状态从5变为6
* 2) 如果event为HGTWAIN_EVENT_CLOSEDSREQ, 表示需要关闭该DS
*/
typedef void (HGAPI *HGTwain_DSEventCallback)(HGTwainDS ds, HGUInt event, HGPointer param);
/* 加载DSM
* 参数:
* 1) dsm: out, DSM句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从1变为2
*/
HGEXPORT HGResult HGAPI HGTwain_LoadDSM(HGTwainDSM *dsm);
/* 卸载DSM
* 参数:
* 1) dsm: in, DSM句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从2变为1
*/
HGEXPORT HGResult HGAPI HGTwain_UnloadDSM(HGTwainDSM dsm);
/* 打开DSM
* 参数:
* 1) dsm: in, DSM句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从2变为3
* 2) 调用该函数的线程需要有消息循环
*/
HGEXPORT HGResult HGAPI HGTwain_OpenDSM(HGTwainDSM dsm);
/* 关闭DSM
* 参数:
* 1) dsm: in, DSM句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从3变为2
*/
HGEXPORT HGResult HGAPI HGTwain_CloseDSM(HGTwainDSM dsm);
/* 获取DS列表
* 参数:
* 1) dsm: in, DSM句柄
* 2) ds: out, DS句柄列表
* 3) size: in, out, DS句柄列表大小/返回的DS句柄数量
* 说明:
* 1) 该函数需要TWAIN状态为3
* 2) size既作为输入, 也作为输出
*/
HGEXPORT HGResult HGAPI HGTwain_GetDSList(HGTwainDSM dsm, HGTwainDS *ds, HGUInt *size);
/* 获取默认的DS
* 参数:
* 1) dsm: in, DSM句柄
* 2) ds: out, DS句柄
* 说明:
* 1) 该函数需要TWAIN状态为3
*/
HGEXPORT HGResult HGAPI HGTwain_GetDefaultDS(HGTwainDSM dsm, HGTwainDS* ds);
/* 弹出DS选择框,并返回选择的DS
* 参数:
* 1) dsm: in, DSM句柄
* 2) ds: out, DS句柄
* 说明:
* 1) 该函数需要TWAIN状态为3
*/
HGEXPORT HGResult HGAPI HGTwain_SelectDS(HGTwainDSM dsm, HGTwainDS* ds);
/* 获取DS名称
* 参数:
* 1) ds: in, DS句柄
* 2) name: out, DS名字数据区地址
* 3) maxLen: in, DS名字数据区长度
* 说明:
* 1) 该函数需要TWAIN状态为3
* 2) size既作为输入, 也作为输出, 返回的size包括空字符
*/
HGEXPORT HGResult HGAPI HGTwain_GetDSName(HGTwainDS ds, HGChar *name, HGUInt maxLen);
/* 打开DS
* 参数:
* 1) ds: in, DS句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从3变为4
*/
HGEXPORT HGResult HGAPI HGTwain_OpenDS(HGTwainDS ds);
/* 关闭DS
* 参数:
* 1) ds: in, DS句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从4变为3
*/
HGEXPORT HGResult HGAPI HGTwain_CloseDS(HGTwainDS ds);
/* 设置DS的能力
* 参数:
* 1) ds: in, DS句柄
* 2) cap: in, 能力
* 3) value: in, 值
* 说明:
* 1) 该函数需要TWAIN状态为4
*/
HGEXPORT HGResult HGAPI HGTwain_SetCapability(HGTwainDS ds, HGUInt cap, HGInt value);
/* 获取DS的能力
* 参数:
* 1) ds: in, DS句柄
* 2) cap: in, 能力
* 3) value: out, 值
* 说明:
* 1) 该函数需要TWAIN状态为4-7
*/
HGEXPORT HGResult HGAPI HGTwain_GetCapability(HGTwainDS ds, HGUInt cap, HGInt* value);
/* 启动DS, 仅仅用作参数设置
* 参数:
* 1) ds: in, DS句柄
* 2) showUI: in, 是否显示UI
* 3) parent: in, 父窗口句柄
* 4) func: in, 回调函数
* 5) param: in, 回调参数
* 说明:
* 1) 执行此函数后,TWAIN状态从4变为5
*/
HGEXPORT HGResult HGAPI HGTwain_EnableDSUIOnly(HGTwainDS ds, HGBool showUI, HWND parent,
HGTwain_DSEventCallback func, HGPointer param);
/* 启动DS
* 参数:
* 1) ds: in, DS句柄
* 2) showUI: in, 是否显示UI
* 3) parent: in, 父窗口句柄
* 4) func: in, 回调函数
* 5) param: in, 回调参数
* 说明:
* 1) 执行此函数后,TWAIN状态从4变为5
*/
HGEXPORT HGResult HGAPI HGTwain_EnableDS(HGTwainDS ds, HGBool showUI, HWND parent,
HGTwain_DSEventCallback func, HGPointer param);
/* 停止DS
* 参数:
* 1) ds: in, DS句柄
* 说明:
* 1) 执行此函数后,TWAIN状态从5变为4
*/
HGEXPORT HGResult HGAPI HGTwain_DisableDS(HGTwainDS ds);
/* 本地传输图像
* 参数:
* 1) ds: in, DS句柄
* 2) type: in, 图像类型
* 3) origin: in, 图像数据排列方式
* 4) image: out, 获取的图像
* 说明:
* 1) 该函数需要在状态6调用
* 2) 执行此函数时,TWAIN状态从6变为7
* 3) 生成的image需要调用HGBase_DestroyImage销毁
*/
HGEXPORT HGResult HGAPI HGTwain_ImageNativeXfer(HGTwainDS ds, HGUInt type, HGUInt origin, HGImage *image);
/* 停止本次传输
* 参数:
* 1) ds: in, DS句柄
* 2) count: out, 还剩下的未传输的图像数量
* 说明:
* 1) 执行此函数后,TWAIN状态变为6
* 2) 当count为0时, 可以关闭DS
*/
HGEXPORT HGResult HGAPI HGTwain_EndXfer(HGTwainDS ds, HGUInt* count);
/* 停止所有传输
* 参数:
* 1) ds: in, DS句柄
* 说明:
* 1) 执行此函数后,TWAIN状态变为5
* 2) 可以关闭DS
*/
HGEXPORT HGResult HGAPI HGTwain_Reset(HGTwainDS ds);
#endif /* __HGTWAIN_H__ */
\ No newline at end of file
#ifndef __HGTWAINERR_H__
#define __HGTWAINERR_H__
/* 一般错误 */
#define HGTWAIN_ERR_FAIL 0x00001001L
#endif /* __HGTWAINERR_H__ */
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment