com.esri.arcgis.datasourcesraster
Class PixelBlockCursor

java.lang.Object
  extended by com.esri.arcgis.datasourcesraster.PixelBlockCursor
All Implemented Interfaces:
IPixelBlockCursor, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class PixelBlockCursor
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IPixelBlockCursor

A PixelBlock cursor class.

Description

The PixelBlockCursor object provides a mechanism for iterating through the pixel blocks in a Raster or a RasterBand. It is useful for rasters that are too large to be brought into memory at once.

The PixelBlockCursor object, although similar to RasterCursor, provides a more convient way for iterating through the pixel blocks in a Raster or a RasterBand. It allows any pixel block size and provides four iteration modes.

When iterating through pixel blocks in a Rasterband, you must specify the size of the pixel block at the time of initiating it. After initiation, the pixel block size is fixed. When iterating through pixel blocks in a Raster, the size of the PixelBlock is determined automatically at the time of initiation. You can modify the size of the PixelBlock later on.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
PixelBlockCursor()
          Constructs a PixelBlockCursor using ArcGIS Engine.
PixelBlockCursor(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
PixelBlockCursor thePixelBlockCursor = (PixelBlockCursor) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 void getBlockSize(int[] pBlockSizeX, int[] pBlockSizeY)
          Gets the cursor block size.
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void initByRaster(IRaster pRaster)
          Initializes the cursor by the raster interface.
 void initByRawPixels(IRawPixels pRowPixels, int blockSizeX, int blockSizeY)
          Initializes the cursor by the raw pixel interface.
 IPixelBlock nextBlock(int[] pLeft, int[] pTop, int[] pSizeX, int[] pSizeY)
          Obtains the next pixel block from the cursor.
 void setScanMode(int rhs1)
          The cursor scan mode: Line = 0, LineSerpent = 1, Serpent2 = 3, alaGIF = 4.
 void updateBlockSize(int blockSizeX, int blockSizeY)
          Updates the cursor block size.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

PixelBlockCursor

public PixelBlockCursor()
                 throws IOException,
                        UnknownHostException
Constructs a PixelBlockCursor using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

PixelBlockCursor

public PixelBlockCursor(Object obj)
                 throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
PixelBlockCursor thePixelBlockCursor = (PixelBlockCursor) obj;

Construct a PixelBlockCursor using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to PixelBlockCursor.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

initByRawPixels

public void initByRawPixels(IRawPixels pRowPixels,
                            int blockSizeX,
                            int blockSizeY)
                     throws IOException,
                            AutomationException
Initializes the cursor by the raw pixel interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
initByRawPixels in interface IPixelBlockCursor
Parameters:
pRowPixels - A reference to a com.esri.arcgis.datasourcesraster.IRawPixels (in)
blockSizeX - The blockSizeX (in)
blockSizeY - The blockSizeY (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initByRaster

public void initByRaster(IRaster pRaster)
                  throws IOException,
                         AutomationException
Initializes the cursor by the raster interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
initByRaster in interface IPixelBlockCursor
Parameters:
pRaster - A reference to a com.esri.arcgis.geodatabase.IRaster (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

updateBlockSize

public void updateBlockSize(int blockSizeX,
                            int blockSizeY)
                     throws IOException,
                            AutomationException
Updates the cursor block size.

Remarks

This should be used only when reading a PixelBlock from a Raster.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
updateBlockSize in interface IPixelBlockCursor
Parameters:
blockSizeX - The blockSizeX (in)
blockSizeY - The blockSizeY (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBlockSize

public void getBlockSize(int[] pBlockSizeX,
                         int[] pBlockSizeY)
                  throws IOException,
                         AutomationException
Gets the cursor block size.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getBlockSize in interface IPixelBlockCursor
Parameters:
pBlockSizeX - The pBlockSizeX (in/out: use single element array)
pBlockSizeY - The pBlockSizeY (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setScanMode

public void setScanMode(int rhs1)
                 throws IOException,
                        AutomationException
The cursor scan mode: Line = 0, LineSerpent = 1, Serpent2 = 3, alaGIF = 4.

Remarks

The supported 4 scan modes are Line, LineSerpent, Serpent, and alaGIF, with value 0,1,3, and 4 respectively. The default is line mode.

If you wish to change the scan mode, this property must be set immedietly after initializing the pixel block (calling InitByRawPixels or InitByRaster).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setScanMode in interface IPixelBlockCursor
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

nextBlock

public IPixelBlock nextBlock(int[] pLeft,
                             int[] pTop,
                             int[] pSizeX,
                             int[] pSizeY)
                      throws IOException,
                             AutomationException
Obtains the next pixel block from the cursor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
nextBlock in interface IPixelBlockCursor
Parameters:
pLeft - The pLeft (in/out: use single element array)
pTop - The pTop (in/out: use single element array)
pSizeX - The pSizeX (in/out: use single element array)
pSizeY - The pSizeY (in/out: use single element array)
Returns:
A reference to a com.esri.arcgis.geodatabase.IPixelBlock
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.