src/main/java/com/xceptance/neodymium/visual/ai/util/Helper.java
/***
     * Transform double array in BufferedImage.
     * 
     * @param array
     *            Container which hold the date
     * @param imageType
     *            int value of the target ImageType
     * @return b BufferedImage
     */
Transform double array in BufferedImage.

@param array
Container which hold the date
@param imageType
int value of the target ImageType
@return b BufferedImage
Transform double array in BufferedImage . @param array Container which hold the date @param imageType int value of the target ImageType @return b BufferedImage
public static BufferedImage ArrayToBufferedImage(double[][] array, int imageType)
    {
        int xLength = array.length;
        int yLength = array[0].length;
        BufferedImage b = new BufferedImage(xLength, yLength, imageType);
        for (int x = 0; x < xLength; x++)
        {
            for (int y = 0; y < yLength; y++)
            {
                int rgb = (int) array[x][y] << 16 | (int) array[x][y] << 8 | (int) array[x][y];
                b.setRGB(x, y, rgb);
            }
        }
        return b;
    }
public static BufferedImage ArrayToBufferedImage ( double [ ] [ ] array , int imageType ) { int xLength = array . length ; int yLength = array [ 0 ] . length ; BufferedImage b = new BufferedImage ( xLength , yLength , imageType ) ; for ( int x = 0 ; x < xLength ; x ++ ) { for ( int y = 0 ; y < yLength ; y ++ ) { int rgb = ( int ) array [ x ] [ y ] << 16 | ( int ) array [ x ] [ y ] << 8 | ( int ) array [ x ] [ y ] ; b . setRGB ( x , y , rgb ) ; } } return b ; }
Transform double array in BufferedImage.
Transform double array in BufferedImage .