Skip to content

Commit

Permalink
Merge commit 'a09147a27941af7dcb9c576c231eea380083ff3f' into bugfix/u…
Browse files Browse the repository at this point in the history
…pdate_tgfx

# Conflicts:
#	DEPS   resolved by a09147a version
#	test/baseline/version.json
  • Loading branch information
Hparty committed Dec 9, 2024
2 parents cd18289 + a09147a commit bc0a9e5
Show file tree
Hide file tree
Showing 14 changed files with 216 additions and 166 deletions.
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"common": [
{
"url": "${PAG_GROUP}/vendor_tools.git",
"commit": "b3125b9cf13bcc70e63212de1d0ed95e7beaa2a9",
"commit": "4e331972e2e828655b1901dccd5081cc995b32fc",
"dir": "third_party/vendor_tools"
},
{
"url": "${PAG_GROUP}/tgfx.git",
"commit": "861d79ed1926accea903200af36f1c2be0c99567",
"commit": "b062b9a779e481e99f0e1da1f0951f0f5a9f431f",
"dir": "third_party/tgfx"
},
{
Expand Down
147 changes: 76 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,55 @@ English | [简体中文](./README.zh_CN.md) | [Homepage](https://pag.io)

## Introduction

libpag is a real-time rendering library for PAG (Portable Animated Graphics) files that renders both
vector-based and raster-based animations across most platforms, such as iOS, Android, OpenHarmony, macOS,
Windows, Linux, and Web.
libpag is a real-time rendering library for PAG (Portable Animated Graphics) files, capable of
rendering both vector-based and raster-based animations across various platforms, including iOS,
Android, OpenHarmony, macOS, Windows, Linux, and the Web.

PAG is an open-source file format for recording animations. PAG files can be created and exported
from Adobe After Effects with the PAGExporter plugin and previewed in the PAGViewer app, which you
can get from [pag.io](https://pag.io), and both of them are available on both macOS and Windows.
PAG is an open-source file format designed for recording animations. You can create and export PAG
files from Adobe After Effects using the PAGExporter plugin and preview them in the PAGViewer app,
both available on macOS and Windows.

PAG is now being used by 40+ Tencent apps, such as WeChat, Mobile QQ, Honor of Kings Mobile Game,
Tencent Video, QQ Music, and so on, reaching hundreds of millions of users.
PAG is widely used in major Tencent apps like WeChat, Mobile QQ, Honor of Kings, Tencent Video, and
QQ Music, as well as in thousands of third-party apps, reaching hundreds of millions of users.

## Advantages

- **Highly efficient file format**

<img src="resources/readme/intro_1.png" alt="intro_1" width="282"/>

Benefiting from the highly efficient binary format design, PAG files can be decoded 10x faster than
JSON files but also are about 50% smaller in file size when exporting the same animations. Designers
can also ship beautiful animations with bitmaps or audiovisual media integrated into a single file
easily without other attachments.
Benefiting from its highly efficient binary format, PAG files decode 10 times faster than JSON files
and are about 50% smaller in file size for the same animations. Designers can also easily include
beautiful animations with bitmaps or audiovisual media in a single file without needing additional
attachments.

- **All AE features supported**

<img src="resources/readme/intro_2.png" alt="intro_2" width="282"/>

While other solutions may only support exporting limited vector-based AE features, PAG supports
exporting all AE animations into a single file by combining vector-based exporting with raster-based
exporting techniques. Therefore, third-party plugin effects in AE can be exported as well.
While other solutions may only support exporting limited vector-based AE features, PAG combines
vector-based and raster-based exporting techniques to support all AE animations in a single file.
This means third-party plugin effects in AE can also be exported.

- **Measurable performance**

<img src="resources/readme/intro_4.png" alt="intro_4" width="282"/>

PAG provides a monitoring panel in PAGViewer that shows normalized performance data for PAG files,
which helps designers to examine and optimize performance easily without developers. Along with
dozens of automatic optimization techniques from the PAGExporter plugin, animations with cool visual
effects and excellent performance now can be created more effectively.
PAG provides a monitoring panel in PAGViewer that displays normalized performance data for PAG files,
making it easy for designers to review and optimize performance without needing developers. With
numerous automatic optimization techniques from the PAGExporter plugin, you can create animations
with impressive visual effects and excellent performance more efficiently.


PAGViewer includes a monitoring panel
- **Runtime editable animations**

<img src="resources/readme/intro_5.png" alt="intro_5" width="282"/>

With the flexible editing APIs from PAG SDK, developers can easily change the layer structure of a
single PAG file, mix multiple PAG files into one composition, or replace texts and images with all
pre-designed animation effects applied at runtime. It reduces tons of coding work for product
features like video templates.
With the flexible editing APIs from the PAG SDK, developers can easily modify the layer structure of
a single PAG file, combine multiple PAG files into one composition, or replace text and images with
all pre-designed animation effects applied at runtime. This significantly reduces the coding work
required for features like video templates.

## System Requirements

Expand All @@ -74,15 +76,14 @@ features like video templates.

## Getting Started

We currently only publish precompiled libraries for iOS, Android, and Web. You can build libraries of
other platforms from the source code. The latest releases can be downloaded
We currently only publish precompiled libraries for iOS, Android, macOS, Web, and OpenHarmony. You
can build libraries of other platforms from the source code. The latest releases can be downloaded
from [here](https://github.com/Tencent/libpag/releases).

### iOS Integration

You can use the framework downloaded from the release page, or add libpag to your project by
CocoaPods:
Add the pod to your Podfile:
You can download the framework from the release page or add `libpag` to your project using CocoaPods.
To add the pod to your Podfile, include:

```
pod 'libpag'
Expand All @@ -94,17 +95,17 @@ And then run:
pod install
```

After installing the cocoapod into your project import libpag with
After installing the CocoaPod, import `libpag` into your project with:

```
#import <libpag/xxx.h>
```

### Android Integration

You can use the aar downloaded from the release page, or add libpag to your project by Maven:
You can download the AAR from the release page or add `libpag` to your project using Maven:

Edit the `build.gradle` file in the root of your project, add `mavenCentral()` to `repositories`:
Edit the `build.gradle` file in the root of your project and add `mavenCentral()` to the `repositories` section:

```
buildscript {
Expand All @@ -125,38 +126,42 @@ dependencies {
}
```

Add the following rule to your proguard rules to avoid the wrong obfuscation.
Add the following rule to your proguard rules to prevent incorrect obfuscation:

```
-keep class org.libpag.** {*;}
-keep class androidx.exifinterface.** {*;}
```

Finally, run gradle sync and then build the project.
Finally, run gradle sync and build your project.

### OpenHarmony Integration
You can use the har downloaded from the [release](https://github.com/Tencent/libpag/releases) page, or add libpag to your project by
OHPM:

You can download the HAR file from the [release](https://github.com/Tencent/libpag/releases) page,
or add `libpag` to your project using OHPM:

```
ohpm install @tencent/libpag
```

Or, you can add it to your project manually.
Add the following lines to oh-package.json5 on your app module.
Alternatively, you can add it to your project manually. Add the following lines to `oh-package.json5`
in your app module.

```
"dependencies": {
"@tencent/libpag": "^1.0.1",
}
```
Then run

Then run:

```
ohpm install
```

### Web Integration

Simply copy the following code into an HTML file and open it in your browser:
Copy the following code into an HTML file and open it in your browser:

```html
<canvas class="canvas" id="pag"></canvas>
Expand All @@ -178,7 +183,7 @@ More information:[Web SDK Guide](./web/README.md)

### Example

Check out the following projects to learn how to use the APIs of libpag:
Explore these projects to learn how to use the libpag APIs:

- [https://github.com/libpag/pag-ios](https://github.com/libpag/pag-ios)
- [https://github.com/libpag/pag-android](https://github.com/libpag/pag-android)
Expand All @@ -190,21 +195,21 @@ Check out the following projects to learn how to use the APIs of libpag:
- [Android API Reference](https://pag.io/apis/android/index.html)
- [Web API Reference](https://pag.io/apis/web/index.html)

You can find other docs on [pag.io](https://pag.io/docs/home.html)
You can find additional documentation on [pag.io](https://pag.io/docs/home.html)

## Development

We recommend using CLion IDE on the macOS platform for development.
We recommend using the CLion IDE on macOS for development.

### Branch Management

- The `main` branch is our active developing branch which contains the latest features and bugfixes.
- The branches under `release/` are our stable milestone branches which are fully tested. We will
periodically cut a `release/{version}` branch from the `main` branch. After one `release/{version}`
branch is cut, only high-priority fixes are checked into it.
- The `main` branch is our active development branch, containing the latest features and bug fixes.
- The `release/` branches are our stable milestone branches, fully tested. We periodically create a
`release/{version}` branch from the `main` branch. After a `release/{version}` branch is created,
only high-priority fixes are checked into it.

**Note: This repository only contains the latest code since PAG 4.0. To use the legacy PAG 3.0
versions, you can download the precompiled libraries from [here](https://github.com/Tencent/libpag/releases).**
**Note: This repository only contains the latest code since PAG 4.0. For legacy PAG 3.0 versions,
you can download the precompiled libraries from [here](https://github.com/Tencent/libpag/releases).**

### Build Prerequisites

Expand All @@ -220,57 +225,58 @@ versions, you can download the precompiled libraries from [here](https://github.

### Dependency Management

libpag uses [depsync](https://github.com/domchen/depsync) tool to manage third-party dependencies.
libpag uses the [depsync](https://github.com/domchen/depsync) tool to manage third-party dependencies.

**For macOS platform:**

Run the script in the root of the project:
Run the script located in the root directory of the project:

```
./sync_deps.sh
```

This script will automatically install the necessary tools and synchronize all third-party repositories.
This script will automatically install the necessary tools and sync all third-party repositories.

**For other platforms:**

First, make sure you have installed the latest version of node.js (You may need to restart your
computer after this step). And then run the following command to install depsync tool:
First, ensure you have the latest version of Node.js installed (you may need to restart your
computer afterward). Then, run the following command to install the depsync tool:

```
npm install -g depsync
```

And then run `depsync` in the root directory of the project.
Then, run `depsync` in the root directory of the project.

```
depsync
```

Git account and password may be required during synchronizing. Please make sure you have enabled the
`git-credential-store` so that `CMakeList.txt` can trigger synchronizing automatically next time.
You might need to enter your Git account and password during synchronization. Ensure you have
enabled the `git-credential-store` so that `CMakeList.txt` can automatically trigger synchronization
next time.

### Build

After the synchronization, you can open the project with CLion and build the pag library.
After synchronization, you can open the project with CLion and build the PAG library.

**For macOS platform:**
**For macOS:**

There are no extra configurations of CLion required.
No additional CLion configuration is needed.

**For Windows platform:**
**For Windows:**

Please follow the following steps to configure the CLion environment correctly:
Follow these steps to configure CLion correctly:

- Make sure you have installed at least the **[Desktop development with C++]** and **[Universal Windows Platform development]** components for VS2019.
- Open the **File->Setting** panel, and go to **Build, Execution, Deployment->ToolChains**, then set the toolchain of CLion to **Visual Studio** with **amd64 (Recommended)** or **x86** architecture.
- Ensure you have installed the **[Desktop development with C++]** and **[Universal Windows Platform development]** components for VS2019.
- Open the **File->Settings** panel, go to **Build, Execution, Deployment->Toolchains**, and set the toolchain to **Visual Studio** with **amd64 (Recommended)** or **x86** architecture.

**Note: If anything goes wrong during cmake building, please update the cmake commandline tool to the latest
version and try again.**
**Note: If you encounter issues during the CMake build, update to the latest version of the CMake
command-line tool and try again.**

## Support Us

If you find libpag is helpful, please give us a **Star**. We sincerely appreciate your support :)
If you find libpag helpful, please give us a **Star**. We truly appreciate your support :)


[![Star History Chart](https://api.star-history.com/svg?repos=Tencent/libpag&type=Date)](https://star-history.com/#Tencent/libpag&Date)
Expand All @@ -282,13 +288,12 @@ libpag is licensed under the [Apache Version 2.0 License](./LICENSE.txt)

## Privacy Policy

Please comply with [the personal information processing rules of PAG SDK](https://privacy.qq.com/document/preview/01e79d0cc7a2427ba774b88c6beff0fd) while using libpag SDK
Please refer to the [PAG SDK Personal Information Processing Rules](https://privacy.qq.com/document/preview/01e79d0cc7a2427ba774b88c6beff0fd) when using the libpag SDK.

## Contribution

If you have any ideas or suggestions to improve libpag, welcome to submit
an [issue](https://github.com/Tencent/libpag/issues/new/choose)
/ [pull request](https://github.com/Tencent/libpag/pulls). Before making a pull request or issue,
please make sure to read [Contributing Guide](./CONTRIBUTING.md).
If you have any ideas or suggestions to improve libpag, feel free to submit an
[issue](https://github.com/Tencent/libpag/issues/new/choose) or a [pull request](https://github.com/Tencent/libpag/pulls).
Before doing so, please read our [Contributing Guide](./CONTRIBUTING.md).


9 changes: 5 additions & 4 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Windows, Linux, 以及 Web 端。
PAG 方案是一套完善的动效工作流。提供从 AE(Adobe After Effects)导出插件,到桌面预览工具 PAGViewer,再到各端的跨平台渲染 SDK。
目标是降低或消除动效研发相关的成本,打通设计师创作到素材交付上线的极简流程,不断输出运行时可编辑的高质量动效内容。

PAG 方案目前已经接入了腾讯系 40 余款应用,包括微信,手机QQ,王者荣耀,腾讯视频,QQ音乐等头部产品,稳定性经过了海量用户的持续验证,可以广泛应用于UI动画、贴纸动画、视频编辑、模板设计等场景。典型应用场景可以参考[官网案例](https://pag.io/case.html)
PAG 方案目前已经接入了腾讯系几乎所有主流应用以及外部几千个业务,包括微信,手机QQ,王者荣耀,腾讯视频,QQ音乐等头部产品,
稳定性经过了海量用户的持续验证,可以广泛应用于UI动画、贴纸动画、视频编辑、模板设计等场景。典型应用场景可以参考[官网案例](https://pag.io/case.html)

详细介绍可以参考相关报道:

Expand Down Expand Up @@ -63,8 +64,8 @@ PAG 方案目前已经接入了腾讯系 40 余款应用,包括微信,手机

## 快速接入

由于大部分平台没有统一的上层业务框架,目前我们暂时只为 iOS, AndroidWeb 平台定期发布预编译的二进制库,其他平台的库需要通过
源码根据自己的实际需求调整参数进行编译。移动端最新的release库可以在 [这里](https://github.com/Tencent/libpag/releases)
由于大部分平台没有统一的上层业务框架,目前我们暂时只为 iOS, Android,macOs, Web 和鸿蒙平台定期发布预编译的二进制库,
其他平台的库需要通过源码根据自己的实际需求调整参数进行编译。移动端最新的release库可以在 [这里](https://github.com/Tencent/libpag/releases)
下载。 详细的 SDK接入文档可以参考 [SDK 接入](https://pag.io/docs/sdk.html) 。Web 平台的接入文档可以参考 [Web SDK
接入](./web/README.md)

Expand Down Expand Up @@ -267,7 +268,7 @@ libpag 基于 [Apache-2.0](./LICENSE.txt) 协议开源.

## 隐私政策

使用 libpag SDK 时请遵守 [PAG SDK个人信息保护规则](https://privacy.qq.com/document/preview/01e79d0cc7a2427ba774b88c6beff0fd).
使用 libpag SDK 时请参考 [PAG SDK个人信息保护规则](https://privacy.qq.com/document/preview/01e79d0cc7a2427ba774b88c6beff0fd).

## 贡献

Expand Down
12 changes: 7 additions & 5 deletions qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ if (NOT CMAKE_PREFIX_PATH)
include("./QTCMAKE.cfg")
endif ()

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
if (${QT_VERSION_MAJOR} LESS 6)
message("The QT version is less than 6.0, force to use x86_64 architecture.")
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
SET(CMAKE_OSX_ARCHITECTURES x86_64)
string(REGEX MATCH "([0-9]+)\\.[0-9]+\\.[0-9]+" QT_VERSION ${CMAKE_PREFIX_PATH})
if (QT_VERSION)
string(REGEX MATCH "^[0-9]+" QT_VERSION_MAJOR ${QT_VERSION})
if (QT_VERSION_MAJOR GREATER_EQUAL 6 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
message(FATAL_ERROR "QT has dropped support for 32-bit builds since version 6.0.0")
endif ()
endif ()

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets OpenGL Qml Quick)
list(APPEND PAG_VIEWER_PLATFORM_LIBS Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::Qml Qt${QT_VERSION_MAJOR}::Quick)
Expand Down
12 changes: 6 additions & 6 deletions qt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ English | [简体中文](./README.zh_CN.md)

# QT Demo

Please make sure you have built the libpag library successfully before building the QT demo project.
Before building the QT demo project, make sure you have successfully built the libpag library.

## macOS

Open the `qt` folder with CLion, and then open the `qt/QTCMAKE.cfg` file to modify the QT path to
your local QT installation path. Then you can build and run the `PAGViewer` target.
Open the `qt` folder in CLion, then open the `qt/QTCMAKE.cfg` file and update the QT path to your
local QT installation path. After that, you can build and run the `PAGViewer` target.

## Windows

- Please refer to the build guide in [README.md](./../README.md) to install the necessary modules of VS2019 and make sure the ToolChain of CLion is Visual Studio with **amd64** architecture.
- Open the `qt` folder with CLion, and then open the `qt/QTCMAKE.cfg` file to modify the QT path to your local QT installation path. For example: `C:/Qt/Qt5.13.0/5.13.0/msvc2017_64/lib/cmake`.
- Open the configuration panel of `PAGViewer` target in CLion, and then fill in the local QT DLL library path in the `Environment Variables` row. For example: `PATH=C:\Qt\Qt5.13.0\5.13.0\msvc2017_64\bin`.
- Follow the build guide in [README.md](./../README.md) to install the necessary VS2019 modules and ensure the CLion ToolChain is set to Visual Studio with **amd64** architecture.
- Open the `qt` folder in CLion, then open the `qt/QTCMAKE.cfg` file and update the QT path to your local QT installation path. For example: `C:/Qt/Qt5.13.0/5.13.0/msvc2017_64/lib/cmake`.
- In CLion, open the configuration panel for the `PAGViewer` target and set the local QT DLL library path in the `Environment Variables` field. For example: `PATH=C:\Qt\Qt5.13.0\5.13.0\msvc2017_64\bin`.
- Finally, build and run the `PAGViewer` target.


Expand Down
Loading

0 comments on commit bc0a9e5

Please sign in to comment.