/* 波打ち (横) ImageFilter Ver 0.10 */ /* */ /* */ /* by Atsushi 98/4/9 */ package net.antun.lib.awt.image; import java.awt.Dimension; import java.awt.image.ColorModel; public class SideWaveImageFilter extends SinglepassImageFilter { /* --- Field --- */ private int width,height; private int waveLength,amplitude; private double phase; /* --- Constructor --- */ public SideWaveImageFilter(int waveLength,int amplitude,double phase) { this.waveLength=waveLength; this.amplitude =amplitude; this.phase =phase; } /* --- フィルタリング --- */ public void setDimensions(int width,int height) { super.setDimensions(width,height); this.width =width+amplitude*2; this.height=height; consumer.setDimensions(this.width,this.height); } protected void filterImage() { int p[],xx; p=new int[width]; for (int y=0;y<=height-1;y++) { for (int x=0;x<=width-1;x++) { xx=x-amplitude+(int)( Math.sin(phase+2.0*Math.PI*y/waveLength)*amplitude); if (0<=xx && xx