sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] branch geoapi-4.0 updated: Internal class renaming.
Date Tue, 09 Apr 2019 07:49:11 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


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new c526b03  Internal class renaming.
c526b03 is described below

commit c526b0357bcd379982088d0bf1a10c8389ec5e48
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue Apr 9 09:48:57 2019 +0200

    Internal class renaming.
---
 .../internal/coverage/BufferedGridCoverage.java    |  2 +-
 .../internal/coverage/ConvertedGridCoverage.java   | 26 ++++++++++++----------
 .../referencing/provider/Equirectangular.java      |  2 +-
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/BufferedGridCoverage.java
b/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/BufferedGridCoverage.java
index ba3438b..0fae561 100644
--- a/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/BufferedGridCoverage.java
+++ b/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/BufferedGridCoverage.java
@@ -159,6 +159,6 @@ public class BufferedGridCoverage extends GridCoverage {
      * @return the converted coverage. May be {@code coverage}.
      */
     public static GridCoverage convert(final GridCoverage packed) {
-        return ConvertedGridCoverage.convert(packed);
+        return ConvertedGridCoverage.create(packed);
     }
 }
diff --git a/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/ConvertedGridCoverage.java
b/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/ConvertedGridCoverage.java
index 72e0ec0..a7a11a7 100644
--- a/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/ConvertedGridCoverage.java
+++ b/core/sis-raster/src/main/java/org/apache/sis/internal/coverage/ConvertedGridCoverage.java
@@ -59,7 +59,7 @@ final class ConvertedGridCoverage extends GridCoverage {
      * @param  packed  the coverage containing packed values to convert.
      * @return the converted coverage. May be {@code coverage}.
      */
-    public static GridCoverage convert(final GridCoverage packed) {
+    public static GridCoverage create(final GridCoverage packed) {
         final List<SampleDimension> sds = packed.getSampleDimensions();
         final List<SampleDimension> cfs = new ArrayList<>(sds.size());
         for (SampleDimension sd : sds) {
@@ -136,14 +136,14 @@ final class ConvertedGridCoverage extends GridCoverage {
         }
         final SampleModel baseSm = raster.getSampleModel();
         final DataBuffer dataBuffer = raster.getDataBuffer();
-        final ConvertedSampleModel convSm = new ConvertedSampleModel(baseSm, toConverted,
toPacked);
+        final SampleConverter convSm = new SampleConverter(baseSm, toConverted, toPacked);
         final WritableRaster convRaster = WritableRaster.createWritableRaster(convSm, dataBuffer,
null);
         /*
          * The default color models have a lot of constraints. Use a custom model with relaxed
rules instead.
          * We arbitrarily use the range of values of the first band only; a future Apache
SIS version will
          * need to perform another calculation.
          */
-        final ColorModel cm = new ConvertedColorModel(getSampleDimensions().get(0).getSampleRange().get());
+        final ColorModel cm = new ScaledColorModel(getSampleDimensions().get(0).getSampleRange().get());
         return new BufferedImage(cm, convRaster, false, null);
     }
 
@@ -163,14 +163,14 @@ final class ConvertedGridCoverage extends GridCoverage {
      * also converts the sample values. This may be an issue for optimized pipelines accessing
{@link DataBuffer}
      * directly. This class may be replaced by another mechanism (creating new tiles) in
a future SIS version.</p>
      */
-    private static final class ConvertedSampleModel extends SampleModel {
+    private static final class SampleConverter extends SampleModel {
 
         private final SampleModel base;
         private final int baseDataType;
         private final MathTransform1D[] toConverted;
         private final MathTransform1D[] toPacked;
 
-        ConvertedSampleModel(SampleModel base, MathTransform1D[] toConverted, MathTransform1D[]
toPacked) {
+        SampleConverter(SampleModel base, MathTransform1D[] toConverted, MathTransform1D[]
toPacked) {
             super(DataBuffer.TYPE_FLOAT, base.getWidth(), base.getHeight(), base.getNumBands());
             this.base         = base;
             this.baseDataType = base.getDataType();
@@ -342,7 +342,7 @@ final class ConvertedGridCoverage extends GridCoverage {
         @Override
         public SampleModel createCompatibleSampleModel(int w, int h) {
             final SampleModel cp = base.createCompatibleSampleModel(w, h);
-            return new ConvertedSampleModel(cp, toConverted, toPacked);
+            return new SampleConverter(cp, toConverted, toPacked);
         }
 
         @Override
@@ -354,7 +354,7 @@ final class ConvertedGridCoverage extends GridCoverage {
                 trs[i] = toConverted[bands[i]];
                 ivtrs[i] = toPacked[bands[i]];
             }
-            return new ConvertedSampleModel(cp, trs, ivtrs);
+            return new SampleConverter(cp, trs, ivtrs);
         }
 
         @Override
@@ -376,15 +376,17 @@ final class ConvertedGridCoverage extends GridCoverage {
     }
 
     /**
-     * Color model for working with {@link ConvertedSampleModel}.
+     * Color model for working with {@link SampleConverter}.
      * Defined as a workaround for the validations normally performed by {@link ColorModel}.
      *
      * <p><b>WARNING: this is a temporary class.</b>
      * This color model disable validations normally performed by {@link ColorModel}, in
order to enable the use
-     * of {@link ConvertedSampleModel}. This class may be replaced by another mechanism (creating
new tiles) in
+     * of {@link SampleConverter}. This class may be replaced by another mechanism (creating
new tiles) in
      * a future SIS version.</p>
+     *
+     * @see org.apache.sis.internal.raster.ScaledColorSpace
      */
-    private static final class ConvertedColorModel extends ColorModel {
+    private static final class ScaledColorModel extends ColorModel {
 
         private final float scale;
         private final float offset;
@@ -392,7 +394,7 @@ final class ConvertedGridCoverage extends GridCoverage {
         /**
          * Creates a new color model for the given of converted values.
          */
-        ConvertedColorModel(final NumberRange<?> range){
+        ScaledColorModel(final NumberRange<?> range){
             super(Float.SIZE);
             final double scale  = (255.0) / (range.getMaxDouble() - range.getMinDouble());
             this.scale  = (float) scale;
@@ -406,7 +408,7 @@ final class ConvertedGridCoverage extends GridCoverage {
 
         @Override
         public boolean isCompatibleSampleModel(SampleModel sm) {
-            return sm instanceof ConvertedSampleModel;
+            return sm instanceof SampleConverter;
         }
 
         @Override
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
index 033a241..941d45c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
@@ -63,7 +63,7 @@ import static java.lang.Math.*;
  * @author  Martin Desruisseaux (Geomatys)
  * @version 1.0
  *
- * @see PseudoPlateCarre
+ * @see PseudoPlateCarree
  * @see <a href="http://geotiff.maptools.org/proj_list/equirectangular.html">GeoTIFF
parameters for Equirectangular</a>
  *
  * @since 0.6


Mime
View raw message