class LocationScalePixel extends PixelTransform{ double location, scale; LocationScalePixel(double location, double scale){ double sum = location + scale; if( sum > 1 ){ System.err.println( "--- Error --- location (" + location + ") scale (" + scale + ") > 1" ); location /= sum; scale /= sum; }; this.location = location; this.scale = scale; } int getPixel(int i, int j){ return image.getRGB( ((int) (width*location)) + (i+width)%((int) (width*scale)) , ((int) (height*location)) + (j+height)%((int)(height*scale)) ); } }