diff --git a/thirdparty/libtiff/BUILD.gn b/thirdparty/libtiff/BUILD.gn deleted file mode 100755 index c3434fc98c6e8d83c921df8bf21275551cda5ad4..0000000000000000000000000000000000000000 --- a/thirdparty/libtiff/BUILD.gn +++ /dev/null @@ -1,319 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") - -declare_args() { - enable_libtiff_test = false -} - -config("libtiff_config") { - include_dirs = [ - "libtiff/libtiff/libtiff", - "//third_party/libjpeg", - "//third_party/zlib", - "adapted", - ] -} - -ohos_shared_library("libtiff_shared") { - sources = [ - "libtiff/libtiff/tif_aux.c", - "libtiff/libtiff/tif_close.c", - "libtiff/libtiff/tif_codec.c", - "libtiff/libtiff/tif_color.c", - "libtiff/libtiff/tif_compress.c", - "libtiff/libtiff/tif_dir.c", - "libtiff/libtiff/tif_dirinfo.c", - "libtiff/libtiff/tif_dirread.c", - "libtiff/libtiff/tif_dirwrite.c", - "libtiff/libtiff/tif_dumpmode.c", - "libtiff/libtiff/tif_error.c", - "libtiff/libtiff/tif_extension.c", - "libtiff/libtiff/tif_fax3.c", - "libtiff/libtiff/tif_fax3sm.c", - "libtiff/libtiff/tif_flush.c", - "libtiff/libtiff/tif_getimage.c", - "libtiff/libtiff/tif_jbig.c", - "libtiff/libtiff/tif_jpeg.c", - "libtiff/libtiff/tif_jpeg_12.c", - "libtiff/libtiff/tif_lerc.c", - "libtiff/libtiff/tif_luv.c", - "libtiff/libtiff/tif_lzma.c", - "libtiff/libtiff/tif_lzw.c", - "libtiff/libtiff/tif_next.c", - "libtiff/libtiff/tif_ojpeg.c", - "libtiff/libtiff/tif_open.c", - "libtiff/libtiff/tif_packbits.c", - "libtiff/libtiff/tif_pixarlog.c", - "libtiff/libtiff/tif_predict.c", - "libtiff/libtiff/tif_print.c", - "libtiff/libtiff/tif_read.c", - "libtiff/libtiff/tif_strip.c", - "libtiff/libtiff/tif_swab.c", - "libtiff/libtiff/tif_thunder.c", - "libtiff/libtiff/tif_tile.c", - "libtiff/libtiff/tif_unix.c", - "libtiff/libtiff/tif_version.c", - "libtiff/libtiff/tif_warning.c", - "libtiff/libtiff/tif_webp.c", - "libtiff/libtiff/tif_write.c", - "libtiff/libtiff/tif_zip.c", - "libtiff/libtiff/tif_zstd.c", - ] - configs = [ ":libtiff_config" ] - deps = [ - "//third_party/libjpeg:libjpeg_static", - "//third_party/zlib:libz", - ] - part_name = "libtiff" -} - -config("test_config") { - include_dirs = [ - "libtiff/tools", - "libtiff/libtiff", - "libtiff/port", - "adapted", - ] - - cflags_cc = [] -} -ohos_executable("fax2ps") { - sources = [ "libtiff/tools/fax2ps.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("fax2tiff") { - sources = [ "libtiff/tools/fax2tiff.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("pal2rgb") { - sources = [ "libtiff/tools/pal2rgb.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("ppm2tiff") { - sources = [ "libtiff/tools/ppm2tiff.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("raw2tiff") { - sources = [ "libtiff/tools/raw2tiff.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("rgb2ycbcr") { - sources = [ "libtiff/tools/rgb2ycbcr.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("thumbnail") { - sources = [ "libtiff/tools/thumbnail.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiff2bw") { - sources = [ "libtiff/tools/tiff2bw.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiff2pdf") { - sources = [ "libtiff/tools/tiff2pdf.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiff2ps") { - sources = [ "libtiff/tools/tiff2ps.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiff2rgba") { - sources = [ "libtiff/tools/tiff2rgba.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffcmp") { - sources = [ "libtiff/tools/tiffcmp.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffcp") { - sources = [ "libtiff/tools/tiffcp.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffcrop") { - sources = [ "libtiff/tools/tiffcrop.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffdither") { - sources = [ "libtiff/tools/tiffdither.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffdump") { - sources = [ "libtiff/tools/tiffdump.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffinfo") { - sources = [ "libtiff/tools/tiffinfo.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffmedian") { - sources = [ "libtiff/tools/tiffmedian.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffset") { - sources = [ "libtiff/tools/tiffset.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -ohos_executable("tiffsplit") { - sources = [ "libtiff/tools/tiffsplit.c" ] - - configs = [ ":test_config" ] - - deps = [ ":libtiff_shared" ] - - part_name = "libtiff" -} - -group("libtiff") { - deps = [ ":libtiff_shared" ] - - if (enable_libtiff_test) { - deps += [ - ":fax2ps", - ":fax2tiff", - ":pal2rgb", - ":ppm2tiff", - ":raw2tiff", - ":rgb2ycbcr", - ":thumbnail", - ":tiff2bw", - ":tiff2pdf", - ":tiff2ps", - ":tiff2rgba", - ":tiffcmp", - ":tiffcp", - ":tiffcrop", - ":tiffdither", - ":tiffdump", - ":tiffinfo", - ":tiffmedian", - ":tiffset", - ":tiffsplit", - ] - } -} diff --git a/thirdparty/libtiff/adapted/libport_config.h b/thirdparty/libtiff/adapted/libport_config.h deleted file mode 100755 index d708dae412500182d5a8cf02d4d75b1129c29751..0000000000000000000000000000000000000000 --- a/thirdparty/libtiff/adapted/libport_config.h +++ /dev/null @@ -1,13 +0,0 @@ -/* libtiff/libport_config.h.cmake.in. Not generated, but originated from autoheader. */ -/* This file must be kept up-to-date with needed substitutions from port/libport_config.h.in. */ - -#ifndef _LIBPORT_CONFIG_H_ -#define _LIBPORT_CONFIG_H_ - -/* Define to 1 if you have the `getopt' function. */ -#define HAVE_GETOPT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -#endif /* _LIBPORT_CONFIG_H_ */ diff --git a/thirdparty/libtiff/adapted/tif_config.h b/thirdparty/libtiff/adapted/tif_config.h deleted file mode 100755 index 98948a208be7e269614a99994cde840a175082ab..0000000000000000000000000000000000000000 --- a/thirdparty/libtiff/adapted/tif_config.h +++ /dev/null @@ -1,155 +0,0 @@ -/* libtiff/tif_config.h.cmake.in. Not generated, but originated from autoheader. */ -/* This file must be kept up-to-date with needed substitutions from libtiff/tif_config.h.in. */ - -#include "tiffconf.h" - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* enable partial strip reading for large strips (experimental) */ -/* #undef CHUNKY_STRIP_READ_SUPPORT */ - -/* Support C++ stream API (requires C++ compiler) */ -#define CXX_SUPPORT 1 - -/* enable deferred strip/tile offset/size loading (experimental) */ -/* #undef DEFER_STRILE_LOAD */ - -/* Define to 1 if you have the header file. */ -#define HAVE_ASSERT_H 1 - -/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't. */ -#define HAVE_DECL_OPTARG 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -/* #undef HAVE_FSEEKO */ - -/* Define to 1 if you have the `getopt' function. */ -#define HAVE_GETOPT 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_GLUT_GLUT_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_GL_GLUT_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_GL_GLU_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_GL_GL_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_IO_H */ - -/* Define to 1 if you have the `jbg_newlen' function. */ -#define HAVE_JBG_NEWLEN 1 - -/* Define to 1 if you have the `mmap' function. */ -#define HAVE_MMAP 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENGL_GLU_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_OPENGL_GL_H */ - -/* Define to 1 if you have the `setmode' function. */ -/* #undef HAVE_SETMODE */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* 8/12 bit libjpeg dual mode enabled */ -/* #undef JPEG_DUAL_MODE_8_12 */ - -/* Support LERC compression */ -/* #undef LERC_SUPPORT */ - -/* 12bit libjpeg primary include file with path */ -#define LIBJPEG_12_PATH "" - -/* Support LZMA2 compression */ -/* #undef LZMA_SUPPORT */ - -/* Name of package */ -#define PACKAGE "LibTIFF Software" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "tiff@lists.maptools.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "LibTIFF Software" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LibTIFF Software 4.3.0" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "tiff" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "4.3.0" - -/* Size of size_t */ -#define SIZEOF_SIZE_T 8 - -/* Default size of the strip in bytes (when strip chopping enabled) */ -#define STRIP_SIZE_DEFAULT 8192 - -/* define to use win32 IO system */ -/* #undef USE_WIN32_FILEIO */ - -/* Version number of package */ -#define VERSION "4.3.0" - -/* Support WEBP compression */ -/* #undef WEBP_SUPPORT */ - -/* Support ZSTD compression */ -/* #undef ZSTD_SUPPORT */ - - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif - -#if !defined(__MINGW32__) -# define TIFF_SIZE_FORMAT "zu" -#endif -#if SIZEOF_SIZE_T == 8 -# define TIFF_SSIZE_FORMAT PRId64 -# if defined(__MINGW32__) -# define TIFF_SIZE_FORMAT PRIu64 -# endif -#elif SIZEOF_SIZE_T == 4 -# define TIFF_SSIZE_FORMAT PRId32 -# if defined(__MINGW32__) -# define TIFF_SIZE_FORMAT PRIu32 -# endif -#else -# error "Unsupported size_t size; please submit a bug report" -#endif diff --git a/thirdparty/libtiff/adapted/tiffconf.h b/thirdparty/libtiff/adapted/tiffconf.h deleted file mode 100755 index ce51e612b83c3d1f39d77af86e6611027fdde589..0000000000000000000000000000000000000000 --- a/thirdparty/libtiff/adapted/tiffconf.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - Configuration defines for installed libtiff. - This file maintained for backward compatibility. Do not use definitions - from this file in your programs. -*/ - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ - - -#include -#include -#include - - -/* Signed 16-bit type */ -#define TIFF_INT16_T int16_t - -/* Signed 32-bit type */ -#define TIFF_INT32_T int32_t - -/* Signed 64-bit type */ -#define TIFF_INT64_T int64_t - -/* Signed 8-bit type */ -#define TIFF_INT8_T int8_t - -/* Unsigned 16-bit type */ -#define TIFF_UINT16_T uint16_t - -/* Unsigned 32-bit type */ -#define TIFF_UINT32_T uint32_t - -/* Unsigned 64-bit type */ -#define TIFF_UINT64_T uint64_t - -/* Unsigned 8-bit type */ -#define TIFF_UINT8_T uint8_t - -/* Signed size type */ -#define TIFF_SSIZE_T int64_t - -/* Compatibility stuff. */ - -/* Define as 0 or 1 according to the floating point format supported by the - machine */ -#define HAVE_IEEEFP 1 - -/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian - (Intel) */ -#define HOST_BIGENDIAN 0 - -/* Support CCITT Group 3 & 4 algorithms */ -#define CCITT_SUPPORT 1 - -/* Support JPEG compression (requires IJG JPEG library) */ -#define JPEG_SUPPORT 1 - -/* Support JBIG compression (requires JBIG-KIT library) */ -/* #undef JBIG_SUPPORT */ - -/* Support LERC compression */ -/* #undef LERC_SUPPORT */ - -/* Support LogLuv high dynamic range encoding */ -#define LOGLUV_SUPPORT 1 - -/* Support LZW algorithm */ -#define LZW_SUPPORT 1 - -/* Support NeXT 2-bit RLE algorithm */ -#define NEXT_SUPPORT 1 - -/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation - fails with unpatched IJG JPEG library) */ -#define OJPEG_SUPPORT 1 - -/* Support Macintosh PackBits algorithm */ -#define PACKBITS_SUPPORT 1 - -/* Support Pixar log-format algorithm (requires Zlib) */ -#define PIXARLOG_SUPPORT 1 - -/* Support ThunderScan 4-bit RLE algorithm */ -#define THUNDER_SUPPORT 1 - -/* Support Deflate compression */ -#define ZIP_SUPPORT 1 - -/* Support libdeflate enhanced compression */ -/* #undef LIBDEFLATE_SUPPORT */ - -/* Support strip chopping (whether or not to convert single-strip uncompressed - images to multiple strips of ~8Kb to reduce memory usage) */ -#define STRIPCHOP_DEFAULT 1 - -/* Enable SubIFD tag (330) support */ -#define SUBIFD_SUPPORT 1 - -/* Treat extra sample as alpha (default enabled). The RGBA interface will - treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many - packages produce RGBA files but don't mark the alpha properly. */ -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 - -/* Pick up YCbCr subsampling info from the JPEG data stream to support files - lacking the tag (default enabled). */ -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 - -/* Support MS MDI magic number files as TIFF */ -#define MDI_SUPPORT 1 - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ diff --git a/thirdparty/libtiff/bundle.json b/thirdparty/libtiff/bundle.json deleted file mode 100755 index 8b9b9f0874a39656011a18f3f44acd5d3dfbec1e..0000000000000000000000000000000000000000 --- a/thirdparty/libtiff/bundle.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@ohos/libtiff", - "description": "a small collection of tools for doingsimple manipulations of TIFF images, and documentation on the library and tools.", - "version": "v4.3.0", - "license": "libtiff License", - "publishAs": "", - "segment": { - "destPath": "third_party/libtiff" - }, - "dirs": {}, - "scripts": {}, - "readmePath": { - "en": "README" - }, - "component": { - "name": "libtiff", - "subsystem": "thirdparty", - "syscap": [], - "features": [], - "adapted_system_type": ["standard"], - "rom": "", - "ram": "", - "deps": { - "components": [], - "third_party": [] - }, - "build": { - "sub_component": ["//third_party/libtiff:libtiff"], - "inner_kits": [], - "test": [] - } - } -} diff --git a/thirdparty/libtiff/docs/pic/result.png b/thirdparty/libtiff/docs/pic/result.png deleted file mode 100755 index f48367939c2d4529a678cb3341df611935cc127c..0000000000000000000000000000000000000000 Binary files a/thirdparty/libtiff/docs/pic/result.png and /dev/null differ diff --git a/thirdparty/libtiff/docs/rom_integrate.md b/thirdparty/libtiff/docs/rom_integrate.md deleted file mode 100755 index 3dad4f311edb14038c6f49619b794649b02fb903..0000000000000000000000000000000000000000 --- a/thirdparty/libtiff/docs/rom_integrate.md +++ /dev/null @@ -1,111 +0,0 @@ -# libtiff如何集成到系统Rom -## 准备源码工程 -本库是基于OpenHarmony-v3.2-Beta1版本,在RK3568开发板上验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 -### 准备系统Rom源码 -系统源码获取请参考:[OpenHarmony源码下载](https://gitee.com/openharmony/docs/blob/OpenHarmony-v3.2-Beta2/zh-cn/release-notes/OpenHarmony-v3.2-beta1.md) -### 增加构建脚本及配置文件 -- 下载本仓库代码 - ``` - cd ~ - git clone git@gitee.com:openharmony-sig/tpc_c_cplusplus.git --depth=1 - ``` -- 三方库目录结构 - ``` - tpc_c_cplusplus/thirdparty/libtiff #三方库xerces-c的目录结构如下 - ├── adapted #存放三方库适配需要的代码文件 - ├── docs #存放三方库相关文档的文件夹 - ├── BUILD.gn #构建脚本,支持rom包集成 - ├── bundle.json #三方库组件定义文件 - ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 - ├── README_zh.md - ``` -- 将三方库拷贝到OpenHarmony源码的third_party目录下 - ``` - cp ~/tpc_c_cplusplus/thirdparty/libtiff ~/openharmony/third_party -rf - ``` -### 准备三方库源码 -``` -cd ~/openharmony/third_party/libtiff #进入三方库目录 -git clone https://gitlab.com/libtiff/libtiff.git -b v4.3.0 --depth=1 #下载三方库源码 -``` -## 系统Rom中引入三方库 -准备完三方库代码后,我们需要将三方库加入到编译构建体系中。标准系统编译构建可以参考文档[标准系统编译构建指导](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Beta1/zh-cn/device-dev/subsystems/subsys-build-standard-large.md) -我们默认三方库是属于OpenHarmony的thirdparty子系统,如果需要自己定义子系统参考文档[如何为三方库组件中添加一个三方库](https://gitee.com/openharmony-sig/knowledge/blob/master/docs/openharmony_getstarted/port_thirdparty/README.md) -新增需要编译的组件,在OpenHarmony源码的vendor/hihope/rk3568/config.json文件中,新增需要编译的组件,如下代码段所示,在thirdparty子系统下面新增libtiff组件 - -``` - { - "subsystem": "thirdparty", - "components": [ - { - "component": "musl", - "features": [] - }, - { - "component": "libtiff", - "features": [] - } - ] - } - -``` -## 系统Rom中引入三方库测试程序 -如果需要编译测试用例,在OpenHarmony源码的vendor/hihope/rk3568/config.json文件,对应组件的features中打开编译选项,如下 -``` - { - "subsystem": "thirdparty", - "components": [ - { - "component": "musl", - "features": [] - }, - { - "component": "libtiff", - "features": ["enable_libtiff_test=true"] - } - ] - } -``` -## 编译工程 -在OpenHarmony源码根目录下 -``` -cd ~/openharmony -``` -- 选择平台 - ``` - hb set #hb set 命令会列出所有可选平台,这里我们选择rk3568 - ``` -- 执行编译 - ``` - hb build --target-cpu arm #编译32位系统 - hb build --target-cpu arm64 #编译64位系统 - ``` -- 生成文件的路径,可执行文件和库文件都在out/rk3568/thirdparty/libtiff目录下,同时也打包到了镜像中 -## 运行效果 -将编译生成的库和测试文件放到板子上运行,为避免每次将文件推入设备都烧录整个镜像,我们使用hdc_std工具将文件推到开发板上 -- 首先将hdc_std工具编译出来 - 工具编译出来所在路径out/sdk/ohos-sdk/windows/toolchains/hdc_std.exe - - ``` - hb set #源码根目录下使用hb set 选择产品ohos-sdk - hb build #然后编译 - ``` -- 将工具拷贝到Windows,可以为工具目录配置环境变量,也可以在工具所在目录打开windows命令行 -- 将原生库测试需要的所有文件打包成libtiff.tar,并拷贝到windows下 -- 将文件推送到开发板,在windows命令行进行如下操作 - ``` - hdc_std shell mount -oremount,rw / #修改系统权限为可读写 - hdc_std file send libtiff.tar / #将文件包推入开发板 - hdc_std shell #进入开发板 - tar xvf libtiff.tar #解压 - #注意需要将库拷贝到/system/lib 或者/system/lib64目录下 - ``` -- 运行测试程序 - 测试用例非常多,这里演示其中几个用例,如下图 - ![result](pic/result.png) -## 参考资料 -- [润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld) -- [OpenHarmony三方库地址](https://gitee.com/openharmony-tpc) -- [OpenHarmony知识体系](https://gitee.com/openharmony-sig/knowledge) -- [如何为三方库组件中添加一个三方库](https://gitee.com/openharmony-sig/knowledge/blob/master/docs/openharmony_getstarted/port_thirdparty/README.md) -- [标准系统编译构建指导](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.2-Beta1/zh-cn/device-dev/subsystems/subsys-build-standard-large.md) \ No newline at end of file diff --git a/thirdparty/tiff/HPKBUILD b/thirdparty/tiff/HPKBUILD index 7e62baeb99b4909c293790229c5f72536a15ae82..ec0523f10ce52af00275b057ccd35cb1aa7672fe 100644 --- a/thirdparty/tiff/HPKBUILD +++ b/thirdparty/tiff/HPKBUILD @@ -40,6 +40,8 @@ package() { check() { echo "The test must be on an OpenHarmony device!" + # 设置LD_LIBRARY_PATH环境变量 + # ctest 测试 } # 清理环境 diff --git a/thirdparty/libtiff/README.OpenSource b/thirdparty/tiff/README.OpenSource old mode 100755 new mode 100644 similarity index 71% rename from thirdparty/libtiff/README.OpenSource rename to thirdparty/tiff/README.OpenSource index 262d6f3c8faf336c6a56de035f67258e3dbd2f11..f086b20034d7eb4b35fe26d229a78ce03c184171 --- a/thirdparty/libtiff/README.OpenSource +++ b/thirdparty/tiff/README.OpenSource @@ -1,9 +1,9 @@ [ { - "Name": "libtiff", - "License": "libtiff License", + "Name": "tiff", + "License": "1991-1997 Silicon Graphics, Inc", "License File": "COPYRIGHT", - "Version Number": "v4.3.0", + "Version Number": "v4.5.0", "Owner": "huangminzhong2@huawei.com", "Upstream URL": "https://gitlab.com/libtiff/libtiff.git", "Description": "a small collection of tools for doingsimple manipulations of TIFF images, and documentation on the library and tools." diff --git a/thirdparty/libtiff/README_zh.md b/thirdparty/tiff/README_zh.md old mode 100755 new mode 100644 similarity index 51% rename from thirdparty/libtiff/README_zh.md rename to thirdparty/tiff/README_zh.md index 1e1ddb5ef5a1c0a2eaf27a0880f976286aa867bc..1d449436bd3c5ab0c1f24ee7c2b88e570265ddd0 --- a/thirdparty/libtiff/README_zh.md +++ b/thirdparty/tiff/README_zh.md @@ -1,10 +1,14 @@ -# libtiff三方库说明 +# tiff三方库说明 ## 功能简介 -libtiff是一个用来读写标签图片(tiff)的库。该库还支持如下文件格式的转化。 +tiff是一个用来读写标签图片(tiff)的库。该库还支持如下文件格式的转化。 ## 使用约束 - ROM版本:OpenHarmony-v3.2-Beta1 -- 三方库版本:v4.3.0 +- IDE版本:DevEco Studio 3.1 Release(3.1.0.500) + +- SDK:API9 Release(3.2.12.2) + +- 三方库版本:v4.5.0 - 当前适配的功能:支持如下格式转换 @@ -18,6 +22,6 @@ libtiff是一个用来读写标签图片(tiff)的库。该库还支持如下文 | tiff | pdf | | tiff | ps | -- [libtiff license](https://gitlab.com/libtiff/libtiff/-/blob/v4.3.0/COPYRIGHT) +- [1991-1997 Silicon Graphics, Inc](https://gitlab.com/libtiff/libtiff/-/blob/v4.5.0/) ## 集成方式 -+ [系统Rom包集成](docs/rom_integrate.md) ++ [系统hap包集成](docs/hap_integrate.md) diff --git a/thirdparty/tiff/docs/hap_integrate.md b/thirdparty/tiff/docs/hap_integrate.md new file mode 100644 index 0000000000000000000000000000000000000000..13567865cef7cd7341f7ca52cafab5cecbe6887d --- /dev/null +++ b/thirdparty/tiff/docs/hap_integrate.md @@ -0,0 +1,97 @@ +# tiff集成到应用hap +本库是在RK3568开发板上基于OpenHarmony3.2 Release版本的镜像验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 +## 开发环境 +- ubuntu20.04 +- [OpenHarmony3.2.1Release镜像](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2.1%2Fdayu200_standard_arm32.tar.gz) +- [ohos_sdk_public 3.2.12.5](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2.1%2Fohos-sdk-windows_linux-public.tar.gz) +- [DevEco Studio 3.1 release](https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_package_901_9/16/v3/YO_7mAQNTbS8jekrvez5IA/devecostudio-windows-3.1.0.500.zip?HW-CC-KV=V1&HW-CC-Date=20230512T073650Z&HW-CC-Expire=315360000&HW-CC-Sign=90814E421B9A6D8DB4757FAFC21A965CF890A387DF9A2633B4AB797AD77E6485) +- [准备三方库构建环境](../../../tools/README.md#编译环境准备) +- [准备三方库测试环境](../../../tools/README.md#ci环境准备) + +## 编译三方库 +- 下载本仓库 + ``` + git clone https://gitee.com/openharmony-sig/tpc_c_cplusplus.git --depth=1 + ``` +- 三方库目录结构 + ``` + tpc_c_cplusplus/thirdparty/tiff #三方库tiff的目录结构如下 + ├── adapted #存放三方库适配需要的代码文件 + ├── BUILD.gn # 构建脚本,支持rom包集成 + ├── docs #三方库相关文档的文件夹 + ├── bundle.json #三方库组件定义文件 + ├── HPKBUILD #构建脚本 + ├── SHA512SUM #三方库校验文件 + ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 + ├── README_zh.md + ``` + +- 将tiff拷贝和依赖的库拷贝至tools/main目录下 + ``` + cd tpc_c_cplusplus + cp thirdparty/tiff tools/main -rf + cp thirdparty/libpng tools/main -rf + cp thirdparty/libjpeg-turbo tools/main -rf + cp thirdparty/libwebp tools/main -rf + cp thirdparty/xz tools/main -rf + cp thirdparty/zstd tools/main -rf + cp thirdparty/libdeflate tools/main -rf + ``` +- 在tools目录下编译三方库 + 编译环境的搭建参考[准备三方库构建环境](../../../tools/README.md#编译环境准备) + + ``` + cd tools + ./build.sh tiff libpng libjpeg-turbo libwebp zstd xz libdeflate + ``` +- 三方库头文件及生成的库 + 在tools目录下会生成usr目录,该目录下存在已编译完成的32位和64位三方库 + + ``` + tiff/arm64-v8a tiff/armeabi-v7a libpng/arm64-v8a libpng/armeabi-v7a + libjpeg-turbo/arm64-v8a libjpeg-turbo/armeabi-v7a libwebp/arm64-v8a libwebp/armeabi-v7a + zstd/arm64-v8a zstd/armeabi-v7a xz/arm64-v8a xz/armeabi-v7a libdeflate/arm64-v8a libdeflate/armeabi-v7a + ``` + +- [测试三方库](#测试三方库) + +## 应用中使用三方库 +- 拷贝动态库到`\\entry\libs\${OHOS_ARCH}\`目录: + 动态库需要在`\\entry\libs\${OHOS_ARCH}\`目录,才能集成到hap包中,所以需要将对应的so文件拷贝到对应CPU架构的目录 +- 在IDE的cpp目录下新增thirdparty目录,将编译生成的库拷贝到该目录下,如下图所示 + ![tiff_install](pic/tiff_install.png) +- 在最外层(cpp目录下)CMakeLists.txt中添加如下语句 + ``` + + #将三方库加入工程中 + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libdeflate.so.0) + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libjpeg.so.62) + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/liblzma.so.5) + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libtiff.so.6) + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libzstd.so.1) + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libwebp.so.7) + #将三方库的头文件加入工程中 + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libpng/${OHOS_ARCH}/include) + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libjpeg-turbo/${OHOS_ARCH}/include) + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libwebp/${OHOS_ARCH}/include) + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/tiff/${OHOS_ARCH}/include) + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zstd/${OHOS_ARCH}/include) + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/xz/${OHOS_ARCH}/include) + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libdeflate/${OHOS_ARCH}/include) + + ``` + ![tiff_usage](pic/tiff_usage.png) +## 测试三方库 +三方库的测试使用原库自带的测试用例来做测试,[准备三方库测试环境](../../../tools/README.md#ci环境准备) + +进入到构建目录执行 make -C prog check-TESTS 运行测试用例,如下截图(arm64-v8a-build为构建64位的目录,armeabi-v7a-build为构建32位的目录) + +![tiff_test](pic/tiff_ohos_test1.png) + +![tiff_test](pic/tiff_ohos_test2.png) + +## 参考资料 +- [润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld) +- [OpenHarmony三方库地址](https://gitee.com/openharmony-tpc) +- [OpenHarmony知识体系](https://gitee.com/openharmony-sig/knowledge) +- [通过DevEco Studio开发一个NAPI工程](https://gitee.com/openharmony-sig/knowledge_demo_temp/blob/master/docs/napi_study/docs/hello_napi.md) diff --git a/thirdparty/tiff/docs/pic/tiff_install.png b/thirdparty/tiff/docs/pic/tiff_install.png new file mode 100644 index 0000000000000000000000000000000000000000..d294cbdec62514a435cd37c7363116f013b5e233 Binary files /dev/null and b/thirdparty/tiff/docs/pic/tiff_install.png differ diff --git a/thirdparty/tiff/docs/pic/tiff_ohos_test1.png b/thirdparty/tiff/docs/pic/tiff_ohos_test1.png new file mode 100644 index 0000000000000000000000000000000000000000..d68ea3b71270c212e17d0fd56c082399d21b4c7f Binary files /dev/null and b/thirdparty/tiff/docs/pic/tiff_ohos_test1.png differ diff --git a/thirdparty/tiff/docs/pic/tiff_ohos_test2.png b/thirdparty/tiff/docs/pic/tiff_ohos_test2.png new file mode 100644 index 0000000000000000000000000000000000000000..b8d1f59678554511de4c79c08f2c06617165268f Binary files /dev/null and b/thirdparty/tiff/docs/pic/tiff_ohos_test2.png differ diff --git a/thirdparty/tiff/docs/pic/tiff_usage.png b/thirdparty/tiff/docs/pic/tiff_usage.png new file mode 100644 index 0000000000000000000000000000000000000000..817d25565afa90c346ad1530405c57ee28d3634a Binary files /dev/null and b/thirdparty/tiff/docs/pic/tiff_usage.png differ