Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified NOTE.md
100644 → 100755
Empty file.
Empty file modified README-zh.md
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified app/.classpath
100644 → 100755
Empty file.
Empty file modified app/.gitignore
100644 → 100755
Empty file.
Empty file modified app/.project
100644 → 100755
Empty file.
Empty file modified app/.settings/org.eclipse.buildship.core.prefs
100644 → 100755
Empty file.
Empty file modified app/bugly/BuglySymtabLog.txt
100644 → 100755
Empty file.
Empty file modified app/bugly/BuglyUploadLog.txt
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions app/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
applicationId "com.trinity.sample"
applicationId "com.trinity.video"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0.2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Empty file modified app/proguard-rules.pro
100644 → 100755
Empty file.
Empty file.
Empty file modified app/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/assets/douyin_quanjiwu.mp3
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/assets/dream.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[
{
"id": 1,
"name": "爱心光斑",
"name": "Love spot",
"color": "#CCEA0000",
"effect": "effect/loveSpot",
"effectName": "loveSpot"
Expand Down
30 changes: 15 additions & 15 deletions app/src/main/assets/effect.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
[
{
"id": 0,
"name": "撤回",
"name": "Withdraw",
"color": "#4F4F4F"
},
{
"id": 1,
"name": "闪白",
"name": "Flash white",
"color": "#cc23bdb1",
"effect": "effect/flashWhite",
"effectName": "FlashWhite"
},
{
"id": 2,
"name": "两屏",
"name": "Two screens",
"color": "#cce77e86",
"effect": "effect/twoScreen",
"effectName": "SplitScreen"
},
{
"id": 3,
"name": "三屏",
"name": "Three screens",
"color": "#ccdc424e",
"effect": "effect/threeScreen",
"effectName": "SplitScreen"
},
{
"id": 4,
"name": "四屏",
"name": "Four screens",
"color": "#ccc12430",
"effect": "effect/fourScreen",
"effectName": "SplitScreen"
},
{
"id": 5,
"name": "六屏",
"name": "Six screens",
"color": "#ccef2f3e",
"effect": "effect/sixScreen",
"effectName": "SplitScreen"
},
{
"id": 6,
"name": "九屏",
"name": "Nine screens",
"color": "#ccdc143c",
"effect": "effect/nineScreen",
"effectName": "SplitScreen"
},
{
"id": 6,
"name": "黑白分屏",
"name": "Black and white split screen",
"color": "#ccdc143c",
"effect": "effect/blackWhiteScreen",
"effectName": "blackWhiteScreen"
},
{
"id": 7,
"name": "模糊分屏",
"name": "Fuzzy split screen",
"color": "#CCEA0000",
"effect": "effect/blurScreen",
"effectName": "SplitScreen"
},
{
"id": 8,
"name": "灵魂出窍",
"name": "Soul out of the body",
"color": "#EA0000",
"effect": "effect/soulScale",
"effectName": "effect/SoulScale"
},
{
"id": 9,
"name": "抖动",
"name": "Jitter",
"color": "#CCEA0000",
"effect": "effect/shake",
"effectName": "Shake"
},
{
"id": 10,
"name": "毛刺",
"name": "glitch",
"color": "#CCEA0000",
"effect": "effect/skinNeedling",
"effectName": "SkinNeedling"
},
{
"id": 11,
"name": "缩放",
"name": "Zoom",
"color": "#CCEA0000",
"effect": "effect/zoomInOut",
"effectName": "zoomInOut"
Expand All @@ -104,14 +104,14 @@
},
{
"id": 14,
"name": "倒计时",
"name": "Countdown",
"color": "#CCEA0000",
"effect": "effect/countDown",
"effectName": "countDown"
},
{
"id": 15,
"name": "爱心光斑",
"name": "Love spot",
"color": "#CCEA0000",
"effect": "effect/loveSpot",
"effectName": "loveSpot"
Expand Down
Empty file modified app/src/main/assets/effect/70s/config.json
100644 → 100755
Empty file.
Empty file modified app/src/main/assets/effect/70s/resource/fshader.fs
100644 → 100755
Empty file.
Empty file modified app/src/main/assets/effect/70s/resource/vshader.vs
100644 → 100755
Empty file.
46 changes: 23 additions & 23 deletions app/src/main/assets/effect/README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
# 效果说明
### 分屏
# Effect description
### Split Screen
<table>
<tr>
<td>配置</td>
<td>中文说明</td>
<td>Configuration</td>
<td>Chinese description</td>
</tr>
<tr>
<td>towScreen</td>
<td align="center">两分屏</td>
<td align="center">Two-screen</td>
</tr>
<tr>
<td>threeScreen</td>
<td align="center">三分屏</td>
<td align="center">Three-split screen</td>
</tr>
<tr>
<td>fourScreen</td>
<td align="center">四分屏</td>
<td align="center">Quarter screen</td>
</tr>
<tr>
<td>sixScreen</td>
<td align="center">六分屏</td>
<td align="center">Six screen</td>
</tr>
<tr>
<td>nineScreen</td>
<td align="center">九分屏</td>
<td align="center">Nine split screen</td>
</tr>
<tr>
<td>blackWhiteScreen</td>
<td align="center">黑白分屏</td>
<td align="center">Black and white split screen</td>
</tr>
<tr>
<td>blurScreen</td>
<td align="center">模糊分屏</td>
<td align="center">Fuzzy split screen</td>
</tr>
</table>

### 滤镜
### Filter
<table>
<tr>
<td>配置</td>
<td>中文说明</td>
<td>Configuration</td>
<td>Chinese description</td>
</tr>
<tr>
<td>zoomInOut</td>
<td align="center">缩放</td>
<td align="center">Zoom</td>
</tr>
<tr>
<td>soulScale</td>
<td align="center">灵魂出窍</td>
<td align="center">Soul out of the body</td>
</tr>
<tr>
<td>shake</td>
<td align="center">抖动</td>
<td align="center">Jitter</td>
</tr>
<tr>
<td>flashWhite</td>
<td align="center">闪白</td>
<td align="center">Flash white</td>
</tr>
<tr>
<td>skinNeedling</td>
<td align="center">毛刺</td>
<td align="center">glitch</td>
</tr>
<tr>
<td>70s</td>
Expand All @@ -71,18 +71,18 @@
</tr>
<tr>
<td>countDown</td>
<td align="center">倒计时</td>
<td align="center">Countdown</td>
</tr>
<tr>
<td>loveSpot</td>
<td align="center">爱心光斑</td>
<td align="center">Love spot</td>
</tr>
</table>

### 人脸识别
### Face recognition
<table>
<tr>
<td>roseEyeMarkup</td>
<td align="center">玫瑰眼妆</td>
<td align="center">Rose eye makeup</td>
</tr>
</table>
Empty file modified app/src/main/assets/effect/beauty/config.json
100644 → 100755
Empty file.
30 changes: 15 additions & 15 deletions app/src/main/assets/effect/beauty/resource/beauty_adjust.fs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@
precision mediump float;
#endif
varying vec2 textureCoordinate;
uniform sampler2D inputImageTexture; // 输入原图
uniform sampler2D blurTexture; // 原图的高斯模糊纹理
uniform sampler2D highPassBlurTexture; // 高反差保留的高斯模糊纹理
uniform sampler2D inputImageTexture; // Input original image
uniform sampler2D blurTexture; // Gaussian blur texture of the original image
uniform sampler2D highPassBlurTexture; // Gaussian blur texture preserved by high contrast
#ifdef GL_ES
uniform lowp float intensity; // 磨皮程度
uniform lowp float intensity; // Degree of microdermabrasion
#else
uniform float intensity; // 磨皮程度
uniform float intensity; // Degree of microdermabrasion
#endif
void main() {
#ifdef GL_ES
lowp vec4 sourceColor = texture2D(inputImageTexture, textureCoordinate);
lowp vec4 blurColor = texture2D(blurTexture, textureCoordinate);
lowp vec4 highPassBlurColor = texture2D(highPassBlurTexture, textureCoordinate);
// 调节蓝色通道值
// Adjust the blue channel value
mediump float value = clamp((min(sourceColor.b, blurColor.b) - 0.2) * 5.0, 0.0, 1.0);
// 找到模糊之后RGB通道的最大值
// Find the maximum value of the RGB channel after blur
mediump float maxChannelColor = max(max(highPassBlurColor.r, highPassBlurColor.g), highPassBlurColor.b);
// 计算当前的强度
// Calculate current intensity
mediump float currentIntensity = (1.0 - maxChannelColor / (maxChannelColor + 0.2)) * value * intensity;
// 混合输出结果
// Mixed output results
lowp vec3 resultColor = mix(sourceColor.rgb, blurColor.rgb, currentIntensity);
// 输出颜色
// Output color
gl_FragColor = vec4(resultColor, 1.0);
#else
vec4 sourceColor = texture2D(inputImageTexture, textureCoordinate);
vec4 blurColor = texture2D(blurTexture, textureCoordinate);
vec4 highPassBlurColor = texture2D(highPassBlurTexture, textureCoordinate);
// 调节蓝色通道值
// Adjust the blue channel value
float value = clamp((min(sourceColor.b, blurColor.b) - 0.2) * 5.0, 0.0, 1.0);
// 找到模糊之后RGB通道的最大值
// Find the maximum value of the RGB channel after blur
float maxChannelColor = max(max(highPassBlurColor.r, highPassBlurColor.g), highPassBlurColor.b);
// 计算当前的强度
// Calculate current intensity
float currentIntensity = (1.0 - maxChannelColor / (maxChannelColor + 0.2)) * value * intensity;
// 混合输出结果
// Mixed output results
vec3 resultColor = mix(sourceColor.rgb, blurColor.rgb, currentIntensity);
// 输出颜色
// Output color
gl_FragColor = vec4(resultColor, 1.0);
#endif
}
Empty file modified app/src/main/assets/effect/beauty/resource/beauty_adjust.vs
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions app/src/main/assets/effect/beauty/resource/beauty_blur.fs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ uniform sampler2D inputImageTexture;
const int SHIFT_SIZE = 5;
varying vec4 blurShiftCoordinates[SHIFT_SIZE];
void main() {
// 计算当前坐标的颜色值
// Calculate the color value of the current coordinate
vec4 currentColor = texture2D(inputImageTexture, textureCoordinate);
#ifdef GL_ES
mediump vec3 sum = currentColor.rgb;
// 计算偏移坐标的颜色值总和
// Calculate the sum of the color values of the offset coordinates
for (int i = 0; i < SHIFT_SIZE; i++) {
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].xy).rgb;
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].zw).rgb;
}
// 求出平均值
// Find the average
gl_FragColor = vec4(sum * 1.0 / float(2 * SHIFT_SIZE + 1), currentColor.a);
#else
vec3 sum = currentColor.rgb;
// 计算偏移坐标的颜色值总和
// Calculate the sum of the color values of the offset coordinates
for (int i = 0; i < SHIFT_SIZE; i++) {
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].xy).rgb;
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].zw).rgb;
}
// 求出平均值
// Find the average
gl_FragColor = vec4(sum * 1.0 / float(2 * SHIFT_SIZE + 1), currentColor.a);
#endif
}
Empty file modified app/src/main/assets/effect/beauty/resource/beauty_blur.vs
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions app/src/main/assets/effect/beauty/resource/gaussian_pass.fs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ precision mediump float;
#endif
varying vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
// 高斯算子左右偏移值,当偏移值为2时,高斯算子为5 x 5
// The left and right offset value of the Gaussian operator, when the offset value is 2, the Gaussian operator is 5 x 5
const int SHIFT_SIZE = 2;
varying vec4 blurShiftCoordinates[SHIFT_SIZE];
void main() {
// 计算当前坐标的颜色值
// Calculate the color value of the current coordinate
vec4 currentColor = texture2D(inputImageTexture, textureCoordinate);
#ifdef GL_ES
mediump vec3 sum = currentColor.rgb;
// 计算偏移坐标的颜色值总和
// Calculate the sum of the color values of the offset coordinates
for (int i = 0; i < SHIFT_SIZE; i++) {
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].xy).rgb;
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].zw).rgb;
}
// 求出平均值
// Find the average
gl_FragColor = vec4(sum * 1.0 / float(2 * SHIFT_SIZE + 1), currentColor.a);
#else
vec3 sum = currentColor.rgb;
// 计算偏移坐标的颜色值总和
// Calculate the sum of the color values of the offset coordinates
for (int i = 0; i < SHIFT_SIZE; i++) {
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].xy).rgb;
sum += texture2D(inputImageTexture, blurShiftCoordinates[i].zw).rgb;
}
// 求出平均值
// Find the average
gl_FragColor = vec4(sum * 1.0 / float(2 * SHIFT_SIZE + 1), currentColor.a);
#endif
}
6 changes: 3 additions & 3 deletions app/src/main/assets/effect/beauty/resource/gaussian_pass.vs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
attribute vec4 position;
attribute vec4 inputTextureCoordinate;

// 高斯算子左右偏移值,当偏移值为2时,高斯算子为5 x 5
// The left and right offset value of the Gaussian operator, when the offset value is 2, the Gaussian operator is 5 x 5
const int SHIFT_SIZE = 2;

#ifdef GL_ES
Expand All @@ -18,9 +18,9 @@ varying vec4 blurShiftCoordinates[SHIFT_SIZE];
void main() {
gl_Position = position;
textureCoordinate = inputTextureCoordinate.xy;
// 偏移步距
// Offset step
vec2 singleStepOffset = vec2(texelWidthOffset, texelHeightOffset);
// 记录偏移坐标
// Record offset coordinates
for (int i = 0; i < SHIFT_SIZE; i++) {
blurShiftCoordinates[i] = vec4(textureCoordinate.xy - float(i + 1) * singleStepOffset,
textureCoordinate.xy + float(i + 1) * singleStepOffset);
Expand Down
Empty file modified app/src/main/assets/effect/beauty/resource/high_pass.fs
100644 → 100755
Empty file.
Empty file modified app/src/main/assets/effect/beauty/resource/high_pass.vs
100644 → 100755
Empty file.
Empty file modified app/src/main/assets/effect/bigEye/config.json
100644 → 100755
Empty file.
Loading