Skip to content

Commit 74bcab8

Browse files
Copilotwysaid
andauthored
Convert Chinese comments and documentation to English (#552)
* Initial plan * Convert Chinese comments to English in C++ files Co-authored-by: wysaid <[email protected]> * Convert Chinese comments to English in filter and common files Co-authored-by: wysaid <[email protected]> * Convert Chinese comments to English in Java and remaining files Co-authored-by: wysaid <[email protected]> * Fix remaining Chinese strings identified by code review Co-authored-by: wysaid <[email protected]> * Complete internationalization improvements Co-authored-by: wysaid <[email protected]> * Remove CodeQL artifact and add to gitignore Co-authored-by: wysaid <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: wysaid <[email protected]>
1 parent f62a158 commit 74bcab8

File tree

63 files changed

+181
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+181
-178
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ objs/
1111
obj/
1212
build/
1313
library/.cxx/
14-
.kotlin/
14+
.kotlin/
15+
16+
# CodeQL
17+
_codeql_detected_source_root

cgeDemo/src/main/java/org/wysaid/cgeDemo/ImageDemoActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ public void run() {
253253
content += String.format("Accuracy: %g, center %g, %g, eyeDis: %g\n", face.confidence(), pnt.x, pnt.y, eyeDis);
254254
canvas.drawRect((int) (pnt.x - eyeDis * 1.5f), (int) (pnt.y - eyeDis * 1.5f), (int) (pnt.x + eyeDis * 1.5f), (int) (pnt.y + eyeDis * 1.5f), paint);
255255

256-
//眼睛中心
256+
// Eye center
257257
canvas.drawRect((int) (pnt.x - 2.0f), (int) (pnt.y - 2.0f), (int) (pnt.x + 2.0f), (int) (pnt.y + 2.0f), paint);
258258

259-
//双眼
259+
// Both eyes
260260
canvas.drawRect((int) (pnt.x - halfEyeDis - 2.0f), (int) (pnt.y - 2.0f), (int) (pnt.x - halfEyeDis + 2.0f), (int) (pnt.y + 2.0f), paint);
261261
canvas.drawRect((int) (pnt.x + halfEyeDis - 2.0f), (int) (pnt.y - 2.0f), (int) (pnt.x + halfEyeDis + 2.0f), (int) (pnt.y + 2.0f), paint);
262262
}

cgeDemo/src/main/java/org/wysaid/cgeDemo/MainActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class MainActivity extends AppCompatActivity {
3131

3232
public static final String EFFECT_CONFIGS[] = {
3333
"",
34-
"@curve RGB(0,255)(255,0) @style cm mapping0.jpg 80 80 8 3", // ASCII art (字符画效果)
34+
"@curve RGB(0,255)(255,0) @style cm mapping0.jpg 80 80 8 3", // ASCII art effect
3535
"@style waveform 0.01 0.01 0.4 0.4",
3636
"@beautify face 1 480 640", //Beautify
3737
"@adjust lut edgy_amber.png",
@@ -144,7 +144,7 @@ public class MainActivity extends AppCompatActivity {
144144
public CGENativeLibrary.LoadImageCallback mLoadImageCallback = new CGENativeLibrary.LoadImageCallback() {
145145

146146
//Notice: the 'name' passed in is just what you write in the rule, e.g: 1.jpg
147-
//注意, 这里回传的name不包含任何路径名, 仅为具体的图片文件名如 1.jpg
147+
// Note: The name returned here does not contain any path name, only the specific image filename such as 1.jpg
148148
@Override
149149
public Bitmap loadImage(String name, Object arg) {
150150

@@ -167,8 +167,8 @@ public void loadImageOK(Bitmap bmp, Object arg) {
167167

168168
//The bitmap is which you returned at 'loadImage'.
169169
//You can call recycle when this function is called, or just keep it for further usage.
170-
//唯一不需要马上recycle的应用场景为 多个不同的滤镜都使用到相同的bitmap
171-
//那么可以选择缓存起来。
170+
// The only scenario where immediate recycle is not needed is when multiple different filters use the same bitmap
171+
// Then it can be cached.
172172
bmp.recycle();
173173
}
174174
};
@@ -251,7 +251,7 @@ protected void onCreate(Bundle savedInstanceState) {
251251
}
252252

253253
//The second param will be passed as the second arg of the callback function.
254-
//第二个参数根据自身需要设置, 将作为 loadImage 第二个参数回传
254+
// The second parameter is set according to your needs and will be passed back as the second parameter of loadImage
255255
CGENativeLibrary.setLoadImageCallback(mLoadImageCallback, null);
256256
PermissionUtil.verifyStoragePermissions(this);
257257
}

cgeDemo/src/main/java/org/wysaid/cgeDemo/VideoPlayerDemoActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ public void onClick(View v) {
210210
mPlayerView.setPlayerInitializeCallback(new VideoPlayerGLSurfaceView.PlayerInitializeCallback() {
211211
@Override
212212
public void initPlayer(final MediaPlayer player) {
213-
//针对网络视频进行进度检查
213+
// Check progress for network videos
214214
player.setOnBufferingUpdateListener(new MediaPlayer.OnBufferingUpdateListener() {
215215
@Override
216216
public void onBufferingUpdate(MediaPlayer mp, int percent) {
217217
Log.i(Common.LOG_TAG, "Buffer update: " + percent);
218218
if (percent == 100) {
219-
Log.i(Common.LOG_TAG, "缓冲完毕!");
219+
Log.i(Common.LOG_TAG, "Buffering complete!");
220220
player.setOnBufferingUpdateListener(null);
221221
}
222222
}

library/src/main/java/org/wysaid/algorithm/AlgorithmUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created by wysaid on 16/3/9.
55
66
* blog: wysaid.org
7-
* Description: algorithm目录的所有类都是为了OpenGL 辅助使用, 所以 float 使用较多.
7+
* Description: All classes in the algorithm directory are for OpenGL auxiliary use, so float is used extensively.
88
*/
99
public class AlgorithmUtil {
1010
public static float getNormalizeScaling(final float x, final float y, final float z) {

library/src/main/java/org/wysaid/common/ProgramObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ProgramObject {
1414
private int mProgramID;
1515
private ShaderObject mVertexShader, mFragmentShader;
1616

17-
//单独初始化之后可以进行一些 attribute location 的绑定操作
17+
// After separate initialization, some attribute location binding operations can be performed
1818
//之后再进行init
1919
public ProgramObject() {
2020
mProgramID = GLES20.glCreateProgram();

library/src/main/java/org/wysaid/common/SharedContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class SharedContext {
2929

3030
private static int mBitsR = 8, mBitsG = 8, mBitsB = 8, mBitsA = 8;
3131

32-
//注意, 设置之后将影响之后的所有操作
32+
// Note: After setting, it will affect all subsequent operations
3333
static public void setContextColorBits(int r, int g, int b, int a) {
3434
mBitsR = r;
3535
mBitsG = g;

library/src/main/java/org/wysaid/myUtils/FileUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static String getPathInPackage(Context context, boolean grantPermissions)
4949
if(context == null || packageFilesDirectory != null)
5050
return packageFilesDirectory;
5151

52-
//手机不存在sdcard, 需要使用 data/data/name.of.package/files 目录
52+
// Phone does not have sdcard, need to use data/data/name.of.package/files directory
5353
String path = context.getFilesDir() + "/" + mDefaultFolder;
5454
File file = new File(path);
5555

library/src/main/java/org/wysaid/myUtils/ImageUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static String saveBitmap(Bitmap bmp, String filename) {
4343
}
4444

4545
public static class FaceRects {
46-
public int numOfFaces; // 实际检测出的人脸数
46+
public int numOfFaces; // Number of faces actually detected
4747
public FaceDetector.Face[] faces; // faces.length >= numOfFaces
4848
}
4949

library/src/main/java/org/wysaid/nativePort/CGEFaceTracker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ protected void finalize() throws Throwable {
108108
// sIsTrackerSetup = true;
109109
// }
110110

111-
//命名Simple 是因为后续将接入更加完整的结果数据(包含66个点的网格等等)
111+
// Named Simple because more complete result data (including 66-point mesh etc.) will be integrated in the future
112112
public FaceResultSimple detectFaceWithSimpleResult(Bitmap bmp, boolean drawFeature) {
113113
float[] result = nativeDetectFaceWithSimpleResult(mNativeAddress, bmp, drawFeature);
114114

0 commit comments

Comments
 (0)