aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/CMakeLists.txt21
-rw-r--r--java/Makefile.am18
-rw-r--r--java/TJExample.java23
-rw-r--r--java/TJUnitTest.java41
-rw-r--r--java/doc/allclasses-frame.html6
-rw-r--r--java/doc/allclasses-noframe.html6
-rw-r--r--java/doc/constant-values.html4
-rw-r--r--java/doc/deprecated-list.html4
-rw-r--r--java/doc/help-doc.html4
-rw-r--r--java/doc/index-all.html42
-rw-r--r--java/doc/index.html2
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/TJ.html37
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html8
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html21
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html (renamed from java/doc/org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html)217
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/TJTransform.html8
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html4
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/package-frame.html6
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/package-summary.html8
-rw-r--r--java/doc/org/libjpegturbo/turbojpeg/package-tree.html8
-rw-r--r--java/doc/overview-tree.html8
-rw-r--r--java/doc/serialized-form.html7
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJ.java19
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJCompressor.java2
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJDecompressor.java29
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJLoader.java35
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJLoader.java.in35
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJScalingFactor.java96
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJTransformer.java2
-rw-r--r--turbojpeg-jni.c2
30 files changed, 492 insertions, 231 deletions
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index b676ce8..8f35862 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -4,6 +4,7 @@ set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.MF)
set(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ
org/libjpegturbo/turbojpeg/TJCompressor
org/libjpegturbo/turbojpeg/TJDecompressor
+ org/libjpegturbo/turbojpeg/TJScalingFactor
org/libjpegturbo/turbojpeg/TJTransform
org/libjpegturbo/turbojpeg/TJTransformer
TJUnitTest
@@ -15,6 +16,13 @@ else()
set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})
endif()
+set(TURBOJPEG_DLL_NAME "turbojpeg")
+if(MINGW)
+ set(TURBOJPEG_DLL_NAME "libturbojpeg")
+endif()
+configure_file(org/libjpegturbo/turbojpeg/TJLoader.java.in
+ ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
+
set(JAVA_SOURCES "")
set(JAVA_CLASSES "")
set(JAVA_CLASSES_FULL "")
@@ -24,13 +32,12 @@ foreach(class ${JAVA_CLASSNAMES})
set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL} ${OBJDIR}/${class}.class)
endforeach()
-if(MSVC_IDE)
- set(JAVA_CLASSES ${JAVA_CLASSES}
- org/libjpegturbo/turbojpeg/TJ$ScalingFactor.class)
-else()
- set(JAVA_CLASSES ${JAVA_CLASSES}
- org/libjpegturbo/turbojpeg/TJ$$ScalingFactor.class)
-endif()
+set(JAVA_SOURCES ${JAVA_SOURCES}
+ ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)
+set(JAVA_CLASSES ${JAVA_CLASSES}
+ org/libjpegturbo/turbojpeg/TJLoader.class)
+set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL}
+ ${OBJDIR}/org/libjpegturbo/turbojpeg/TJLoader.class)
add_custom_command(OUTPUT ${JAVA_CLASSES_FULL} DEPENDS ${JAVA_SOURCES}
COMMAND ${JAVA_COMPILE} -d ${OBJDIR} ARGS ${JAVA_SOURCES})
diff --git a/java/Makefile.am b/java/Makefile.am
index 7615442..c13ef44 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -3,6 +3,8 @@ JAVAROOT = .
JAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \
org/libjpegturbo/turbojpeg/TJCompressor.java \
org/libjpegturbo/turbojpeg/TJDecompressor.java \
+ org/libjpegturbo/turbojpeg/TJLoader.java \
+ org/libjpegturbo/turbojpeg/TJScalingFactor.java \
org/libjpegturbo/turbojpeg/TJTransform.java \
org/libjpegturbo/turbojpeg/TJTransformer.java \
TJExample.java \
@@ -20,6 +22,8 @@ dist_noinst_JAVA = ${JAVASOURCES}
JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
org/libjpegturbo/turbojpeg/TJCompressor.class \
org/libjpegturbo/turbojpeg/TJDecompressor.class \
+ org/libjpegturbo/turbojpeg/TJLoader.class \
+ org/libjpegturbo/turbojpeg/TJScalingFactor.class \
org/libjpegturbo/turbojpeg/TJTransform.class \
org/libjpegturbo/turbojpeg/TJTransformer.class \
TJExample.class \
@@ -28,8 +32,7 @@ JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \
all: all-am turbojpeg.jar
turbojpeg.jar: $(JAVA_CLASSES) ${srcdir}/MANIFEST.MF
- $(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES) \
- org/libjpegturbo/turbojpeg/TJ\$$ScalingFactor.class
+ $(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES)
clean-local:
rm -f turbojpeg.jar
@@ -42,6 +45,17 @@ uninstall-local:
rm -f $(DESTDIR)/$(prefix)/classes/turbojpeg.jar
if [ -d $(DESTDIR)/$(prefix)/classes ]; then rmdir $(DESTDIR)/$(prefix)/classes; fi
+headers: all
+ cd ${srcdir}; \
+ javah org.libjpegturbo.turbojpeg.TJ; \
+ javah org.libjpegturbo.turbojpeg.TJCompressor; \
+ javah org.libjpegturbo.turbojpeg.TJDecompressor; \
+ javah org.libjpegturbo.turbojpeg.TJTransformer
+
+docs: all
+ cd ${srcdir}; \
+ mkdir -p doc; cd doc; javadoc -classpath .. org.libjpegturbo.turbojpeg
+
endif
EXTRA_DIST = MANIFEST.MF ${JAVASOURCES} ${JNIHEADERS} doc CMakeLists.txt
diff --git a/java/TJExample.java b/java/TJExample.java
index 9ecda65..b9ea34a 100644
--- a/java/TJExample.java
+++ b/java/TJExample.java
@@ -50,7 +50,7 @@ public class TJExample {
System.out.println("-scale M/N = if the input image is a JPEG file, scale the width/height of the");
System.out.print(" output image by a factor of M/N (M/N = ");
for(int i = 0; i < sf.length; i++) {
- System.out.print(sf[i].num + "/" + sf[i].denom);
+ System.out.print(sf[i].getNum() + "/" + sf[i].getDenom());
if(sf.length == 2 && i != sf.length - 1) System.out.print(" or ");
else if(sf.length > 2) {
if(i != sf.length - 1) System.out.print(", ");
@@ -99,7 +99,7 @@ public class TJExample {
usage();
}
- int scaleNum = 1, scaleDenom = 1;
+ TJScalingFactor scaleFactor = new TJScalingFactor(1, 1);
String inFormat = "jpg", outFormat = "jpg";
int outSubsamp = -1, outQual = 95;
boolean display = false;
@@ -114,11 +114,12 @@ public class TJExample {
int temp1 = 0, temp2 = 0;
String[] scaleArg = argv[++i].split("/");
if(scaleArg.length == 2) {
- temp1 = Integer.parseInt(scaleArg[0]);
- temp2 = Integer.parseInt(scaleArg[1]);
+ TJScalingFactor tempsf =
+ new TJScalingFactor(Integer.parseInt(scaleArg[0]),
+ Integer.parseInt(scaleArg[1]));
for(int j = 0; j < sf.length; j++) {
- if(temp1 == sf[j].num && temp2 == sf[j].denom) {
- scaleNum = temp1; scaleDenom = temp2;
+ if(tempsf.equals(sf[j])) {
+ scaleFactor = sf[j];
match = 1; break;
}
}
@@ -230,7 +231,7 @@ public class TJExample {
if(outFormat.equalsIgnoreCase("jpg")
&& (xform.op != TJTransform.OP_NONE || xform.options != 0)
- && (scaleNum == 1 && scaleDenom == 1)) {
+ && scaleFactor.isOne()) {
file = new File(argv[1]);
FileOutputStream fos = new FileOutputStream(file);
fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize());
@@ -238,10 +239,8 @@ public class TJExample {
System.exit(0);
}
- if(scaleNum != 1 || scaleDenom != 1) {
- width = (width * scaleNum + scaleDenom - 1) / scaleDenom;
- height = (height * scaleNum + scaleDenom - 1) / scaleDenom;
- }
+ width = scaleFactor.getScaled(width);
+ height = scaleFactor.getScaled(height);
if(!outFormat.equalsIgnoreCase("jpg"))
img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB, 0);
@@ -305,5 +304,5 @@ public class TJExample {
}
}
- static TJ.ScalingFactor sf [] = null;
+ static TJScalingFactor sf [] = null;
};
diff --git a/java/TJUnitTest.java b/java/TJUnitTest.java
index 0252c20..1bbdad2 100644
--- a/java/TJUnitTest.java
+++ b/java/TJUnitTest.java
@@ -238,14 +238,14 @@ public class TJUnitTest {
}
private static int checkBuf(byte[] buf, int w, int pitch, int h, int pf,
- int subsamp, int scaleNum, int scaleDenom, int flags) throws Exception {
+ int subsamp, TJScalingFactor sf, int flags) throws Exception {
int roffset = TJ.getRedOffset(pf);
int goffset = TJ.getGreenOffset(pf);
int boffset = TJ.getBlueOffset(pf);
int ps = TJ.getPixelSize(pf);
int i, _i, j, retval = 1;
- int halfway = 16 * scaleNum / scaleDenom;
- int blockSize = 8 * scaleNum / scaleDenom;
+ int halfway = 16 * sf.getNum() / sf.getDenom();
+ int blockSize = 8 * sf.getNum() / sf.getDenom();
try {
for(_i = 0; _i < halfway; _i++) {
@@ -322,13 +322,13 @@ public class TJUnitTest {
}
private static int checkIntBuf(int[] buf, int w, int pitch, int h, int pf,
- int subsamp, int scaleNum, int scaleDenom, int flags) throws Exception {
+ int subsamp, TJScalingFactor sf, int flags) throws Exception {
int rshift = TJ.getRedOffset(pf) * 8;
int gshift = TJ.getGreenOffset(pf) * 8;
int bshift = TJ.getBlueOffset(pf) * 8;
int i, _i, j, retval = 1;
- int halfway = 16 * scaleNum / scaleDenom;
- int blockSize = 8 * scaleNum / scaleDenom;
+ int halfway = 16 * sf.getNum() / sf.getDenom();
+ int blockSize = 8 * sf.getNum() / sf.getDenom();
try {
for(_i = 0; _i < halfway; _i++) {
@@ -405,7 +405,7 @@ public class TJUnitTest {
}
private static int checkImg(BufferedImage img, int pf,
- int subsamp, int scaleNum, int scaleDenom, int flags) throws Exception {
+ int subsamp, TJScalingFactor sf, int flags) throws Exception {
WritableRaster wr = img.getRaster();
int imgtype = img.getType();
if(imgtype == BufferedImage.TYPE_INT_RGB
@@ -416,7 +416,7 @@ public class TJUnitTest {
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
int[] buf = db.getData();
return checkIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf,
- subsamp, scaleNum, scaleDenom, flags);
+ subsamp, sf, flags);
}
else {
ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel();
@@ -424,7 +424,7 @@ public class TJUnitTest {
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
byte[] buf = db.getData();
return checkBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, subsamp,
- scaleNum, scaleDenom, flags);
+ sf, flags);
}
}
@@ -610,11 +610,11 @@ public class TJUnitTest {
private static void genTestBMP(TJDecompressor tjd, byte[] jpegBuf,
int jpegsize, int w, int h, int pf, String baseFilename, int subsamp,
- int flags, int scaleNum, int scaleDenom) throws Exception {
+ int flags, TJScalingFactor sf) throws Exception {
String pfStr, tempstr;
double t;
- int scaledWidth = (w * scaleNum + scaleDenom - 1) / scaleDenom;
- int scaledHeight = (h * scaleNum + scaleDenom - 1) / scaleDenom;
+ int scaledWidth = sf.getScaled(w);
+ int scaledHeight = sf.getScaled(h);
int temp1, temp2;
BufferedImage img = null;
byte[] bmpBuf = null;
@@ -629,8 +629,8 @@ public class TJUnitTest {
System.out.print(pfStr + " ");
if((flags & TJ.FLAG_BOTTOMUP) != 0) System.out.print("Bottom-Up ");
else System.out.print("Top-Down ");
- if(scaleNum != 1 || scaleDenom != 1)
- System.out.print(scaleNum + "/" + scaleDenom + " ... ");
+ if(!sf.isOne())
+ System.out.print(sf.getNum() + "/" + sf.getDenom() + " ... ");
else System.out.print("... ");
}
@@ -658,7 +658,7 @@ public class TJUnitTest {
if(bi) {
tempstr = baseFilename + "_dec_" + pfStr + "_"
+ (((flags & TJ.FLAG_BOTTOMUP) != 0) ? "BU" : "TD") + "_"
- + subName[subsamp] + "_" + (double)scaleNum / (double)scaleDenom
+ + subName[subsamp] + "_" + (double)sf.getNum() / (double)sf.getDenom()
+ "x" + ".png";
File file = new File(tempstr);
ImageIO.write(img, "png", file);
@@ -672,10 +672,9 @@ public class TJUnitTest {
}
}
else {
- if((bi && checkImg(img, pf, subsamp, scaleNum, scaleDenom, flags) == 1)
+ if((bi && checkImg(img, pf, subsamp, sf, flags) == 1)
|| (!bi && checkBuf(bmpBuf, scaledWidth, scaledWidth
- * TJ.getPixelSize(pf), scaledHeight, pf, subsamp, scaleNum,
- scaleDenom, flags) == 1))
+ * TJ.getPixelSize(pf), scaledHeight, pf, subsamp, sf, flags) == 1))
System.out.print("Passed.");
else {
System.out.print("FAILED!"); exitStatus = -1;
@@ -689,14 +688,14 @@ public class TJUnitTest {
int flags) throws Exception {
int i;
if((subsamp == TJ.SAMP_444 || subsamp == TJ.SAMP_GRAY) && yuv == 0) {
- TJ.ScalingFactor sf[] = TJ.getScalingFactors();
+ TJScalingFactor sf[] = TJ.getScalingFactors();
for(i = 0; i < sf.length; i++)
genTestBMP(tjd, jpegBuf, jpegsize, w, h, pf, baseFilename, subsamp,
- flags, sf[i].num, sf[i].denom);
+ flags, sf[i]);
}
else
genTestBMP(tjd, jpegBuf, jpegsize, w, h, pf, baseFilename, subsamp,
- flags, 1, 1);
+ flags, new TJScalingFactor(1, 1));
System.out.print("\n");
}
diff --git a/java/doc/allclasses-frame.html b/java/doc/allclasses-frame.html
index 15d1977..038f9ad 100644
--- a/java/doc/allclasses-frame.html
+++ b/java/doc/allclasses-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
All Classes
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -27,6 +27,8 @@ All Classes
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
<BR>
+<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
+<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A>
diff --git a/java/doc/allclasses-noframe.html b/java/doc/allclasses-noframe.html
index 97b7a3d..964f111 100644
--- a/java/doc/allclasses-noframe.html
+++ b/java/doc/allclasses-noframe.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
All Classes
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -27,6 +27,8 @@ All Classes
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
<BR>
+<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
<BR>
<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</A>
diff --git a/java/doc/constant-values.html b/java/doc/constant-values.html
index 648fc8a..17936ea 100644
--- a/java/doc/constant-values.html
+++ b/java/doc/constant-values.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
Constant Field Values
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/deprecated-list.html b/java/doc/deprecated-list.html
index 7531123..ac6d82c 100644
--- a/java/doc/deprecated-list.html
+++ b/java/doc/deprecated-list.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
Deprecated List
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/help-doc.html b/java/doc/help-doc.html
index 1ff7958..27fbb7f 100644
--- a/java/doc/help-doc.html
+++ b/java/doc/help-doc.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
API Help
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/index-all.html b/java/doc/index-all.html
index 820fd95..af5f275 100644
--- a/java/doc/index-all.html
+++ b/java/doc/index-all.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 18:44:49 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
Index
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
@@ -76,7 +76,7 @@ function windowTitle()
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
-<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_J_">J</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <HR>
+<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_J_">J</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <HR>
<A NAME="_B_"><!-- --></A><H2>
<B>B</B></H2>
<DL>
@@ -146,9 +146,6 @@ Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
<DD>Decompress the JPEG source image associated with this decompressor
instance and return a buffer containing a YUV planar image.
-<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#denom"><B>denom</B></A> -
-Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A>
-<DD>Denominator
</DL>
<HR>
<A NAME="_E_"><!-- --></A><H2>
@@ -170,6 +167,10 @@ Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
<DD>Encode the uncompressed source image stored in <code>srcImage</code>
and return a buffer containing a YUV planar image.
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)"><B>equals(TJScalingFactor)</B></A> -
+Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<DD>Returns true or false, depending on whether this instance and
+ <code>other</code> have the same numerator and denominator.
</DL>
<HR>
<A NAME="_F_"><!-- --></A><H2>
@@ -218,6 +219,9 @@ Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/tu
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
<DD>Returns the size of the image (in bytes) generated by the most recent
compress/encode operation.
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()"><B>getDenom()</B></A> -
+Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<DD>Returns denominator
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getGreenOffset(int)"><B>getGreenOffset(int)</B></A> -
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>For the given pixel format, returns the number of bytes that the green
@@ -241,6 +245,9 @@ Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/tu
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Returns the MCU block width for the given level of chrominance
subsampling.
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()"><B>getNum()</B></A> -
+Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<DD>Returns numerator
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)"><B>getPixelSize(int)</B></A> -
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Returns the pixel size (in bytes) of the given pixel format.
@@ -248,6 +255,9 @@ Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/tu
Static method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>For the given pixel format, returns the number of bytes that the red
component is offset from the start of the pixel.
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><B>getScaled(int)</B></A> -
+Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<DD>Returns the scaled value of <code>dimension</code>.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><B>getScaledHeight(int, int)</B></A> -
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
<DD>Returns the height of the largest scaled down image that the TurboJPEG
@@ -284,6 +294,15 @@ Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojp
<DD>&nbsp;
</DL>
<HR>
+<A NAME="_I_"><!-- --></A><H2>
+<B>I</B></H2>
+<DL>
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()"><B>isOne()</B></A> -
+Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<DD>Returns true or false, depending on whether this instance is equal to
+ 1/1.
+</DL>
+<HR>
<A NAME="_J_"><!-- --></A><H2>
<B>J</B></H2>
<DL>
@@ -307,9 +326,6 @@ Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojp
<A NAME="_N_"><!-- --></A><H2>
<B>N</B></H2>
<DL>
-<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#num"><B>num</B></A> -
-Variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A>
-<DD>Numerator
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP"><B>NUMOP</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
<DD>The number of lossless transform operations
@@ -438,9 +454,6 @@ Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>TurboJPEG utility class (cannot be instantiated)<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#TJ()"><B>TJ()</B></A> -
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>&nbsp;
-<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ.ScalingFactor</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>Fractional scaling factor<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#TJ.ScalingFactor()"><B>TJ.ScalingFactor()</B></A> -
-Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A>
-<DD>&nbsp;
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>TurboJPEG compressor<DT><A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()"><B>TJCompressor()</B></A> -
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</A>
<DD>Create a TurboJPEG compressor instance.
@@ -461,6 +474,9 @@ Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/tur
<DD>Create a TurboJPEG decompressor instance and associate the JPEG image
of length <code>imageSize</code> bytes stored in <code>jpegImage</code>
with the newly-created instance.
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>Fractional scaling factor<DT><A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)"><B>TJScalingFactor(int, int)</B></A> -
+Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>
+<DD>&nbsp;
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A> - Class in <A HREF="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</A><DD>Lossless transform parameters<DT><A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform()"><B>TJTransform()</B></A> -
Constructor for class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A>
<DD>Create a new lossless transform instance.
@@ -494,7 +510,7 @@ Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg
which has a transformed JPEG image associated with it.
</DL>
<HR>
-<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_J_">J</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A>
+<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_J_">J</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
diff --git a/java/doc/index.html b/java/doc/index.html
index bb9704a..abf4dd4 100644
--- a/java/doc/index.html
+++ b/java/doc/index.html
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc on Tue Mar 15 15:50:55 CDT 2011-->
+<!-- Generated by javadoc on Fri Apr 01 20:49:05 CDT 2011-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html
index 4589133..86e33d6 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 18:44:49 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:04 CDT 2011 -->
<TITLE>
TJ
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -54,7 +54,7 @@ function windowTitle()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJ.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="TJ.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
@@ -74,7 +74,7 @@ function windowTitle()
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
+ SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
@@ -106,24 +106,7 @@ TurboJPEG utility class (cannot be instantiated)
<HR>
<P>
-<!-- ======== NESTED CLASS SUMMARY ======== -->
-
-<A NAME="nested_class_summary"><!-- --></A>
-<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
-<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
-<B>Nested Class Summary</B></FONT></TH>
-</TR>
-<TR BGCOLOR="white" CLASS="TableRowColor">
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
-<CODE>&nbsp;class</CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A></B></CODE>
-
-<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fractional scaling factor</TD>
-</TR>
-</TABLE>
-&nbsp;<!-- =========== FIELD SUMMARY =========== -->
+<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
@@ -399,7 +382,7 @@ TurboJPEG utility class (cannot be instantiated)
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
-<CODE>static&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A>[]</CODE></FONT></TD>
+<CODE>static&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()">getScalingFactors</A></B>()</CODE>
<BR>
@@ -883,8 +866,8 @@ public static int <B>bufSizeYUV</B>(int&nbsp;width,
<A NAME="getScalingFactors()"><!-- --></A><H3>
getScalingFactors</H3>
<PRE>
-public static <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A>[] <B>getScalingFactors</B>()
- throws java.lang.Exception</PRE>
+public static <A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>[] <B>getScalingFactors</B>()
+ throws java.lang.Exception</PRE>
<DL>
<DD>Returns a list of fractional scaling factors that the JPEG decompressor in
this implementation of TurboJPEG supports.
@@ -927,7 +910,7 @@ public static <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJ.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="TJ.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
@@ -947,7 +930,7 @@ public static <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
+ SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
index 6c4517d..b9a8fc4 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 18:44:49 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
TJCompressor
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -53,7 +53,7 @@ function windowTitle()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A> &nbsp;
@@ -661,7 +661,7 @@ protected void <B>finalize</B>()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A> &nbsp;
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
index 60c4d6a..f610afe 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 18:44:49 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
TJDecompressor
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -54,7 +54,7 @@ function windowTitle()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="TJDecompressor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
@@ -705,8 +705,9 @@ public void <B>decompress</B>(byte[]&nbsp;dstBuf,
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer which will receive the decompressed image. This
buffer should normally be <code>pitch * scaledHeight</code> bytes in size,
- where <code>scaledHeight = ceil(jpegHeight * scalingFactor)</code>, and
- the supported scaling factors can be determined by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><CODE>TJ.getScalingFactors()</CODE></A>.<DD><CODE>desiredWidth</CODE> - desired width (in pixels) of the decompressed image.
+ where <code>scaledHeight</code> can be determined by calling <code>
+ scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegHeight)
+ </code> with one of the scaling factors returned from <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><CODE>TJ.getScalingFactors()</CODE></A> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><CODE>getScaledHeight(int, int)</CODE></A>.<DD><CODE>desiredWidth</CODE> - desired width (in pixels) of the decompressed image.
If the desired image dimensions are smaller than the dimensions of the
JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG
decompressor to generate the largest possible image that will fit within
@@ -716,9 +717,11 @@ public void <B>decompress</B>(byte[]&nbsp;dstBuf,
should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
the decompressed image is unpadded, but you can use this to, for instance,
pad each line of the decompressed image to a 4-byte boundary. NOTE:
- <code>scaledWidth = ceil(jpegWidth * scalingFactor)</code>. Setting this
- parameter to 0 is the equivalent of setting it to
- <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.<DD><CODE>desiredHeight</CODE> - desired height (in pixels) of the decompressed image.
+ <code>scaledWidth</code> can be determined by calling <code>
+ scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegWidth)
+ </code> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)"><CODE>getScaledWidth(int, int)</CODE></A>. Setting this parameter to
+ 0 is the equivalent of setting it to <code>scaledWidth *
+ TJ.pixelSize(pixelFormat)</code>.<DD><CODE>desiredHeight</CODE> - desired height (in pixels) of the decompressed image.
If the desired image dimensions are smaller than the dimensions of the
JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG
decompressor to generate the largest possible image that will fit within
@@ -911,7 +914,7 @@ protected void <B>finalize</B>()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="TJDecompressor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
index 5fac384..867f418 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:54 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
-TJ.ScalingFactor
+TJScalingFactor
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -15,7 +15,7 @@ TJ.ScalingFactor
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="TJ.ScalingFactor";
+ parent.document.title="TJScalingFactor";
}
}
</SCRIPT>
@@ -53,11 +53,11 @@ function windowTitle()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" target="_top"><B>FRAMES</B></A> &nbsp;
-&nbsp;<A HREF="TJ.ScalingFactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
+ <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A> &nbsp;
+&nbsp;<A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
@@ -74,9 +74,9 @@ function windowTitle()
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_java.lang.Object">METHOD</A></FONT></TD>
+ SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
-DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
+DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
@@ -88,17 +88,14 @@ DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor
<FONT SIZE="-1">
org.libjpegturbo.turbojpeg</FONT>
<BR>
-Class TJ.ScalingFactor</H2>
+Class TJScalingFactor</H2>
<PRE>
java.lang.Object
- <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJ.ScalingFactor</B>
+ <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJScalingFactor</B>
</PRE>
-<DL>
-<DT><B>Enclosing class:</B><DD><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></DD>
-</DL>
<HR>
<DL>
-<DT><PRE>public final class <B>TJ.ScalingFactor</B><DT>extends java.lang.Object</DL>
+<DT><PRE>public class <B>TJScalingFactor</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
@@ -109,32 +106,7 @@ Fractional scaling factor
<HR>
<P>
-<!-- =========== FIELD SUMMARY =========== -->
-
-<A NAME="field_summary"><!-- --></A>
-<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
-<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
-<B>Field Summary</B></FONT></TH>
-</TR>
-<TR BGCOLOR="white" CLASS="TableRowColor">
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
-<CODE>&nbsp;int</CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#denom">denom</A></B></CODE>
-<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denominator</TD>
-</TR>
-<TR BGCOLOR="white" CLASS="TableRowColor">
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
-<CODE>&nbsp;int</CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#num">num</A></B></CODE>
-
-<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Numerator</TD>
-</TR>
-</TABLE>
-&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
@@ -144,7 +116,8 @@ Fractional scaling factor
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
-<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#TJ.ScalingFactor()">TJ.ScalingFactor</A></B>()</CODE>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)">TJScalingFactor</A></B>(int&nbsp;num,
+ int&nbsp;denom)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
@@ -159,6 +132,48 @@ Fractional scaling factor
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals</A></B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>&nbsp;other)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true or false, depending on whether this instance and
+ <code>other</code> have the same numerator and denominator.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns denominator</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns numerator</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</A></B>(int&nbsp;dimension)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the scaled value of <code>dimension</code>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true or false, depending on whether this instance is equal to
+ 1/1.</TD>
+</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
@@ -172,54 +187,112 @@ Fractional scaling factor
&nbsp;
<P>
-<!-- ============ FIELD DETAIL =========== -->
+<!-- ========= CONSTRUCTOR DETAIL ======== -->
-<A NAME="field_detail"><!-- --></A>
+<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
-<B>Field Detail</B></FONT></TH>
+<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
-<A NAME="num"><!-- --></A><H3>
-num</H3>
+<A NAME="TJScalingFactor(int, int)"><!-- --></A><H3>
+TJScalingFactor</H3>
<PRE>
-public int <B>num</B></PRE>
+public <B>TJScalingFactor</B>(int&nbsp;num,
+ int&nbsp;denom)
+ throws java.lang.Exception</PRE>
<DL>
-<DD>Numerator
-<P>
<DL>
+
+<DT><B>Throws:</B>
+<DD><CODE>java.lang.Exception</CODE></DL>
</DL>
+
+<!-- ============ METHOD DETAIL ========== -->
+
+<A NAME="method_detail"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
+<B>Method Detail</B></FONT></TH>
+</TR>
+</TABLE>
+
+<A NAME="getNum()"><!-- --></A><H3>
+getNum</H3>
+<PRE>
+public int <B>getNum</B>()</PRE>
+<DL>
+<DD>Returns numerator
+<P>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>numerator</DL>
+</DD>
</DL>
<HR>
-<A NAME="denom"><!-- --></A><H3>
-denom</H3>
+<A NAME="getDenom()"><!-- --></A><H3>
+getDenom</H3>
<PRE>
-public int <B>denom</B></PRE>
+public int <B>getDenom</B>()</PRE>
<DL>
-<DD>Denominator
+<DD>Returns denominator
<P>
-<DL>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>denominator</DL>
+</DD>
</DL>
+<HR>
+
+<A NAME="getScaled(int)"><!-- --></A><H3>
+getScaled</H3>
+<PRE>
+public int <B>getScaled</B>(int&nbsp;dimension)</PRE>
+<DL>
+<DD>Returns the scaled value of <code>dimension</code>. This function
+ performs the integer equivalent of
+ <code>ceil(dimension * scalingFactor)</code>.
+<P>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>the scaled value of <code>dimension</code></DL>
+</DD>
</DL>
+<HR>
-<!-- ========= CONSTRUCTOR DETAIL ======== -->
+<A NAME="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)"><!-- --></A><H3>
+equals</H3>
+<PRE>
+public boolean <B>equals</B>(<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A>&nbsp;other)</PRE>
+<DL>
+<DD>Returns true or false, depending on whether this instance and
+ <code>other</code> have the same numerator and denominator.
+<P>
+<DD><DL>
-<A NAME="constructor_detail"><!-- --></A>
-<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
-<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
-<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
-<B>Constructor Detail</B></FONT></TH>
-</TR>
-</TABLE>
+<DT><B>Returns:</B><DD>true or false, depending on whether this instance and
+ <code>other</code> have the same numerator and denominator</DL>
+</DD>
+</DL>
+<HR>
-<A NAME="TJ.ScalingFactor()"><!-- --></A><H3>
-TJ.ScalingFactor</H3>
+<A NAME="isOne()"><!-- --></A><H3>
+isOne</H3>
<PRE>
-public <B>TJ.ScalingFactor</B>()</PRE>
+public boolean <B>isOne</B>()</PRE>
<DL>
+<DD>Returns true or false, depending on whether this instance is equal to
+ 1/1.
+<P>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>true or false, depending on whether this instance is equal to
+ 1/1</DL>
+</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
@@ -250,11 +323,11 @@ public <B>TJ.ScalingFactor</B>()</PRE>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" target="_top"><B>FRAMES</B></A> &nbsp;
-&nbsp;<A HREF="TJ.ScalingFactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
+ <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A> &nbsp;
+&nbsp;<A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
@@ -271,9 +344,9 @@ public <B>TJ.ScalingFactor</B>()</PRE>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_java.lang.Object">METHOD</A></FONT></TD>
+ SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
-DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD>
+DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
index 73953c2..fecccea 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 18:44:49 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
TJTransform
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -53,7 +53,7 @@ function windowTitle()
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJTransform.html" target="_top"><B>FRAMES</B></A> &nbsp;
@@ -684,7 +684,7 @@ public <B>TJTransform</B>(java.awt.Rectangle&nbsp;r,
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJTransform.html" target="_top"><B>FRAMES</B></A> &nbsp;
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
index 8379074..d3da485 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 18:44:49 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
TJTransformer
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-frame.html b/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
index 8c56f05..4338f9b 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -29,6 +29,8 @@ Classes</FONT>&nbsp;
<BR>
<A HREF="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJDecompressor</A>
<BR>
+<A HREF="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJScalingFactor</A>
+<BR>
<A HREF="TJTransform.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransform</A>
<BR>
<A HREF="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg" target="classFrame">TJTransformer</A></FONT></TD>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-summary.html b/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
index 7784a08..733d88d 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -99,6 +99,10 @@ Package org.libjpegturbo.turbojpeg
<TD>TurboJPEG decompressor</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</A></B></TD>
+<TD>Fractional scaling factor</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</A></B></TD>
<TD>Lossless transform parameters</TD>
</TR>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
index 0d70986..ee04a10 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
org.libjpegturbo.turbojpeg Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -95,9 +95,9 @@ Class Hierarchy
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A></UL>
</UL>
</UL>
-<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ.ScalingFactor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL>
+<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A></UL>
-</UL>
+<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A></UL>
</UL>
<HR>
diff --git a/java/doc/overview-tree.html b/java/doc/overview-tree.html
index 20725dc..8a19a88 100644
--- a/java/doc/overview-tree.html
+++ b/java/doc/overview-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -97,9 +97,9 @@ Class Hierarchy
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransform</B></A></UL>
</UL>
</UL>
-<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ.ScalingFactor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL>
+<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>TJ</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJCompressor</B></A><LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJDecompressor</B></A><UL>
<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg"><B>TJTransformer</B></A></UL>
-</UL>
+<LI TYPE="circle">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>TJScalingFactor</B></A></UL>
</UL>
<HR>
diff --git a/java/doc/serialized-form.html b/java/doc/serialized-form.html
index 69556cd..90d6ff8 100644
--- a/java/doc/serialized-form.html
+++ b/java/doc/serialized-form.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_22) on Tue Mar 15 15:50:55 CDT 2011 -->
+<!-- Generated by javadoc (build 1.6.0_24) on Fri Apr 01 20:49:05 CDT 2011 -->
<TITLE>
Serialized Form
</TITLE>
-<META NAME="date" CONTENT="2011-03-15">
+<META NAME="date" CONTENT="2011-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -100,6 +100,9 @@ Serialized Form</H1>
</TABLE>
<P>
+<B>serialVersionUID:&nbsp;</B>-127367705761430371L
+
+<P>
<A NAME="serializedForm"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java
index a1ab4ac..3941b53 100644
--- a/java/org/libjpegturbo/turbojpeg/TJ.java
+++ b/java/org/libjpegturbo/turbojpeg/TJ.java
@@ -35,21 +35,6 @@ final public class TJ {
/**
- * Fractional scaling factor
- */
- final public class ScalingFactor {
- /**
- * Numerator
- */
- public int num = 1;
- /**
- * Denominator
- */
- public int denom = 1;
- };
-
-
- /**
* The number of chrominance subsampling options
*/
final public static int NUMSAMP = 5;
@@ -323,10 +308,10 @@ final public class TJ {
* @return a list of fractional scaling factors that the JPEG decompressor in
* this implementation of TurboJPEG supports
*/
- public native static ScalingFactor[] getScalingFactors()
+ public native static TJScalingFactor[] getScalingFactors()
throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
};
diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java
index 55a983f..de32227 100644
--- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java
@@ -444,7 +444,7 @@ public class TJCompressor {
throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
private long handle = 0;
diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
index 79021fb..b247847 100644
--- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
+++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
@@ -175,13 +175,13 @@ public class TJDecompressor {
throw new Exception(NO_ASSOC_ERROR);
if(desiredWidth < 0 || desiredHeight < 0)
throw new Exception("Invalid argument in getScaledWidth()");
- TJ.ScalingFactor sf[] = TJ.getScalingFactors();
+ TJScalingFactor sf[] = TJ.getScalingFactors();
if(desiredWidth == 0) desiredWidth = jpegWidth;
if(desiredHeight == 0) desiredHeight = jpegHeight;
int scaledWidth = jpegWidth, scaledHeight = jpegHeight;
for(int i = 0; i < sf.length; i++) {
- scaledWidth = (jpegWidth * sf[i].num + sf[i].denom - 1) / sf[i].denom;
- scaledHeight = (jpegHeight * sf[i].num + sf[i].denom - 1) / sf[i].denom;
+ scaledWidth = sf[i].getScaled(jpegWidth);
+ scaledHeight = sf[i].getScaled(jpegHeight);
if(scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
break;
}
@@ -215,13 +215,13 @@ public class TJDecompressor {
throw new Exception(NO_ASSOC_ERROR);
if(desiredWidth < 0 || desiredHeight < 0)
throw new Exception("Invalid argument in getScaledHeight()");
- TJ.ScalingFactor sf[] = TJ.getScalingFactors();
+ TJScalingFactor sf[] = TJ.getScalingFactors();
if(desiredWidth == 0) desiredWidth = jpegWidth;
if(desiredHeight == 0) desiredHeight = jpegHeight;
int scaledWidth = jpegWidth, scaledHeight = jpegHeight;
for(int i = 0; i < sf.length; i++) {
- scaledWidth = (jpegWidth * sf[i].num + sf[i].denom - 1) / sf[i].denom;
- scaledHeight = (jpegHeight * sf[i].num + sf[i].denom - 1) / sf[i].denom;
+ scaledWidth = sf[i].getScaled(jpegWidth);
+ scaledHeight = sf[i].getScaled(jpegHeight);
if(scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
break;
}
@@ -236,9 +236,10 @@ public class TJDecompressor {
*
* @param dstBuf buffer which will receive the decompressed image. This
* buffer should normally be <code>pitch * scaledHeight</code> bytes in size,
- * where <code>scaledHeight = ceil(jpegHeight * scalingFactor)</code>, and
- * the supported scaling factors can be determined by calling {@link
- * TJ#getScalingFactors}.
+ * where <code>scaledHeight</code> can be determined by calling <code>
+ * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)
+ * </code> with one of the scaling factors returned from {@link
+ * TJ#getScalingFactors} or by calling {@link #getScaledHeight}.
*
* @param desiredWidth desired width (in pixels) of the decompressed image.
* If the desired image dimensions are smaller than the dimensions of the
@@ -252,9 +253,11 @@ public class TJDecompressor {
* should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
* the decompressed image is unpadded, but you can use this to, for instance,
* pad each line of the decompressed image to a 4-byte boundary. NOTE:
- * <code>scaledWidth = ceil(jpegWidth * scalingFactor)</code>. Setting this
- * parameter to 0 is the equivalent of setting it to
- * <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.
+ * <code>scaledWidth</code> can be determined by calling <code>
+ * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)
+ * </code> or by calling {@link #getScaledWidth}. Setting this parameter to
+ * 0 is the equivalent of setting it to <code>scaledWidth *
+ * TJ.pixelSize(pixelFormat)</code>.
*
* @param desiredHeight desired height (in pixels) of the decompressed image.
* If the desired image dimensions are smaller than the dimensions of the
@@ -494,7 +497,7 @@ public class TJDecompressor {
throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
protected long handle = 0;
diff --git a/java/org/libjpegturbo/turbojpeg/TJLoader.java b/java/org/libjpegturbo/turbojpeg/TJLoader.java
new file mode 100644
index 0000000..db77bba
--- /dev/null
+++ b/java/org/libjpegturbo/turbojpeg/TJLoader.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;
+
+final class TJLoader {
+ static void load() {
+ System.loadLibrary("turbojpeg");
+ }
+};
diff --git a/java/org/libjpegturbo/turbojpeg/TJLoader.java.in b/java/org/libjpegturbo/turbojpeg/TJLoader.java.in
new file mode 100644
index 0000000..22353a5
--- /dev/null
+++ b/java/org/libjpegturbo/turbojpeg/TJLoader.java.in
@@ -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;
+
+final class TJLoader {
+ static void load() {
+ System.loadLibrary("@TURBOJPEG_DLL_NAME@");
+ }
+};
diff --git a/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java b/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java
new file mode 100644
index 0000000..2e4b66a
--- /dev/null
+++ b/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java
@@ -0,0 +1,96 @@
+/*
+ * 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;
+
+/**
+ * Fractional scaling factor
+ */
+public class TJScalingFactor {
+
+ public TJScalingFactor(int num, int denom) throws Exception {
+ if(num < 1 || denom < 1)
+ throw new Exception("Numerator and denominator must be >= 1");
+ }
+
+ /**
+ * Returns numerator
+ * @return numerator
+ */
+ public int getNum() {
+ return num;
+ }
+
+ /**
+ * Returns denominator
+ * @return denominator
+ */
+ public int getDenom() {
+ return denom;
+ }
+
+ /**
+ * Returns the scaled value of <code>dimension</code>. This function
+ * performs the integer equivalent of
+ * <code>ceil(dimension * scalingFactor)</code>.
+ * @return the scaled value of <code>dimension</code>
+ */
+ public int getScaled(int dimension) {
+ return (dimension * num + denom - 1) / denom;
+ }
+
+ /**
+ * Returns true or false, depending on whether this instance and
+ * <code>other</code> have the same numerator and denominator.
+ * @return true or false, depending on whether this instance and
+ * <code>other</code> have the same numerator and denominator
+ */
+ public boolean equals(TJScalingFactor other) {
+ return (this.num == other.num && this.denom == other.denom);
+ }
+
+ /**
+ * Returns true or false, depending on whether this instance is equal to
+ * 1/1.
+ * @return true or false, depending on whether this instance is equal to
+ * 1/1
+ */
+ public boolean isOne() {
+ return (num == 1 && denom == 1);
+ }
+
+ /**
+ * Numerator
+ */
+ private int num = 1;
+
+ /**
+ * Denominator
+ */
+ private int denom = 1;
+};
diff --git a/java/org/libjpegturbo/turbojpeg/TJTransformer.java b/java/org/libjpegturbo/turbojpeg/TJTransformer.java
index 6976cd1..78c4c9d 100644
--- a/java/org/libjpegturbo/turbojpeg/TJTransformer.java
+++ b/java/org/libjpegturbo/turbojpeg/TJTransformer.java
@@ -151,7 +151,7 @@ public class TJTransformer extends TJDecompressor {
TJTransform[] transforms, int flags) throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
private int[] transformedSizes = null;
diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c
index c133969..099d6bf 100644
--- a/turbojpeg-jni.c
+++ b/turbojpeg-jni.c
@@ -302,7 +302,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFact
if((sf=tjGetScalingFactors(&n))==NULL || n==0)
_throw(tjGetErrorStr());
- bailif0(sfcls=(*env)->FindClass(env, "org/libjpegturbo/turbojpeg/TJ$ScalingFactor"));
+ bailif0(sfcls=(*env)->FindClass(env, "org/libjpegturbo/turbojpeg/TJScalingFactor"));
bailif0(sfjava=(jobjectArray)(*env)->NewObjectArray(env, n, sfcls, 0));
for(i=0; i<n; i++)