diff --git a/thirdparty/jbig2dec/HPKBUILD b/thirdparty/jbig2dec/HPKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..5233c8bc1f18db0a54e9c2782dc04235e18e9457 --- /dev/null +++ b/thirdparty/jbig2dec/HPKBUILD @@ -0,0 +1,74 @@ +# Contributor: wupingyuan +# Maintainer: wupingyuan +pkgname=jbig2dec +pkgver=0.19 +pkgrel=0 +pkgdesc="jbig2dec is a decoder library and example utility implementing the JBIG2 bi-level image compression spec. Also known as ITU T.88 and ISO IEC 14492, and included by reference in Adobe's PDF version 1.4 and later." +url="https://jbig2dec.com/" +archs=("armeabi-v7a" "arm64-v8a") +license=("AGPLv3") +depends=() +makedepends=() +install= +source="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/$pkgname-$pkgver.tar.gz" + +autounpack=true +downloadpackage=true +buildtools="configure" +builddir=$pkgname-$pkgver +packagename=$builddir.tar.gz +source envset.sh +host= + +prepare() { + cp -rf $builddir $pkgname-$ARCH-build + if [ $ARCH == ${archs[0]} ] + then + setarm32ENV + host=arm-linux + fi + if [ $ARCH == ${archs[1]} ] + then + setarm64ENV + host=aarch64-linux + fi + cd $pkgname-$ARCH-build + ./autogen.sh > `pwd`/build.log 2>&1 + cd $OLDPWD +} + +build() { + cd $pkgname-$ARCH-build + ./configure "$@" --host=$host >> `pwd`/build.log 2>&1 + make -j4 >> `pwd`/build.log 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $pkgname-$ARCH-build + make install >> `pwd`/build.log 2>&1 + ret=$? + cd $OLDPWD + if [ $ARCH == ${archs[0]} ] + then + unsetarm32ENV + fi + if [ $ARCH == ${archs[1]} ] + then + unsetarm64ENV + fi + unset host + return $ret +} + +check() { + echo "The test must be on an OpenHarmony device!" + # 在OpenHarmony开发板中执行用例 + # make check-TESTS +} + +cleanbuild(){ + rm -rf ${PWD}/$builddir $builddir-armeabi-v7a-build $builddir-arm64-v8a-build #${PWD}/$packagename +} \ No newline at end of file diff --git a/thirdparty/jbig2dec/README.OpenSource b/thirdparty/jbig2dec/README.OpenSource new file mode 100644 index 0000000000000000000000000000000000000000..2e9c095ad1e119c62d587e5071f70c854c3759ed --- /dev/null +++ b/thirdparty/jbig2dec/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "jbig2dec", + "License": "AGPLv3", + "License File": "LICENSE", + "Version Number": "0.19", + "Owner": "wupingyuan@huawei.com", + "Upstream URL": "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/jbig2dec-0.19.tar.gz", + "Description": "jbig2dec is a decoder library and example utility implementing the JBIG2 bi-level image compression spec. Also known as ITU T.88 and ISO IEC 14492, and included by reference in Adobe's PDF version 1.4 and later." + } +] diff --git a/thirdparty/jbig2dec/README_zh.md b/thirdparty/jbig2dec/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..625d49f039bcba1d5ec2d690ba660d6e983f90c3 --- /dev/null +++ b/thirdparty/jbig2dec/README_zh.md @@ -0,0 +1,12 @@ +# jbig2dec三方库说明 +## 功能简介 +jbig2dec是JBIG2图像压缩格式的解码器实现。 +## 使用约束 +- IDE版本:DevEco Studio 3.1 Release +- SDK版本:ohos_sdk_public 3.2.11.9 (API Version 9 Release) +- 三方库版本:0.19 +- 当前适配的功能:JBIG2图像压缩格式的解码 +- [AGPLv3](https://jbig2dec.com/) + +## 集成方式 ++ [应用hap包集成](docs/hap_integrate.md) diff --git a/thirdparty/jbig2dec/SHA512SUM b/thirdparty/jbig2dec/SHA512SUM new file mode 100644 index 0000000000000000000000000000000000000000..5eaec21f611b28feb0eb7c6f76fd874dddd88442 --- /dev/null +++ b/thirdparty/jbig2dec/SHA512SUM @@ -0,0 +1 @@ +0d3ec8123b446b5b74846b189004c188e82cdf7b1c7ec3e02f98892aaa249fba0b0fe7f1db7036f2571b0ef2a5df22d1997d3d3f5479c9bef7851bf114134737 jbig2dec-0.19.tar.gz \ No newline at end of file diff --git a/thirdparty/jbig2dec/docs/hap_integrate.md b/thirdparty/jbig2dec/docs/hap_integrate.md new file mode 100644 index 0000000000000000000000000000000000000000..41b939b2d1fd5e2facda153f8a8e38bb3a97cb1c --- /dev/null +++ b/thirdparty/jbig2dec/docs/hap_integrate.md @@ -0,0 +1,71 @@ +# jbig2dec集成到应用hap +本库是在RK3568开发板上基于OpenHarmony3.2 Release版本的镜像验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 +## 开发环境 +- ubuntu20.04 +- [OpenHarmony3.2Release镜像](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2-Release%2Fdayu200_standard_arm32.tar.gz) +- [ohos_sdk_public 3.2.11.9 (API Version 9 Release)](https://gitee.com/link?target=https%3A%2F%2Frepo.huaweicloud.com%2Fopenharmony%2Fos%2F3.2-Release%2Fohos-sdk-windows_linux-public.tar.gz) +- [DevEco Studio 3.1 Beta2](https://gitee.com/link?target=https%3A%2F%2Fcontentcenter-vali-drcn.dbankcdn.cn%2Fpvt_2%2FDeveloperAlliance_package_901_9%2Ff3%2Fv3%2FuJyuq3syQ2ak4hE1QZmAug%2Fdevecostudio-windows-3.1.0.400.zip%3FHW-CC-KV%3DV1%26HW-CC-Date%3D20230408T013335Z%26HW-CC-Expire%3D315360000%26HW-CC-Sign%3D96262721EDC9B34E6F62E66884AB7AE2A94C2A7B8C28D6F7FC891F46EB211A70) +- [准备三方库构建环境](../../../tools/README.md#编译环境准备) +- [准备三方库测试环境](../../../tools/README.md#ci环境准备) +## 编译三方库 +- 下载本仓库 + ``` + git clone https://gitee.com/openharmony-sig/tpc_c_cplusplus.git --depth=1 + ``` +- 三方库目录结构 + ``` + tpc_c_cplusplus/thirdparty/jbig2dec #三方库jbig2dec的目录结构如下 + ├── docs #三方库相关文档的文件夹 + ├── HPKBUILD #构建脚本 + ├── SHA512SUM #三方库校验文件 + ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 + ├── README_zh.md + ``` + +- 将jbig2dec拷贝至tools/main目录下 + ``` + cd tpc_c_cplusplus + cp thirdparty/jbig2dec tools/main -rf + ``` +- 在tools目录下编译三方库 + 编译环境的搭建参考[准备三方库构建环境](../../../tools/README.md#编译环境准备) + ``` + cd tools + ./build.sh jbig2dec + ``` +- 三方库头文件及生成的库 + 在tools目录下会生成usr目录,该目录下存在已编译完成的32位和64位三方库 + ``` + jbig2dec-arm64-v8a-install jbig2dec-armeabi-v7a-install + ``` + +- [测试三方库](#测试三方库) + +## 应用中使用三方库 + +- 在IDE的cpp目录下新增thirdparty目录,将编译生成的库拷贝到该目录下,如下图所示 + ![thirdparty_install_dir](pic/jbig2dec_install_dir.jpg) +- 在最外层(cpp目录下)CMakeLists.txt中添加如下语句 + ``` + #将三方库加入工程中 + add_library(jbig2dec SHARED IMPORTED) + set_target_properties(jbig2dec + PROPERTIES IMPORTED_LOCATION + ${CMAKE_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libjbig2dec.so) + target_link_libraries(entry PUBLIC libace_napi.z.so jbig2dec) + #将三方库的头文件加入工程中 + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/jbig2dec-${OHOS_ARCH}-install/include) + ``` + ![jbig2dec_usage](pic/jbig2dec_usage.jpg) +## 测试三方库 +三方库的测试使用原库自带的测试用例来做测试,[准备三方库测试环境](../../../tools/README.md#ci环境准备) + +进入到构建目录执行make check运行测试用例(arm64-v8a-build为构建64位的目录,armeabi-v7a-build为构建32位的目录) + + ![jbig2dec_test](pic/jbig2dec_test.jpg) + +## 参考资料 +- [润和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/jbig2dec/docs/pic/jbig2dec_install_dir.jpg b/thirdparty/jbig2dec/docs/pic/jbig2dec_install_dir.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c90871a39bdbd1871f114462890a9c003471cbfb Binary files /dev/null and b/thirdparty/jbig2dec/docs/pic/jbig2dec_install_dir.jpg differ diff --git a/thirdparty/jbig2dec/docs/pic/jbig2dec_test.jpg b/thirdparty/jbig2dec/docs/pic/jbig2dec_test.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a82eee48fdc53f5ff4f65fc1dc396891fb1f0790 Binary files /dev/null and b/thirdparty/jbig2dec/docs/pic/jbig2dec_test.jpg differ diff --git a/thirdparty/jbig2dec/docs/pic/jbig2dec_usage.jpg b/thirdparty/jbig2dec/docs/pic/jbig2dec_usage.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9f7b07a5e22ef206f0205cce748030ea1df31df7 Binary files /dev/null and b/thirdparty/jbig2dec/docs/pic/jbig2dec_usage.jpg differ