You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by da...@apache.org on 2012/05/26 23:19:22 UTC
svn commit: r1342971 [8/20] - in /commons/proper/imaging/trunk/src:
main/java/org/apache/commons/imaging/formats/bmp/
main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/
main/java/org/apache/commons/imaging/formats/bmp/writers/ main/java/org...
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/ScanExpediterSimple.java Sat May 26 21:19:03 2012
@@ -24,8 +24,7 @@ import org.apache.commons.imaging.ImageR
import org.apache.commons.imaging.formats.png.chunks.PngChunkPlte;
import org.apache.commons.imaging.formats.transparencyfilters.TransparencyFilter;
-public class ScanExpediterSimple extends ScanExpediter
-{
+public class ScanExpediterSimple extends ScanExpediter {
public ScanExpediterSimple(int width, int height, InputStream is,
BufferedImage bi, int color_type, int BitDepth, int bitsPerPixel,
PngChunkPlte pngChunkPLTE, GammaCorrection gammaCorrection,
@@ -37,14 +36,12 @@ public class ScanExpediterSimple extends
}
@Override
- public void drive() throws ImageReadException, IOException
- {
+ public void drive() throws ImageReadException, IOException {
int bitsPerScanLine = bitsPerPixel * width;
int pixelBytesPerScanLine = getBitsToBytesRoundingUp(bitsPerScanLine);
byte prev[] = null;
- for (int y = 0; y < height; y++)
- {
+ for (int y = 0; y < height; y++) {
byte unfiltered[] = getNextScanline(is, pixelBytesPerScanLine,
prev, bytesPerPixel);
@@ -53,8 +50,7 @@ public class ScanExpediterSimple extends
BitParser bitParser = new BitParser(unfiltered, bitsPerPixel,
bitDepth);
- for (int x = 0; x < width; x++)
- {
+ for (int x = 0; x < width; x++) {
int rgb = getRGB(bitParser, x);
bi.setRGB(x, y, rgb);
@@ -62,4 +58,4 @@ public class ScanExpediterSimple extends
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunk.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunk.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunk.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunk.java Sat May 26 21:19:03 2012
@@ -20,8 +20,7 @@ import java.io.ByteArrayInputStream;
import org.apache.commons.imaging.common.BinaryFileParser;
-public class PngChunk extends BinaryFileParser
-{
+public class PngChunk extends BinaryFileParser {
public final int length;
public final int chunkType;
public final int crc;
@@ -30,8 +29,7 @@ public class PngChunk extends BinaryFile
public final boolean propertyBits[];
public final boolean ancillary, isPrivate, reserved, safeToCopy;
- public PngChunk(int Length, int ChunkType, int CRC, byte bytes[])
- {
+ public PngChunk(int Length, int ChunkType, int CRC, byte bytes[]) {
this.length = Length;
this.chunkType = ChunkType;
this.crc = CRC;
@@ -39,8 +37,7 @@ public class PngChunk extends BinaryFile
propertyBits = new boolean[4];
int shift = 24;
- for (int i = 0; i < 4; i++)
- {
+ for (int i = 0; i < 4; i++) {
int theByte = 0xff & (ChunkType >> shift);
shift -= 8;
int theMask = 1 << 5;
@@ -53,10 +50,9 @@ public class PngChunk extends BinaryFile
safeToCopy = propertyBits[3];
}
- protected ByteArrayInputStream getDataStream()
- {
+ protected ByteArrayInputStream getDataStream() {
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
return is;
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkGama.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkGama.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkGama.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkGama.java Sat May 26 21:19:03 2012
@@ -19,22 +19,19 @@ package org.apache.commons.imaging.forma
import java.io.ByteArrayInputStream;
import java.io.IOException;
-public class PngChunkGama extends PngChunk
-{
+public class PngChunkGama extends PngChunk {
public final int Gamma;
public PngChunkGama(int Length, int ChunkType, int CRC, byte bytes[])
- throws IOException
- {
+ throws IOException {
super(Length, ChunkType, CRC, bytes);
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
Gamma = read4Bytes("Gamma", is, "Not a Valid Png File: gAMA Corrupt");
}
- public double getGamma()
- {
+ public double getGamma() {
return 1.0 / (Gamma / 100000.0);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIccp.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIccp.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIccp.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIccp.java Sat May 26 21:19:03 2012
@@ -21,21 +21,19 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.common.ZLibUtils;
-public class PngChunkIccp extends PngChunk
-{
- // private final PngImageParser parser;
+public class PngChunkIccp extends PngChunk {
+ // private final PngImageParser parser;
public final String ProfileName;
public final int CompressionMethod;
public final byte CompressedProfile[];
public final byte UncompressedProfile[];
public PngChunkIccp(
- // PngImageParser parser,
+ // PngImageParser parser,
int Length, int ChunkType, int CRC, byte bytes[])
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
super(Length, ChunkType, CRC, bytes);
- // this.parser = parser;
+ // this.parser = parser;
{
int index = findNull(bytes);
@@ -52,8 +50,7 @@ public class PngChunkIccp extends PngChu
System.arraycopy(bytes, index + 1 + 1, CompressedProfile, 0,
CompressedProfileLength);
- if (getDebug())
- {
+ if (getDebug()) {
System.out.println("ProfileName: " + ProfileName);
System.out.println("ProfileName.length(): "
+ ProfileName.length());
@@ -63,11 +60,9 @@ public class PngChunkIccp extends PngChu
System.out.println("bytes.length: " + bytes.length);
}
- UncompressedProfile = new ZLibUtils()
- .inflate(CompressedProfile);
+ UncompressedProfile = new ZLibUtils().inflate(CompressedProfile);
- if (getDebug())
- {
+ if (getDebug()) {
System.out.println("UncompressedProfile: "
+ ((UncompressedProfile == null) ? "null" : ""
+ bytes.length));
@@ -76,4 +71,4 @@ public class PngChunkIccp extends PngChu
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIdat.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIdat.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIdat.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIdat.java Sat May 26 21:19:03 2012
@@ -16,10 +16,8 @@
*/
package org.apache.commons.imaging.formats.png.chunks;
-public class PngChunkIdat extends PngChunk
-{
- public PngChunkIdat(int Length, int ChunkType, int CRC, byte bytes[])
- {
+public class PngChunkIdat extends PngChunk {
+ public PngChunkIdat(int Length, int ChunkType, int CRC, byte bytes[]) {
super(Length, ChunkType, CRC, bytes);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIhdr.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIhdr.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIhdr.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkIhdr.java Sat May 26 21:19:03 2012
@@ -19,8 +19,7 @@ package org.apache.commons.imaging.forma
import java.io.ByteArrayInputStream;
import java.io.IOException;
-public class PngChunkIhdr extends PngChunk
-{
+public class PngChunkIhdr extends PngChunk {
public final int width;
public final int height;
public final int bitDepth;
@@ -30,8 +29,7 @@ public class PngChunkIhdr extends PngChu
public final int interlaceMethod;
public PngChunkIhdr(int Length, int ChunkType, int CRC, byte bytes[])
- throws IOException
- {
+ throws IOException {
super(Length, ChunkType, CRC, bytes);
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
@@ -48,4 +46,4 @@ public class PngChunkIhdr extends PngChu
interlaceMethod = readByte("InterlaceMethod", is,
"Not a Valid Png File: IHDR Corrupt");
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java Sat May 26 21:19:03 2012
@@ -23,8 +23,7 @@ import org.apache.commons.imaging.common
import org.apache.commons.imaging.formats.png.PngConstants;
import org.apache.commons.imaging.formats.png.PngText;
-public class PngChunkItxt extends PngTextChunk
-{
+public class PngChunkItxt extends PngTextChunk {
public final String keyword, text;
/*
@@ -41,8 +40,7 @@ public class PngChunkItxt extends PngTex
public final String translatedKeyword;
public PngChunkItxt(int length, int chunkType, int crc, byte bytes[])
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
super(length, chunkType, crc, bytes);
{
int terminator = findNull(bytes);
@@ -90,8 +88,7 @@ public class PngChunkItxt extends PngTex
"utf-8");
index = terminator + 1;
- if (compressed)
- {
+ if (compressed) {
int compressedTextLength = bytes.length - index;
byte compressedText[] = new byte[compressedTextLength];
@@ -110,8 +107,7 @@ public class PngChunkItxt extends PngTex
* @return Returns the keyword.
*/
@Override
- public String getKeyword()
- {
+ public String getKeyword() {
return keyword;
}
@@ -119,14 +115,12 @@ public class PngChunkItxt extends PngTex
* @return Returns the text.
*/
@Override
- public String getText()
- {
+ public String getText() {
return text;
}
@Override
- public PngText getContents()
- {
+ public PngText getContents() {
return new PngText.iTXt(keyword, text, languageTag, translatedKeyword);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPhys.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPhys.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPhys.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPhys.java Sat May 26 21:19:03 2012
@@ -19,15 +19,13 @@ package org.apache.commons.imaging.forma
import java.io.ByteArrayInputStream;
import java.io.IOException;
-public class PngChunkPhys extends PngChunk
-{
+public class PngChunkPhys extends PngChunk {
public final int PixelsPerUnitXAxis;
public final int PixelsPerUnitYAxis;
public final int UnitSpecifier;
public PngChunkPhys(int Length, int ChunkType, int CRC, byte bytes[])
- throws IOException
- {
+ throws IOException {
super(Length, ChunkType, CRC, bytes);
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
@@ -40,4 +38,4 @@ public class PngChunkPhys extends PngChu
"Not a Valid Png File: pHYs Corrupt");
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkPlte.java Sat May 26 21:19:03 2012
@@ -22,13 +22,11 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.formats.png.GammaCorrection;
-public class PngChunkPlte extends PngChunk
-{
+public class PngChunkPlte extends PngChunk {
public final int rgb[];
public PngChunkPlte(int length, int ChunkType, int CRC, byte bytes[])
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
super(length, ChunkType, CRC, bytes);
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
@@ -40,8 +38,7 @@ public class PngChunkPlte extends PngChu
rgb = new int[count];
- for (int i = 0; i < count; i++)
- {
+ for (int i = 0; i < count; i++) {
int red = readByte("red[" + i + "]", is,
"Not a Valid Png File: PLTE Corrupt");
int green = readByte("green[" + i + "]", is,
@@ -53,8 +50,7 @@ public class PngChunkPlte extends PngChu
}
}
- public int getRGB(int index) throws ImageReadException
- {
+ public int getRGB(int index) throws ImageReadException {
if ((index < 0) || (index >= rgb.length))
throw new ImageReadException("PNG: unknown Palette reference: "
+ index);
@@ -72,10 +68,9 @@ public class PngChunkPlte extends PngChu
// Debug.debug();
// }
- public void correct(GammaCorrection gammaCorrection)
- {
+ public void correct(GammaCorrection gammaCorrection) {
for (int i = 0; i < rgb.length; i++)
rgb[i] = gammaCorrection.correctARGB(rgb[i]);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkText.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkText.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkText.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkText.java Sat May 26 21:19:03 2012
@@ -21,13 +21,11 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.formats.png.PngText;
-public class PngChunkText extends PngTextChunk
-{
+public class PngChunkText extends PngTextChunk {
public final String keyword, text;
public PngChunkText(int length, int chunkType, int crc, byte bytes[])
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
super(length, chunkType, crc, bytes);
{
int index = findNull(bytes);
@@ -40,8 +38,7 @@ public class PngChunkText extends PngTex
int textLength = bytes.length - (index + 1);
text = new String(bytes, index + 1, textLength, "ISO-8859-1");
- if (getDebug())
- {
+ if (getDebug()) {
System.out.println("Keyword: " + keyword);
System.out.println("Text: " + text);
}
@@ -53,8 +50,7 @@ public class PngChunkText extends PngTex
* @return Returns the keyword.
*/
@Override
- public String getKeyword()
- {
+ public String getKeyword() {
return keyword;
}
@@ -62,15 +58,13 @@ public class PngChunkText extends PngTex
* @return Returns the text.
*/
@Override
- public String getText()
- {
+ public String getText() {
return text;
}
@Override
- public PngText getContents()
- {
+ public PngText getContents() {
return new PngText.tEXt(keyword, text);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkZtxt.java Sat May 26 21:19:03 2012
@@ -23,14 +23,12 @@ import org.apache.commons.imaging.common
import org.apache.commons.imaging.formats.png.PngConstants;
import org.apache.commons.imaging.formats.png.PngText;
-public class PngChunkZtxt extends PngTextChunk
-{
+public class PngChunkZtxt extends PngTextChunk {
public final String keyword, text;
public PngChunkZtxt(int length, int chunkType, int crc, byte bytes[])
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
super(length, chunkType, crc, bytes);
{
@@ -62,8 +60,7 @@ public class PngChunkZtxt extends PngTex
* @return Returns the keyword.
*/
@Override
- public String getKeyword()
- {
+ public String getKeyword() {
return keyword;
}
@@ -71,15 +68,13 @@ public class PngChunkZtxt extends PngTex
* @return Returns the text.
*/
@Override
- public String getText()
- {
+ public String getText() {
return text;
}
@Override
- public PngText getContents()
- {
+ public PngText getContents() {
return new PngText.zTXt(keyword, text);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngTextChunk.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngTextChunk.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngTextChunk.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngTextChunk.java Sat May 26 21:19:03 2012
@@ -18,11 +18,9 @@ package org.apache.commons.imaging.forma
import org.apache.commons.imaging.formats.png.PngText;
-public abstract class PngTextChunk extends PngChunk
-{
+public abstract class PngTextChunk extends PngChunk {
- public PngTextChunk(int Length, int ChunkType, int CRC, byte bytes[])
- {
+ public PngTextChunk(int Length, int ChunkType, int CRC, byte bytes[]) {
super(Length, ChunkType, CRC, bytes);
}
@@ -33,4 +31,4 @@ public abstract class PngTextChunk exten
public abstract PngText getContents();
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilter.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilter.java Sat May 26 21:19:03 2012
@@ -20,8 +20,7 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
-public abstract class ScanlineFilter
-{
+public abstract class ScanlineFilter {
public abstract void unfilter(byte src[], byte dst[], byte up[])
throws ImageReadException, IOException;
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterAverage.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterAverage.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterAverage.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterAverage.java Sat May 26 21:19:03 2012
@@ -20,21 +20,17 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
-public class ScanlineFilterAverage extends ScanlineFilter
-{
+public class ScanlineFilterAverage extends ScanlineFilter {
private final int BytesPerPixel;
- public ScanlineFilterAverage(int BytesPerPixel)
- {
+ public ScanlineFilterAverage(int BytesPerPixel) {
this.BytesPerPixel = BytesPerPixel;
}
@Override
public void unfilter(byte src[], byte dst[], byte up[])
- throws ImageReadException, IOException
- {
- for (int i = 0; i < src.length; i++)
- {
+ throws ImageReadException, IOException {
+ for (int i = 0; i < src.length; i++) {
int Raw = 0;
int prev_index = i - BytesPerPixel;
if (prev_index >= 0)
@@ -47,8 +43,8 @@ public class ScanlineFilterAverage exten
int Average = ((0xff & Raw) + (0xff & Prior)) / 2;
dst[i] = (byte) ((src[i] + Average) % 256);
- // dst[i] = src[i];
- // dst[i] = (byte) 255;
+ // dst[i] = src[i];
+ // dst[i] = (byte) 255;
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterNone.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterNone.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterNone.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterNone.java Sat May 26 21:19:03 2012
@@ -20,15 +20,12 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
-public class ScanlineFilterNone extends ScanlineFilter
-{
+public class ScanlineFilterNone extends ScanlineFilter {
@Override
public void unfilter(byte src[], byte dst[], byte up[])
- throws ImageReadException, IOException
- {
- for (int i = 0; i < src.length; i++)
- {
+ throws ImageReadException, IOException {
+ for (int i = 0; i < src.length; i++) {
dst[i] = src[i];
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterPaeth.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterPaeth.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterPaeth.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterPaeth.java Sat May 26 21:19:03 2012
@@ -20,24 +20,21 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
-public class ScanlineFilterPaeth extends ScanlineFilter
-{
+public class ScanlineFilterPaeth extends ScanlineFilter {
private final int BytesPerPixel;
- public ScanlineFilterPaeth(int BytesPerPixel)
- {
+ public ScanlineFilterPaeth(int BytesPerPixel) {
this.BytesPerPixel = BytesPerPixel;
}
- private int PaethPredictor(int a, int b, int c)
- {
- // ; a = left, b = above, c = upper left
- int p = a + b - c; // ; initial estimate
- int pa = Math.abs(p - a); // ; distances to a, b, c
+ private int PaethPredictor(int a, int b, int c) {
+ // ; a = left, b = above, c = upper left
+ int p = a + b - c; // ; initial estimate
+ int pa = Math.abs(p - a); // ; distances to a, b, c
int pb = Math.abs(p - b);
int pc = Math.abs(p - c);
- // ; return nearest of a,b,c,
- // ; breaking ties in order a,b,c.
+ // ; return nearest of a,b,c,
+ // ; breaking ties in order a,b,c.
if ((pa <= pb) && (pa <= pc))
return a;
else if (pb <= pc)
@@ -48,10 +45,8 @@ public class ScanlineFilterPaeth extends
@Override
public void unfilter(byte src[], byte dst[], byte up[])
- throws ImageReadException, IOException
- {
- for (int i = 0; i < src.length; i++)
- {
+ throws ImageReadException, IOException {
+ for (int i = 0; i < src.length; i++) {
int left = 0;
int prev_index = i - BytesPerPixel;
if (prev_index >= 0)
@@ -60,21 +55,21 @@ public class ScanlineFilterPaeth extends
int above = 0;
if (up != null)
above = up[i];
- // above = 255;
+ // above = 255;
int upperleft = 0;
if ((prev_index >= 0) && (up != null))
upperleft = up[prev_index];
- // upperleft = 255;
+ // upperleft = 255;
int PaethPredictor = PaethPredictor(0xff & left, 0xff & above,
0xff & upperleft);
dst[i] = (byte) ((src[i] + PaethPredictor) % 256);
- // dst[i] = (byte) ((src[i] + PaethPredictor) );
- // dst[i] = src[i];
+ // dst[i] = (byte) ((src[i] + PaethPredictor) );
+ // dst[i] = src[i];
- // dst[i] = (byte) 0;
+ // dst[i] = (byte) 0;
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterSub.java Sat May 26 21:19:03 2012
@@ -20,32 +20,29 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
-public class ScanlineFilterSub extends ScanlineFilter
-{
+public class ScanlineFilterSub extends ScanlineFilter {
private final int BytesPerPixel;
- public ScanlineFilterSub(int BytesPerPixel)
- {
+ public ScanlineFilterSub(int BytesPerPixel) {
this.BytesPerPixel = BytesPerPixel;
}
@Override
public void unfilter(byte src[], byte dst[], byte up[])
- throws ImageReadException, IOException
- {
- for (int i = 0; i < src.length; i++)
- {
+ throws ImageReadException, IOException {
+ for (int i = 0; i < src.length; i++) {
int prev_index = i - BytesPerPixel;
if (prev_index >= 0)
dst[i] = (byte) ((src[i] + dst[prev_index]) % 256);
- // dst[i] = 0xff & (src[i] + src[prev_index]);
+ // dst[i] = 0xff & (src[i] + src[prev_index]);
else
dst[i] = src[i];
- // if(i<10)
- // System.out.println("\t" + i + ": " + dst[i] + " (" + src[i] + ", " + prev_index + ")");
+ // if(i<10)
+ // System.out.println("\t" + i + ": " + dst[i] + " (" + src[i] +
+ // ", " + prev_index + ")");
- // dst[i] = src[i];
+ // dst[i] = src[i];
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ScanlineFilterUp.java Sat May 26 21:19:03 2012
@@ -20,33 +20,29 @@ import java.io.IOException;
import org.apache.commons.imaging.ImageReadException;
-public class ScanlineFilterUp extends ScanlineFilter
-{
+public class ScanlineFilterUp extends ScanlineFilter {
private final int BytesPerPixel;
- public ScanlineFilterUp(int BytesPerPixel)
- {
+ public ScanlineFilterUp(int BytesPerPixel) {
this.BytesPerPixel = BytesPerPixel;
}
@Override
public void unfilter(byte src[], byte dst[], byte up[])
- throws ImageReadException, IOException
- {
- for (int i = 0; i < src.length; i++)
- {
- // byte b;
+ throws ImageReadException, IOException {
+ for (int i = 0; i < src.length; i++) {
+ // byte b;
if (up != null)
dst[i] = (byte) ((src[i] + up[i]) % 256);
else
dst[i] = src[i];
- // if(i<10)
- // System.out.println("\t" + i + ": " + dst[i]);
- // dst[i] = b;
- // dst[i] = src[i];
- // dst[i] = (byte) 0;
+ // if(i<10)
+ // System.out.println("\t" + i + ": " + dst[i]);
+ // dst[i] = b;
+ // dst[i] = src[i];
+ // dst[i] = (byte) 0;
}
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/FileInfo.java Sat May 26 21:19:03 2012
@@ -22,13 +22,11 @@ import java.io.InputStream;
import org.apache.commons.imaging.ImageFormat;
import org.apache.commons.imaging.common.ImageBuilder;
-public abstract class FileInfo
-{
+public abstract class FileInfo {
protected final int width, height;
protected final boolean RAWBITS;
- public FileInfo(int width, int height, boolean RAWBITS)
- {
+ public FileInfo(int width, int height, boolean RAWBITS) {
this.width = width;
this.height = height;
this.RAWBITS = RAWBITS;
@@ -50,27 +48,23 @@ public abstract class FileInfo
public abstract int getRGB(InputStream is) throws IOException;
- protected void newline()
- {
+ protected void newline() {
// do nothing by default.
}
- public void readImage(ImageBuilder imageBuilder, InputStream is) throws IOException
- {
+ public void readImage(ImageBuilder imageBuilder, InputStream is)
+ throws IOException {
// is = new BufferedInputStream(is);
// int count = 0;
//
// try
// {
-
- if (!RAWBITS)
- {
+
+ if (!RAWBITS) {
WhiteSpaceReader wsr = new WhiteSpaceReader(is);
- for (int y = 0; y < height; y++)
- {
- for (int x = 0; x < width; x++)
- {
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x++) {
int rgb = getRGB(wsr);
imageBuilder.setRGB(x, y, rgb);
@@ -78,13 +72,10 @@ public abstract class FileInfo
}
newline();
}
- } else
- {
- for (int y = 0; y < height; y++)
- {
+ } else {
+ for (int y = 0; y < height; y++) {
// System.out.println("y: " + y);
- for (int x = 0; x < width; x++)
- {
+ for (int x = 0; x < width; x++) {
int rgb = getRGB(is);
imageBuilder.setRGB(x, y, rgb);
// count++;
@@ -100,8 +91,7 @@ public abstract class FileInfo
// }
}
- public void dump()
- {
+ public void dump() {
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmFileInfo.java Sat May 26 21:19:03 2012
@@ -22,65 +22,53 @@ import java.io.InputStream;
import org.apache.commons.imaging.ImageFormat;
import org.apache.commons.imaging.ImageInfo;
-public class PbmFileInfo extends FileInfo
-{
- public PbmFileInfo(int width, int height, boolean RAWBITS)
- {
+public class PbmFileInfo extends FileInfo {
+ public PbmFileInfo(int width, int height, boolean RAWBITS) {
super(width, height, RAWBITS);
}
@Override
- public int getNumComponents()
- {
+ public int getNumComponents() {
return 1;
}
@Override
- public int getBitDepth()
- {
+ public int getBitDepth() {
return 1;
}
@Override
- public ImageFormat getImageType()
- {
+ public ImageFormat getImageType() {
return ImageFormat.IMAGE_FORMAT_PBM;
}
@Override
- public int getColorType()
- {
+ public int getColorType() {
return ImageInfo.COLOR_TYPE_BW;
}
@Override
- public String getImageTypeDescription()
- {
+ public String getImageTypeDescription() {
return "PBM: portable bitmap fileformat";
}
@Override
- public String getMIMEType()
- {
+ public String getMIMEType() {
return "image/x-portable-bitmap";
}
@Override
- protected void newline()
- {
+ protected void newline() {
bitcache = 0;
bits_in_cache = 0;
}
-
private int bitcache = 0;
private int bits_in_cache = 0;
@Override
- public int getRGB(InputStream is) throws IOException
- {
- if (bits_in_cache < 1)
- {
+ public int getRGB(InputStream is) throws IOException {
+ if (bits_in_cache < 1) {
int bits = is.read();
if (bits < 0)
throw new IOException("PBM: Unexpected EOF");
@@ -100,8 +88,7 @@ public class PbmFileInfo extends FileInf
}
@Override
- public int getRGB(WhiteSpaceReader wsr) throws IOException
- {
+ public int getRGB(WhiteSpaceReader wsr) throws IOException {
int bit = Integer.parseInt(wsr.readtoWhiteSpace());
if (bit == 0)
return 0xff000000;
@@ -110,4 +97,4 @@ public class PbmFileInfo extends FileInf
throw new IOException("PBM: bad bit: " + bit);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmWriter.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmWriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PbmWriter.java Sat May 26 21:19:03 2012
@@ -23,17 +23,14 @@ import java.util.Map;
import org.apache.commons.imaging.ImageWriteException;
-public class PbmWriter extends PnmWriter implements PnmConstants
-{
- public PbmWriter(boolean RAWBITS)
- {
+public class PbmWriter extends PnmWriter implements PnmConstants {
+ public PbmWriter(boolean RAWBITS) {
super(RAWBITS);
}
@Override
public void writeImage(BufferedImage src, OutputStream os, Map params)
- throws ImageWriteException, IOException
- {
+ throws ImageWriteException, IOException {
os.write(PNM_PREFIX_BYTE);
os.write(RAWBITS ? PBM_RAW_CODE : PBM_TEXT_CODE);
os.write(PNM_SEPARATOR);
@@ -50,10 +47,8 @@ public class PbmWriter extends PnmWriter
int bitcache = 0;
int bits_in_cache = 0;
- for (int y = 0; y < height; y++)
- {
- for (int x = 0; x < width; x++)
- {
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x++) {
int argb = src.getRGB(x, y);
int red = 0xff & (argb >> 16);
int green = 0xff & (argb >> 8);
@@ -64,27 +59,25 @@ public class PbmWriter extends PnmWriter
else
sample = 1;
- if (RAWBITS)
- {
+ if (RAWBITS) {
bitcache = (bitcache << 1) | (0x1 & sample);
bits_in_cache++;
- if (bits_in_cache >= 8)
- {
+ if (bits_in_cache >= 8) {
os.write((byte) bitcache);
bitcache = 0;
bits_in_cache = 0;
}
- } else
- {
- os.write(("" + sample).getBytes("US-ASCII")); // max component value
+ } else {
+ os.write(("" + sample).getBytes("US-ASCII")); // max
+ // component
+ // value
os.write(PNM_SEPARATOR);
}
}
- if ((RAWBITS) && (bits_in_cache > 0))
- {
- bitcache = bitcache << (8-bits_in_cache);
+ if ((RAWBITS) && (bits_in_cache > 0)) {
+ bitcache = bitcache << (8 - bits_in_cache);
os.write((byte) bitcache);
bitcache = 0;
bits_in_cache = 0;
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmFileInfo.java Sat May 26 21:19:03 2012
@@ -22,56 +22,47 @@ import java.io.InputStream;
import org.apache.commons.imaging.ImageFormat;
import org.apache.commons.imaging.ImageInfo;
-public class PgmFileInfo extends FileInfo
-{
+public class PgmFileInfo extends FileInfo {
private final int max; // TODO: handle max
- public PgmFileInfo(int width, int height, boolean RAWBITS, int max)
- {
+ public PgmFileInfo(int width, int height, boolean RAWBITS, int max) {
super(width, height, RAWBITS);
this.max = max;
}
@Override
- public int getNumComponents()
- {
+ public int getNumComponents() {
return 1;
}
@Override
- public int getBitDepth()
- {
+ public int getBitDepth() {
return 8;
}
@Override
- public ImageFormat getImageType()
- {
+ public ImageFormat getImageType() {
return ImageFormat.IMAGE_FORMAT_PPM;
}
@Override
- public String getImageTypeDescription()
- {
+ public String getImageTypeDescription() {
return "PGM: portable pixmap file format";
}
@Override
- public String getMIMEType()
- {
+ public String getMIMEType() {
return "image/x-portable-pixmap";
}
@Override
- public int getColorType()
- {
+ public int getColorType() {
return ImageInfo.COLOR_TYPE_RGB;
}
@Override
- public int getRGB(InputStream is) throws IOException
- {
+ public int getRGB(InputStream is) throws IOException {
int sample = is.read();
if (sample < 0)
throw new IOException("PGM: Unexpected EOF");
@@ -85,8 +76,7 @@ public class PgmFileInfo extends FileInf
}
@Override
- public int getRGB(WhiteSpaceReader wsr) throws IOException
- {
+ public int getRGB(WhiteSpaceReader wsr) throws IOException {
int sample = Integer.parseInt(wsr.readtoWhiteSpace());
int alpha = 0xff;
@@ -97,4 +87,4 @@ public class PgmFileInfo extends FileInf
return rgb;
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmWriter.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmWriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PgmWriter.java Sat May 26 21:19:03 2012
@@ -23,18 +23,15 @@ import java.util.Map;
import org.apache.commons.imaging.ImageWriteException;
-public class PgmWriter extends PnmWriter implements PnmConstants
-{
- public PgmWriter(boolean RAWBITS)
- {
+public class PgmWriter extends PnmWriter implements PnmConstants {
+ public PgmWriter(boolean RAWBITS) {
super(RAWBITS);
}
@Override
public void writeImage(BufferedImage src, OutputStream os, Map params)
- throws ImageWriteException, IOException
- {
- // System.out.println
+ throws ImageWriteException, IOException {
+ // System.out.println
// (b1 == 0x50 && b2 == 0x36)
os.write(0x50);
os.write(RAWBITS ? 0x35 : 0x32);
@@ -53,21 +50,19 @@ public class PgmWriter extends PnmWriter
os.write(PNM_NEWLINE);
for (int y = 0; y < height; y++)
- for (int x = 0; x < width; x++)
- {
+ for (int x = 0; x < width; x++) {
int argb = src.getRGB(x, y);
int red = 0xff & (argb >> 16);
int green = 0xff & (argb >> 8);
int blue = 0xff & (argb >> 0);
int sample = (red + green + blue) / 3;
- if (RAWBITS)
- {
+ if (RAWBITS) {
os.write((byte) sample);
- }
- else
- {
- os.write(("" + sample).getBytes("US-ASCII")); // max component value
+ } else {
+ os.write(("" + sample).getBytes("US-ASCII")); // max
+ // component
+ // value
os.write(PNM_SEPARATOR);
}
}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java Sat May 26 21:19:03 2012
@@ -16,8 +16,7 @@
*/
package org.apache.commons.imaging.formats.pnm;
-public interface PnmConstants
-{
+public interface PnmConstants {
public static final byte PNM_PREFIX_BYTE = 0x50; // P
public static final byte PBM_TEXT_CODE = 0x31; // Textual Bitmap
@@ -28,5 +27,6 @@ public interface PnmConstants
public static final byte PPM_RAW_CODE = 0x36; // RAW Pixmap
public static final byte PNM_SEPARATOR = 0x20; // Space
- public static final byte PNM_NEWLINE = 0x0A; // "usually a newline" (http://netpbm.sourceforge.net/doc/pbm.html)
+ public static final byte PNM_NEWLINE = 0x0A; // "usually a newline"
+ // (http://netpbm.sourceforge.net/doc/pbm.html)
}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java Sat May 26 21:19:03 2012
@@ -38,24 +38,20 @@ import org.apache.commons.imaging.common
import org.apache.commons.imaging.common.bytesource.ByteSource;
import org.apache.commons.imaging.util.Debug;
-public class PnmImageParser extends ImageParser implements PnmConstants
-{
+public class PnmImageParser extends ImageParser implements PnmConstants {
- public PnmImageParser()
- {
+ public PnmImageParser() {
super.setByteOrder(BYTE_ORDER_LSB);
// setDebug(true);
}
@Override
- public String getName()
- {
+ public String getName() {
return "Pbm-Custom";
}
@Override
- public String getDefaultExtension()
- {
+ public String getDefaultExtension() {
return DEFAULT_EXTENSION;
}
@@ -65,14 +61,12 @@ public class PnmImageParser extends Imag
".ppm", ".pnm", };
@Override
- protected String[] getAcceptedExtensions()
- {
+ protected String[] getAcceptedExtensions() {
return ACCEPTED_EXTENSIONS;
}
@Override
- protected ImageFormat[] getAcceptedTypes()
- {
+ protected ImageFormat[] getAcceptedTypes() {
return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_PBM, //
ImageFormat.IMAGE_FORMAT_PGM, //
ImageFormat.IMAGE_FORMAT_PPM, //
@@ -80,8 +74,7 @@ public class PnmImageParser extends Imag
}
private FileInfo readHeader(InputStream is) throws ImageReadException,
- IOException
- {
+ IOException {
byte identifier1 = readByte("Identifier1", is, "Not a Valid PNM File");
byte identifier2 = readByte("Identifier2", is, "Not a Valid PNM File");
@@ -104,20 +97,16 @@ public class PnmImageParser extends Imag
return new PbmFileInfo(width, height, false);
else if (identifier2 == PBM_RAW_CODE)
return new PbmFileInfo(width, height, true);
- else if (identifier2 == PGM_TEXT_CODE)
- {
+ else if (identifier2 == PGM_TEXT_CODE) {
int maxgray = Integer.parseInt(wsr.readtoWhiteSpace());
return new PgmFileInfo(width, height, false, maxgray);
- } else if (identifier2 == PGM_RAW_CODE)
- {
+ } else if (identifier2 == PGM_RAW_CODE) {
int maxgray = Integer.parseInt(wsr.readtoWhiteSpace());
return new PgmFileInfo(width, height, true, maxgray);
- } else if (identifier2 == PPM_TEXT_CODE)
- {
+ } else if (identifier2 == PPM_TEXT_CODE) {
int max = Integer.parseInt(wsr.readtoWhiteSpace());
return new PpmFileInfo(width, height, false, max);
- } else if (identifier2 == PPM_RAW_CODE)
- {
+ } else if (identifier2 == PPM_RAW_CODE) {
int max = Integer.parseInt(wsr.readtoWhiteSpace());
// System.out.println("max: " + max);
return new PpmFileInfo(width, height, true, max);
@@ -126,24 +115,19 @@ public class PnmImageParser extends Imag
}
private FileInfo readHeader(ByteSource byteSource)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
InputStream is = null;
- try
- {
+ try {
is = byteSource.getInputStream();
return readHeader(is);
- } finally
- {
- try
- {
+ } finally {
+ try {
if (is != null) {
is.close();
}
- } catch (Exception e)
- {
+ } catch (Exception e) {
Debug.debug(e);
}
}
@@ -151,15 +135,13 @@ public class PnmImageParser extends Imag
@Override
public byte[] getICCProfileBytes(ByteSource byteSource, Map params)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
return null;
}
@Override
public Dimension getImageSize(ByteSource byteSource, Map params)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
FileInfo info = readHeader(byteSource);
if (info == null)
@@ -168,28 +150,24 @@ public class PnmImageParser extends Imag
return new Dimension(info.width, info.height);
}
- public byte[] embedICCProfile(byte image[], byte profile[])
- {
+ public byte[] embedICCProfile(byte image[], byte profile[]) {
return null;
}
@Override
- public boolean embedICCProfile(File src, File dst, byte profile[])
- {
+ public boolean embedICCProfile(File src, File dst, byte profile[]) {
return false;
}
@Override
public IImageMetadata getMetadata(ByteSource byteSource, Map params)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
return null;
}
@Override
public ImageInfo getImageInfo(ByteSource byteSource, Map params)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
FileInfo info = readHeader(byteSource);
if (info == null)
@@ -230,8 +208,7 @@ public class PnmImageParser extends Imag
@Override
public boolean dumpImageFile(PrintWriter pw, ByteSource byteSource)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
pw.println("pnm.dumpImageFile");
{
@@ -247,8 +224,7 @@ public class PnmImageParser extends Imag
return true;
}
- private int[] getColorTable(byte bytes[]) throws ImageReadException
- {
+ private int[] getColorTable(byte bytes[]) throws ImageReadException {
if ((bytes.length % 3) != 0)
throw new ImageReadException("Bad Color Table Length: "
+ bytes.length);
@@ -256,8 +232,7 @@ public class PnmImageParser extends Imag
int result[] = new int[length];
- for (int i = 0; i < length; i++)
- {
+ for (int i = 0; i < length; i++) {
int red = 0xff & bytes[(i * 3) + 0];
int green = 0xff & bytes[(i * 3) + 1];
int blue = 0xff & bytes[(i * 3) + 2];
@@ -273,12 +248,10 @@ public class PnmImageParser extends Imag
@Override
public BufferedImage getBufferedImage(ByteSource byteSource, Map params)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
InputStream is = null;
- try
- {
+ try {
is = byteSource.getInputStream();
FileInfo info = readHeader(is);
@@ -287,19 +260,17 @@ public class PnmImageParser extends Imag
int height = info.height;
boolean hasAlpha = false;
- ImageBuilder imageBuilder = new ImageBuilder(width, height, hasAlpha);
+ ImageBuilder imageBuilder = new ImageBuilder(width, height,
+ hasAlpha);
info.readImage(imageBuilder, is);
return imageBuilder.getBufferedImage();
- } finally
- {
- try
- {
+ } finally {
+ try {
if (is != null) {
is.close();
}
- } catch (Exception e)
- {
+ } catch (Exception e) {
Debug.debug(e);
}
}
@@ -311,23 +282,19 @@ public class PnmImageParser extends Imag
@Override
public void writeImage(BufferedImage src, OutputStream os, Map params)
- throws ImageWriteException, IOException
- {
+ throws ImageWriteException, IOException {
PnmWriter writer = null;
boolean useRawbits = true;
- if (params != null)
- {
+ if (params != null) {
Object useRawbitsParam = params.get(PARAM_KEY_PNM_RAWBITS);
- if (useRawbitsParam != null)
- {
+ if (useRawbitsParam != null) {
if (useRawbitsParam.equals(PARAM_VALUE_PNM_RAWBITS_NO))
useRawbits = false;
}
Object subtype = params.get(PARAM_KEY_FORMAT);
- if (subtype != null)
- {
+ if (subtype != null) {
if (subtype.equals(ImageFormat.IMAGE_FORMAT_PBM))
writer = new PbmWriter(useRawbits);
else if (subtype.equals(ImageFormat.IMAGE_FORMAT_PGM))
@@ -351,8 +318,7 @@ public class PnmImageParser extends Imag
if (params.containsKey(PARAM_KEY_FORMAT))
params.remove(PARAM_KEY_FORMAT);
- if (params.size() > 0)
- {
+ if (params.size() > 0) {
Object firstKey = params.keySet().iterator().next();
throw new ImageWriteException("Unknown parameter: " + firstKey);
}
@@ -363,7 +329,7 @@ public class PnmImageParser extends Imag
/**
* Extracts embedded XML metadata as XML string.
* <p>
- *
+ *
* @param byteSource
* File containing image data.
* @param params
@@ -372,8 +338,7 @@ public class PnmImageParser extends Imag
*/
@Override
public String getXmpXml(ByteSource byteSource, Map params)
- throws ImageReadException, IOException
- {
+ throws ImageReadException, IOException {
return null;
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmWriter.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmWriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmWriter.java Sat May 26 21:19:03 2012
@@ -23,15 +23,13 @@ import java.util.Map;
import org.apache.commons.imaging.ImageWriteException;
-public abstract class PnmWriter
-{
+public abstract class PnmWriter {
protected final boolean RAWBITS;
- public PnmWriter(boolean RAWBITS)
- {
+ public PnmWriter(boolean RAWBITS) {
this.RAWBITS = RAWBITS;
}
public abstract void writeImage(BufferedImage src, OutputStream os,
Map params) throws ImageWriteException, IOException;
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmFileInfo.java Sat May 26 21:19:03 2012
@@ -22,56 +22,47 @@ import java.io.InputStream;
import org.apache.commons.imaging.ImageFormat;
import org.apache.commons.imaging.ImageInfo;
-public class PpmFileInfo extends FileInfo
-{
+public class PpmFileInfo extends FileInfo {
private final int max; // TODO: handle max
- public PpmFileInfo(int width, int height, boolean RAWBITS, int max)
- {
+ public PpmFileInfo(int width, int height, boolean RAWBITS, int max) {
super(width, height, RAWBITS);
this.max = max;
}
@Override
- public int getNumComponents()
- {
+ public int getNumComponents() {
return 3;
}
@Override
- public int getBitDepth()
- {
+ public int getBitDepth() {
return 8;
}
@Override
- public ImageFormat getImageType()
- {
+ public ImageFormat getImageType() {
return ImageFormat.IMAGE_FORMAT_PGM;
}
@Override
- public String getImageTypeDescription()
- {
+ public String getImageTypeDescription() {
return "PGM: portable graymap file format";
}
@Override
- public String getMIMEType()
- {
+ public String getMIMEType() {
return "image/x-portable-graymap";
}
@Override
- public int getColorType()
- {
+ public int getColorType() {
return ImageInfo.COLOR_TYPE_GRAYSCALE;
}
@Override
- public int getRGB(InputStream is) throws IOException
- {
+ public int getRGB(InputStream is) throws IOException {
int red = is.read();
int green = is.read();
int blue = is.read();
@@ -88,8 +79,7 @@ public class PpmFileInfo extends FileInf
}
@Override
- public int getRGB(WhiteSpaceReader wsr) throws IOException
- {
+ public int getRGB(WhiteSpaceReader wsr) throws IOException {
int red = Integer.parseInt(wsr.readtoWhiteSpace());
int green = Integer.parseInt(wsr.readtoWhiteSpace());
int blue = Integer.parseInt(wsr.readtoWhiteSpace());
@@ -103,8 +93,7 @@ public class PpmFileInfo extends FileInf
}
@Override
- public void dump()
- {
- // System.out.println("count: " + count);
+ public void dump() {
+ // System.out.println("count: " + count);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmWriter.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmWriter.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PpmWriter.java Sat May 26 21:19:03 2012
@@ -23,18 +23,15 @@ import java.util.Map;
import org.apache.commons.imaging.ImageWriteException;
-public class PpmWriter extends PnmWriter implements PnmConstants
-{
- public PpmWriter(boolean RAWBITS)
- {
+public class PpmWriter extends PnmWriter implements PnmConstants {
+ public PpmWriter(boolean RAWBITS) {
super(RAWBITS);
}
@Override
public void writeImage(BufferedImage src, OutputStream os, Map params)
- throws ImageWriteException, IOException
- {
- // System.out.println
+ throws ImageWriteException, IOException {
+ // System.out.println
// (b1 == 0x50 && b2 == 0x36)
os.write(0x50);
os.write(RAWBITS ? 0x36 : 0x33);
@@ -53,26 +50,26 @@ public class PpmWriter extends PnmWriter
os.write(PNM_NEWLINE);
for (int y = 0; y < height; y++)
- for (int x = 0; x < width; x++)
- {
+ for (int x = 0; x < width; x++) {
int argb = src.getRGB(x, y);
int red = 0xff & (argb >> 16);
int green = 0xff & (argb >> 8);
int blue = 0xff & (argb >> 0);
- if (RAWBITS)
- {
+ if (RAWBITS) {
os.write((byte) red);
os.write((byte) green);
os.write((byte) blue);
- }
- else
- {
- os.write(("" + red).getBytes("US-ASCII")); // max component value
+ } else {
+ os.write(("" + red).getBytes("US-ASCII")); // max component
+ // value
os.write(PNM_SEPARATOR);
- os.write(("" + green).getBytes("US-ASCII")); // max component value
+ os.write(("" + green).getBytes("US-ASCII")); // max
+ // component
+ // value
os.write(PNM_SEPARATOR);
- os.write(("" + blue).getBytes("US-ASCII")); // max component value
+ os.write(("" + blue).getBytes("US-ASCII")); // max component
+ // value
os.write(PNM_SEPARATOR);
}
}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/WhiteSpaceReader.java Sat May 26 21:19:03 2012
@@ -19,41 +19,34 @@ package org.apache.commons.imaging.forma
import java.io.IOException;
import java.io.InputStream;
-class WhiteSpaceReader
-{
+class WhiteSpaceReader {
private final InputStream is;
- public WhiteSpaceReader(InputStream is)
- {
+ public WhiteSpaceReader(InputStream is) {
this.is = is;
}
int count = 0;
- private char read() throws IOException
- {
+ private char read() throws IOException {
int result = is.read();
if (result < 0)
throw new IOException("PNM: Unexpected EOF");
return (char) result;
}
- public char nextChar() throws IOException
- {
+ public char nextChar() throws IOException {
char c = read();
- if (c == '#')
- {
- while ((c != '\n') && (c != '\r'))
- {
+ if (c == '#') {
+ while ((c != '\n') && (c != '\r')) {
c = read();
}
}
return c;
}
- public String readtoWhiteSpace() throws IOException
- {
+ public String readtoWhiteSpace() throws IOException {
char c = nextChar();
while (Character.isWhitespace(c))
@@ -61,12 +54,11 @@ class WhiteSpaceReader
StringBuffer buffer = new StringBuffer();
- while (!Character.isWhitespace(c))
- {
+ while (!Character.isWhitespace(c)) {
buffer.append(c);
c = nextChar();
}
return buffer.toString();
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageContents.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageContents.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageContents.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageContents.java Sat May 26 21:19:03 2012
@@ -18,8 +18,7 @@ package org.apache.commons.imaging.forma
import java.io.PrintWriter;
-public class ImageContents
-{
+public class ImageContents {
public final PsdHeaderInfo header;
public final int ColorModeDataLength;
@@ -30,8 +29,7 @@ public class ImageContents
public ImageContents(PsdHeaderInfo header,
int ColorModeDataLength, int ImageResourcesLength,
- int LayerAndMaskDataLength, int Compression)
- {
+ int LayerAndMaskDataLength, int Compression) {
this.header = header;
this.ColorModeDataLength = ColorModeDataLength;
this.ImageResourcesLength = ImageResourcesLength;
@@ -39,15 +37,13 @@ public class ImageContents
this.Compression = Compression;
}
- public void dump()
- {
+ public void dump() {
PrintWriter pw = new PrintWriter(System.out);
dump(pw);
pw.flush();
}
- public void dump(PrintWriter pw)
- {
+ public void dump(PrintWriter pw) {
pw.println("");
pw.println("ImageContents");
pw.println("Compression: " + Compression + " ("
@@ -58,14 +54,14 @@ public class ImageContents
+ Integer.toHexString(ImageResourcesLength) + ")");
pw.println("LayerAndMaskDataLength: " + LayerAndMaskDataLength + " ("
+ Integer.toHexString(LayerAndMaskDataLength) + ")");
- // System.out.println("Depth: " + Depth + " ("
- // + Integer.toHexString(Depth) + ")");
- // System.out.println("Mode: " + Mode + " (" + Integer.toHexString(Mode)
- // + ")");
- // System.out.println("Reserved: " + Reserved.length);
+ // System.out.println("Depth: " + Depth + " ("
+ // + Integer.toHexString(Depth) + ")");
+ // System.out.println("Mode: " + Mode + " (" + Integer.toHexString(Mode)
+ // + ")");
+ // System.out.println("Reserved: " + Reserved.length);
pw.println("");
pw.flush();
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceBlock.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceBlock.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceBlock.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceBlock.java Sat May 26 21:19:03 2012
@@ -20,22 +20,19 @@ import java.io.UnsupportedEncodingExcept
import org.apache.commons.imaging.util.Debug;
-class ImageResourceBlock
-{
+class ImageResourceBlock {
protected final int id;
protected final byte nameData[];
protected final byte data[];
- public ImageResourceBlock(int ID, byte NameData[], byte Data[])
- {
+ public ImageResourceBlock(int ID, byte NameData[], byte Data[]) {
this.id = ID;
this.nameData = NameData;
this.data = Data;
}
- public String getName() throws UnsupportedEncodingException
- {
+ public String getName() throws UnsupportedEncodingException {
Debug.debug("getName", nameData.length);
return new String(nameData, "ISO-8859-1");
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceType.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceType.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceType.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/ImageResourceType.java Sat May 26 21:19:03 2012
@@ -18,23 +18,20 @@ package org.apache.commons.imaging.forma
import org.apache.commons.imaging.ImageReadException;
-public class ImageResourceType
-{
+public class ImageResourceType {
public final int ID;
public final String Description;
- public ImageResourceType(int ID, String Description)
- {
+ public ImageResourceType(int ID, String Description) {
this.ID = ID;
this.Description = Description;
}
public ImageResourceType(int ID, int ID2, String Description)
- throws ImageReadException
- {
+ throws ImageReadException {
this(ID, Description);
if (ID != ID2)
throw new ImageReadException("Mismatch ID: " + ID + " ID2: " + ID2);
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdConstants.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdConstants.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdConstants.java Sat May 26 21:19:03 2012
@@ -18,27 +18,22 @@ package org.apache.commons.imaging.forma
import org.apache.commons.imaging.util.Debug;
-public class PsdConstants
-{
+public class PsdConstants {
static final ImageResourceType fImageResourceTypes[];
- public String getDescription(int id)
- {
- for (int i = 0; i < fImageResourceTypes.length; i++)
- {
+ public String getDescription(int id) {
+ for (int i = 0; i < fImageResourceTypes.length; i++) {
if (fImageResourceTypes[i].ID == id)
return fImageResourceTypes[i].Description;
}
return "Unknown";
}
- static
- {
+ static {
ImageResourceType temp[] = null;
- try
- {
- temp = new ImageResourceType[]{
+ try {
+ temp = new ImageResourceType[] {
new ImageResourceType(
0x03E8,
1000,
@@ -192,13 +187,10 @@ public class PsdConstants
new ImageResourceType(
0x2710,
10000,
- "Print flags information. 2 bytes version (=1), 1 byte center crop marks, 1 byte (=0), 4 bytes bleed width value, 2 bytes bleed width scale."),
- };
- }
- catch (Exception e)
- {
+ "Print flags information. 2 bytes version (=1), 1 byte center crop marks, 1 byte (=0), 4 bytes bleed width value, 2 bytes bleed width scale."), };
+ } catch (Exception e) {
Debug.debug(PsdConstants.class, e);
}
fImageResourceTypes = temp;
}
-}
\ No newline at end of file
+}
Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdHeaderInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdHeaderInfo.java?rev=1342971&r1=1342970&r2=1342971&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdHeaderInfo.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/psd/PsdHeaderInfo.java Sat May 26 21:19:03 2012
@@ -18,8 +18,7 @@ package org.apache.commons.imaging.forma
import java.io.PrintWriter;
-public class PsdHeaderInfo
-{
+public class PsdHeaderInfo {
public final int Version;
public final byte Reserved[];
public final int Channels;
@@ -29,8 +28,7 @@ public class PsdHeaderInfo
public final int Mode;
public PsdHeaderInfo(int Version, byte Reserved[], int Channels, int Rows,
- int Columns, int Depth, int Mode)
- {
+ int Columns, int Depth, int Mode) {
this.Version = Version;
this.Reserved = Reserved;
this.Channels = Channels;
@@ -41,15 +39,13 @@ public class PsdHeaderInfo
}
- public void dump()
- {
+ public void dump() {
PrintWriter pw = new PrintWriter(System.out);
dump(pw);
pw.flush();
}
- public void dump(PrintWriter pw)
- {
+ public void dump(PrintWriter pw) {
pw.println("");
pw.println("Header");
pw.println("Version: " + Version + " (" + Integer.toHexString(Version)
@@ -67,4 +63,4 @@ public class PsdHeaderInfo
}
-}
\ No newline at end of file
+}