Slight refactor to put ScalingFactor into its own class (mainly because the $ in the class name was wreaking havoc on the build scripts, but also to add a few convenience methods to it) and to create a separate loader class so we can provide a .jar file with the MinGW distribution that loads the correct DLL

This commit is contained in:
DRC
2011-04-02 02:09:03 +00:00
parent d6d704d30d
commit 90a42bb4d2
30 changed files with 504 additions and 243 deletions

View File

@@ -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})

View File

@@ -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

View File

@@ -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;
};

View File

@@ -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");
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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">

View File

@@ -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">

View File

@@ -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">

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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;

View File

@@ -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;

View File

@@ -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,39 +187,6 @@ Fractional scaling factor
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_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>
</TR>
</TABLE>
<A NAME="num"><!-- --></A><H3>
num</H3>
<PRE>
public int <B>num</B></PRE>
<DL>
<DD>Numerator
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="denom"><!-- --></A><H3>
denom</H3>
<PRE>
public int <B>denom</B></PRE>
<DL>
<DD>Denominator
<P>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
@@ -215,11 +197,102 @@ public int <B>denom</B></PRE>
</TR>
</TABLE>
<A NAME="TJ.ScalingFactor()"><!-- --></A><H3>
TJ.ScalingFactor</H3>
<A NAME="TJScalingFactor(int, int)"><!-- --></A><H3>
TJScalingFactor</H3>
<PRE>
public <B>TJ.ScalingFactor</B>()</PRE>
public <B>TJScalingFactor</B>(int&nbsp;num,
int&nbsp;denom)
throws java.lang.Exception</PRE>
<DL>
<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="getDenom()"><!-- --></A><H3>
getDenom</H3>
<PRE>
public int <B>getDenom</B>()</PRE>
<DL>
<DD>Returns denominator
<P>
<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>
<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>
<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="isOne()"><!-- --></A><H3>
isOne</H3>
<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>

View File

@@ -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;

View File

@@ -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">

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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">
@@ -99,6 +99,9 @@ Serialized Form</H1>
</TR>
</TABLE>
<P>
<B>serialVersionUID:&nbsp;</B>-127367705761430371L
<P>
<A NAME="serializedForm"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">

View File

@@ -34,21 +34,6 @@ package org.libjpegturbo.turbojpeg;
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
*/
@@ -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();
}
};

View File

@@ -444,7 +444,7 @@ public class TJCompressor {
throws Exception;
static {
System.loadLibrary("turbojpeg");
TJLoader.load();
}
private long handle = 0;

View File

@@ -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;

View File

@@ -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");
}
};

View File

@@ -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@");
}
};

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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++)