Skip to content

Commit

Permalink
Upload c code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunzxyong committed Oct 22, 2018
1 parent f2ffaa9 commit b65bac6
Show file tree
Hide file tree
Showing 974 changed files with 150,831 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:bintray-release:0.6.1'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.novoda:bintray-release:0.8.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
1 change: 1 addition & 0 deletions libjpeg-turbo-sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
23 changes: 23 additions & 0 deletions libjpeg-turbo-sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {

}
17 changes: 17 additions & 0 deletions libjpeg-turbo-sdk/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Sunzxyong/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
8 changes: 8 additions & 0 deletions libjpeg-turbo-sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zxy.libjpegturbo">

<application>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.zxy.libjpegturbo;

import android.graphics.Bitmap;

/**
* Created by zhengxiaoyong on 2017/2/23.
*/
public class JpegTurboCompressor {

public static boolean compress(Bitmap bitmap, String outfile, int quality) {
return nativeCompress(bitmap, outfile, quality, true);
}

public static String getVersion() {
return "libjpeg-turbo api version : " + getLibjpegTurboVersion() + ", libjpeg api version : " + getLibjpegVersion();
}

static {
System.loadLibrary("tiny");
}

private static native boolean nativeCompress(Bitmap bitmap, String outfile, int quality, boolean optimize);

private static native int getLibjpegTurboVersion();

private static native int getLibjpegVersion();

}
21 changes: 21 additions & 0 deletions libjpeg-turbo-sdk/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

# LOCAL_MODULE := libjpeg-turbo
# LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libjpeg-turbo.so
LOCAL_MODULE := libjpeg-turbo-static
LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/libjpeg-turbo-static.a

# include $(PREBUILT_SHARED_LIBRARY)
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := tiny
# LOCAL_SHARED_LIBRARIES := libjpeg-turbo
LOCAL_STATIC_LIBRARIES := libjpeg-turbo-static
LOCAL_SRC_FILES := com_zxy_libjpegturbo_JpegTurboCompressor.c
LOCAL_LDLIBS := -ljnigraphics -llog
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/include \

include $(BUILD_SHARED_LIBRARY)
7 changes: 7 additions & 0 deletions libjpeg-turbo-sdk/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
NDK_TOOLCHAIN_VERSION := 4.9
APP_PLATFORM := android-14
APP_ABI := armeabi,armeabi-v7a,arm64-v8a,x86
APP_OPTIM := release
APP_BUILD_SCRIPT := $(LOCAL_PATH)/Android.mk
Loading

0 comments on commit b65bac6

Please sign in to comment.