diff --git a/libsrc/avi/src/org/monte/media/AbstractVideoCodec.java b/libsrc/avi/src/org/monte/media/AbstractVideoCodec.java index 0f7b53bb5..f180e7233 100644 --- a/libsrc/avi/src/org/monte/media/AbstractVideoCodec.java +++ b/libsrc/avi/src/org/monte/media/AbstractVideoCodec.java @@ -1,9 +1,9 @@ /* * @(#)AbstractVideoCodec.java - * + * * Copyright (c) 2011 Werner Randelshofer, Goldau, Switzerland. * All rights reserved. - * + * * You may not use, copy or modify this file, except in compliance with the * license agreement you entered into with Werner Randelshofer. * For details see accompanying license terms. @@ -21,8 +21,7 @@ import java.awt.image.DirectColorModel; import java.awt.image.WritableRaster; import java.io.IOException; import javax.imageio.stream.ImageOutputStream; -import static org.monte.media.VideoFormatKeys.HeightKey; -import static org.monte.media.VideoFormatKeys.WidthKey; +import static org.monte.media.VideoFormatKeys.*; /** * {@code AbstractVideoCodec}. @@ -38,10 +37,7 @@ public abstract class AbstractVideoCodec extends AbstractCodec { super(supportedInputFormats, supportedOutputFormats); } - /** - * Gets 8-bit indexed pixels from a buffer. Returns null if conversion - * failed. - */ + /** Gets 8-bit indexed pixels from a buffer. Returns null if conversion failed. */ protected byte[] getIndexed8(Buffer buf) { if (buf.data instanceof byte[]) { return (byte[]) buf.data; @@ -55,9 +51,7 @@ public abstract class AbstractVideoCodec extends AbstractCodec { return null; } - /** - * Gets 15-bit RGB pixels from a buffer. Returns null if conversion failed. - */ + /** Gets 15-bit RGB pixels from a buffer. Returns null if conversion failed. */ protected short[] getRGB15(Buffer buf) { if (buf.data instanceof int[]) { return (short[]) buf.data; @@ -86,11 +80,7 @@ public abstract class AbstractVideoCodec extends AbstractCodec { } return null; } - - /** - * Gets 16-bit RGB-5-6-5 pixels from a buffer. Returns null if conversion - * failed. - */ + /** Gets 16-bit RGB-5-6-5 pixels from a buffer. Returns null if conversion failed. */ protected short[] getRGB16(Buffer buf) { if (buf.data instanceof int[]) { return (short[]) buf.data; @@ -120,9 +110,8 @@ public abstract class AbstractVideoCodec extends AbstractCodec { return null; } - /** - * Gets 24-bit RGB pixels from a buffer. Returns null if conversion failed. - */ + + /** Gets 24-bit RGB pixels from a buffer. Returns null if conversion failed. */ protected int[] getRGB24(Buffer buf) { if (buf.data instanceof int[]) { return (int[]) buf.data; @@ -144,9 +133,7 @@ public abstract class AbstractVideoCodec extends AbstractCodec { return null; } - /** - * Gets 32-bit ARGB pixels from a buffer. Returns null if conversion failed. - */ + /** Gets 32-bit ARGB pixels from a buffer. Returns null if conversion failed. */ protected int[] getARGB32(Buffer buf) { if (buf.data instanceof int[]) { return (int[]) buf.data; @@ -168,16 +155,13 @@ public abstract class AbstractVideoCodec extends AbstractCodec { return null; } - /** - * Gets a buffered image from a buffer. Returns null if conversion failed. - */ + /** Gets a buffered image from a buffer. Returns null if conversion failed. */ protected BufferedImage getBufferedImage(Buffer buf) { if (buf.data instanceof BufferedImage) { return (BufferedImage) buf.data; } return null; } - private byte[] byteBuf = new byte[4]; protected void writeInt24(ImageOutputStream out, int v) throws IOException { @@ -232,9 +216,7 @@ public abstract class AbstractVideoCodec extends AbstractCodec { out.write(b, 0, len * 3); } - /** - * Copies a buffered image. - */ + /** Copies a buffered image. */ protected static BufferedImage copyImage(BufferedImage img) { ColorModel cm = img.getColorModel(); boolean isAlphaPremultiplied = cm.isAlphaPremultiplied(); diff --git a/libsrc/avi/src/org/monte/media/DefaultRegistry.java b/libsrc/avi/src/org/monte/media/DefaultRegistry.java index 813cbf2a0..16496597b 100644 --- a/libsrc/avi/src/org/monte/media/DefaultRegistry.java +++ b/libsrc/avi/src/org/monte/media/DefaultRegistry.java @@ -1,9 +1,9 @@ /* - * @(#)DefaultRegistry.java - * + * @(#)DefaultRegistry.java + * * Copyright (c) 2011 Werner Randelshofer, Goldau, Switzerland. * All rights reserved. - * + * * You may not use, copy or modify this file, except in compliance onlyWith the * license agreement you entered into onlyWith Werner Randelshofer. * For details see accompanying license terms. @@ -16,41 +16,13 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; -import static org.monte.media.AudioFormatKeys.ENCODING_AVI_PCM; -import static org.monte.media.AudioFormatKeys.ENCODING_PCM_SIGNED; -import static org.monte.media.AudioFormatKeys.ENCODING_PCM_UNSIGNED; -import static org.monte.media.AudioFormatKeys.ENCODING_QUICKTIME_IN24_PCM; -import static org.monte.media.AudioFormatKeys.ENCODING_QUICKTIME_IN32_PCM; -import static org.monte.media.AudioFormatKeys.ENCODING_QUICKTIME_RAW_PCM; -import static org.monte.media.AudioFormatKeys.ENCODING_QUICKTIME_SOWT_PCM; -import static org.monte.media.AudioFormatKeys.ENCODING_QUICKTIME_TWOS_PCM; -import static org.monte.media.FormatKeys.EncodingKey; -import static org.monte.media.FormatKeys.MIME_ANIM; -import static org.monte.media.FormatKeys.MIME_AVI; -import static org.monte.media.FormatKeys.MIME_JAVA; -import static org.monte.media.FormatKeys.MIME_QUICKTIME; -import org.monte.media.FormatKeys.MediaType; -import static org.monte.media.FormatKeys.MediaTypeKey; -import static org.monte.media.FormatKeys.MimeTypeKey; -import static org.monte.media.VideoFormatKeys.COMPRESSOR_NAME_AVI_TECHSMITH_SCREEN_CAPTURE; -import static org.monte.media.VideoFormatKeys.CompressorNameKey; -import static org.monte.media.VideoFormatKeys.ENCODING_AVI_DIB; -import static org.monte.media.VideoFormatKeys.ENCODING_AVI_DOSBOX_SCREEN_CAPTURE; -import static org.monte.media.VideoFormatKeys.ENCODING_AVI_MJPG; -import static org.monte.media.VideoFormatKeys.ENCODING_AVI_PNG; -import static org.monte.media.VideoFormatKeys.ENCODING_AVI_RLE; -import static org.monte.media.VideoFormatKeys.ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE; -import static org.monte.media.VideoFormatKeys.ENCODING_BITMAP_IMAGE; -import static org.monte.media.VideoFormatKeys.ENCODING_BUFFERED_IMAGE; -import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_ANIMATION; -import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_JPEG; -import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_PNG; -import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_RAW; +import static org.monte.media.VideoFormatKeys.*; +import static org.monte.media.AudioFormatKeys.*; /** - * {@code DefaultRegistry}. + * {@code DefaultRegistry}. *
- * FIXME - The registry should be read from a file.
+ * FIXME - The registry should be read from a file.
*
* @author Werner Randelshofer
* @version $Id: DefaultRegistry.java 299 2013-01-03 07:40:18Z werner $
@@ -58,11 +30,8 @@ import static org.monte.media.VideoFormatKeys.ENCODING_QUICKTIME_RAW;
public class DefaultRegistry extends Registry {
private HashMap