summaryrefslogtreecommitdiff
path: root/trunk/java
diff options
context:
space:
mode:
authordcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2011-02-08 02:11:37 +0000
committerdcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2011-02-08 02:11:37 +0000
commit55c82f6130098b0da36088d77774da54134991b4 (patch)
tree26d91a894dcd9efb11cc0b54b3983e67da25d887 /trunk/java
parentc81fcfcbea28c96c1dd093149255ffd2e992b429 (diff)
Use Java capitalization conventions
git-svn-id: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@357 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'trunk/java')
-rw-r--r--trunk/java/README8
-rw-r--r--trunk/java/TJ.h4
-rw-r--r--trunk/java/TJCompressor.h37
-rw-r--r--trunk/java/TJDecompressor.h45
-rw-r--r--trunk/java/TJExample.java (renamed from trunk/java/tjexample.java)16
-rw-r--r--trunk/java/TurboJPEG.java (renamed from trunk/java/turbojpeg.java)30
-rw-r--r--trunk/java/tjCompressor.h37
-rw-r--r--trunk/java/tjDecompressor.h45
8 files changed, 111 insertions, 111 deletions
diff --git a/trunk/java/README b/trunk/java/README
index 8b6f5bc..0146ed3 100644
--- a/trunk/java/README
+++ b/trunk/java/README
@@ -4,12 +4,12 @@ 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
+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
incorporated directly into both open source and proprietary projects without
restriction.
-tjexample.java, which should also be located in the same directory as this
+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.
@@ -48,5 +48,5 @@ convention of MinGW, and it also avoids a filename conflict when the GCC and
Visual C++ versions of the libjpeg-turbo SDK are installed on the same system.
However, the TurboJPEG/OSS JNI wrapper will not work on Windows unless the DLL
is named turbojpeg.dll. You can work around this by renaming the DLL or by
-simply changing the LoadLibrary() calls in turbojpeg.java so that they load
+simply changing the LoadLibrary() calls in TurboJPEG.java so that they load
"libturbojpeg" instead of "turbojpeg".
diff --git a/trunk/java/TJ.h b/trunk/java/TJ.h
index 7be782d..2527117 100644
--- a/trunk/java/TJ.h
+++ b/trunk/java/TJ.h
@@ -35,10 +35,10 @@ extern "C" {
#define TJ_YUV 512L
/*
* Class: TJ
- * Method: BUFSIZE
+ * Method: bufSize
* Signature: (II)J
*/
-JNIEXPORT jlong JNICALL Java_TJ_BUFSIZE
+JNIEXPORT jlong JNICALL Java_TJ_bufSize
(JNIEnv *, jclass, jint, jint);
#ifdef __cplusplus
diff --git a/trunk/java/TJCompressor.h b/trunk/java/TJCompressor.h
new file mode 100644
index 0000000..15e659f
--- /dev/null
+++ b/trunk/java/TJCompressor.h
@@ -0,0 +1,37 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* 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/trunk/java/TJDecompressor.h b/trunk/java/TJDecompressor.h
new file mode 100644
index 0000000..4b61ac9
--- /dev/null
+++ b/trunk/java/TJDecompressor.h
@@ -0,0 +1,45 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* 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/trunk/java/tjexample.java b/trunk/java/TJExample.java
index 5f92333..991b8eb 100644
--- a/trunk/java/tjexample.java
+++ b/trunk/java/TJExample.java
@@ -33,9 +33,9 @@
import java.io.*;
-public class tjexample {
+public class TJExample {
- public static final String classname=new tjexample().getClass().getName();
+ public static final String classname=new TJExample().getClass().getName();
public static void main(String argv[]) {
@@ -57,8 +57,8 @@ public class tjexample {
fis.read(inputbuf);
fis.close();
- tjDecompressor tjd=new tjDecompressor();
- tjHeaderInfo tji=tjd.DecompressHeader(inputbuf, inputsize);
+ TJDecompressor tjd=new TJDecompressor();
+ TJHeaderInfo tji=tjd.decompressHeader(inputbuf, inputsize);
System.out.print("Source Image: "+tji.width+" x "+tji.height+ " pixels, ");
switch(tji.subsamp) {
case TJ.SAMP444: System.out.println("4:4:4 subsampling"); break;
@@ -68,13 +68,13 @@ public class tjexample {
default: System.out.println("Unknown subsampling"); break;
}
byte [] tmpbuf=new byte[tji.width*tji.height*3];
- tjd.Decompress(inputbuf, inputsize, tmpbuf, tji.width, tji.width*3,
+ tjd.decompress(inputbuf, inputsize, tmpbuf, tji.width, tji.width*3,
tji.height, 3, TJ.BOTTOMUP);
tjd.close();
- tjCompressor tjc=new tjCompressor();
- byte [] outputbuf=new byte[(int)TJ.BUFSIZE(tji.width, tji.height)];
- long outputsize=tjc.Compress(tmpbuf, tji.width, tji.width*3, tji.height,
+ TJCompressor tjc=new TJCompressor();
+ byte [] outputbuf=new byte[(int)TJ.bufSize(tji.width, tji.height)];
+ long outputsize=tjc.compress(tmpbuf, tji.width, tji.width*3, tji.height,
3, outputbuf, tji.subsamp, 95, TJ.BOTTOMUP);
tjc.close();
diff --git a/trunk/java/turbojpeg.java b/trunk/java/TurboJPEG.java
index e5ecca7..0d08edc 100644
--- a/trunk/java/turbojpeg.java
+++ b/trunk/java/TurboJPEG.java
@@ -47,14 +47,14 @@ final class TJ {
FASTUPSAMPLE = 256,
YUV = 512;
- public native final static long BUFSIZE(int width, int height);
+ public native final static long bufSize(int width, int height);
};
-class tjCompressor {
+class TJCompressor {
- tjCompressor() throws Exception {Init();}
+ TJCompressor() throws Exception {init();}
- public void close() throws Exception {Destroy();}
+ public void close() throws Exception {destroy();}
protected void finalize() throws Throwable {
try {
@@ -66,12 +66,12 @@ class tjCompressor {
}
};
- private native void Init() throws Exception;
+ private native void init() throws Exception;
- private native void Destroy() throws Exception;
+ private native void destroy() throws Exception;
// JPEG size in bytes is returned
- public native long Compress(byte [] srcbuf, int width, int pitch,
+ public native long compress(byte [] srcbuf, int width, int pitch,
int height, int pixelsize, byte [] dstbuf, int jpegsubsamp, int jpegqual,
int flags) throws Exception;
@@ -82,17 +82,17 @@ class tjCompressor {
private long handle=0;
};
-class tjHeaderInfo {
+class TJHeaderInfo {
int subsamp=-1;
int width=-1;
int height=-1;
};
-class tjDecompressor {
+class TJDecompressor {
- tjDecompressor() throws Exception {Init();}
+ TJDecompressor() throws Exception {init();}
- public void close() throws Exception {Destroy();}
+ public void close() throws Exception {destroy();}
protected void finalize() throws Throwable {
try {
@@ -104,14 +104,14 @@ class tjDecompressor {
}
};
- private native void Init() throws Exception;
+ private native void init() throws Exception;
- private native void Destroy() throws Exception;
+ private native void destroy() throws Exception;
- public native tjHeaderInfo DecompressHeader(byte [] srcbuf, long size)
+ public native TJHeaderInfo decompressHeader(byte [] srcbuf, long size)
throws Exception;
- public native void Decompress(byte [] srcbuf, long size, byte [] dstbuf,
+ public native void decompress(byte [] srcbuf, long size, byte [] dstbuf,
int width, int pitch, int height, int pixelsize, int flags)
throws Exception;
diff --git a/trunk/java/tjCompressor.h b/trunk/java/tjCompressor.h
deleted file mode 100644
index fa2c5ff..0000000
--- a/trunk/java/tjCompressor.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* 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/trunk/java/tjDecompressor.h b/trunk/java/tjDecompressor.h
deleted file mode 100644
index 498112b..0000000
--- a/trunk/java/tjDecompressor.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* 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