public byte[] flipData(byte[] data, int scanlineSize, int height) {
        byte[] newData = new byte[data.length];

        for (int y = 0; y < height; y++) {
            System.arraycopy(data, y * scanlineSize,
                    newData, (height - y - 1) * scanlineSize,
                    scanlineSize);
        }

        return newData;
    }
Flips the given image data on the Y axis.
@param data Data array containing image data (without mipmaps)
@param scanlineSize Size of a single scanline = width * bytesPerPixel
@param height Height of the image in pixels
@return The new data flipped by the Y axis
jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java