Package org.apache.sis.image

# Class PixelIterator.Window<T extends Buffer>

Object
Window<T>

Type Parameters:
  `T` - the type of buffer which can be used for transferring data.

Enclosing class:
  PixelIterator

public abstract static class PixelIterator.Window<T extends Buffer> extends Object
Contains the sample values in a moving window over the image. Windows are created by calls to `PixelIterator​.createWindow(TransferType)` and sample values are stored in `Buffer`s. The buffer content is replaced ever time `update()` is invoked.

Since:
  0.8

Defined in the `sis-feature` module

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final T`
  `values`
  A buffer containing all sample values fetched by the last call to `update()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final Dimension`
  `getSize()`
  Returns the width and height of this window in pixels.
  `abstract void`
  `update()`
  Updates this window with the sample values in the region starting at current iterator position.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### values

    public final T extends Buffer values
    A buffer containing all sample values fetched by the last call to `update()`. The buffer capacity is (number of bands) × (window width) × (window height). Values are always stored with band index varying fastest, then column index, then row index. Columns are traversed from left to right and rows are traversed from top to bottom (linear iteration order). That order is the same regardless the iteration order of enclosing iterator.

    Every time that `update()` is invoked, the buffer content is replaced by sample values starting at the current iterator position. Before the first `update()` invocation, the buffer is filled with zero values.

- ## Method Details

  - ### getSize

    public final Dimension getSize()
    Returns the width and height of this window in pixels.
    Returns:
      the window size in pixels.
    Since:
      1.1

  - ### update

    public abstract void update()
    Updates this window with the sample values in the region starting at current iterator position. The buffer position, limit and mark are cleared.

    The `PixelIterator​.next()` method must have returned `true`, or the `PixelIterator​.moveTo(int,int)` method must have been invoked successfully, before this `update()` method is invoked. If above condition is not met, then this method behavior is undefined: it may throw any runtime exception or return meaningless values (there is no explicit bounds check for performance reasons).