geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
public CoverageDataPngImage drawTile(short[][] pixelValues) {

        int tileWidth = pixelValues[0].length;
        int tileHeight = pixelValues.length;

        CoverageDataPngImage image = createImage(tileWidth, tileHeight);
        PngWriter writer = image.getWriter();
        for (int y = 0; y < tileHeight; y++) {
            ImageLineInt row = new ImageLineInt(writer.imgInfo, new int[tileWidth]);
            int[] rowLine = row.getScanline();
            for (int x = 0; x < tileWidth; x++) {
                short pixelValue = pixelValues[y][x];
                setPixelValue(rowLine, x, pixelValue);
            }
            writer.writeRow(row);
        }
        writer.end();
        image.flushStream();

        return image;
    }
public CoverageDataPngImage drawTile(short[][] pixelValues) {

        int tileWidth = pixelValues[0].length;
        int tileHeight = pixelValues.length;

        CoverageDataPngImage image = createImage(tileWidth, tileHeight);
        PngWriter writer = image.getWriter();
        for (int y = 0; y < tileHeight; y++) {
            ImageLineInt row = new ImageLineInt(writer.imgInfo, new int[tileWidth]);
            int[] rowLine = row.getScanline();
            for (int x = 0; x < tileWidth; x++) {
                short pixelValue = pixelValues[y][x];
                setPixelValue(rowLine, x, pixelValue);
            }
            writer.writeRow(row);
        }
        writer.end();
        image.flushStream();

        return image;
    }
public CoverageDataPngImage drawTile ( short [ ] [ ] pixelValues ) { int tileWidth = pixelValues [ 0 ] . length ; int tileHeight = pixelValues . length ; CoverageDataPngImage image = createImage ( tileWidth , tileHeight ) ; PngWriter writer = image . getWriter ( ) ; for ( int y = 0 ; y < tileHeight ; y ++ ) { ImageLineInt row = new ImageLineInt ( writer . imgInfo , new int [ tileWidth ] ) ; int [ ] rowLine = row . getScanline ( ) ; for ( int x = 0 ; x < tileWidth ; x ++ ) { short pixelValue = pixelValues [ y ] [ x ] ; setPixelValue ( rowLine , x , pixelValue ) ; } writer . writeRow ( row ) ; } writer . end ( ) ; image . flushStream ( ) ; return image ; }
Draw a coverage data tile from the double array of "unsigned short" pixel
values formatted as short[row][width]

@param pixelValues "unsigned short" pixel values as [row][width]
@return coverage data image tile
Draw a coverage data tile from the double array of unsigned short pixel values formatted as short [ row ] [ width ]