Image implements Cloneable, Serializable, ImageProvider<I> { public I shiftRight() { return shiftRight(1); }  @SuppressWarnings("unchecked") void accumulateWith(AccumulatingImageCombiner<I, ?> combiner); abstract I abs(); I add(Image<?, ?> im); I add(Q num); abstract I addInplace(Image<?, ?> im); abstract I addInplace(Q num); @SuppressWarnings("unchecked") void analyseWith(ImageAnalyser<I> analyser); void analyseWith(PixelAnalyser<Q> analyser); void analyseWithMasked(FImage mask, PixelAnalyser<Q> analyser); abstract I clip(Q min, Q max); abstract I clipMax(Q thresh); abstract I clipMin(Q thresh); @Override abstract I clone(); abstract ImageRenderer<Q, I> createRenderer(); abstract ImageRenderer<Q, I> createRenderer(RenderHints options); @SuppressWarnings("unchecked") OUT combineWith(
			ImageCombiner<I, OTHER, OUT> combiner, OTHER other); Q defaultBackgroundColour(); Q defaultForegroundColour(); I divide(Image<?, ?> im); I divide(Q val); abstract I divideInplace(Image<?, ?> im); abstract I divideInplace(Q val); void drawConnectedPoints(List<? extends Point2d> pts, Q col); Point2d[] drawCubicBezier(Point2d p1, Point2d p2,
			Point2d c1, Point2d c2, int thickness, Q col); void drawImage(I image, int x, int y); void drawImage(I image, Point2d pt); void drawImage(I image, int x, int y, @SuppressWarnings("unchecked") Q... ignoreList); void drawLine(int x1, int y1, double theta, int length, int thickness, Q col); void drawLine(int x1, int y1, double theta, int length, Q col); void drawLine(int x0, int y0, int x1, int y1, int thickness, Q col); void drawLine(int x0, int y0, int x1, int y1, Q col); void drawLine(Point2d p1, Point2d p2, Q col); void drawLine(Point2d p1, Point2d p2, int thickness, Q col); void drawLine(Path2d line, int thickness, Q col); void drawPath(Path2d line, int thickness, Q col); void drawLines(Iterable<? extends Path2d> lines, int thickness, Q col); void drawPaths(Iterable<? extends Path2d> lines, int thickness, Q col); void drawPoint(Point2d p, Q col, int size); void drawPoints(Iterable<? extends Point2d> pts, Q col, int size); void drawPolygon(Polygon p, int thickness, Q col); void drawPolygon(Polygon p, Q col); void drawPolygonFilled(Polygon p, Q col); void drawShape(Shape s, int thickness, Q col); void drawShape(Shape p, Q col); void drawShapeFilled(Shape s, Q col); void drawText(AttributedString text, int x, int y); void drawText(AttributedString text, Point2d pt); void drawText(String text, int x, int y, F f, int sz); void drawText(String text, int x, int y, F f, int sz, Q col); void drawText(String text, int x, int y, FontStyle<Q> f); void drawText(String text, Point2d pt, F f, int sz); void drawText(String text, Point2d pt, F f, int sz, Q col); void drawText(String text, Point2d pt, FontStyle<Q> f); I extractCenter(int w, int h); I extractCenter(int x, int y, int w, int h); abstract I extractROI(int x, int y, I img); abstract I extractROI(int x, int y, int w, int h); I extractROI(Rectangle r); abstract I fill(Q colour); abstract I flipX(); abstract I flipY(); Rectangle getBounds(); int getCols(); abstract Rectangle getContentArea(); abstract I getField(Field f); abstract I getFieldCopy(Field f); abstract I getFieldInterpolate(Field f); abstract int getHeight(); abstract Q getPixel(int x, int y); Q getPixel(Pixel p); abstract Comparator<? super Q> getPixelComparator(); abstract Q getPixelInterp(double x, double y); abstract Q getPixelInterp(double x, double y, Q backgroundColour); Q[] getPixelVector(Q[] f); int getRows(); abstract int getWidth(); abstract I internalCopy(I im); abstract I internalAssign(I im); abstract I internalAssign(int[] pixelData, int width, int height); abstract I inverse(); abstract Q max(); abstract Q min(); I multiply(Image<?, ?> im); I multiply(Q num); abstract I multiplyInplace(Image<?, ?> im); abstract I multiplyInplace(Q num); abstract I newInstance(int width, int height); abstract I normalise(); I padding(int paddingWidth, int paddingHeight); @SuppressWarnings("unchecked") I padding(int paddingWidth, int paddingHeight, Q paddingColour); I paddingSymmetric(int paddingLeft, int paddingRight, int paddingTop, int paddingBottom); I process(GridProcessor<Q, I> p); I process(ImageProcessor<I> p); I process(KernelProcessor<Q, I> p); I process(KernelProcessor<Q, I> p, boolean pad); I process(PixelProcessor<Q> p); I process(Processor<I> p); @SuppressWarnings("unchecked") I processInplace(Processor<I> p); @SuppressWarnings("unchecked") I processInplace(ImageProcessor<I> p); I processInplace(KernelProcessor<Q, I> p); @SuppressWarnings("unchecked") I processInplace(KernelProcessor<Q, I> p, boolean pad); @SuppressWarnings("unchecked") I processInplace(PixelProcessor<Q> p); I processMasked(FImage mask, PixelProcessor<Q> p); @SuppressWarnings("unchecked") I processMaskedInplace(FImage mask, PixelProcessor<Q> p); abstract void setPixel(int x, int y, Q val); I subtract(Image<?, ?> im); I subtract(Q num); abstract I subtractInplace(Image<?, ?> im); abstract I subtractInplace(Q num); abstract I threshold(Q thresh); abstract byte[] toByteImage(); abstract int[] toPackedARGBPixels(); I transform(Matrix transform); I trim(); abstract I zero(); I shiftLeftInplace(); I shiftRightInplace(); I shiftLeftInplace(int count); I shiftRightInplace(int count); I shiftLeft(); I shiftLeft(int nPixels); I shiftRight(); I shiftRight(int nPixels); I shiftUpInplace(); I shiftDownInplace(); I shiftUpInplace(int count); I shiftDownInplace(int count); I shiftUp(); I shiftUp(int nPixels); I shiftDown(); I shiftDown(int nPixels); I overlay(I image, int x, int y); abstract I overlayInplace(I image, int x, int y); @SuppressWarnings("unchecked") @Override I getImage(); abstract I replace(Q target, Q replacement);  }
@Test public void testShiftRight() { FImage img = new FImage( 100, 100 ); img.createRenderer().drawLine( 0, 0, 100, 100, 1f ); if( DISPLAY ) DisplayUtilities.display( img, "Original" ); for( int i = 0; i < 10; i++ ) img = img.shiftRight(); if( DISPLAY ) DisplayUtilities.display( img, "Shifted Right 10 times" ); Assert.assertEquals( 1f, img.getPixel( 9, 99 ) ); img = img.shiftRight( 10 ); if( DISPLAY ) DisplayUtilities.display( img, "Shifted Right 10 times, then 20 pixels" ); Assert.assertEquals( 1f, img.getPixel( 19, 99 ) ); }