aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2013-04-27 20:55:45 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2013-04-27 20:55:45 +0000
commit3eaf0288a7b01dcb826b7f4c42b46bdad08d14a2 (patch)
tree0455bc47ecbacc0be4e2b2783dc91081f9ef4357 /java
parentc0990aafb512c7c94914d340c7d867cf047fbe84 (diff)
Correct misuse of the word "pitch" + more code formatting tweaks
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@971 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'java')
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJ.java3
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJCompressor.java16
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJDecompressor.java19
3 files changed, 17 insertions, 21 deletions
diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java
index f182f96..9f7c682 100644
--- a/java/org/libjpegturbo/turbojpeg/TJ.java
+++ b/java/org/libjpegturbo/turbojpeg/TJ.java
@@ -350,8 +350,7 @@ public final class TJ {
* @return the size of the buffer (in bytes) required to hold a YUV planar
* image with the given width, height, and level of chrominance subsampling
*/
- public static native int bufSizeYUV(int width, int height,
- int subsamp)
+ public static native int bufSizeYUV(int width, int height, int subsamp)
throws Exception;
/**
diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java
index 24c122b..f8f82ac 100644
--- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java
@@ -280,15 +280,15 @@ public class TJCompressor {
if (intPixels) {
SinglePixelPackedSampleModel sm =
(SinglePixelPackedSampleModel)srcImage.getSampleModel();
- int pitch = sm.getScanlineStride();
+ int stride = sm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData();
if (srcX >= 0 && srcY >= 0)
- compressedSize = compress(buf, srcX, srcY, width, pitch, height,
+ compressedSize = compress(buf, srcX, srcY, width, stride, height,
pixelFormat, dstBuf, subsamp, jpegQuality,
flags);
else
- compressedSize = compress(buf, width, pitch, height, pixelFormat,
+ compressedSize = compress(buf, width, stride, height, pixelFormat,
dstBuf, subsamp, jpegQuality, flags);
} else {
ComponentSampleModel sm =
@@ -435,10 +435,10 @@ public class TJCompressor {
if (intPixels) {
SinglePixelPackedSampleModel sm =
(SinglePixelPackedSampleModel)srcImage.getSampleModel();
- int pitch = sm.getScanlineStride();
+ int stride = sm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData();
- encodeYUV(buf, width, pitch, height, pixelFormat, dstBuf, subsamp,
+ encodeYUV(buf, width, stride, height, pixelFormat, dstBuf, subsamp,
flags);
} else {
ComponentSampleModel sm =
@@ -511,7 +511,7 @@ public class TJCompressor {
// JPEG size in bytes is returned
private native int compress(byte[] srcBuf, int width, int pitch,
int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,
- int flags) throws Exception;
+ int flags) throws Exception; // deprecated
private native int compress(byte[] srcBuf, int x, int y, int width,
int pitch, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
@@ -519,7 +519,7 @@ public class TJCompressor {
private native int compress(int[] srcBuf, int width, int stride,
int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,
- int flags) throws Exception;
+ int flags) throws Exception; // deprecated
private native int compress(int[] srcBuf, int x, int y, int width,
int stride, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
@@ -529,7 +529,7 @@ public class TJCompressor {
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
throws Exception;
- private native void encodeYUV(int[] srcBuf, int width, int pitch,
+ private native void encodeYUV(int[] srcBuf, int width, int stride,
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
throws Exception;
diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
index c4bb5a3..da51a43 100644
--- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
@@ -520,12 +520,12 @@ public class TJDecompressor {
if (intPixels) {
SinglePixelPackedSampleModel sm =
(SinglePixelPackedSampleModel)dstImage.getSampleModel();
- int pitch = sm.getScanlineStride();
+ int stride = sm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData();
if (jpegBuf == null)
throw new Exception(NO_ASSOC_ERROR);
- decompress(jpegBuf, jpegBufSize, buf, scaledWidth, pitch, scaledHeight,
+ decompress(jpegBuf, jpegBufSize, buf, scaledWidth, stride, scaledHeight,
pixelFormat, flags);
} else {
ComponentSampleModel sm =
@@ -600,25 +600,22 @@ public class TJDecompressor {
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf,
int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)
- throws Exception;
+ throws Exception; // deprecated
private native void decompress(byte[] srcBuf, int size, byte[] dstBuf, int x,
int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat,
- int flags)
- throws Exception;
+ int flags) throws Exception;
private native void decompress(byte[] srcBuf, int size, int[] dstBuf,
- int desiredWidth, int stride, int desiredHeight, int pixelFormat, int flags)
- throws Exception;
+ int desiredWidth, int stride, int desiredHeight, int pixelFormat,
+ int flags) throws Exception; // deprecated
private native void decompress(byte[] srcBuf, int size, int[] dstBuf, int x,
int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat,
- int flags)
- throws Exception;
+ int flags) throws Exception;
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
- int flags)
- throws Exception;
+ int flags) throws Exception;
static {
TJLoader.load();