This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.awt.image.IndexColorModel
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Mon, 29 Sep 2003 13:31:06 +0200
- Subject: FYI: Patch: java.awt.image.IndexColorModel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I commtied the attached patch to reformat
java.awt.image.IndexColorModel.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/eBf6WSOgCCdjSDsRAuQNAJ9OiuuVVasQkoN1Hw+cntX4V7R18ACeMCyM
cXlJBXpDOTY4Tuarkfqh940=
=3bzY
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2202
diff -u -b -B -r1.2202 ChangeLog
--- ChangeLog 29 Sep 2003 11:24:28 -0000 1.2202
+++ ChangeLog 29 Sep 2003 11:28:01 -0000
@@ -1,5 +1,9 @@
2003-09-29 Michael Koch <konqueror@gmx.de>
+ * java/awt/image/IndexColorModel.java: Reformated.
+
+2003-09-29 Michael Koch <konqueror@gmx.de>
+
* java/net/InetAddress.java,
java/net/URL.java: Reformated.
Index: java/awt/image/IndexColorModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/IndexColorModel.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 IndexColorModel.java
--- java/awt/image/IndexColorModel.java 19 Jun 2003 09:33:40 -0000 1.5
+++ java/awt/image/IndexColorModel.java 29 Sep 2003 11:28:01 -0000
@@ -63,7 +63,7 @@
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
byte[] blues)
{
- this(bits, size, reds, greens, blues, (byte[])null);
+ this (bits, size, reds, greens, blues, (byte[]) null);
}
/**
@@ -82,7 +82,7 @@
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
byte[] blues, int trans)
{
- this(bits, size, reds, greens, blues, (byte[])null);
+ this (bits, size, reds, greens, blues, (byte[]) null);
this.trans = trans;
}
@@ -102,7 +102,7 @@
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
byte[] blues, byte[] alphas)
{
- super(bits);
+ super (bits);
map_size = size;
opaque = (alphas == null);
@@ -141,10 +141,10 @@
* @param start the offset of the first color component in <code>cmap</code>
* @param hasAlpha <code>cmap</code> has alpha values
*/
- public IndexColorModel(int bits, int size, byte[] cmap, int start,
+ public IndexColorModel (int bits, int size, byte[] cmap, int start,
boolean hasAlpha)
{
- this(bits, size, cmap, start, hasAlpha, -1);
+ this (bits, size, cmap, start, hasAlpha, -1);
}
/**
@@ -160,10 +160,10 @@
* @param hasAlpha <code>cmap</code> has alpha values
* @param trans the index of the transparent color
*/
- public IndexColorModel(int bits, int size, byte[] cmap, int start,
+ public IndexColorModel (int bits, int size, byte[] cmap, int start,
boolean hasAlpha, int trans)
{
- super(bits);
+ super (bits);
map_size = size;
opaque = !hasAlpha;
this.trans = trans;
@@ -187,7 +187,7 @@
*/
public final void getReds (byte[] r)
{
- getComponents( r, 2 );
+ getComponents (r, 2);
}
/**
@@ -195,7 +195,7 @@
*/
public final void getGreens (byte[] g)
{
- getComponents( g, 1 );
+ getComponents (g, 1);
}
/**
@@ -203,7 +203,7 @@
*/
public final void getBlues (byte[] b)
{
- getComponents( b, 0 );
+ getComponents (b, 0);
}
/**
@@ -211,14 +211,14 @@
*/
public final void getAlphas (byte[] a)
{
- getComponents( a, 3 );
+ getComponents (a, 3);
}
- private void getComponents( byte[] c, int ci )
+ private void getComponents (byte[] c, int ci)
{
- int i, max = ( map_size < c.length ) ? map_size : c.length;
- for( i = 0; i < max; i++ )
- c[i] = (byte)(( generateMask( ci ) & rgb[i]) >> ( ci * pixel_bits) );
+ int i, max = (map_size < c.length) ? map_size : c.length;
+ for (i = 0; i < max; i++)
+ c[i] = (byte) ((generateMask (ci) & rgb[i]) >> (ci * pixel_bits));
}
/**
@@ -226,8 +226,8 @@
*/
public final int getRed (int pixel)
{
- if( pixel < map_size )
- return (int)(( generateMask( 2 ) & rgb[pixel]) >> (2 * pixel_bits ) );
+ if (pixel < map_size)
+ return (int) ((generateMask (2) & rgb[pixel]) >> (2 * pixel_bits));
return 0;
}
@@ -237,8 +237,8 @@
*/
public final int getGreen (int pixel)
{
- if( pixel < map_size )
- return (int)(( generateMask( 1 ) & rgb[pixel]) >> (1 * pixel_bits ) );
+ if (pixel < map_size)
+ return (int) ((generateMask (1) & rgb[pixel]) >> (1 * pixel_bits));
return 0;
}
@@ -248,8 +248,8 @@
*/
public final int getBlue (int pixel)
{
- if( pixel < map_size )
- return (int)( generateMask( 0 ) & rgb[pixel]);
+ if (pixel < map_size)
+ return (int) (generateMask (0) & rgb[pixel]);
return 0;
}
@@ -259,8 +259,8 @@
*/
public final int getAlpha (int pixel)
{
- if( pixel < map_size )
- return (int)(( generateMask( 3 ) & rgb[pixel]) >> (3 * pixel_bits ) );
+ if (pixel < map_size)
+ return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
return 0;
}
@@ -273,16 +273,16 @@
*/
public final int getRGB (int pixel)
{
- if( pixel < map_size )
+ if (pixel < map_size)
return rgb[pixel];
return 0;
}
//pixel_bits is number of bits to be in generated mask
- private int generateMask( int offset )
+ private int generateMask (int offset)
{
- return ( ( ( 2 << pixel_bits ) - 1 ) << ( pixel_bits * offset ) );
+ return (((2 << pixel_bits ) - 1) << (pixel_bits * offset));
}
}