classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI [gui] java/awt/image/LookupOp.java cleanup


From: Mark Wielaard
Subject: [cp-patches] FYI [gui] java/awt/image/LookupOp.java cleanup
Date: Mon, 08 Nov 2004 00:03:42 +0100

Hi,

This small patch fixes some comments and indentatation in LookupOp.java.

2004-11-07  Mark Wielaard  <address@hidden>

       * java/awt/image/LookupOp.java: Comments and indentation fixes.

I am checking it in GNU Classpath CVS and the libgcj gui branch.

Cheers,

Mark
Index: java/awt/image/LookupOp.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/image/LookupOp.java,v
retrieving revision 1.1
diff -u -r1.1 LookupOp.java
--- java/awt/image/LookupOp.java        6 Nov 2004 16:24:37 -0000       1.1
+++ java/awt/image/LookupOp.java        7 Nov 2004 22:12:33 -0000
@@ -1,4 +1,4 @@
-/* ColorModel.java --
+/* LookupOp.java -- Filter that converts each pixel using a lookup table.
 Copyright (C) 2004  Free Software Foundation
 
 This file is part of GNU Classpath.
@@ -35,12 +35,6 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
-/*
- * Created on Oct 6, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
 package java.awt.image;
 
 import java.awt.Graphics2D;
@@ -67,7 +61,8 @@
  * 
  * @author jlquinn
  */
-public class LookupOp implements BufferedImageOp, RasterOp {
+public class LookupOp implements BufferedImageOp, RasterOp
+{
   private LookupTable lut;
   private RenderingHints hints;
   
@@ -89,7 +84,7 @@
   {
     if (src.getColorModel() instanceof IndexColorModel)
       throw new IllegalArgumentException("LookupOp.filter: IndexColorModel "
-                                                                        + "not 
allowed");
+                                        + "not allowed");
     if (dst == null)
       dst = createCompatibleDestImage(src, src.getColorModel());
 
@@ -122,10 +117,12 @@
           dr.setPixel(x, y, lut.lookupPixel(tmp, dbuf));
         }
     }
-    else if (lut.getNumComponents() != 1 &&
-                lut.getNumComponents() != 
src.getColorModel().getNumComponents())
-      throw new IllegalArgumentException("LookupOp.filter: Incompatible lookup 
"
-                        + "table and source image");
+    else if (lut.getNumComponents() != 1
+            &&
+            lut.getNumComponents() != src.getColorModel().getNumComponents())
+      throw new IllegalArgumentException("LookupOp.filter: "
+                                        + "Incompatible lookup "
+                                        + "table and source image");
 
     // No alpha to ignore
     int[] dbuf = new int[src.getColorModel().getNumComponents()];
@@ -160,12 +157,12 @@
    * @see 
java.awt.image.BufferedImageOp#createCompatibleDestImage(java.awt.image.BufferedImage,
 java.awt.image.ColorModel)
    */
   public BufferedImage createCompatibleDestImage(BufferedImage src,
-                                                                               
         ColorModel dstCM)
+                                                ColorModel dstCM)
   {
     // FIXME: set properties to those in src
     return new BufferedImage(dstCM,
-                                               
src.getRaster().createCompatibleWritableRaster(),
-                                               src.isPremultiplied, null);
+                            src.getRaster().createCompatibleWritableRaster(),
+                            src.isPremultiplied, null);
   }
 
   /** Return corresponding destination point for source point.
@@ -177,7 +174,9 @@
    */
   public Point2D getPoint2D(Point2D src, Point2D dst)
   {
-    if (dst == null) return (Point2D)src.clone();
+    if (dst == null)
+      return (Point2D) src.clone();
+
     dst.setLocation(src);
     return dst;
   }
@@ -218,7 +217,8 @@
       if (src.getNumBands() != dest.getNumBands())
         throw new IllegalArgumentException();
 
-    if (lut.getNumComponents() != 1 && lut.getNumComponents() != 
src.getNumBands())
+    if (lut.getNumComponents() != 1
+       && lut.getNumComponents() != src.getNumBands())
       throw new IllegalArgumentException();
 
    

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]