com.esri.sde.sdk.client
Class SeRasterTile

java.lang.Object
  extended by com.esri.sde.sdk.client.SeRasterTile
All Implemented Interfaces:
java.lang.Cloneable

public class SeRasterTile
extends java.lang.Object
implements java.lang.Cloneable

A SeRasterTile object provide client side methods for ArcSDE raster tile data Input/Output operation.

Since:
ArcSDE 9.0
See Also:
SeRasterColumn, SeRaster, SeRasterBand, SeRasterAttr

Constructor Summary
SeRasterTile()
          Creates a new SeRasterTile instance.
 
Method Summary
 SeObjectId getBandId()
          Retrieves raster band ID.
 byte[] getBitMaskData()
          Return bit mask data, if exist, else return Zero length byte[] array.
 int getColumnIndex()
          Retrieves tile's column index number.
 int getLevel()
          Retrieves scaling factor (ie, level of detail) info, level 0 is the base image level, level N is the N-th reduction image.
 int getNumPixels()
          Retrieves number of pixels.
 byte[] getPixelData()
          Retrieves pixel data and bitmask data if exist.
 byte[] getPixels(byte[] bArray)
          Returns a byte[] array containing all pixels for this tile, each pixel value is represented by an unsiged-byte.
 double[] getPixels(double[] dArray)
          Returns a double[] array containing all pixels for this tile, each pixel value is represented by a double.
 byte[] getPixels(double statsMin, double statsMax, byte[] bArray)
          Returns a byte[] array containing all pixels for this tile, each pixel value is represented by an unsiged-byte.
 double[] getPixels(double statsMin, double statsMax, double[] dArray)
          Returns a double[] array containing all pixels for this tile, each pixel value is represented by a double.
 float[] getPixels(double statsMin, double statsMax, float[] fArray)
          Returns a float[] array containing all pixels for this tile, each pixel value is represented by a float.
 int[] getPixels(double statsMin, double statsMax, int[] iArray)
          Returns an int[] array containing all pixels for this tile, each pixel value is represented by an int.
 float[] getPixels(float[] fArray)
          Returns a float[] array containing all pixels for this tile, each pixel value is represented by a float.
 int[] getPixels(int[] iArray)
          Returns an int[] array containing all pixels for this tile, each pixel value is represented by an int.
 int getPixelType()
          Retrieves pixel type.
 int getRowIndex()
          Retrieves tile's row index number.
 boolean hasBitMask()
          Return true if bit mask exist.
 void setBandId(SeObjectId rasBandIdObj)
          Sets raster band ID.
 void setLevel(int level)
          Sets scaling factor (ie, level of detail) info, level 0 is the base image level, level N is the N-th reduction image.
 void setPixelData(byte[] pixelData)
          Sets tile's pixel data.
 void setRowColumnIndex(int row, int column)
          Sets tile's row and column index position.
 java.lang.String toString()
          toString () method for SeRasterTile object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SeRasterTile

public SeRasterTile()
Creates a new SeRasterTile instance.

Method Detail

hasBitMask

public boolean hasBitMask()
Return true if bit mask exist.

Returns:
a boolean value

getBitMaskData

public byte[] getBitMaskData()
Return bit mask data, if exist, else return Zero length byte[] array.

Returns:
a byte[] value

getBandId

public SeObjectId getBandId()
Retrieves raster band ID.

Returns:
a SeObjectId value
See Also:
setBandId(com.esri.sde.sdk.client.SeObjectId)

getColumnIndex

public int getColumnIndex()
Retrieves tile's column index number.

Returns:
an int value
See Also:
setRowColumnIndex(int, int), getRowIndex()

getLevel

public int getLevel()
Retrieves scaling factor (ie, level of detail) info, level 0 is the base image level, level N is the N-th reduction image.

Returns:
an int value
See Also:
setLevel(int)

getNumPixels

public int getNumPixels()
Retrieves number of pixels.

Returns:
a int value

getPixelData

public byte[] getPixelData()
Retrieves pixel data and bitmask data if exist. The pixel data is packed in the returning byte[] array according to pixel_type and bitmaks data would be append to the end if exit. See also other alternative to retrieve pixel_data and bitmask.

Returns:
a byte[] value
See Also:
setPixelData(byte[]), getPixels(byte[]), getPixels(double, double, byte[]), getPixels(int[]), getPixels(double, double, int[]), getPixels(float[]), getPixels(double, double, float[]), getPixels(double[]), getPixels(double, double, double[])

getPixels

public byte[] getPixels(byte[] bArray)
                 throws java.lang.Exception
Returns a byte[] array containing all pixels for this tile, each pixel value is represented by an unsiged-byte.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated bArray[] is too small. Copy the pixel value as is from the source and cast it to the output byte[] array. But, throw an exception if pixel_type are of the following for potentially overflow reason.

SeRaster.SE_PIXEL_TYPE: 16BIT_S, 16BIT_U, 32BIT_S, 32BIT_U, 32BIT_REAL or 64BIT_REAL.

Parameters:
bArray - An optionally pre-allocated byte[] array
Returns:
a byte[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(double, double, byte[])

getPixels

public byte[] getPixels(double statsMin,
                        double statsMax,
                        byte[] bArray)
                 throws java.lang.Exception
Returns a byte[] array containing all pixels for this tile, each pixel value is represented by an unsiged-byte.

This is useful in Java AWT image environment for constructing pixel with packed RGB component represented by an int value. An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated bArray[] is too small.

if (statsMin == statsMax), this is same as calling getPixels(byte[]). Which attempt to just copy the pixel value from the source as is and cast it to the output byte[] array. But, throw an exception if pixel_type are of the following for potentially overflow reason.

SeRaster.SE_PIXEL_TYPE: 16BIT_S, 16BIT_U, 32BIT_S, 32BIT_U, 32BIT_REAL or 64BIT_REAL.

if (statsMin != statsMax), attempt to stretch/shrink the source pixel value with the following formula and cast the result to the output byte[] array.

     int    UINT8_MAX_VALUE = 0xff;
     double f = (double) UINT8_MAX_VALUE / (statsMax - statsMin);
     for (int i=0; i < numOfPixels; i++)
       bArray[i] = (byte) (((double) srcPixelVal[i] - statsMin) * f);
 

Parameters:
statsMin - pixels statistic min value.
statsMax - pixels statistic max value.
bArray - An optionally pre-allocated output byte[] array.
Returns:
a byte[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(byte[]), getPixelData(), setPixelData(byte[]), SeRasterData.decodePixelsConvertToObject(int, byte[], int, double, double, java.lang.Object, int, double, int)

getPixels

public int[] getPixels(int[] iArray)
                throws java.lang.Exception
Returns an int[] array containing all pixels for this tile, each pixel value is represented by an int.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated iArray[] is too small. Copy the pixel value as is from the source and cast it to the output int[] array. But, throw an exception if pixel_type are of the following for potentially overflow reason.

SeRaster.SE_PIXEL_TYPE: 32BIT_U, 32BIT_REAL and 64BIT_REAL.

Parameters:
iArray - An optionally pre-allocated output int[] array.
Returns:
an int[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(double, double, int[])

getPixels

public int[] getPixels(double statsMin,
                       double statsMax,
                       int[] iArray)
                throws java.lang.Exception
Returns an int[] array containing all pixels for this tile, each pixel value is represented by an int.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated iArray[] is too small.

if (statsMin == statsMax), this is same as calling getPixels(byte[]). Which attempt to just copy the pixel value from the source as is and cast it to the output int[] array. But, throw an exception if pixel_type are of the following for potentially overflow reason.

SeRaster.SE_PIXEL_TYPE: 32BIT_U, 32BIT_REAL and 64BIT_REAL

if (statsMin != statsMax), attempt to stretch/shrink the source pixel value with the following formula and cast the result to the output int[] array.

     double f = (double) Integer.MAX_VALUE / (statsMax - statsMin);
     for (int i=0; i < numOfPixels; i++)
       iArray[i] = (int) (((double) srcPixelVal[i] - statsMin) * f);
 

Parameters:
statsMin - pixels statistic min value.
statsMax - pixels statistic max value.
iArray - An optionally pre-allocated output int[] array.
Returns:
an int[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(int[]), getPixelData(), setPixelData(byte[]), SeRasterData.decodePixelsConvertToObject(int, byte[], int, double, double, java.lang.Object, int, double, int)

getPixels

public float[] getPixels(float[] fArray)
                  throws java.lang.Exception
Returns a float[] array containing all pixels for this tile, each pixel value is represented by a float.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated fArray[] is too small. Copy the pixel value as is from the source and cast it to the output float[] array. But, throw an exception if pixel_type is 64BIT_REAL for potentially overflow reason.

Parameters:
fArray - An optionally pre-allocated output float[] array
Returns:
a float[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(double, double, float[])

getPixels

public float[] getPixels(double statsMin,
                         double statsMax,
                         float[] fArray)
                  throws java.lang.Exception
Returns a float[] array containing all pixels for this tile, each pixel value is represented by a float.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated fArray is too small.

if (statsMin == statsMax), this is same as calling getPixels(float[]). Which attempt to just copy the pixel value as is from the source and cast it to the output float[] array. But, throw an exception if pixel_type is 64BIT_REAL for potentially overflow reason.

if (statsMin != statsMax), attempt to stretch/shrink the source pixel value with the following formula and cast the result to the output float[] array.

     double f = (double) Float.MAX_VALUE / (statsMax - statsMin);
     for (int i=0; i < numOfPixels; i++)
       fArray[i] = (float) (((double) srcPixelVal[i] - statsMin) * f);
 

Parameters:
statsMin - pixels statistic min value.
statsMax - pixels statistic max value.
fArray - An optionally pre-allocated output float[] array.
Returns:
a float[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(float[]), getPixelData(), setPixelData(byte[]), SeRasterData.decodePixelsConvertToObject(int, byte[], int, double, double, java.lang.Object, int, double, int)

getPixels

public double[] getPixels(double[] dArray)
                   throws java.lang.Exception
Returns a double[] array containing all pixels for this tile, each pixel value is represented by a double.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated dArray[] is too small. Copy the pixel value as is from the source and cast it to the output double[] array.

Parameters:
dArray - An optionally pre-allocated outpu double[] array.
Returns:
a double[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(double, double, double[])

getPixels

public double[] getPixels(double statsMin,
                          double statsMax,
                          double[] dArray)
                   throws java.lang.Exception
Returns a double[] array containing all pixels for this tile, each pixel value is represented by a double.

An ArrayIndexOutOfBoundException may be thrown if the optional pre-allocated dArray[] is too small.

if (statsMin == statsMax), this is same as calling getPixels(double[]). Which attempt to just copy the pixel value from the source and cast it to the output double[] array.

if (statsMin != statsMax), attempt to stretch the source pixel value with the following formula and cast the result to the output double[] array.

     double f = Double.MAX_VALUE / (statsMax - statsMin);
     for (int i=0; i < numOfPixels; i++)
       dArray[i] = (double) (((double) srcPixelVal[i] - statsMin) * f);
 

Parameters:
statsMin - pixels statistic min value.
statsMax - pixels statistic max value.
dArray - An optionally pre-allocated output double[] array.
Returns:
a double[] value
Throws:
java.lang.Exception - if an error occurs.
See Also:
getPixels(double[]), getPixelData(), setPixelData(byte[]), SeRasterData.decodePixelsConvertToObject(int, byte[], int, double, double, java.lang.Object, int, double, int)

getPixelType

public int getPixelType()
Retrieves pixel type. See SeRasterBand.setPixelType(int) for valid pixel_type values.

Returns:
an int value

getRowIndex

public int getRowIndex()
Retrieves tile's row index number.

Returns:
a int value
See Also:
setRowColumnIndex(int, int), getColumnIndex()

setBandId

public void setBandId(SeObjectId rasBandIdObj)
               throws SeException
Sets raster band ID.

Parameters:
rasBandIdObj - a SeObjectId value
Throws:
SeException - if an error occurs.
See Also:
getBandId()

setLevel

public void setLevel(int level)
              throws SeException
Sets scaling factor (ie, level of detail) info, level 0 is the base image level, level N is the N-th reduction image.

Parameters:
level - level of detail.
Throws:
SeException - if an error occurs.
See Also:
getLevel()

setPixelData

public void setPixelData(byte[] pixelData)
                  throws SeException
Sets tile's pixel data. If mask_mode, then bitmask data is right after pixel data. See also getPixelData

Parameters:
pixelData - a byte[] value
Throws:
SeException - if an error occurs.
See Also:
getPixelData()

setRowColumnIndex

public void setRowColumnIndex(int row,
                              int column)
                       throws SeException
Sets tile's row and column index position.

Parameters:
row - an int value.
column - an int value.
Throws:
SeException - if an error occurs.
See Also:
getRowIndex(), getColumnIndex()

toString

public java.lang.String toString()
toString () method for SeRasterTile object.

Overrides:
toString in class java.lang.Object
Returns:
a String value