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 ce51d34  After doing retro-propagation of converted values to source 
integer values, we should declare the tiles as dirty because converting back to 
"geophysics" values may produce slightly different results.
ce51d34 is described below

commit ce51d347fd85c34ba7a03b79ffb79be2b6fd6140
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Thu Jan 9 11:03:42 2020 +0100

    After doing retro-propagation of converted values to source integer values, 
we should declare the tiles as dirty because converting back to "geophysics" 
values may produce slightly different results.
---
 .../apache/sis/internal/coverage/j2d/BandedSampleConverter.java  | 6 ++++++
 .../org/apache/sis/internal/coverage/j2d/TileOpExecutor.java     | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git 
a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/BandedSampleConverter.java
 
b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/BandedSampleConverter.java
index b463cd5..36743b4 100644
--- 
a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/BandedSampleConverter.java
+++ 
b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/BandedSampleConverter.java
@@ -343,6 +343,12 @@ public class BandedSampleConverter extends ComputedImage {
                 }
             };
             executor.writeTo(target);
+            /*
+             * Request to recompute the tiles of this `BandedSampleConverter` 
because if the values
+             * in the source image are integers, then converting back to 
floating point values may
+             * produce slightly different results.
+             */
+            markDirtyTiles(executor.getTileIndices());
         }
     }
 }
diff --git 
a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/TileOpExecutor.java
 
b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/TileOpExecutor.java
index 5fe1882..0885a87 100644
--- 
a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/TileOpExecutor.java
+++ 
b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/TileOpExecutor.java
@@ -64,6 +64,15 @@ public abstract class TileOpExecutor {
     }
 
     /**
+     * Returns the range of indices of tiles to be processed by this {@code 
TileOpExecutor}.
+     *
+     * @return range of tile indices to be processed.
+     */
+    public final Rectangle getTileIndices() {
+        return new Rectangle(minTileX, minTileY, maxTileX - minTileX + 1, 
maxTileY - minTileY + 1);
+    }
+
+    /**
      * Executes the read operation on the given tile.
      * The default implementation does nothing.
      *

Reply via email to