diff --git a/thirdparty/Little-CMS/HPKBUILD b/thirdparty/Little-CMS/HPKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..517c7f1757f9a6e18d4944189dedac6a318327e3 --- /dev/null +++ b/thirdparty/Little-CMS/HPKBUILD @@ -0,0 +1,62 @@ +# Copyright (c) 2023 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. + +# Contributor: wangjialun<2271411@stu.neu.edu.cn>, zhangqian<2371418@stu.neu.edu.cn>, wangyihao<2942375747@qq.com>, wangying +# Maintainer: wangyihao<2471389@stu.neu.edu.cn>, wangjialun<2271411@stu.neu.edu.cn>, zhangqian<2371418@stu.neu.edu.cn>, wangying + +pkgname=Little-CMS +pkgver=2.11 +pkgrel=0 +pkgdesc="Little-CMS is a free, open source, CMM engine. It provides fast transforms between ICC profiles." +url="https://github.com/mm2/Little-CMS/tree/2.11" +archs=("armeabi-v7a" "arm64-v8a") +license=("MIT License") +depends=() +makedepends=() +source="https://github.com/mm2/Little-CMS/archive/refs/tags/2.11.zip" + +downloadpackage=true +autounpack=true +buildtools=configure + +builddir=$pkgname-${pkgver} +packagename=$builddir.zip + +prepare() { + mkdir -p $builddir/$ARCH-build +} + +build() { + cd $builddir/$ARCH-build + ../configure $*>> `pwd`/build.log 2>&1 + make -j4 >> `pwd`/build.log 2>&1 + ret=$? + cd $OLDPWD + return $ret +} + +package() { + cd $builddir + $MAKE -C $ARCH-build install >> $buildlog 2>&1 + cd $OLDPWD +} + + +check() { + echo "The test must be on an OpenHarmony device!" +} + + +cleanbuild() { + rm -rf ${PWD}/$builddir +} diff --git a/thirdparty/Little-CMS/HPKCHECK b/thirdparty/Little-CMS/HPKCHECK new file mode 100644 index 0000000000000000000000000000000000000000..bf95de7c03daefcd029bdb515396ad016cb9b19a --- /dev/null +++ b/thirdparty/Little-CMS/HPKCHECK @@ -0,0 +1,33 @@ +# Copyright (c) 2023 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. + +# Contributor: wangjialun<2271411@stu.neu.edu.cn>, zhangqian<2371418@stu.neu.edu.cn>, wangyihao<2471389@stu.neu.edu.cn>, wangying +# Maintainer: wangyihao<2471389@stu.neu.edu.cn>, wangjialun<2271411@stu.neu.edu.cn>, zhangqian<2371418@stu.neu.edu.cn>, wangying + +source HPKBUILD > /dev/null 2>&1 # 导入HPKBUILD文件 +logfile=${LYCIUM_THIRDPARTY_ROOT}/${pkgname}/${pkgname}_${ARCH}_${OHOS_SDK_VER}_test.log + +checkprepare(){ + return 0 +} + +# 在OH环境执行测试的接口 +openharmonycheck() { + res=0 # 记录返回值 + cd ${builddir}/${ARCH}-build # 进入到测试目录 + ctest > ${logfile} 2>&1 # 执行测试命令并将测试结果导出到${logfile},测试命令根据每个库的真实情况填写 + res=$? # 记录测试结果返回值 + cd $OLDPWD # 返回上一次目录 + + return $res # 返回测试值 +} \ No newline at end of file diff --git a/thirdparty/Little-CMS/OAT.xml b/thirdparty/Little-CMS/OAT.xml new file mode 100644 index 0000000000000000000000000000000000000000..eeb1f946d683c0b81976cd06522096062a6901b9 --- /dev/null +++ b/thirdparty/Little-CMS/OAT.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Little-CMS/README.OpenSource b/thirdparty/Little-CMS/README.OpenSource new file mode 100644 index 0000000000000000000000000000000000000000..23bb105295eff18c5353ec3e4e24a53dadc04560 --- /dev/null +++ b/thirdparty/Little-CMS/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "Little-CMS", + "License": "MIT License", + "License File": "https://github.com/mm2/Little-CMS/blob/master/LICENSE", + "Version Number": "2.11", + "Owner": "2942375747@qq.com", + "Upstream URL": "https://github.com/mm2/Little-CMS", + "Description": "Little-CMS is a free, open source, CMM engine. It provides fast transforms between ICC profiles." + } +] \ No newline at end of file diff --git a/thirdparty/Little-CMS/README_zh.md b/thirdparty/Little-CMS/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..99bab77f73121aa39c4a260d9f719f826692eb9e --- /dev/null +++ b/thirdparty/Little-CMS/README_zh.md @@ -0,0 +1,10 @@ +# Little-CMS三方库说明 +## 功能简介 +Little-CMS是一个免费的、开源的CMM引擎。它提供了ICC配置文件之间的快速转换。 +## 使用约束 +- IDE版本:DevEco Studio 3.1.0.501 +- SDK版本:ohos_sdk_public 4.1.3.5 +- 三方库版本:2.11 + +## 集成方式 ++ [应用hap包集成](docs/hap_integrate.md) diff --git a/thirdparty/Little-CMS/SHA512SUM b/thirdparty/Little-CMS/SHA512SUM new file mode 100644 index 0000000000000000000000000000000000000000..043c41163fd503300cedf85539fe7f1439a8fa94 --- /dev/null +++ b/thirdparty/Little-CMS/SHA512SUM @@ -0,0 +1 @@ +62e4b5b45ad7604f596bd2f6c94102cedbc203dda356ea6d43252efc835363d5a06ba7db0fb245741cc54e9b831d608ff80416ccbcdcf48b6236769b51853022 Little-CMS-2.11.zip \ No newline at end of file diff --git a/thirdparty/Little-CMS/docs/hap_integrate.md b/thirdparty/Little-CMS/docs/hap_integrate.md new file mode 100644 index 0000000000000000000000000000000000000000..bfa4588594b2fc499025d2466dba4fbad247c0ed --- /dev/null +++ b/thirdparty/Little-CMS/docs/hap_integrate.md @@ -0,0 +1,79 @@ +# Little-CMS 集成到应用hap + +本库是在RK3568开发板上基于OpenHarmony3.2 Release版本的镜像验证的,如果是从未使用过RK3568,可以先查看[润和RK3568开发板标准系统快速上手](https://gitee.com/openharmony-sig/knowledge_demo_temp/tree/master/docs/rk3568_helloworld)。 + +## 开发环境 + +- [开发环境准备](../../../docs/hap_integrate_environment.md) + +## 编译三方库 + +- 下载本仓库 + + ```shell + git clone https://gitee.com/openharmony-sig/tpc_c_cplusplus.git --depth=1 + ``` + +- 三方库目录结构 + + ```shell + tpc_c_cplusplus/thirdparty/Little-CMS #三方库Little-CMS的目录结构如下 + ├── docs #三方库相关文档的文件夹 + ├── HPKBUILD #构建脚本 + ├── HPKCHECK #测试脚本 + ├── SHA512SUM #三方库校验文件 + ├── README.OpenSource #说明三方库源码的下载地址,版本,license等信息 + ├── README_zh.md #三方库简介 + ``` + +- 在lycium目录下编译三方库 + + 编译环境的搭建参考[准备三方库构建环境](../../../lycium/README.md#1编译环境准备) + + ```shell + cd lycium + ./build.sh Little-CMS-2.11 + ``` + +- 三方库头文件及生成的库 + + 在lycium目录下会生成usr目录,该目录下存在已编译完成的32位和64位三方库 + + ```shell + Little-CMS-2.11/arm64-v8a Little-CMS-2.11/armeabi-v7a + ``` + +- [测试三方库](#测试三方库) + +- 编译出可执行的文件进行测试,[准备三方库测试环境](../../../lycium/README.md#3ci环境准备) +## 应用中使用三方库 + +- 在IDE的cpp目录下新增thirdparty目录,将编译生成的头文件拷贝到该目录下,将编译生成的三方库以及依赖库全部(动态库名字带版本号和不带版本号的都需要)拷贝到工程的libs目录下,如下图所示: +   + +  ![thirdparty_install_dir](pic/Little-CMS_install_dir.png) + +- 在最外层(cpp目录下)CMakeLists.txt中添加如下语句 + + ```shell + #将三方库加入工程中 + target_link_libraries(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/Little-CMS/${OHOS_ARCH}/lib/liblcms2.a) + #将三方库的头文件加入工程中 + target_include_directories(entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/Little-CMS/${OHOS_ARCH}/include) + ``` + +## 测试三方库 +在lycium目录下执行脚本./test.sh,自动检测thridparty目录下已编译的三方库, + + +```shell + cd lycium + ./test.sh Little-CMS-2.11 +``` + ![libucl_test](pic/Little-CMS_test.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) \ No newline at end of file diff --git a/thirdparty/Little-CMS/docs/pic/Little-CMS_install_dir.png b/thirdparty/Little-CMS/docs/pic/Little-CMS_install_dir.png new file mode 100644 index 0000000000000000000000000000000000000000..f2cb3a8004b1543658574b291ab69249ee82c288 Binary files /dev/null and b/thirdparty/Little-CMS/docs/pic/Little-CMS_install_dir.png differ diff --git a/thirdparty/Little-CMS/docs/pic/Little-CMS_test.png b/thirdparty/Little-CMS/docs/pic/Little-CMS_test.png new file mode 100644 index 0000000000000000000000000000000000000000..19b22103bdf697411c80b01b0775a2d6a4896b57 Binary files /dev/null and b/thirdparty/Little-CMS/docs/pic/Little-CMS_test.png differ