зеркало из https://github.com/mozilla/mozjpeg.git
Restructure Java classes into their own package
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@358 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
Родитель
2413cb8673
Коммит
c5a419970e
|
@ -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.
|
||||
|
||||
|
|
47
java/TJ.h
47
java/TJ.h
|
@ -1,47 +0,0 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* 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
|
|
@ -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
|
|
@ -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
|
|
@ -32,6 +32,7 @@
|
|||
*/
|
||||
|
||||
import java.io.*;
|
||||
import org.libjpegturbo.turbojpeg.*;
|
||||
|
||||
public class TJExample {
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
|
@ -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;
|
||||
};
|
|
@ -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;
|
||||
};
|
|
@ -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;
|
||||
};
|
|
@ -0,0 +1,47 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* 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
|
|
@ -0,0 +1,37 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* 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
|
|
@ -0,0 +1,45 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* 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
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
#include "turbojpeg.h"
|
||||
#include <jni.h>
|
||||
#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);
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
*;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче