Here you can find the source of flipImage(int stride, int height, int b[])
public static void flipImage(int stride, int height, int b[])
//package com.java2s; //License from project: LGPL public class Main { public static void flipImage(int stride, int height, int b[]) { int tmp[] = new int[stride]; for (int row = 0; row < height / 2; row++) { int rowa = row; int rowb = height - 1 - rowa; // swap rowa and rowb // tmp <-- rowa System.arraycopy(b, rowa * stride, tmp, 0, stride); // rowa <-- rowb System.arraycopy(b, rowb * stride, b, rowa * stride, stride); // rowb <-- tmp System.arraycopy(tmp, 0, b, rowb * stride, stride); }// w ww . j a v a2s . c o m } }