diff --git a/java/README b/java/README index 0146ed31..87d3181b 100644 --- a/java/README +++ b/java/README @@ -3,9 +3,9 @@ TurboJPEG/OSS JNI Wrapper TurboJPEG/OSS can optionally be built with a Java Native Interface wrapper, which allows the TurboJPEG/OSS dynamic library to be loaded and used directly -from Java applications. The Java front end for this is defined in -TurboJPEG.java, which should be located in the same directory as this README -file. TurboJPEG.java is licensed under a BSD-style license, so it can be +from Java applications. The Java front end for this is defined in several +classes located under org/libjpegturbo/turbojpeg. The source code for these +Java classes is licensed under a BSD-style license, so the files can be incorporated directly into both open source and proprietary projects without restriction. @@ -13,7 +13,7 @@ TJExample.java, which should also be located in the same directory as this README file, demonstrates how to use the TurboJPEG/OSS Java front end to compress and decompress JPEG images in memory. - javac *.java + javac TJExample.java builds .class files for both the front end and example code. diff --git a/java/TJ.h b/java/TJ.h deleted file mode 100644 index 25271179..00000000 --- a/java/TJ.h +++ /dev/null @@ -1,47 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class TJ */ - -#ifndef _Included_TJ -#define _Included_TJ -#ifdef __cplusplus -extern "C" { -#endif -#undef TJ_SAMP444 -#define TJ_SAMP444 0L -#undef TJ_SAMP422 -#define TJ_SAMP422 1L -#undef TJ_SAMP420 -#define TJ_SAMP420 2L -#undef TJ_GRAYSCALE -#define TJ_GRAYSCALE 3L -#undef TJ_BGR -#define TJ_BGR 1L -#undef TJ_BOTTOMUP -#define TJ_BOTTOMUP 2L -#undef TJ_FORCEMMX -#define TJ_FORCEMMX 8L -#undef TJ_FORCESSE -#define TJ_FORCESSE 16L -#undef TJ_FORCESSE2 -#define TJ_FORCESSE2 32L -#undef TJ_ALPHAFIRST -#define TJ_ALPHAFIRST 64L -#undef TJ_FORCESSE3 -#define TJ_FORCESSE3 128L -#undef TJ_FASTUPSAMPLE -#define TJ_FASTUPSAMPLE 256L -#undef TJ_YUV -#define TJ_YUV 512L -/* - * Class: TJ - * Method: bufSize - * Signature: (II)J - */ -JNIEXPORT jlong JNICALL Java_TJ_bufSize - (JNIEnv *, jclass, jint, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/java/TJCompressor.h b/java/TJCompressor.h deleted file mode 100644 index 15e659fa..00000000 --- a/java/TJCompressor.h +++ /dev/null @@ -1,37 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class TJCompressor */ - -#ifndef _Included_TJCompressor -#define _Included_TJCompressor -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: TJCompressor - * Method: init - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_TJCompressor_init - (JNIEnv *, jobject); - -/* - * Class: TJCompressor - * Method: destroy - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_TJCompressor_destroy - (JNIEnv *, jobject); - -/* - * Class: TJCompressor - * Method: compress - * Signature: ([BIIII[BIII)J - */ -JNIEXPORT jlong JNICALL Java_TJCompressor_compress - (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/java/TJDecompressor.h b/java/TJDecompressor.h deleted file mode 100644 index 4b61ac9b..00000000 --- a/java/TJDecompressor.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class TJDecompressor */ - -#ifndef _Included_TJDecompressor -#define _Included_TJDecompressor -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: TJDecompressor - * Method: init - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_TJDecompressor_init - (JNIEnv *, jobject); - -/* - * Class: TJDecompressor - * Method: destroy - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_TJDecompressor_destroy - (JNIEnv *, jobject); - -/* - * Class: TJDecompressor - * Method: decompressHeader - * Signature: ([BJ)LTJHeaderInfo; - */ -JNIEXPORT jobject JNICALL Java_TJDecompressor_decompressHeader - (JNIEnv *, jobject, jbyteArray, jlong); - -/* - * Class: TJDecompressor - * Method: decompress - * Signature: ([BJ[BIIIII)V - */ -JNIEXPORT void JNICALL Java_TJDecompressor_decompress - (JNIEnv *, jobject, jbyteArray, jlong, jbyteArray, jint, jint, jint, jint, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/java/TJExample.java b/java/TJExample.java index 991b8eb4..f6c2e43b 100644 --- a/java/TJExample.java +++ b/java/TJExample.java @@ -32,6 +32,7 @@ */ import java.io.*; +import org.libjpegturbo.turbojpeg.*; public class TJExample { diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java new file mode 100644 index 00000000..2d4d89d6 --- /dev/null +++ b/java/org/libjpegturbo/turbojpeg/TJ.java @@ -0,0 +1,53 @@ +/* + * Copyright (C)2011 D. R. Commander. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the libjpeg-turbo Project nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +package org.libjpegturbo.turbojpeg; + +final public class TJ { + + // Subsampling options + final public static int + SAMP444 = 0, + SAMP422 = 1, + SAMP420 = 2, + GRAYSCALE = 3; + + // Flags + final public static int + BGR = 1, + BOTTOMUP = 2, + FORCEMMX = 8, + FORCESSE = 16, + FORCESSE2 = 32, + ALPHAFIRST = 64, + FORCESSE3 = 128, + FASTUPSAMPLE = 256, + YUV = 512; + + public native final static long bufSize(int width, int height); +}; diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java new file mode 100644 index 00000000..67b70b0d --- /dev/null +++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java @@ -0,0 +1,65 @@ +/* + * Copyright (C)2011 D. R. Commander. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the libjpeg-turbo Project nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +package org.libjpegturbo.turbojpeg; + +public class TJCompressor { + + public TJCompressor() throws Exception { + init(); + } + + public void close() throws Exception { + destroy(); + } + + protected void finalize() throws Throwable { + try { + close(); + } catch(Exception e) { + } + finally { + super.finalize(); + } + }; + + private native void init() throws Exception; + + private native void destroy() throws Exception; + + // JPEG size in bytes is returned + public native long compress(byte [] srcbuf, int width, int pitch, + int height, int pixelsize, byte [] dstbuf, int jpegsubsamp, int jpegqual, + int flags) throws Exception; + + static { + System.loadLibrary("turbojpeg"); + } + + private long handle = 0; +}; diff --git a/java/TurboJPEG.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java similarity index 61% rename from java/TurboJPEG.java rename to java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 0d08edc7..6408d588 100644 --- a/java/TurboJPEG.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -26,73 +26,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -final class TJ { +package org.libjpegturbo.turbojpeg; - // Subsampling options - final static int - SAMP444 = 0, - SAMP422 = 1, - SAMP420 = 2, - GRAYSCALE = 3; +public class TJDecompressor { - // Flags - final static int - BGR = 1, - BOTTOMUP = 2, - FORCEMMX = 8, - FORCESSE = 16, - FORCESSE2 = 32, - ALPHAFIRST = 64, - FORCESSE3 = 128, - FASTUPSAMPLE = 256, - YUV = 512; - - public native final static long bufSize(int width, int height); -}; - -class TJCompressor { - - TJCompressor() throws Exception {init();} - - public void close() throws Exception {destroy();} - - protected void finalize() throws Throwable { - try { - close(); - } catch(Exception e) { - } - finally { - super.finalize(); - } - }; - - private native void init() throws Exception; - - private native void destroy() throws Exception; - - // JPEG size in bytes is returned - public native long compress(byte [] srcbuf, int width, int pitch, - int height, int pixelsize, byte [] dstbuf, int jpegsubsamp, int jpegqual, - int flags) throws Exception; - - static { - System.loadLibrary("turbojpeg"); + public TJDecompressor() throws Exception { + init(); } - private long handle=0; -}; - -class TJHeaderInfo { - int subsamp=-1; - int width=-1; - int height=-1; -}; - -class TJDecompressor { - - TJDecompressor() throws Exception {init();} - - public void close() throws Exception {destroy();} + public void close() throws Exception { + destroy(); + } protected void finalize() throws Throwable { try { @@ -119,5 +63,5 @@ class TJDecompressor { System.loadLibrary("turbojpeg"); } - private long handle=0; + private long handle = 0; }; diff --git a/java/org/libjpegturbo/turbojpeg/TJHeaderInfo.java b/java/org/libjpegturbo/turbojpeg/TJHeaderInfo.java new file mode 100644 index 00000000..e4ee59f3 --- /dev/null +++ b/java/org/libjpegturbo/turbojpeg/TJHeaderInfo.java @@ -0,0 +1,35 @@ +/* + * Copyright (C)2011 D. R. Commander. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of the libjpeg-turbo Project nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +package org.libjpegturbo.turbojpeg; + +public class TJHeaderInfo { + public int subsamp = -1; + public int width = -1; + public int height = -1; +}; diff --git a/java/org_libjpegturbo_turbojpeg_TJ.h b/java/org_libjpegturbo_turbojpeg_TJ.h new file mode 100644 index 00000000..6c0cf39d --- /dev/null +++ b/java/org_libjpegturbo_turbojpeg_TJ.h @@ -0,0 +1,47 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_libjpegturbo_turbojpeg_TJ */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJ +#define _Included_org_libjpegturbo_turbojpeg_TJ +#ifdef __cplusplus +extern "C" { +#endif +#undef org_libjpegturbo_turbojpeg_TJ_SAMP444 +#define org_libjpegturbo_turbojpeg_TJ_SAMP444 0L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP422 +#define org_libjpegturbo_turbojpeg_TJ_SAMP422 1L +#undef org_libjpegturbo_turbojpeg_TJ_SAMP420 +#define org_libjpegturbo_turbojpeg_TJ_SAMP420 2L +#undef org_libjpegturbo_turbojpeg_TJ_GRAYSCALE +#define org_libjpegturbo_turbojpeg_TJ_GRAYSCALE 3L +#undef org_libjpegturbo_turbojpeg_TJ_BGR +#define org_libjpegturbo_turbojpeg_TJ_BGR 1L +#undef org_libjpegturbo_turbojpeg_TJ_BOTTOMUP +#define org_libjpegturbo_turbojpeg_TJ_BOTTOMUP 2L +#undef org_libjpegturbo_turbojpeg_TJ_FORCEMMX +#define org_libjpegturbo_turbojpeg_TJ_FORCEMMX 8L +#undef org_libjpegturbo_turbojpeg_TJ_FORCESSE +#define org_libjpegturbo_turbojpeg_TJ_FORCESSE 16L +#undef org_libjpegturbo_turbojpeg_TJ_FORCESSE2 +#define org_libjpegturbo_turbojpeg_TJ_FORCESSE2 32L +#undef org_libjpegturbo_turbojpeg_TJ_ALPHAFIRST +#define org_libjpegturbo_turbojpeg_TJ_ALPHAFIRST 64L +#undef org_libjpegturbo_turbojpeg_TJ_FORCESSE3 +#define org_libjpegturbo_turbojpeg_TJ_FORCESSE3 128L +#undef org_libjpegturbo_turbojpeg_TJ_FASTUPSAMPLE +#define org_libjpegturbo_turbojpeg_TJ_FASTUPSAMPLE 256L +#undef org_libjpegturbo_turbojpeg_TJ_YUV +#define org_libjpegturbo_turbojpeg_TJ_YUV 512L +/* + * Class: org_libjpegturbo_turbojpeg_TJ + * Method: bufSize + * Signature: (II)J + */ +JNIEXPORT jlong JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize + (JNIEnv *, jclass, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/java/org_libjpegturbo_turbojpeg_TJCompressor.h b/java/org_libjpegturbo_turbojpeg_TJCompressor.h new file mode 100644 index 00000000..090929cd --- /dev/null +++ b/java/org_libjpegturbo_turbojpeg_TJCompressor.h @@ -0,0 +1,37 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_libjpegturbo_turbojpeg_TJCompressor */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJCompressor +#define _Included_org_libjpegturbo_turbojpeg_TJCompressor +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: destroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJCompressor + * Method: compress + * Signature: ([BIIII[BIII)J + */ +JNIEXPORT jlong JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress + (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/java/org_libjpegturbo_turbojpeg_TJDecompressor.h b/java/org_libjpegturbo_turbojpeg_TJDecompressor.h new file mode 100644 index 00000000..ad753279 --- /dev/null +++ b/java/org_libjpegturbo_turbojpeg_TJDecompressor.h @@ -0,0 +1,45 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_libjpegturbo_turbojpeg_TJDecompressor */ + +#ifndef _Included_org_libjpegturbo_turbojpeg_TJDecompressor +#define _Included_org_libjpegturbo_turbojpeg_TJDecompressor +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: destroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy + (JNIEnv *, jobject); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompressHeader + * Signature: ([BJ)Lorg/libjpegturbo/turbojpeg/TJHeaderInfo; + */ +JNIEXPORT jobject JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader + (JNIEnv *, jobject, jbyteArray, jlong); + +/* + * Class: org_libjpegturbo_turbojpeg_TJDecompressor + * Method: decompress + * Signature: ([BJ[BIIIII)V + */ +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress + (JNIEnv *, jobject, jbyteArray, jlong, jbyteArray, jint, jint, jint, jint, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index c0992a41..892e51b2 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -28,9 +28,9 @@ #include "turbojpeg.h" #include -#include "java/TJCompressor.h" -#include "java/TJDecompressor.h" -#include "java/TJ.h" +#include "java/org_libjpegturbo_turbojpeg_TJCompressor.h" +#include "java/org_libjpegturbo_turbojpeg_TJDecompressor.h" +#include "java/org_libjpegturbo_turbojpeg_TJ.h" #define _throw(msg) { \ jclass _exccls=(*env)->FindClass(env, "java/lang/Exception"); \ @@ -49,13 +49,13 @@ handle=(tjhandle)(long)(*env)->GetLongField(env, obj, _fid); \ } -JNIEXPORT jlong JNICALL Java_TJ_bufSize +JNIEXPORT jlong JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize (JNIEnv *env, jclass cls, jint width, jint height) { return TJBUFSIZE(width, height); } -JNIEXPORT void JNICALL Java_TJCompressor_init +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init (JNIEnv *env, jobject obj) { jclass cls; @@ -73,7 +73,7 @@ JNIEXPORT void JNICALL Java_TJCompressor_init return; } -JNIEXPORT jlong JNICALL Java_TJCompressor_compress +JNIEXPORT jlong JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress (JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch, jint height, jint pixelsize, jbyteArray dst, jint jpegsubsamp, jint jpegqual, jint flags) @@ -101,7 +101,7 @@ JNIEXPORT jlong JNICALL Java_TJCompressor_compress return size; } -JNIEXPORT void JNICALL Java_TJCompressor_destroy +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy (JNIEnv *env, jobject obj) { tjhandle handle=0; @@ -114,7 +114,7 @@ JNIEXPORT void JNICALL Java_TJCompressor_destroy return; } -JNIEXPORT void JNICALL Java_TJDecompressor_init +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init (JNIEnv *env, jobject obj) { jclass cls; @@ -131,7 +131,7 @@ JNIEXPORT void JNICALL Java_TJDecompressor_init return; } -JNIEXPORT jobject JNICALL Java_TJDecompressor_decompressHeader +JNIEXPORT jobject JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader (JNIEnv *env, jobject obj, jbyteArray src, jlong size) { jclass jhicls=NULL; @@ -153,7 +153,7 @@ JNIEXPORT jobject JNICALL Java_TJDecompressor_decompressHeader } (*env)->ReleasePrimitiveArrayCritical(env, src, srcbuf, 0); srcbuf=NULL; - bailif0(jhicls=(*env)->FindClass(env, "TJHeaderInfo")); + bailif0(jhicls=(*env)->FindClass(env, "org/libjpegturbo/turbojpeg/TJHeaderInfo")); bailif0(jhiobj=(*env)->AllocObject(env, jhicls)); bailif0(fid=(*env)->GetFieldID(env, jhicls, "subsamp", "I")); @@ -167,7 +167,7 @@ JNIEXPORT jobject JNICALL Java_TJDecompressor_decompressHeader return jhiobj; } -JNIEXPORT void JNICALL Java_TJDecompressor_decompress +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress (JNIEnv *env, jobject obj, jbyteArray src, jlong size, jbyteArray dst, jint width, jint pitch, jint height, jint pixelsize, jint flags) { @@ -193,8 +193,8 @@ JNIEXPORT void JNICALL Java_TJDecompressor_decompress return; } -JNIEXPORT void JNICALL Java_TJDecompressor_destroy +JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy (JNIEnv *env, jobject obj) { - Java_TJCompressor_destroy(env, obj); + Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy(env, obj); } diff --git a/turbojpeg-mapfile.jni b/turbojpeg-mapfile.jni index 0b1d1bd4..5aaa1e0c 100755 --- a/turbojpeg-mapfile.jni +++ b/turbojpeg-mapfile.jni @@ -9,14 +9,14 @@ tjDecompress; tjDestroy; tjGetErrorStr; - Java_TJ_bufSize; - Java_TJCompressor_init; - Java_TJCompressor_compress; - Java_TJCompressor_destroy; - Java_TJDecompressor_init; - Java_TJDecompressor_decompressHeader; - Java_TJDecompressor_decompress; - Java_TJDecompressor_destroy; + Java_org_libjpegturbo_turbojpeg_TJ_bufSize; + Java_org_libjpegturbo_turbojpeg_TJCompressor_init; + Java_org_libjpegturbo_turbojpeg_TJCompressor_compress; + Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy; + Java_org_libjpegturbo_turbojpeg_TJDecompressor_init; + Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader; + Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress; + Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy; local: *; };