diff --context --recursive pHash-0.9.0/bindings/java/Makefile.am pHash/bindings/java/Makefile.am *** pHash-0.9.0/bindings/java/Makefile.am 2010-01-21 04:42:44.000000000 +0100 --- pHash/bindings/java/Makefile.am 2010-04-21 11:02:43.000000000 +0200 *************** *** 1,8 **** INCLUDES = -I$(top_srcdir)/src lib_LTLIBRARIES = libpHash-jni.la libpHash_jni_la_SOURCES = pHash-jni.cpp ! include_HEADERS = pHash-jni.h pHash_MVPTree.h ! EXTRA_DIST = *.java README libpHash_jni_la_LIBADD = $(top_srcdir)/src/libpHash.la --- 1,8 ---- INCLUDES = -I$(top_srcdir)/src lib_LTLIBRARIES = libpHash-jni.la libpHash_jni_la_SOURCES = pHash-jni.cpp ! include_HEADERS = org_pHash_pHash.h org_pHash_MVPTree.h ! EXTRA_DIST = org/pHash/*.java README libpHash_jni_la_LIBADD = $(top_srcdir)/src/libpHash.la diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/AudioHash.java pHash/bindings/java/org/pHash/AudioHash.java *** pHash-0.9.0/bindings/java/org/pHash/AudioHash.java 2010-01-20 17:50:25.000000000 +0100 --- pHash/bindings/java/org/pHash/AudioHash.java 2010-04-21 10:29:21.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + public class AudioHash extends Hash { int[] hash; diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/DCTImageHash.java pHash/bindings/java/org/pHash/DCTImageHash.java *** pHash-0.9.0/bindings/java/org/pHash/DCTImageHash.java 2010-01-20 17:51:29.000000000 +0100 --- pHash/bindings/java/org/pHash/DCTImageHash.java 2010-04-21 10:29:21.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + public class DCTImageHash extends ImageHash { long hash; diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/Hash.java pHash/bindings/java/org/pHash/Hash.java *** pHash-0.9.0/bindings/java/org/pHash/Hash.java 2010-01-20 17:49:55.000000000 +0100 --- pHash/bindings/java/org/pHash/Hash.java 2010-04-21 10:29:21.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + abstract class Hash { String filename; diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/ImageHash.java pHash/bindings/java/org/pHash/ImageHash.java *** pHash-0.9.0/bindings/java/org/pHash/ImageHash.java 2010-01-20 17:51:06.000000000 +0100 --- pHash/bindings/java/org/pHash/ImageHash.java 2010-04-21 10:29:20.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + abstract class ImageHash extends Hash { } diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/MHImageHash.java pHash/bindings/java/org/pHash/MHImageHash.java *** pHash-0.9.0/bindings/java/org/pHash/MHImageHash.java 2010-01-20 17:51:48.000000000 +0100 --- pHash/bindings/java/org/pHash/MHImageHash.java 2010-04-21 10:29:21.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + public class MHImageHash extends ImageHash { byte[] hash; diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/MVPTree.java pHash/bindings/java/org/pHash/MVPTree.java *** pHash-0.9.0/bindings/java/org/pHash/MVPTree.java 2010-02-23 06:53:48.000000000 +0100 --- pHash/bindings/java/org/pHash/MVPTree.java 2010-04-21 10:29:21.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + public class MVPTree { String mvpFile; diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/pHash.java pHash/bindings/java/org/pHash/pHash.java *** pHash-0.9.0/bindings/java/org/pHash/pHash.java 2010-02-28 01:32:51.000000000 +0100 --- pHash/bindings/java/org/pHash/pHash.java 2010-04-21 10:29:20.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + import java.io.*; public class pHash diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/TextHash.java pHash/bindings/java/org/pHash/TextHash.java *** pHash-0.9.0/bindings/java/org/pHash/TextHash.java 2010-01-20 18:00:06.000000000 +0100 --- pHash/bindings/java/org/pHash/TextHash.java 2010-04-21 10:29:20.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + public class TextHash extends Hash { String[] hash; diff --context --recursive pHash-0.9.0/bindings/java/org/pHash/VideoHash.java pHash/bindings/java/org/pHash/VideoHash.java *** pHash-0.9.0/bindings/java/org/pHash/VideoHash.java 2010-01-20 17:50:40.000000000 +0100 --- pHash/bindings/java/org/pHash/VideoHash.java 2010-04-21 10:29:20.000000000 +0200 *************** *** 1,3 **** --- 1,5 ---- + package org.pHash; + public class VideoHash extends Hash { long[] hash; diff --context --recursive pHash-0.9.0/bindings/java/org_pHash_MVPTree.h pHash/bindings/java/org_pHash_MVPTree.h *** pHash-0.9.0/bindings/java/org_pHash_MVPTree.h 2010-02-23 06:54:46.000000000 +0100 --- pHash/bindings/java/org_pHash_MVPTree.h 2010-04-21 10:54:18.000000000 +0200 *************** *** 1,34 **** /* DO NOT EDIT THIS FILE - it is machine generated */ #include ! /* Header for class MVPTree */ ! #ifndef _Included_MVPTree ! #define _Included_MVPTree #ifdef __cplusplus extern "C" { #endif /* ! * Class: MVPTree * Method: create ! * Signature: ([LHash;)Z */ ! JNIEXPORT jboolean JNICALL Java_MVPTree_create (JNIEnv *, jobject, jobjectArray); /* ! * Class: MVPTree * Method: query ! * Signature: (LHash;FI)[LHash; */ ! JNIEXPORT jobjectArray JNICALL Java_MVPTree_query (JNIEnv *, jobject, jobject, jfloat, jfloat, jint); /* ! * Class: MVPTree * Method: add ! * Signature: ([LHash;)Z */ ! JNIEXPORT jboolean JNICALL Java_MVPTree_add (JNIEnv *, jobject, jobjectArray); #ifdef __cplusplus --- 1,34 ---- /* DO NOT EDIT THIS FILE - it is machine generated */ #include ! /* Header for class org_pHash_MVPTree */ ! #ifndef _Included_org_pHash_MVPTree ! #define _Included_org_pHash_MVPTree #ifdef __cplusplus extern "C" { #endif /* ! * Class: org_pHash_MVPTree * Method: create ! * Signature: ([Lorg/pHash/Hash;)Z */ ! JNIEXPORT jboolean JNICALL Java_org_pHash_MVPTree_create (JNIEnv *, jobject, jobjectArray); /* ! * Class: org_pHash_MVPTree * Method: query ! * Signature: (Lorg/pHash/Hash;FFI)[Lorg/pHash/Hash; */ ! JNIEXPORT jobjectArray JNICALL Java_org_pHash_MVPTree_query (JNIEnv *, jobject, jobject, jfloat, jfloat, jint); /* ! * Class: org_pHash_MVPTree * Method: add ! * Signature: ([Lorg/pHash/Hash;)Z */ ! JNIEXPORT jboolean JNICALL Java_org_pHash_MVPTree_add (JNIEnv *, jobject, jobjectArray); #ifdef __cplusplus diff --context --recursive pHash-0.9.0/bindings/java/org_pHash_pHash.h pHash/bindings/java/org_pHash_pHash.h *** pHash-0.9.0/bindings/java/org_pHash_pHash.h 2010-01-24 06:21:04.000000000 +0100 --- pHash/bindings/java/org_pHash_pHash.h 2010-04-21 10:53:51.000000000 +0200 *************** *** 1,98 **** /* DO NOT EDIT THIS FILE - it is machine generated */ #include ! /* Header for class pHash */ ! #ifndef _Included_pHash ! #define _Included_pHash #ifdef __cplusplus extern "C" { #endif /* ! * Class: pHash * Method: videoHash ! * Signature: (Ljava/lang/String;)LVideoHash; */ ! JNIEXPORT jobject JNICALL Java_pHash_videoHash (JNIEnv *, jclass, jstring); /* ! * Class: pHash * Method: audioHash ! * Signature: (Ljava/lang/String;)LAudioHash; */ ! JNIEXPORT jobject JNICALL Java_pHash_audioHash (JNIEnv *, jclass, jstring); /* ! * Class: pHash * Method: dctImageHash ! * Signature: (Ljava/lang/String;)LDCTImageHash; */ ! JNIEXPORT jobject JNICALL Java_pHash_dctImageHash (JNIEnv *, jclass, jstring); /* ! * Class: pHash * Method: mhImageHash ! * Signature: (Ljava/lang/String;)LMHImageHash; */ ! JNIEXPORT jobject JNICALL Java_pHash_mhImageHash (JNIEnv *, jclass, jstring); /* ! * Class: pHash * Method: textHash ! * Signature: (Ljava/lang/String;)LTextHash; */ ! JNIEXPORT jobject JNICALL Java_pHash_textHash (JNIEnv *, jclass, jstring); /* ! * Class: pHash * Method: imageDistance ! * Signature: (LImageHash;LImageHash;)D */ ! JNIEXPORT jdouble JNICALL Java_pHash_imageDistance (JNIEnv *, jclass, jobject, jobject); /* ! * Class: pHash * Method: audioDistance ! * Signature: (LAudioHash;LAudioHash;)D */ ! JNIEXPORT jdouble JNICALL Java_pHash_audioDistance (JNIEnv *, jclass, jobject, jobject); /* ! * Class: pHash * Method: videoDistance ! * Signature: (LVideoHash;LVideoHash;I)D */ ! JNIEXPORT jdouble JNICALL Java_pHash_videoDistance (JNIEnv *, jclass, jobject, jobject, jint); /* ! * Class: pHash * Method: textDistance ! * Signature: (LTextHash;LTextHash;)I */ ! JNIEXPORT jint JNICALL Java_pHash_textDistance (JNIEnv *, jclass, jobject, jobject); /* ! * Class: pHash * Method: pHashInit * Signature: ()V */ ! JNIEXPORT void JNICALL Java_pHash_pHashInit (JNIEnv *, jclass); /* ! * Class: pHash * Method: cleanup * Signature: ()V */ ! JNIEXPORT void JNICALL Java_pHash_cleanup (JNIEnv *, jclass); #ifdef __cplusplus --- 1,98 ---- /* DO NOT EDIT THIS FILE - it is machine generated */ #include ! /* Header for class org_pHash_pHash */ ! #ifndef _Included_org_pHash_pHash ! #define _Included_org_pHash_pHash #ifdef __cplusplus extern "C" { #endif /* ! * Class: org_pHash_pHash * Method: videoHash ! * Signature: (Ljava/lang/String;)Lorg/pHash/VideoHash; */ ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_videoHash (JNIEnv *, jclass, jstring); /* ! * Class: org_pHash_pHash * Method: audioHash ! * Signature: (Ljava/lang/String;)Lorg/pHash/AudioHash; */ ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_audioHash (JNIEnv *, jclass, jstring); /* ! * Class: org_pHash_pHash * Method: dctImageHash ! * Signature: (Ljava/lang/String;)Lorg/pHash/DCTImageHash; */ ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_dctImageHash (JNIEnv *, jclass, jstring); /* ! * Class: org_pHash_pHash * Method: mhImageHash ! * Signature: (Ljava/lang/String;)Lorg/pHash/MHImageHash; */ ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_mhImageHash (JNIEnv *, jclass, jstring); /* ! * Class: org_pHash_pHash * Method: textHash ! * Signature: (Ljava/lang/String;)Lorg/pHash/TextHash; */ ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_textHash (JNIEnv *, jclass, jstring); /* ! * Class: org_pHash_pHash * Method: imageDistance ! * Signature: (Lorg/pHash/ImageHash;Lorg/pHash/ImageHash;)D */ ! JNIEXPORT jdouble JNICALL Java_org_pHash_pHash_imageDistance (JNIEnv *, jclass, jobject, jobject); /* ! * Class: org_pHash_pHash * Method: audioDistance ! * Signature: (Lorg/pHash/AudioHash;Lorg/pHash/AudioHash;)D */ ! JNIEXPORT jdouble JNICALL Java_org_pHash_pHash_audioDistance (JNIEnv *, jclass, jobject, jobject); /* ! * Class: org_pHash_pHash * Method: videoDistance ! * Signature: (Lorg/pHash/VideoHash;Lorg/pHash/VideoHash;I)D */ ! JNIEXPORT jdouble JNICALL Java_org_pHash_pHash_videoDistance (JNIEnv *, jclass, jobject, jobject, jint); /* ! * Class: org_pHash_pHash * Method: textDistance ! * Signature: (Lorg/pHash/TextHash;Lorg/pHash/TextHash;)I */ ! JNIEXPORT jint JNICALL Java_org_pHash_pHash_textDistance (JNIEnv *, jclass, jobject, jobject); /* ! * Class: org_pHash_pHash * Method: pHashInit * Signature: ()V */ ! JNIEXPORT void JNICALL Java_org_pHash_pHash_pHashInit (JNIEnv *, jclass); /* ! * Class: org_pHash_pHash * Method: cleanup * Signature: ()V */ ! JNIEXPORT void JNICALL Java_org_pHash_pHash_cleanup (JNIEnv *, jclass); #ifdef __cplusplus diff --context --recursive pHash-0.9.0/bindings/java/pHash-jni.cpp pHash/bindings/java/pHash-jni.cpp *** pHash-0.9.0/bindings/java/pHash-jni.cpp 2010-03-27 22:32:36.000000000 +0100 --- pHash/bindings/java/pHash-jni.cpp 2010-04-21 11:01:33.000000000 +0200 *************** *** 24,32 **** #include "config.h" #include ! #include "pHash-jni.h" #include "pHash.h" ! #include "pHash_MVPTree.h" #ifdef HAVE_AUDIO_HASH #include "audiophash.h" --- 24,32 ---- #include "config.h" #include ! #include "org_pHash_pHash.h" #include "pHash.h" ! #include "org_pHash_MVPTree.h" #ifdef HAVE_AUDIO_HASH #include "audiophash.h" *************** *** 124,137 **** {&audioClass, UINT32ARRAY, audio_distance, AUDIO_HASH, &audioCtor, &audioHash_hash}, }; ! JNIEXPORT jboolean JNICALL Java_MVPTree_create (JNIEnv *e, jobject ob, jobjectArray hashArray) { jint hashLen; if(hashArray == NULL || (hashLen = e->GetArrayLength(hashArray)) == 0) return JNI_FALSE; ! jstring mvp = (jstring)e->GetObjectField(ob, e->GetFieldID(e->FindClass("MVPTree"), "mvpFile", "Ljava/lang/String;")); MVPFile mvpfile; --- 124,137 ---- {&audioClass, UINT32ARRAY, audio_distance, AUDIO_HASH, &audioCtor, &audioHash_hash}, }; ! JNIEXPORT jboolean JNICALL Java_org_pHash_MVPTree_create (JNIEnv *e, jobject ob, jobjectArray hashArray) { jint hashLen; if(hashArray == NULL || (hashLen = e->GetArrayLength(hashArray)) == 0) return JNI_FALSE; ! jstring mvp = (jstring)e->GetObjectField(ob, e->GetFieldID(e->FindClass("org/pHash/MVPTree"), "mvpFile", "Ljava/lang/String;")); MVPFile mvpfile; *************** *** 251,257 **** return (int)ret; } ! JNIEXPORT jobjectArray JNICALL Java_MVPTree_query (JNIEnv *e, jobject ob, jobject hashObj, jfloat radius, jfloat thresh, jint max) { --- 251,257 ---- return (int)ret; } ! JNIEXPORT jobjectArray JNICALL Java_org_pHash_MVPTree_query (JNIEnv *e, jobject ob, jobject hashObj, jfloat radius, jfloat thresh, jint max) { *************** *** 260,266 **** jniHashType type; ph_mvp_init(&mvpfile); ! jstring mvp = (jstring)e->GetObjectField(ob, e->GetFieldID(e->FindClass("MVPTree"), "mvpFile", "Ljava/lang/String;")); mvpfile.filename = strdup(e->GetStringUTFChars(mvp, 0)); --- 260,266 ---- jniHashType type; ph_mvp_init(&mvpfile); ! jstring mvp = (jstring)e->GetObjectField(ob, e->GetFieldID(e->FindClass("org/pHash/MVPTree"), "mvpFile", "Ljava/lang/String;")); mvpfile.filename = strdup(e->GetStringUTFChars(mvp, 0)); *************** *** 381,387 **** return ret; } ! JNIEXPORT jboolean JNICALL Java_MVPTree_add (JNIEnv *e, jobject ob, jobjectArray hashArray) { MVPFile mvpfile; --- 381,387 ---- return ret; } ! JNIEXPORT jboolean JNICALL Java_org_pHash_MVPTree_add (JNIEnv *e, jobject ob, jobjectArray hashArray) { MVPFile mvpfile; *************** *** 392,398 **** if(hashArray == NULL || (len = e->GetArrayLength(hashArray)) == 0) return JNI_FALSE; ! jstring mvp = (jstring)e->GetObjectField(ob, e->GetFieldID(e->FindClass("MVPTree"), "mvpFile", "Ljava/lang/String;")); mvpfile.filename = strdup(e->GetStringUTFChars(mvp, 0)); --- 392,398 ---- if(hashArray == NULL || (len = e->GetArrayLength(hashArray)) == 0) return JNI_FALSE; ! jstring mvp = (jstring)e->GetObjectField(ob, e->GetFieldID(e->FindClass("org/pHash/MVPTree"), "mvpFile", "Ljava/lang/String;")); mvpfile.filename = strdup(e->GetStringUTFChars(mvp, 0)); *************** *** 490,527 **** } ! JNIEXPORT void JNICALL Java_pHash_pHashInit (JNIEnv *e, jclass cl) ! { ! dctImClass = (jclass)e->NewGlobalRef(e->FindClass("DCTImageHash")); ! mhImClass = (jclass)e->NewGlobalRef(e->FindClass("MHImageHash")); ! audioClass = (jclass)e->NewGlobalRef(e->FindClass("AudioHash")); ! vidClass = (jclass)e->NewGlobalRef(e->FindClass("VideoHash")); ! dctImHash_hash = e->GetFieldID(dctImClass, "hash", "J"); mhImHash_hash = e->GetFieldID(mhImClass, "hash", "[B"); audioHash_hash = e->GetFieldID(audioClass, "hash", "[I"); vidHash_hash = e->GetFieldID(vidClass, "hash", "[J"); ! hash_filename = e->GetFieldID(e->FindClass("Hash"), "filename", "Ljava/lang/String;"); dctImCtor = e->GetMethodID(dctImClass, "", "()V"); mhImCtor = e->GetMethodID(mhImClass, "", "()V"); vidCtor = e->GetMethodID(vidClass, "", "()V"); audioCtor = e->GetMethodID(audioClass, "", "()V"); - } ! JNIEXPORT void JNICALL Java_pHash_cleanup (JNIEnv *e, jclass cl) { e->DeleteGlobalRef(mhImClass); e->DeleteGlobalRef(dctImClass); e->DeleteGlobalRef(vidClass); e->DeleteGlobalRef(audioClass); - } ! JNIEXPORT jdouble JNICALL Java_pHash_imageDistance (JNIEnv *e, jclass cl, jobject hash1, jobject hash2) { if(e->IsInstanceOf(hash1, dctImClass) && e->IsInstanceOf(hash2, dctImClass)) --- 490,528 ---- } ! JNIEXPORT void JNICALL Java_org_pHash_pHash_pHashInit (JNIEnv *e, jclass cl) ! { ! printf("[D] function: Java_org_pHash_pHash_pHashInit in pHash-jni.cpp\n"); ! dctImClass = (jclass)e->NewGlobalRef(e->FindClass("org/pHash/DCTImageHash")); ! mhImClass = (jclass)e->NewGlobalRef(e->FindClass("org/pHash/MHImageHash")); ! audioClass = (jclass)e->NewGlobalRef(e->FindClass("org/pHash/AudioHash")); ! vidClass = (jclass)e->NewGlobalRef(e->FindClass("org/pHash/VideoHash")); ! dctImHash_hash = e->GetFieldID(dctImClass, "hash", "J"); mhImHash_hash = e->GetFieldID(mhImClass, "hash", "[B"); audioHash_hash = e->GetFieldID(audioClass, "hash", "[I"); vidHash_hash = e->GetFieldID(vidClass, "hash", "[J"); ! hash_filename = e->GetFieldID(e->FindClass("org/pHash/Hash"), "filename", "Ljava/lang/String;"); dctImCtor = e->GetMethodID(dctImClass, "", "()V"); mhImCtor = e->GetMethodID(mhImClass, "", "()V"); vidCtor = e->GetMethodID(vidClass, "", "()V"); audioCtor = e->GetMethodID(audioClass, "", "()V"); } ! ! JNIEXPORT void JNICALL Java_org_pHash_pHash_cleanup (JNIEnv *e, jclass cl) { e->DeleteGlobalRef(mhImClass); e->DeleteGlobalRef(dctImClass); e->DeleteGlobalRef(vidClass); e->DeleteGlobalRef(audioClass); } ! ! JNIEXPORT jdouble JNICALL Java_org_pHash_pHash_imageDistance (JNIEnv *e, jclass cl, jobject hash1, jobject hash2) { if(e->IsInstanceOf(hash1, dctImClass) && e->IsInstanceOf(hash2, dctImClass)) *************** *** 549,555 **** } #ifdef HAVE_AUDIO_HASH ! JNIEXPORT jdouble JNICALL Java_pHash_audioDistance (JNIEnv *e, jclass cl, jobject audioHash1, jobject audioHash2) { --- 550,556 ---- } #ifdef HAVE_AUDIO_HASH ! JNIEXPORT jdouble JNICALL Java_org_pHash_pHash_audioDistance (JNIEnv *e, jclass cl, jobject audioHash1, jobject audioHash2) { *************** *** 591,597 **** } #endif ! JNIEXPORT jobject JNICALL Java_pHash_dctImageHash (JNIEnv *e, jclass cl, jstring f) { --- 592,598 ---- } #endif ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_dctImageHash (JNIEnv *e, jclass cl, jstring f) { *************** *** 609,615 **** } ! JNIEXPORT jobject JNICALL Java_pHash_mhImageHash (JNIEnv *e, jclass cl, jstring f) { --- 610,616 ---- } ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_mhImageHash (JNIEnv *e, jclass cl, jstring f) { *************** *** 635,641 **** } #ifdef HAVE_VIDEO_HASH ! JNIEXPORT jdouble JNICALL Java_pHash_videoDistance (JNIEnv *e, jclass cl, jobject vidHash1, jobject vidHash2, jint thresh) { --- 636,642 ---- } #ifdef HAVE_VIDEO_HASH ! JNIEXPORT jdouble JNICALL Java_org_pHash_pHash_videoDistance (JNIEnv *e, jclass cl, jobject vidHash1, jobject vidHash2, jint thresh) { *************** *** 663,669 **** e->ReleaseLongArrayElements(hash2, (jlong*)hash2_n, 0); return sim; } ! JNIEXPORT jobject JNICALL Java_pHash_videoHash (JNIEnv *e, jclass cl, jstring f) { --- 664,670 ---- e->ReleaseLongArrayElements(hash2, (jlong*)hash2_n, 0); return sim; } ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_videoHash (JNIEnv *e, jclass cl, jstring f) { *************** *** 687,693 **** } #endif #ifdef HAVE_AUDIO_HASH ! JNIEXPORT jobject JNICALL Java_pHash_audioHash (JNIEnv *e, jclass cl, jstring f) { jintArray ret = NULL; --- 688,694 ---- } #endif #ifdef HAVE_AUDIO_HASH ! JNIEXPORT jobject JNICALL Java_org_pHash_pHash_audioHash (JNIEnv *e, jclass cl, jstring f) { jintArray ret = NULL; *************** *** 726,728 **** --- 727,730 ---- } #endif + diff --context --recursive pHash-0.9.0/bindings/java/README pHash/bindings/java/README *** pHash-0.9.0/bindings/java/README 2010-01-21 22:13:29.000000000 +0100 --- pHash/bindings/java/README 2010-04-21 11:11:06.000000000 +0200 *************** *** 1,11 **** ! How to use Java bindings: ! 1) Configure pHash with Java support (--enable-java) ! 2) Build pHash ! 3) Compile Java classes if not done already: javac *.java ! 4) Install pHash (make install) ! 5) java -Djava.library.path=/usr/local/lib pHash -mh img1.jpg img2.jpg ! See pHash.java for additional options ! Note: When using the MVP storage functions, the number of hashes needed to create the tree is the leaf ! capacity + 3 (28 by default). --- 1,55 ---- ! A. How to use the Java bindings: ! ============================================================ ! -) Configure pHash with Java support (--enable-java) ! ! -) Build pHash ! ! -) Change your working directory to ./bindings/java. ! ! This is necessary for the Java classpath to be correctly set. ! The Java classes of pHash are residing in the package ! "org.pHash". ! ! -) Compile Java classes if not done already: ! ! $ javac org/pHash/*.java ! ! -) Install pHash (make install) ! ! -) Run example program utilizing the Mexican/Harr hat wavelet based ! image hash: ! ! java -Djava.library.path=/usr/local/lib org.pHash.pHash \ ! -mh img1.jpg img2.jpg ! ! See pHash.java for additional options. ! ! Note: When using the MVP storage functions, the number of ! hashes needed to create the tree is the leaf capacity + 3 (28 ! by default). ! ! ! B. How to hack on the Java bindings: ! ============================================================ ! ! -) Declare native function prototypes in Java source code. ! ! -) Generate C/C++ header files for all function prototypes in ! Java files: ! ! $ javah -jni -classpath . org.pHash.pHash ! $ javah -jni -classpath . org.pHash.MVPTree ! ! -) Implement functions for newly generated function prototypes in ! e.g. pHash-jni.cpp. ! ! -) Test pHash using the Java bindings (see section A). ! ! Things to consider ! ------------------------------------------------------------ ! ! It is a good programming practice to encapsulate all JNI calls ! inside a "service provider". Though no such service provider API ! exists at the moment the pHash class is a good starting point.