sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/03: Clarification in documentation about where is located the iterator current position in the window.
Date Mon, 09 Sep 2019 12:43:50 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 b2326a190db4066c6cd3b28f0038e1f787212132
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Mon Sep 9 11:05:45 2019 +0200

    Clarification in documentation about where is located the iterator current position in
the window.
---
 .../src/main/java/org/apache/sis/image/PixelIterator.java        | 7 +++++++
 .../main/java/org/apache/sis/image/WritablePixelIterator.java    | 9 +++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/PixelIterator.java b/core/sis-feature/src/main/java/org/apache/sis/image/PixelIterator.java
index 8b7a793..4235a5d 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/PixelIterator.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/PixelIterator.java
@@ -635,6 +635,8 @@ public abstract class PixelIterator {
     /**
      * Returns a moving window over the sample values in a rectangular region starting at
iterator position.
      * The <cite>window size</cite> must have been specified at {@code PixelIterator} construction
time.
+     * The current iterator position is the window corner having the smallest <var>x</var>
and <var>y</var> coordinates.
+     * This is typically, but not necessarily (depending on axis orientations) the window
upper-left corner.
      * Sample values are stored in a sequence of length
      * <var>(number of bands)</var> × <var>(window width)</var>
× <var>(window height)</var>.
      * Values are always stored with band index varying fastest, then column index, then
row index.
@@ -652,6 +654,11 @@ public abstract class PixelIterator {
      * replaces the window content with values starting at the new iterator position.
      * Before the first {@link Window#update()} invocation, the window is filled with zero
values.
      *
+     * <p>If this iterator is used for
+     * {@linkplain WritablePixelIterator#setPixel(int[]) writing pixel values at current
position},
+     * those write operations may change the content of windows at {@linkplain #next() next
positions}
+     * unless the iteration order of this iterator is {@link SequenceType#LINEAR}.</p>
+     *
      * <div class="note"><b>Usage example:</b>
      * following code creates an iterator over the full area of given image, then a window
of 5×5 pixels.
      * The window is moved over all the image area in iteration order. Inside the window,
data are copied
diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/WritablePixelIterator.java
b/core/sis-feature/src/main/java/org/apache/sis/image/WritablePixelIterator.java
index 65f8900..c27f733 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/WritablePixelIterator.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/WritablePixelIterator.java
@@ -142,10 +142,11 @@ public abstract class WritablePixelIterator extends PixelIterator implements
Clo
     }
 
     /**
-     * Returns {@code true} if this iterator can write pixel values.
-     * This method should be used instead than {@code instanceof} check because, for some
implementations, being an
-     * instance of {@code WritablePixelIterator} is not a sufficient condition. However this
method is guaranteed to
-     * return {@code true} for any iterator created by {@code WritablePixelIterator.create(…)}
methods.
+     * Returns {@code true} if this iterator can write pixel values. For some implementations,
being an
+     * instance of {@code WritablePixelIterator} is not sufficient for being able to write
pixel values.
+     *
+     * <p><b>Note:</b> all instances created by {@code WritablePixelIterator.create(…)}
methods are
+     * guaranteed to {@code true}.</p>
      *
      * @return {@code true} if this iterator can be used for writing pixel values.
      */


Mime
View raw message