parent
4fd50bb91b
commit
3ad5d29d36
Before Width: | Height: | Size: 445 KiB |
Before Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 18 KiB |
@ -0,0 +1,44 @@ |
||||
# For more information about using CMake with Android Studio, read the |
||||
# documentation: https://d.android.com/studio/projects/add-native-code.html |
||||
|
||||
# Sets the minimum version of CMake required to build the native library. |
||||
|
||||
cmake_minimum_required(VERSION 3.4.1) |
||||
|
||||
# Creates and names a library, sets it as either STATIC |
||||
# or SHARED, and provides the relative paths to its source code. |
||||
# You can define multiple libraries, and CMake builds them for you. |
||||
# Gradle automatically packages shared libraries with your APK. |
||||
|
||||
add_library( # Sets the name of the library. |
||||
native-lib |
||||
|
||||
# Sets the library as a shared library. |
||||
SHARED |
||||
|
||||
# Provides a relative path to your source file(s). |
||||
src/main/cpp/native-lib.cpp ) |
||||
|
||||
# Searches for a specified prebuilt library and stores the path as a |
||||
# variable. Because CMake includes system libraries in the search path by |
||||
# default, you only need to specify the name of the public NDK library |
||||
# you want to add. CMake verifies that the library exists before |
||||
# completing its build. |
||||
|
||||
find_library( # Sets the name of the path variable. |
||||
log-lib |
||||
|
||||
# Specifies the name of the NDK library that |
||||
# you want CMake to locate. |
||||
log ) |
||||
|
||||
# Specifies libraries CMake should link to your target library. You |
||||
# can link multiple libraries, such as libraries you define in this |
||||
# build script, prebuilt third-party libraries, or system libraries. |
||||
|
||||
target_link_libraries( # Specifies the target library. |
||||
native-lib |
||||
|
||||
# Links the target library to the log library |
||||
# included in the NDK. |
||||
${log-lib} ) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1,4 @@ |
||||
<manifest package="com.zwy.nsfw"/> |
||||
<manifest package="com.zwy.nsfw" xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> |
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> |
||||
</manifest> |
||||
|
@ -0,0 +1,24 @@ |
||||
#include <jni.h> |
||||
#include <string> |
||||
|
||||
extern "C" |
||||
JNIEXPORT void JNICALL |
||||
Java_com_zwy_nsfw_JniLoader_argb2bgr(JNIEnv *env, jobject thiz, |
||||
jbyteArray rgbSrc_, |
||||
jbyteArray bgrDesc_) { |
||||
jbyte *rgbSrc = env->GetByteArrayElements(rgbSrc_, NULL); |
||||
jbyte *bgrDesc = env->GetByteArrayElements(bgrDesc_, NULL); |
||||
printf("s[]=%s\n","C+++++++++");/*输出数组字符串s[]=Hello,Comrade*/ |
||||
int wh = env->GetArrayLength(rgbSrc_) / 4 ; |
||||
|
||||
|
||||
//#pragma omp parallel for
|
||||
for (int i = 0; i < wh; ++i) { |
||||
bgrDesc[i * 3] = rgbSrc[i * 4 + 2]; //B
|
||||
bgrDesc[i * 3 + 1] = rgbSrc[i * 4 + 1]; //G
|
||||
bgrDesc[i * 3 + 2] = rgbSrc[i * 4 ]; //R
|
||||
} |
||||
|
||||
env->ReleaseByteArrayElements(rgbSrc_, rgbSrc, JNI_ABORT); |
||||
env->ReleaseByteArrayElements(bgrDesc_, bgrDesc, JNI_COMMIT); |
||||
} |
@ -0,0 +1,10 @@ |
||||
package com.zwy.nsfw; |
||||
|
||||
public class JniLoader { |
||||
|
||||
static { |
||||
System.loadLibrary("native-lib"); |
||||
} |
||||
|
||||
public static native void argb2bgr(byte[] rgbSrc,byte[] bgrDesc); |
||||
} |
@ -0,0 +1,17 @@ |
||||
apply plugin: 'com.android.library' |
||||
|
||||
android { |
||||
compileSdkVersion 28 |
||||
|
||||
defaultConfig { |
||||
minSdkVersion 15 |
||||
targetSdkVersion 28 |
||||
} |
||||
|
||||
buildTypes { |
||||
release { |
||||
minifyEnabled false |
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,199 @@ |
||||
/* |
||||
* This file is auto-generated. DO NOT MODIFY. |
||||
* Original file: /Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/aidl/org/opencv/engine/OpenCVEngineInterface.aidl |
||||
*/ |
||||
package org.opencv.engine; |
||||
/** |
||||
* Class provides a Java interface for OpenCV Engine Service. It's synchronous with native OpenCVEngine class. |
||||
*/ |
||||
public interface OpenCVEngineInterface extends android.os.IInterface |
||||
{ |
||||
/** Local-side IPC implementation stub class. */ |
||||
public static abstract class Stub extends android.os.Binder implements org.opencv.engine.OpenCVEngineInterface |
||||
{ |
||||
private static final java.lang.String DESCRIPTOR = "org.opencv.engine.OpenCVEngineInterface"; |
||||
/** Construct the stub at attach it to the interface. */ |
||||
public Stub() |
||||
{ |
||||
this.attachInterface(this, DESCRIPTOR); |
||||
} |
||||
/** |
||||
* Cast an IBinder object into an org.opencv.engine.OpenCVEngineInterface interface, |
||||
* generating a proxy if needed. |
||||
*/ |
||||
public static org.opencv.engine.OpenCVEngineInterface asInterface(android.os.IBinder obj) |
||||
{ |
||||
if ((obj==null)) { |
||||
return null; |
||||
} |
||||
android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR); |
||||
if (((iin!=null)&&(iin instanceof org.opencv.engine.OpenCVEngineInterface))) { |
||||
return ((org.opencv.engine.OpenCVEngineInterface)iin); |
||||
} |
||||
return new org.opencv.engine.OpenCVEngineInterface.Stub.Proxy(obj); |
||||
} |
||||
@Override public android.os.IBinder asBinder() |
||||
{ |
||||
return this; |
||||
} |
||||
@Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException |
||||
{ |
||||
java.lang.String descriptor = DESCRIPTOR; |
||||
switch (code) |
||||
{ |
||||
case INTERFACE_TRANSACTION: |
||||
{ |
||||
reply.writeString(descriptor); |
||||
return true; |
||||
} |
||||
case TRANSACTION_getEngineVersion: |
||||
{ |
||||
data.enforceInterface(descriptor); |
||||
int _result = this.getEngineVersion(); |
||||
reply.writeNoException(); |
||||
reply.writeInt(_result); |
||||
return true; |
||||
} |
||||
case TRANSACTION_getLibPathByVersion: |
||||
{ |
||||
data.enforceInterface(descriptor); |
||||
java.lang.String _arg0; |
||||
_arg0 = data.readString(); |
||||
java.lang.String _result = this.getLibPathByVersion(_arg0); |
||||
reply.writeNoException(); |
||||
reply.writeString(_result); |
||||
return true; |
||||
} |
||||
case TRANSACTION_installVersion: |
||||
{ |
||||
data.enforceInterface(descriptor); |
||||
java.lang.String _arg0; |
||||
_arg0 = data.readString(); |
||||
boolean _result = this.installVersion(_arg0); |
||||
reply.writeNoException(); |
||||
reply.writeInt(((_result)?(1):(0))); |
||||
return true; |
||||
} |
||||
case TRANSACTION_getLibraryList: |
||||
{ |
||||
data.enforceInterface(descriptor); |
||||
java.lang.String _arg0; |
||||
_arg0 = data.readString(); |
||||
java.lang.String _result = this.getLibraryList(_arg0); |
||||
reply.writeNoException(); |
||||
reply.writeString(_result); |
||||
return true; |
||||
} |
||||
default: |
||||
{ |
||||
return super.onTransact(code, data, reply, flags); |
||||
} |
||||
} |
||||
} |
||||
private static class Proxy implements org.opencv.engine.OpenCVEngineInterface |
||||
{ |
||||
private android.os.IBinder mRemote; |
||||
Proxy(android.os.IBinder remote) |
||||
{ |
||||
mRemote = remote; |
||||
} |
||||
@Override public android.os.IBinder asBinder() |
||||
{ |
||||
return mRemote; |
||||
} |
||||
public java.lang.String getInterfaceDescriptor() |
||||
{ |
||||
return DESCRIPTOR; |
||||
} |
||||
@Override public int getEngineVersion() throws android.os.RemoteException |
||||
{ |
||||
android.os.Parcel _data = android.os.Parcel.obtain(); |
||||
android.os.Parcel _reply = android.os.Parcel.obtain(); |
||||
int _result; |
||||
try { |
||||
_data.writeInterfaceToken(DESCRIPTOR); |
||||
mRemote.transact(Stub.TRANSACTION_getEngineVersion, _data, _reply, 0); |
||||
_reply.readException(); |
||||
_result = _reply.readInt(); |
||||
} |
||||
finally { |
||||
_reply.recycle(); |
||||
_data.recycle(); |
||||
} |
||||
return _result; |
||||
} |
||||
@Override public java.lang.String getLibPathByVersion(java.lang.String version) throws android.os.RemoteException |
||||
{ |
||||
android.os.Parcel _data = android.os.Parcel.obtain(); |
||||
android.os.Parcel _reply = android.os.Parcel.obtain(); |
||||
java.lang.String _result; |
||||
try { |
||||
_data.writeInterfaceToken(DESCRIPTOR); |
||||
_data.writeString(version); |
||||
mRemote.transact(Stub.TRANSACTION_getLibPathByVersion, _data, _reply, 0); |
||||
_reply.readException(); |
||||
_result = _reply.readString(); |
||||
} |
||||
finally { |
||||
_reply.recycle(); |
||||
_data.recycle(); |
||||
} |
||||
return _result; |
||||
} |
||||
/** |
||||
* Tries to install defined version of OpenCV from Google Play Market. |
||||
* @param OpenCV version. |
||||
* @return Returns true if installation was successful or OpenCV package has been already installed. |
||||
*/ |
||||
@Override public boolean installVersion(java.lang.String version) throws android.os.RemoteException |
||||
{ |
||||
android.os.Parcel _data = android.os.Parcel.obtain(); |
||||
android.os.Parcel _reply = android.os.Parcel.obtain(); |
||||
boolean _result; |
||||
try { |
||||
_data.writeInterfaceToken(DESCRIPTOR); |
||||
_data.writeString(version); |
||||
mRemote.transact(Stub.TRANSACTION_installVersion, _data, _reply, 0); |
||||
_reply.readException(); |
||||
_result = (0!=_reply.readInt()); |
||||
} |
||||
finally { |
||||
_reply.recycle(); |
||||
_data.recycle(); |
||||
} |
||||
return _result; |
||||
} |
||||
@Override public java.lang.String getLibraryList(java.lang.String version) throws android.os.RemoteException |
||||
{ |
||||
android.os.Parcel _data = android.os.Parcel.obtain(); |
||||
android.os.Parcel _reply = android.os.Parcel.obtain(); |
||||
java.lang.String _result; |
||||
try { |
||||
_data.writeInterfaceToken(DESCRIPTOR); |
||||
_data.writeString(version); |
||||
mRemote.transact(Stub.TRANSACTION_getLibraryList, _data, _reply, 0); |
||||
_reply.readException(); |
||||
_result = _reply.readString(); |
||||
} |
||||
finally { |
||||
_reply.recycle(); |
||||
_data.recycle(); |
||||
} |
||||
return _result; |
||||
} |
||||
} |
||||
static final int TRANSACTION_getEngineVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); |
||||
static final int TRANSACTION_getLibPathByVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); |
||||
static final int TRANSACTION_installVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); |
||||
static final int TRANSACTION_getLibraryList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); |
||||
} |
||||
public int getEngineVersion() throws android.os.RemoteException; |
||||
public java.lang.String getLibPathByVersion(java.lang.String version) throws android.os.RemoteException; |
||||
/** |
||||
* Tries to install defined version of OpenCV from Google Play Market. |
||||
* @param OpenCV version. |
||||
* @return Returns true if installation was successful or OpenCV package has been already installed. |
||||
*/ |
||||
public boolean installVersion(java.lang.String version) throws android.os.RemoteException; |
||||
public java.lang.String getLibraryList(java.lang.String version) throws android.os.RemoteException; |
||||
} |
@ -0,0 +1,13 @@ |
||||
/** |
||||
* Automatically generated file. DO NOT MODIFY |
||||
*/ |
||||
package org.opencv; |
||||
|
||||
public final class BuildConfig { |
||||
public static final boolean DEBUG = Boolean.parseBoolean("true"); |
||||
public static final String APPLICATION_ID = "org.opencv"; |
||||
public static final String BUILD_TYPE = "debug"; |
||||
public static final String FLAVOR = ""; |
||||
public static final int VERSION_CODE = -1; |
||||
public static final String VERSION_NAME = ""; |
||||
} |
@ -0,0 +1,9 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
||||
package="org.opencv" > |
||||
|
||||
<uses-sdk |
||||
android:minSdkVersion="15" |
||||
android:targetSdkVersion="28" /> |
||||
|
||||
</manifest> |
@ -0,0 +1 @@ |
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":-1,"enabled":true,"outputFile":"openCVLibrary340-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"org.opencv","split":""}}] |
@ -0,0 +1 @@ |
||||
{} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/debug/jniLibs"/></dataSet></merger> |
@ -0,0 +1,2 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/debug/shaders"/></dataSet></merger> |
@ -0,0 +1,2 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/assets"/><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/debug/assets"/></dataSet></merger> |
@ -0,0 +1 @@ |
||||
#Mon May 20 14:42:33 CST 2019 |
@ -0,0 +1,11 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<resources> |
||||
<declare-styleable name="CameraBridgeViewBase"> |
||||
<attr format="boolean" name="show_fps"/> |
||||
<attr format="integer" name="camera_id"> |
||||
<enum name="any" value="-1"/> |
||||
<enum name="back" value="99"/> |
||||
<enum name="front" value="98"/> |
||||
</attr> |
||||
</declare-styleable> |
||||
</resources> |
@ -0,0 +1,16 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/res"/><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/build/generated/res/rs/debug"/><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/res"><file path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/main/res/values/attrs.xml" qualifiers=""><declare-styleable name="CameraBridgeViewBase"> |
||||
<attr format="boolean" name="show_fps"/> |
||||
<attr format="integer" name="camera_id"> |
||||
<enum name="any" value="-1"/> |
||||
<enum name="back" value="99"/> |
||||
<enum name="front" value="98"/> |
||||
</attr> |
||||
</declare-styleable></file></source><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/build/generated/res/rs/debug"/><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/jason/AndroidStudioProjects/open_nsfw_android/openCVLibrary340/src/debug/res"/></dataSet><mergedItems><configuration qualifiers=""><declare-styleable name="CameraBridgeViewBase"> |
||||
<attr format="boolean" name="show_fps"/> |
||||
<attr format="integer" name="camera_id"> |
||||
<enum name="any" value="-1"/> |
||||
<enum name="back" value="99"/> |
||||
<enum name="front" value="98"/> |
||||
</attr> |
||||
</declare-styleable></configuration></mergedItems></merger> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue