/** Checks whether QTJava is available, throwing an exception if not. */ public void checkQTLibrary() throws MissingLibraryException { if (isJVM64Bit()) throw new MissingLibraryException(JVM_64BIT_MSG); if (isQTExpired()) throw new MissingLibraryException(EXPIRED_QT_MSG); if (!canDoQT()) throw new MissingLibraryException(NO_QT_MSG); }
/** Whether this JVM is 64-bit. */ public boolean isJVM64Bit() { if (!initialized) initClass(); return jvm64Bit; }
tools = new LegacyQTTools(); r = tools.getUniverse(); tools.checkQTLibrary();
boolean canDoQT = new LegacyQTTools().canDoQT(); qtJava = new JCheckBox("Use QTJava", canDoQT); qtJava.setEnabled(canDoQT);
/** Gets width and height for the given PICT bytes. */ public Dimension getPictDimensions(byte[] bytes) throws FormatException, ReflectException { checkQTLibrary(); try { r.exec("QTSession.open()"); r.setVar("bytes", bytes); r.exec("pict = new Pict(bytes)"); r.exec("box = pict.getPictFrame()"); int width = ((Integer) r.exec("box.getWidth()")).intValue(); int height = ((Integer) r.exec("box.getHeight()")).intValue(); r.exec("QTSession.close()"); return new Dimension(width, height); } catch (ReflectException e) { r.exec("QTSession.close()"); throw new FormatException("PICT height determination failed", e); } }
in.read(pix); byte[][] b = AWTImageTools.getBytes( AWTImageTools.makeBuffered(qtTools.pictToImage(pix))); pix = null; for (int i=0; i<b.length; i++) {
tools = new LegacyQTTools(); r = tools.getUniverse(); tools.checkQTLibrary();
boolean canDoQT = new LegacyQTTools().canDoQT(); qtJava = new JCheckBox("Use QTJava", canDoQT); qtJava.setEnabled(canDoQT);
/** Gets width and height for the given PICT bytes. */ public Dimension getPictDimensions(byte[] bytes) throws FormatException, ReflectException { checkQTLibrary(); try { r.exec("QTSession.open()"); r.setVar("bytes", bytes); r.exec("pict = new Pict(bytes)"); r.exec("box = pict.getPictFrame()"); int width = ((Integer) r.exec("box.getWidth()")).intValue(); int height = ((Integer) r.exec("box.getHeight()")).intValue(); r.exec("QTSession.close()"); return new Dimension(width, height); } catch (ReflectException e) { r.exec("QTSession.close()"); throw new FormatException("PICT height determination failed", e); } }
in.read(pix); byte[][] b = AWTImageTools.getBytes( AWTImageTools.makeBuffered(qtTools.pictToImage(pix))); pix = null; for (int i=0; i<b.length; i++) {
/** Checks whether QTJava is available, throwing an exception if not. */ public void checkQTLibrary() throws MissingLibraryException { if (isJVM64Bit()) throw new MissingLibraryException(JVM_64BIT_MSG); if (isQTExpired()) throw new MissingLibraryException(EXPIRED_QT_MSG); if (!canDoQT()) throw new MissingLibraryException(NO_QT_MSG); }
tools = new LegacyQTTools(); r = tools.getUniverse(); tools.checkQTLibrary();
public QTWriter() { super("QuickTime", "mov"); LegacyQTTools tools = new LegacyQTTools(); if (tools.canDoQT()) { compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression(), // NB: Writing to Motion JPEG-B with QTJava seems to be broken. /*"Motion JPEG-B",*/ CompressionType.CINEPAK.getCompression(), CompressionType.ANIMATION.getCompression(), CompressionType.H_263.getCompression(), CompressionType.SORENSON.getCompression(), CompressionType.SORENSON_3.getCompression(), CompressionType.MPEG_4.getCompression() }; } else compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression()}; }
/** Whether QuickTime for Java has expired. */ public boolean isQTExpired() { if (!initialized) initClass(); return expiredQT; }
throws FormatException checkQTLibrary(); try { r.exec("QTSession.open()");
/** Gets the QuickTime for Java version number. */ public String getQTVersion() { if (isJVM64Bit()) return "Not available"; else if (isQTExpired()) return "Expired"; else if (!canDoQT()) return "Missing"; else { try { String qtMajor = r.exec("QTSession.getMajorVersion()").toString(); String qtMinor = r.exec("QTSession.getMinorVersion()").toString(); return qtMajor + "." + qtMinor; } catch (Throwable t) { LOGGER.debug("Could not retrieve QuickTime for Java version", t); return "Error"; } } }
tools = new LegacyQTTools(); r = tools.getUniverse(); tools.checkQTLibrary();
public QTWriter() { super("QuickTime", "mov"); LegacyQTTools tools = new LegacyQTTools(); if (tools.canDoQT()) { compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression(), // NB: Writing to Motion JPEG-B with QTJava seems to be broken. /*"Motion JPEG-B",*/ CompressionType.CINEPAK.getCompression(), CompressionType.ANIMATION.getCompression(), CompressionType.H_263.getCompression(), CompressionType.SORENSON.getCompression(), CompressionType.SORENSON_3.getCompression(), CompressionType.MPEG_4.getCompression() }; } else compressionTypes = new String[] { CompressionType.UNCOMPRESSED.getCompression()}; }
/** Gets QuickTime for Java reflected universe. */ public ReflectedUniverse getUniverse() { if (!initialized) initClass(); return r; }
throws FormatException checkQTLibrary(); try { r.exec("QTSession.open()");