sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/02: Remove commented-out methods that were creating an image from arrays. They will be in the history if we want to bring them back. Those methods are omitted because they implied a copy of all sample values, contrarily to all other `setValues(…)` methods which copy only a reference.
Date Tue, 24 Mar 2020 00:11:04 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 0349b33a61616103673c34fd2e4d3070f8d04e5c
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue Mar 24 00:50:33 2020 +0100

    Remove commented-out methods that were creating an image from arrays.
    They will be in the history if we want to bring them back.
    Those methods are omitted because they implied a copy of all sample values,
    contrarily to all other `setValues(…)` methods which copy only a reference.
---
 .../sis/coverage/grid/GridCoverageBuilder.java     | 66 ----------------------
 1 file changed, 66 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java
b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java
index c7a0d76..813c4bc 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridCoverageBuilder.java
@@ -336,72 +336,6 @@ public class GridCoverageBuilder {
         return this;
     }
 
-//    /**
-//     * Creates a coverage from the given matrix.
-//     * This method copies the values from the given matrix to a new DataBuffer.
-//     * <p>
-//     * The coverage height will be the length of the {@code matrix} argument.
-//     * The coverage width will be the length of the first row, all rows are expected
-//     * to have the same length.
-//     *
-//     * @param matrix The matrix data in a {@code [row][column]} layout.
-//     * @throws ArithmeticException if the buffer size exceeds the {@code int} capacity.
-//     */
-//    public void setValues(int[][] matrix) throws ArithmeticException {
-//        final int height = matrix.length;
-//        final int width = matrix[0].length;
-//        final int[] datas = new int[Math.multiplyExact(height,width)];
-//        for (int i = 0, offset=0; i < matrix.length; i++,offset+=width) {
-//            System.arraycopy(matrix[i], 0, datas, offset, width);
-//        }
-//        final DataBuffer buffer = new DataBufferInt(datas, datas.length);
-//        setValues(buffer, width, height);
-//    }
-//
-//    /**
-//     * Creates a coverage from the given matrix.
-//     * This method copies the values from the given matrix to a new DataBuffer.
-//     * <p>
-//     * The coverage height will be the length of the {@code matrix} argument.
-//     * The coverage width will be the length of the first row, all rows are expected
-//     * to have the same length.
-//     *
-//     * @param matrix The matrix data in a {@code [row][column]} layout.
-//     * @throws ArithmeticException if the buffer size exceeds the {@code int} capacity.
-//     */
-//    public void setValues(float[][] matrix) throws ArithmeticException {
-//        final int height = matrix.length;
-//        final int width = matrix[0].length;
-//        final float[] datas = new float[Math.multiplyExact(height,width)];
-//        for (int i = 0, offset=0; i < matrix.length; i++,offset+=width) {
-//            System.arraycopy(matrix[i], 0, datas, offset, width);
-//        }
-//        final DataBuffer buffer = new DataBufferFloat(datas, datas.length);
-//        setValues(buffer, width, height);
-//    }
-//
-//    /**
-//     * Creates a coverage from the given matrix.
-//     * This method copies the values from the given matrix to a new DataBuffer.
-//     * <p>
-//     * The coverage height will be the length of the {@code matrix} argument.
-//     * The coverage width will be the length of the first row, all rows are expected
-//     * to have the same length.
-//     *
-//     * @param matrix The matrix data in a {@code [row][column]} layout.
-//     * @throws ArithmeticException if the buffer size exceeds the {@code int} capacity.
-//     */
-//    public void setValues(double[][] matrix) throws ArithmeticException {
-//        final int height = matrix.length;
-//        final int width = matrix[0].length;
-//        final double[] datas = new double[Math.multiplyExact(height,width)];
-//        for (int i = 0, offset=0; i < matrix.length; i++,offset+=width) {
-//            System.arraycopy(matrix[i], 0, datas, offset, width);
-//        }
-//        final DataBuffer buffer = new DataBufferDouble(datas, datas.length);
-//        setValues(buffer, width, height);
-//    }
-
     /**
      * Sets a two-dimensional slice of sample values as a Java2D data buffer.
      * The {@linkplain DataBuffer#getNumBanks() number of banks} will be the number of bands
in the image.


Mime
View raw message