commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1546370 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp: ./ pixelparsers/ writers/
Date Thu, 28 Nov 2013 14:16:29 GMT
Author: ebourg
Date: Thu Nov 28 14:16:29 2013
New Revision: 1546370

URL: http://svn.apache.org/r1546370
Log:
Merged the bmp sub packages and hide the internal classes

Added:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriter.java
      - copied, changed from r1545174, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriter.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java
      - copied, changed from r1545998, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterPalette.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java
      - copied, changed from r1545174, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterRgb.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java
      - copied, changed from r1546112, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
      - copied, changed from r1546332, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserBitFields.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
      - copied, changed from r1546112, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRgb.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
      - copied, changed from r1546332, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
      - copied, changed from r1545839, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserSimple.java
Removed:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/
Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/ImageContents.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java?rev=1546370&r1=1546369&r2=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
Thu Nov 28 14:16:29 2013
@@ -16,7 +16,7 @@
  */
 package org.apache.commons.imaging.formats.bmp;
 
-public class BmpHeaderInfo {
+class BmpHeaderInfo {
     // BM - Windows 3.1x, 95, NT
     // BA - OS/2 Bitmap Array
     // CI - OS/2 Color Icon

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java?rev=1546370&r1=1546369&r2=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
Thu Nov 28 14:16:29 2013
@@ -41,13 +41,6 @@ import org.apache.commons.imaging.common
 import org.apache.commons.imaging.common.IImageMetadata;
 import org.apache.commons.imaging.common.ImageBuilder;
 import org.apache.commons.imaging.common.bytesource.ByteSource;
-import org.apache.commons.imaging.formats.bmp.pixelparsers.PixelParser;
-import org.apache.commons.imaging.formats.bmp.pixelparsers.PixelParserBitFields;
-import org.apache.commons.imaging.formats.bmp.pixelparsers.PixelParserRgb;
-import org.apache.commons.imaging.formats.bmp.pixelparsers.PixelParserRle;
-import org.apache.commons.imaging.formats.bmp.writers.BmpWriter;
-import org.apache.commons.imaging.formats.bmp.writers.BmpWriterPalette;
-import org.apache.commons.imaging.formats.bmp.writers.BmpWriterRgb;
 import org.apache.commons.imaging.palette.PaletteFactory;
 import org.apache.commons.imaging.palette.SimplePalette;
 import org.apache.commons.imaging.util.IoUtils;

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriter.java
(from r1545174, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriter.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriter.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriter.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriter.java&r1=1545174&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriter.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriter.java
Thu Nov 28 14:16:29 2013
@@ -14,20 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.writers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.awt.image.BufferedImage;
 import java.io.IOException;
 
 import org.apache.commons.imaging.common.BinaryOutputStream;
 
-public abstract class BmpWriter {
+abstract class BmpWriter {
+
     public abstract int getPaletteSize();
 
     public abstract int getBitsPerPixel();
 
-    public abstract void writePalette(BinaryOutputStream bos)
-            throws IOException;
+    public abstract void writePalette(BinaryOutputStream bos) throws IOException;
 
     public abstract byte[] getImageData(BufferedImage src);
 }

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java
(from r1545998, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterPalette.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterPalette.java&r1=1545998&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterPalette.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java
Thu Nov 28 14:16:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.writers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.awt.image.BufferedImage;
 import java.io.ByteArrayOutputStream;
@@ -23,7 +23,8 @@ import java.io.IOException;
 import org.apache.commons.imaging.common.BinaryOutputStream;
 import org.apache.commons.imaging.palette.SimplePalette;
 
-public class BmpWriterPalette extends BmpWriter {
+class BmpWriterPalette extends BmpWriter {
+
     private final SimplePalette palette;
     private final int bitsPerSample;
 

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java
(from r1545174, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterRgb.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterRgb.java&r1=1545174&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/writers/BmpWriterRgb.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java
Thu Nov 28 14:16:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.writers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.awt.image.BufferedImage;
 import java.io.ByteArrayOutputStream;
@@ -22,7 +22,7 @@ import java.io.IOException;
 
 import org.apache.commons.imaging.common.BinaryOutputStream;
 
-public class BmpWriterRgb extends BmpWriter {
+class BmpWriterRgb extends BmpWriter {
     // private final boolean alpha;
     //
     // public BmpWriterRgb(boolean alpha)

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/ImageContents.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/ImageContents.java?rev=1546370&r1=1546369&r2=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/ImageContents.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/ImageContents.java
Thu Nov 28 14:16:29 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.imaging.formats.bmp;
 
-import org.apache.commons.imaging.formats.bmp.pixelparsers.PixelParser;
-
 class ImageContents {
 
     public final BmpHeaderInfo bhi;

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java
(from r1546112, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java&r1=1546112&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParser.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParser.java
Thu Nov 28 14:16:29 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.pixelparsers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -22,9 +22,9 @@ import java.io.InputStream;
 
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
-import org.apache.commons.imaging.formats.bmp.BmpHeaderInfo;
 
-public abstract class PixelParser {
+abstract class PixelParser {
+
     public final BmpHeaderInfo bhi;
     public final byte[] colorTable;
     public final byte[] imageData;
@@ -39,8 +39,7 @@ public abstract class PixelParser {
         is = new ByteArrayInputStream(imageData);
     }
 
-    public abstract void processImage(ImageBuilder imageBuilder)
-            throws ImageReadException, IOException;
+    public abstract void processImage(ImageBuilder imageBuilder) throws ImageReadException,
IOException;
 
     protected int getColorTableRGB(int index) {
         index *= 4;

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
(from r1546332, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserBitFields.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserBitFields.java&r1=1546332&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserBitFields.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
Thu Nov 28 14:16:29 2013
@@ -14,17 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.pixelparsers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.io.IOException;
 import java.nio.ByteOrder;
 
 import org.apache.commons.imaging.ImageReadException;
-import org.apache.commons.imaging.formats.bmp.BmpHeaderInfo;
 
 import static org.apache.commons.imaging.common.BinaryFunctions.*;
 
-public class PixelParserBitFields extends PixelParserSimple {
+class PixelParserBitFields extends PixelParserSimple {
 
     private final int redShift;
     private final int greenShift;

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
(from r1546112, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRgb.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRgb.java&r1=1546112&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRgb.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
Thu Nov 28 14:16:29 2013
@@ -14,24 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.pixelparsers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.io.IOException;
 import java.nio.ByteOrder;
 
 import org.apache.commons.imaging.ImageReadException;
-import org.apache.commons.imaging.formats.bmp.BmpHeaderInfo;
 
 import static org.apache.commons.imaging.common.BinaryFunctions.*;
 
-public class PixelParserRgb extends PixelParserSimple {
+class PixelParserRgb extends PixelParserSimple {
     private int bytecount;
     private int cachedBitCount;
     private int cachedByte;
     private int pixelCount;
 
-    public PixelParserRgb(final BmpHeaderInfo bhi, final byte[] colorTable,
-            final byte[] imageData) {
+    public PixelParserRgb(final BmpHeaderInfo bhi, final byte[] colorTable, final byte[]
imageData) {
         super(bhi, colorTable, imageData);
 
     }

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
(from r1546332, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java&r1=1546332&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserRle.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
Thu Nov 28 14:16:29 2013
@@ -14,19 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.pixelparsers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.io.IOException;
 
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.BinaryFunctions;
 import org.apache.commons.imaging.common.ImageBuilder;
-import org.apache.commons.imaging.formats.bmp.BmpHeaderInfo;
 
-public class PixelParserRle extends PixelParser {
+class PixelParserRle extends PixelParser {
 
-    public PixelParserRle(final BmpHeaderInfo bhi, final byte[] colorTable,
-            final byte[] imageData) {
+    public PixelParserRle(final BmpHeaderInfo bhi, final byte[] colorTable, final byte[]
imageData) {
         super(bhi, colorTable, imageData);
 
     }

Copied: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
(from r1545839, commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserSimple.java)
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java?p2=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java&p1=commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserSimple.java&r1=1545839&r2=1546370&rev=1546370&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/pixelparsers/PixelParserSimple.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserSimple.java
Thu Nov 28 14:16:29 2013
@@ -14,15 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.imaging.formats.bmp.pixelparsers;
+package org.apache.commons.imaging.formats.bmp;
 
 import java.io.IOException;
 
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.common.ImageBuilder;
-import org.apache.commons.imaging.formats.bmp.BmpHeaderInfo;
 
-public abstract class PixelParserSimple extends PixelParser {
+abstract class PixelParserSimple extends PixelParser {
     public PixelParserSimple(final BmpHeaderInfo bhi, final byte[] colorTable, final byte[]
imageData) {
         super(bhi, colorTable, imageData);
     }
@@ -32,10 +31,7 @@ public abstract class PixelParserSimple 
     public abstract void newline() throws ImageReadException, IOException;
 
     @Override
-    public void processImage(final ImageBuilder imageBuilder)
-            throws ImageReadException, IOException {
-        // DataBuffer db = bi.getRaster().getDataBuffer();
-
+    public void processImage(final ImageBuilder imageBuilder) throws ImageReadException,
IOException {
         for (int y = bhi.height - 1; y >= 0; y--) {
             for (int x = 0; x < bhi.width; x++) {
                 final int rgb = getNextRGB();



Mime
View raw message