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
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 "")
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})
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 \
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 \
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
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
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(", ");
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;
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;
}
}
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());
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);
}
}
- static TJ.ScalingFactor sf [] = null;
+ static TJScalingFactor sf [] = null;
};
}
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++) {
}
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++) {
}
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
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();
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
byte[] buf = db.getData();
return checkBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, subsamp,
- scaleNum, scaleDenom, flags);
+ sf, flags);
}
}
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;
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("... ");
}
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);
}
}
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;
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");
}
<!--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">
<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>
<!--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">
<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>
<!--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">
<!--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">
<!--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">
<!--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">
<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>
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>
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>
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
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.
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
<DD>
</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>
<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
<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>
-<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>
<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.
<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>
<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.
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>
<!--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>
<!--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">
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+ <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>
<A HREF="TJ.html" target="_top"><B>NO FRAMES</B></A>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
+ SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
<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> 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>
- Fractional scaling factor</TD>
-</TR>
-</TABLE>
- <!-- =========== FIELD SUMMARY =========== -->
+<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
-<CODE>static <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJ.ScalingFactor</A>[]</CODE></FONT></TD>
+<CODE>static <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>
<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.
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+ <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>
<A HREF="TJ.html" target="_top"><B>NO FRAMES</B></A>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
+ SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
<!--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">
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
+ <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
<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>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
+ <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
<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>
<!--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">
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+ <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>
<A HREF="TJDecompressor.html" target="_top"><B>NO FRAMES</B></A>
<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
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
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+ <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>
<A HREF="TJDecompressor.html" target="_top"><B>NO FRAMES</B></A>
<!--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">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="TJ.ScalingFactor";
+ parent.document.title="TJScalingFactor";
}
}
</SCRIPT>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+ <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
+ <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>
- <A HREF="TJ.ScalingFactor.html" target="_top"><B>NO FRAMES</B></A>
+ <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A>
+ <A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Object">METHOD</A></FONT></TD>
+ SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
-DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
+DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<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>
<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> int</CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#denom">denom</A></B></CODE>
-<BR>
- Denominator</TD>
-</TR>
-<TR BGCOLOR="white" CLASS="TableRowColor">
-<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
-<CODE> int</CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.ScalingFactor.html#num">num</A></B></CODE>
-
-<BR>
- Numerator</TD>
-</TR>
-</TABLE>
-
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<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 num,
+ int denom)</CODE>
<BR>
</TD>
<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> 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> other)</CODE>
+
+<BR>
+ 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> int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom</A></B>()</CODE>
+
+<BR>
+ Returns denominator</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()">getNum</A></B>()</CODE>
+
+<BR>
+ Returns numerator</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE> int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)">getScaled</A></B>(int dimension)</CODE>
+
+<BR>
+ 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> boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()">isOne</A></B>()</CODE>
+
+<BR>
+ Returns true or false, depending on whether this instance is equal to
+ 1/1.</TD>
+</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<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 num,
+ int 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 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> 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>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
+ <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
+ <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>
- <A HREF="TJ.ScalingFactor.html" target="_top"><B>NO FRAMES</B></A>
+ <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html" target="_top"><B>FRAMES</B></A>
+ <A HREF="TJScalingFactor.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.lang.Object">METHOD</A></FONT></TD>
+ SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
-DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
+DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!--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">
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
+ <A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
<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>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
+ <A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>
<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>
<!--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">
<!--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">
<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>
<!--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">
<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>
<!--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">
<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>
<!--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">
<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>
<!--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">
</TR>
</TABLE>
+<P>
+<B>serialVersionUID: </B>-127367705761430371L
+
<P>
<A NAME="serializedForm"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
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
*/
* @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();
}
};
throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
private long handle = 0;
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;
}
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;
}
*
* @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
* 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
throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
protected long handle = 0;
--- /dev/null
+/*
+ * 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");
+ }
+};
--- /dev/null
+/*
+ * 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@");
+ }
+};
--- /dev/null
+/*
+ * 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;
+};
TJTransform[] transforms, int flags) throws Exception;
static {
- System.loadLibrary("turbojpeg");
+ TJLoader.load();
}
private int[] transformedSizes = null;
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++)