revert changes in avi lib (Netbeans reformated the code automatically)

This commit is contained in:
honfika@gmail.com
2015-03-07 14:47:51 +01:00
parent 3c995f42e3
commit f938e97f5a
2 changed files with 39 additions and 91 deletions

View File

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