-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
500 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* .vitepress/theme/custom.css colors */ | ||
:root { | ||
--vp-c-brand: #646cff; | ||
--vp-c-brand-light: #747bff; | ||
--vp-c-brand-lighter: #9499ff; | ||
--vp-c-brand-lightest: #bcc0ff; | ||
--vp-c-brand-dark: #535bf2; | ||
--vp-c-brand-darker: #454ce1; | ||
--vp-c-brand-dim: rgba(100,108,255,0.08); | ||
} | ||
|
||
/* .vitepress/theme/custom.css home */ | ||
|
||
:root { | ||
--vp-home-hero-image-background-image: linear-gradient( -45deg, #bd34fe 50%, #47caff 50% ); | ||
--vp-home-hero-image-filter: blur( 40px ); | ||
--vp-home-hero-name-color: transparent; | ||
--vp-home-hero-name-background: -webkit-linear-gradient( 120deg, #bd34fe 30%, #41d1ff ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// .vitepress/theme/index.js | ||
import DefaultTheme from 'vitepress/theme'; | ||
import './custom.css'; | ||
export default DefaultTheme; | ||
|
||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# https://vitepress.dev/reference/default-theme-home-page | ||
layout: home | ||
|
||
hero: | ||
name: "GPUPixel" | ||
text: "Real-Time AI Image Beauty Filter Library" | ||
tagline: Achieving Commercial-Grade Beauty Effects | ||
actions: | ||
- theme: brand | ||
text: Markdown Examples | ||
link: /markdown-examples | ||
- theme: alt | ||
text: API Examples | ||
link: /api-examples | ||
|
||
features: | ||
- title: Feature A | ||
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
- title: Feature B | ||
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
- title: Feature C | ||
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
--- | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# 编译 | ||
::: tip | ||
从 v1.1.0 版本开始,源码使用CMake编译,请自行搜索如何安装和配置CMake | ||
生成的库和应用程序将位于项目根文件夹下的"output"目录中 | ||
::: | ||
|
||
## iOS | ||
|
||
```shell | ||
cd src | ||
mkdir build | ||
cd build | ||
|
||
# 生成工程 | ||
## for iOS arm64 | ||
cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../toolchain/ios.toolchain.cmake -DPLATFORM=OS64 .. | ||
|
||
# 编译 | ||
cmake --build . --config Debug | ||
``` | ||
|
||
## Mac | ||
|
||
```shell | ||
cd src | ||
mkdir build | ||
cd build | ||
|
||
# 生成工程 | ||
## for Mac Apple Silicon | ||
cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../toolchain/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 .. | ||
## for Mac Intel | ||
cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../toolchain/ios.toolchain.cmake -DPLATFORM=MAC .. | ||
|
||
# 编译 | ||
cmake --build . --config Debug | ||
``` | ||
|
||
## Android | ||
|
||
使用Android Studio打开目录 `src/android/java`,安卓的工程 | ||
|
||
## Windows | ||
|
||
你需要自己安装和配置 Cmake 以及 MinGW64. | ||
|
||
```shell | ||
cd src | ||
mkdir build | ||
cd build | ||
|
||
# 生成工程 | ||
cmake -G "MinGW Makefiles" .. | ||
|
||
# 编译 | ||
mingw32-make | ||
``` | ||
|
||
## Linux (只测试了ubuntu) | ||
|
||
```shell | ||
# 安装cmake | ||
sudo apt-get install cmake pkg-config | ||
# 安装依赖 | ||
sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev libglfw3-dev | ||
|
||
# start build | ||
cd src | ||
mkdir build | ||
cd build | ||
|
||
# 生成工程 | ||
cmake .. | ||
|
||
# 编译 | ||
make | ||
``` | ||
|
||
--- | ||
|
||
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
# 简单的调用说明 | ||
**声明filters** | ||
|
||
```c++ | ||
// video data input | ||
std::shared_ptr<SourceRawDataInput> source_raw_input_; | ||
// beauty filter | ||
std::shared_ptr<BeautyFaceFilter> beauty_face_filter_; | ||
// video data output | ||
std::shared_ptr<TargetRawDataOutput> target_raw_output_; | ||
``` | ||
|
||
**Create and link filters** | ||
|
||
```c++ | ||
gpupixel::GPUPixelContext::getInstance()->runSync([&] { | ||
// Create filter | ||
source_raw_input_ = SourceRawDataInput::create(); | ||
target_raw_output_ = TargetRawDataOutput::create(); | ||
// Face Beauty Filter | ||
beauty_face_filter_ = BeautyFaceFilter::create(); | ||
|
||
// Add filter | ||
source_raw_input_->addTarget(beauty_face_filter_) | ||
->addTarget(target_raw_output_); | ||
} | ||
``` | ||
**输入 YUV420P 或 RGBA数据** | ||
```c++ | ||
// ... | ||
// YUVI420 | ||
source_raw_input_->uploadBytes(width, | ||
height, | ||
bufferY, | ||
strideY, | ||
bufferU, | ||
strideU, | ||
bufferV, | ||
strideV); | ||
// ... | ||
// bytes: RGBA data | ||
source_raw_input_->uploadBytes(bytes, | ||
width, | ||
height, | ||
stride); | ||
``` | ||
|
||
**设置输出数据 YUV或RGB回调** | ||
|
||
```c++ | ||
// I420 callback | ||
target_raw_output_->setI420Callbck([=](const uint8_t *data, | ||
int width, | ||
int height, | ||
int64_t ts) { | ||
size_t y_size = width * height; | ||
const uint8_t *uData = data + y_size; | ||
const uint8_t *vData = data + y_size + y_size / 4; | ||
// Do something you want | ||
}); | ||
|
||
// RGBA callback-> | ||
target_raw_output_->setPixelsCallbck([=](const uint8_t *data, | ||
int width, | ||
int height, | ||
int64_t ts) { | ||
size_t rgba_size = width * height*4; | ||
// Do something you want | ||
}); | ||
|
||
// Output data callbck | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.