mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
Add ParenPad and NoWhitespaceAfter checkstyle rules
This commit is contained in:
parent
9d0d8088f4
commit
9165e818d9
17 changed files with 76 additions and 60 deletions
|
@ -30,19 +30,19 @@ import java.awt.image.ColorModel;
|
|||
public abstract class AbstractBufferedImageOp implements BufferedImageOp, Cloneable {
|
||||
|
||||
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM) {
|
||||
if ( dstCM == null )
|
||||
if (dstCM == null)
|
||||
dstCM = src.getColorModel();
|
||||
return new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), dstCM.isAlphaPremultiplied(), null);
|
||||
}
|
||||
|
||||
public Rectangle2D getBounds2D( BufferedImage src ) {
|
||||
public Rectangle2D getBounds2D(BufferedImage src) {
|
||||
return new Rectangle(0, 0, src.getWidth(), src.getHeight());
|
||||
}
|
||||
|
||||
public Point2D getPoint2D( Point2D srcPt, Point2D dstPt ) {
|
||||
if ( dstPt == null )
|
||||
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
|
||||
if (dstPt == null)
|
||||
dstPt = new Point2D.Double();
|
||||
dstPt.setLocation( srcPt.getX(), srcPt.getY() );
|
||||
dstPt.setLocation(srcPt.getX(), srcPt.getY());
|
||||
return dstPt;
|
||||
}
|
||||
|
||||
|
@ -62,11 +62,11 @@ public abstract class AbstractBufferedImageOp implements BufferedImageOp, Clonea
|
|||
* @return the pixels
|
||||
* @see #setRGB
|
||||
*/
|
||||
public int[] getRGB( BufferedImage image, int x, int y, int width, int height, int[] pixels ) {
|
||||
public int[] getRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels) {
|
||||
int type = image.getType();
|
||||
if ( type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB )
|
||||
return (int [])image.getRaster().getDataElements( x, y, width, height, pixels );
|
||||
return image.getRGB( x, y, width, height, pixels, 0, width );
|
||||
if (type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB)
|
||||
return (int [])image.getRaster().getDataElements(x, y, width, height, pixels);
|
||||
return image.getRGB(x, y, width, height, pixels, 0, width);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,19 +80,19 @@ public abstract class AbstractBufferedImageOp implements BufferedImageOp, Clonea
|
|||
* @param pixels the array of pixels to set
|
||||
* @see #getRGB
|
||||
*/
|
||||
public void setRGB( BufferedImage image, int x, int y, int width, int height, int[] pixels ) {
|
||||
public void setRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels) {
|
||||
int type = image.getType();
|
||||
if ( type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB )
|
||||
image.getRaster().setDataElements( x, y, width, height, pixels );
|
||||
if (type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB)
|
||||
image.getRaster().setDataElements(x, y, width, height, pixels);
|
||||
else
|
||||
image.setRGB( x, y, width, height, pixels, 0, width );
|
||||
image.setRGB(x, y, width, height, pixels, 0, width);
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
}
|
||||
catch ( CloneNotSupportedException e ) {
|
||||
catch (CloneNotSupportedException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ public class QuantizeFilter extends WholeImageFilter {
|
|||
}
|
||||
}
|
||||
|
||||
protected int[] filterPixels( int width, int height, int[] inPixels, Rectangle transformedSpace ) {
|
||||
protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace) {
|
||||
int[] outPixels = new int[width*height];
|
||||
|
||||
quantize(inPixels, outPixels, width, height, numColors, dither, serpentine);
|
||||
|
|
|
@ -43,7 +43,7 @@ public abstract class WholeImageFilter extends AbstractBufferedImageOp {
|
|||
public WholeImageFilter() {
|
||||
}
|
||||
|
||||
public BufferedImage filter( BufferedImage src, BufferedImage dst ) {
|
||||
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
|
||||
int width = src.getWidth();
|
||||
int height = src.getHeight();
|
||||
int type = src.getType();
|
||||
|
@ -53,15 +53,15 @@ public abstract class WholeImageFilter extends AbstractBufferedImageOp {
|
|||
transformedSpace = new Rectangle(0, 0, width, height);
|
||||
transformSpace(transformedSpace);
|
||||
|
||||
if ( dst == null ) {
|
||||
if (dst == null) {
|
||||
ColorModel dstCM = src.getColorModel();
|
||||
dst = new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(transformedSpace.width, transformedSpace.height), dstCM.isAlphaPremultiplied(), null);
|
||||
}
|
||||
WritableRaster dstRaster = dst.getRaster();
|
||||
|
||||
int[] inPixels = getRGB( src, 0, 0, width, height, null );
|
||||
inPixels = filterPixels( width, height, inPixels, transformedSpace );
|
||||
setRGB( dst, 0, 0, transformedSpace.width, transformedSpace.height, inPixels );
|
||||
int[] inPixels = getRGB(src, 0, 0, width, height, null);
|
||||
inPixels = filterPixels(width, height, inPixels, transformedSpace);
|
||||
setRGB(dst, 0, 0, transformedSpace.width, transformedSpace.height, inPixels);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
@ -81,6 +81,6 @@ public abstract class WholeImageFilter extends AbstractBufferedImageOp {
|
|||
* @param transformedSpace the output bounds
|
||||
* @return the output pixels
|
||||
*/
|
||||
protected abstract int[] filterPixels( int width, int height, int[] inPixels, Rectangle transformedSpace );
|
||||
protected abstract int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue