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 1dfd3d9 Rename SOURCE_PADDING_KEY in a way more consistent with other
properties.
1dfd3d9 is described below
commit 1dfd3d9971244686fe4930fe4c3d6fae67780e3e
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Thu May 7 00:02:52 2020 +0200
Rename SOURCE_PADDING_KEY in a way more consistent with other properties.
---
.../main/java/org/apache/sis/image/ComputedImage.java | 8 ++++----
.../src/main/java/org/apache/sis/image/PlanarImage.java | 16 +++++++++++++---
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/image/ComputedImage.java
b/core/sis-feature/src/main/java/org/apache/sis/image/ComputedImage.java
index d64d8dc..dd03046 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/ComputedImage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/ComputedImage.java
@@ -71,7 +71,7 @@ import org.apache.sis.internal.feature.Resources;
* implementation assumes that source images occupy the same region as this
{@code ComputedImage}:
* all pixels at coordinates (<var>x</var>, <var>y</var>) in this {@code
ComputedImage} depend on pixels
* at the same (<var>x</var>, <var>y</var>) coordinates in the source images,
- * possibly shifted or expanded to neighborhood pixels as described in {@link
#SOURCE_PADDING_PROPERTY}.
+ * possibly shifted or expanded to neighborhood pixels as described in {@link
#SOURCE_PADDING_KEY}.
* If this assumption does not hold, then subclasses should override the
* {@link #sourceTileChanged(RenderedImage, int, int)} method.</p>
*
@@ -139,7 +139,7 @@ public abstract class ComputedImage extends PlanarImage
implements Disposable {
* @see #getProperty(String)
* @see #sourceTileChanged(RenderedImage, int, int)
*/
- public static final String SOURCE_PADDING_PROPERTY = "sourcePadding";
+ public static final String SOURCE_PADDING_KEY =
"org.apache.sis.SourcePadding";
/**
* Weak reference to this image, also used as a cleaner when the image is
garbage-collected.
@@ -588,7 +588,7 @@ public abstract class ComputedImage extends PlanarImage
implements Disposable {
* <p>The default implementation assumes that source images use pixel
coordinate systems aligned with this
* {@code ComputedImage} in such a way that all pixels at coordinates
(<var>x</var>, <var>y</var>) in the
* {@code source} image are used for calculation of pixels at the same
(<var>x</var>, <var>y</var>) coordinates
- * in this {@code ComputedImage}, possibly expanded to neighborhood pixels
if the {@value #SOURCE_PADDING_PROPERTY}
+ * in this {@code ComputedImage}, possibly expanded to neighborhood pixels
if the {@value #SOURCE_PADDING_KEY}
* property is defined. If this assumption does not hold, then subclasses
should override this method and invoke
* {@link #markDirtyTiles(Rectangle)} themselves.</p>
*
@@ -603,7 +603,7 @@ public abstract class ComputedImage extends PlanarImage
implements Disposable {
final long targetHeight = this .getTileHeight();
final long tx = tileX * sourceWidth +
source.getTileGridXOffset() - getTileGridXOffset();
final long ty = tileY * sourceHeight +
source.getTileGridYOffset() - getTileGridYOffset();
- final Insets b = getProperty(Insets.class, SOURCE_PADDING_PROPERTY,
source);
+ final Insets b = getProperty(Insets.class, SOURCE_PADDING_KEY, source);
reference.markDirtyTiles(Numerics.clamp(Math.floorDiv(tx - (b == null
? 0 : b.left), targetWidth)),
Numerics.clamp(Math.floorDiv(ty - (b == null
? 0 : b.top), targetHeight)),
Numerics.clamp(Math.floorDiv(tx + (b == null
? 0 : b.right) + sourceWidth - 1, targetWidth)),
diff --git
a/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
b/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
index ceab89d..258918a 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/PlanarImage.java
@@ -163,9 +163,19 @@ public abstract class PlanarImage implements RenderedImage
{
*
* <table class="sis">
* <caption>Examples of property keys</caption>
- * <tr><th>Keys</th> <th>Values</th></tr>
- * <tr><td>{@value #SAMPLE_RESOLUTIONS_KEY}</td> <td>Resolutions of
sample values in each band.</td></tr>
- * <tr><td>{@value #STATISTICS_KEY}</td> <td>Minimum, maximum
and mean values for each band.</td></tr>
+ * <tr>
+ * <th>Keys</th>
+ * <th>Values</th>
+ * </tr><tr>
+ * <td>{@value #SAMPLE_RESOLUTIONS_KEY}</td>
+ * <td>Resolutions of sample values in each band.</td>
+ * </tr><tr>
+ * <td>{@value #STATISTICS_KEY}</td>
+ * <td>Minimum, maximum and mean values for each band.</td>
+ * </tr><tr>
+ * <td>{@value ComputedImage#SOURCE_PADDING_KEY}</td>
+ * <td>Amount of additional source pixels needed on each side of a
destination pixel for computing its value.</td>
+ * </tr>
* </table>
*
* This method shall return {@link Image#UndefinedProperty} if the
specified property is not defined.