|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.sde.sdk.client.SeRasterAttr
public class SeRasterAttr
A SeRasterAttr
object provide client side methods for
ArcSDE raster data Input/Output operation.
SeRasterColumn
,
SeRaster
,
SeRasterBand
Field Summary | |
---|---|
static java.lang.String |
COMPRESSION_BIT_RATE
Tag for raster compression bit rate |
static java.lang.String |
COMPRESSION_QUALITY
Tag for raster compression quality |
static java.lang.String |
PYRAMID_AUTO_LEVEL
Tag for raster pyramid auto level flag |
static java.lang.String |
PYRAMID_INTERPOLATION
Tag for raster pyramid interpolation type |
static java.lang.String |
PYRAMID_MAX_LEVEL
Tag for raster pyramid max level |
Constructor Summary | |
---|---|
SeRasterAttr(boolean inputMode)
Constructs SeRasterAttr with specified inputMode |
Method Summary | |
---|---|
int |
getBandHeight()
Retrieves image band height. |
SeRasterBand |
getBandInfo(int index)
Retrieves raster band info at specified index location, this is a base 1 index value. |
SeRasterBand[] |
getBands()
Retrieves all raster bands for this image. |
int |
getBandWidth()
Retrieves image band width. |
double |
getCompressionProperty(java.lang.String propertyName)
Retrieves compression property. |
int |
getCompressionType()
Retrieves compression type. |
java.lang.String |
getDescription()
Retrieves the description |
SeExtent |
getExtent()
Retrieves image extent. |
SeExtent |
getExtentByLevel(int level)
Retrieves image extent by pyramid level. |
SDEPoint |
getExtentOffsetByLevel(int level)
Retrieves image offset values by pyramid level. |
int |
getImageHeight()
Retrieves image band height. |
int |
getImageHeightByLevel(int level)
Retrieves image band height by pyramid level. |
SDEPoint |
getImageOffsetByLevel(int level)
Retrieves image XY offset values by pyramid level. |
int |
getImageWidth()
Retrieves image band width. |
int |
getImageWidthByLevel(int level)
Retrieves image band width by pyramid level. |
int |
getInterleave()
Retrieves interleave type. |
int |
getInterpolation()
Retrieves interpolation method. |
int |
getMaxLevel()
Retrieves maximum pyramid level. |
int |
getNumBands()
Retrieves number of bands. |
int |
getPixelDepth()
Return pixel depth in number of bits. |
int |
getPixelType()
Retrieves pixel type. |
int |
getPyramidProperty(java.lang.String propertyName)
Retrieves pyramid property. |
SeObjectId |
getRasterColumnId()
Retrieves the raster_column_ID as SeObjectId . |
SeObjectId |
getRasterId()
Retrieves the raster_ID as SeObjectId . |
SeRaster |
getRasterInfo()
Retrieves ArcSDE raster info as a SeRaster object. |
int |
getTileHeight()
Retrieves tile height. |
SDEPoint |
getTileOrigin()
Retrieves the coordinates of the upper-left corner pixel of tile (0, 0) |
int |
getTilesPerColByLevel(int level)
Retrieves number of tiles per column (ie, numYTiles) by pyramid level. |
int |
getTilesPerRowByLevel(int level)
Retrieves number of tiles per row (ie, numXTiles) by pyramid level. |
int |
getTileWidth()
Retrieves tile width. |
boolean |
isAutoLevelSet()
Return true if pyramid auto level is set. |
boolean |
isInputMode()
Return true if input mode,
else false for output mode. |
boolean |
isMaskMode()
Return true if mask mode. |
void |
setColorMap(int colormapType,
java.awt.image.DataBuffer colormapData)
Sets colormap. |
void |
setCompressionType(int compressionType)
Sets compression type. |
void |
setDeleteArea(SeExtent area)
Deprecated. at ArcSDE v9.0. |
void |
setExtent(SeExtent envelope)
Sets image extent. |
void |
setImageOrigin(double x,
double y)
Sets image origin. |
void |
setImageSize(int bandWidth,
int bandHeight,
int numBands)
Sets image size. |
void |
setImportMode(boolean importMode)
Sets import mode is for ESRI internal use only. |
void |
setInterleave(boolean is_scr_data,
int interleave)
Sets interleave type. |
void |
setMaskMode(boolean maskMode)
Sets mask mode for masking off no-data pixels with bitmask data. |
void |
setMosaicMode(int mosaicMode)
Sets mosaic mode, default off. |
void |
setPixelType(int pixelType)
Sets pixel type. |
void |
setPyramidInfo(int maxLevel,
boolean skipLevelOne,
int interpolation)
Sets pyramid info. |
void |
setPyramidProperty(java.lang.String propertyName,
int propertyValue)
Sets pyramid property. |
void |
setRasterCallBack(SeRasterCallBack rasterCallBack,
java.lang.Object userContext)
Sets C like callback method on input mode. |
void |
setRasterProducer(SeRasterProducer rp)
Sets java.awt imaging like producer/comsumer callback interface method on input mode. |
void |
setTileSize(int tileWidth,
int tileHeight)
Sets raster tile's size. |
boolean |
skipLevelOne()
Return true , if skip pyramid level one. |
java.lang.String |
toString()
toString () method for SeRasterAttr object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COMPRESSION_BIT_RATE
public static final java.lang.String COMPRESSION_QUALITY
public static final java.lang.String PYRAMID_AUTO_LEVEL
public static final java.lang.String PYRAMID_INTERPOLATION
public static final java.lang.String PYRAMID_MAX_LEVEL
Constructor Detail |
---|
public SeRasterAttr(boolean inputMode) throws SeException
SeRasterAttr
with specified inputMode
Top of
class.
SeRasterAttr
inputMode
- true
for input mode,
false
for output mode.
SeException
- if an error occurs.Method Detail |
---|
public int getBandHeight() throws SeException
int
value
SeException
- if an error occursgetImageHeight()
,
getImageWidth()
,
setImageSize(int, int, int)
public int getBandWidth() throws SeException
int
value
SeException
- if an error occursgetImageHeight()
,
getImageWidth()
,
setImageSize(int, int, int)
public SeRasterBand getBandInfo(int index) throws SeException
index
- an int
value
SeRasterBand
value
SeException
- if an error occursgetBands()
public SeRasterBand[] getBands() throws SeException
SeRasterBand[]
value
SeException
- if an error occursgetBandInfo(int)
public double getCompressionProperty(java.lang.String propertyName) throws SeException
propertyName
- a case insensitive String
Use value Quality
or BitRate
, or
double
value.
SeException
- if an error occursgetCompressionType()
,
setCompressionType(int)
public int getCompressionType() throws SeException
int
value
SeRaster.SE_COMPRESSION_JP2 is not yet implemented.
SeException
- if an error occurssetCompressionType(int)
public java.lang.String getDescription()
String
valuepublic SeExtent getExtent() throws SeException
SeExtent
value
SeException
- if an error occurssetExtent(SeExtent)
,
getExtentByLevel(int)
,
getExtentOffsetByLevel(int)
public SeExtent getExtentByLevel(int level) throws SeException
On output mode. This following group of instance methods have the same affect on each other on getting info by pyramid level. If one of the method is called for the first time, other pyramid related info is calculated and cached for faster access later for these methods:
getExtentByLevel
getExtentOffsetByLevel
getImageHeightByLevel
getImageWidthByLevel
getImageOffsetByLevel
level
- an int
value
SeExtent
value
SeException
- if an error occursgetExtent()
public SDEPoint getExtentOffsetByLevel(int level) throws SeException
To get offset in integer form simply cast point's XY values
to int
.
For example,
SDEPoint imgOffset = getImageOffsetByLevel (lvl); int imgOffsetX = (int) imgOffset.getX (); int imgOffsetY = (int) imgOffset.getY ();
level
- an int
value
SDEPoint
value
SeException
- if an error occursgetExtent()
,
getExtentByLevel(int)
,
getImageHeightByLevel(int)
,
getImageWidthByLevel(int)
,
getImageOffsetByLevel(int)
public int getImageHeight() throws SeException
int
value
SeException
- if an error occursgetBandHeight()
,
getBandWidth()
,
setImageSize(int, int, int)
public int getImageWidth() throws SeException
int
value
SeException
- if an error occursgetBandHeight()
,
getBandWidth()
,
setImageSize(int, int, int)
public int getImageHeightByLevel(int level) throws SeException
On output mode. This following group of instance methods have the same affect on each other on getting info by pyramid level. If one of the method is called for the first time, other pyramid related info is calculated and cached for faster access later for these methods:
getExtentByLevel
getExtentOffsetByLevel
getImageHeightByLevel
getImageWidthByLevel
getImageOffsetByLevel
level
- an int
value
int
value
SeException
- if an error occursgetBandHeight()
,
getTileHeight()
public int getImageWidthByLevel(int level) throws SeException
level
- an int
value
int
value
SeException
- if an error occursgetImageHeightByLevel(int)
,
getImageOffsetByLevel(int)
,
getExtentByLevel(int)
,
getExtentOffsetByLevel(int)
,
getBandWidth()
,
getTileWidth()
public SDEPoint getImageOffsetByLevel(int level) throws SeException
To get offset in integer form simply cast point's XY values
to int
.
For example,
SDEPoint imgOffset = getImageOffsetByLevel (lvl); int imgOffsetX = (int) imgOffset.getX (); int imgOffsetY = (int) imgOffset.getY ();
level
- an int
value
SDEPoint
value
SeException
- if an error occursgetExtentOffsetByLevel(int)
,
getExtentByLevel(int)
,
getImageHeightByLevel(int)
,
getImageWidthByLevel(int)
public int getInterleave() throws SeException
int
value
SeException
- if an error occurspublic int getInterpolation() throws SeException
int
value
SeException
- if an error occursgetMaxLevel()
,
skipLevelOne()
,
setPyramidInfo(int, boolean, int)
public int getMaxLevel() throws SeException
int
value
SeException
- if an error occursgetInterpolation()
,
skipLevelOne()
,
setPyramidInfo(int, boolean, int)
public int getNumBands() throws SeException
int
value
SeException
- if an error occurspublic int getPixelDepth() throws SeException
int
value
SeException
getPixelType()
,
setPixelType(int)
public int getPixelType() throws SeException
int
value
SeRaster.SE_PIXEL_TYPE_1BIT
SeRaster.SE_PIXEL_TYPE_4BIT
SeRaster.SE_PIXEL_TYPE_8BIT_U
SeRaster.SE_PIXEL_TYPE_8BIT_S
SeRaster.SE_PIXEL_TYPE_16BIT_U
SeRaster.SE_PIXEL_TYPE_16BIT_S
SeRaster.SE_PIXEL_TYPE_32BIT_U
SeRaster.SE_PIXEL_TYPE_32BIT_S
SeRaster.SE_PIXEL_TYPE_32BIT_REAL
SeRaster.SE_PIXEL_TYPE_64BIT_REAL
SeException
- if an error occurssetPixelType(int)
public int getPyramidProperty(java.lang.String propertyName) throws SeException
propertyName
- a case insensitive String
Use value MaxLevel
, Interpolation
or AutoLevel
, or use
int
value.
SeException
- if an error occurssetPyramidProperty(java.lang.String, int)
,
getInterpolation()
,
getMaxLevel()
,
skipLevelOne()
,
isAutoLevelSet()
public SeObjectId getRasterColumnId() throws SeException
SeObjectId
.
SeObjectId
value
SeException
- if an error occursgetRasterId()
public SeObjectId getRasterId() throws SeException
SeObjectId
.
SeObjectId
value
SeException
- if an error occursgetRasterColumnId()
public SeRaster getRasterInfo() throws SeException, java.lang.CloneNotSupportedException
SeRaster object.
- Returns:
- a
SeRaster
value
- Throws:
SeException
- if an error occurs
java.lang.CloneNotSupportedException
- if an error occurs- See Also:
SeRaster
public int getTileHeight() throws SeException
int
value
SeException
- if an error occursgetTileWidth()
,
getTileOrigin()
public int getTileWidth() throws SeException
int
value
SeException
- if an error occursgetTileHeight()
,
getTileOrigin()
public SDEPoint getTileOrigin() throws SeException
SDEPoint
value
SeException
- if an error occursgetTileHeight()
,
getTileWidth()
public int getTilesPerColByLevel(int level) throws SeException
int
value
SeException
- if an error occursgetTilesPerRowByLevel(int)
public int getTilesPerRowByLevel(int level) throws SeException
int
value
SeException
- if an error occursgetTilesPerColByLevel(int)
public boolean isAutoLevelSet() throws SeException
true
if pyramid auto level is set.
boolean
value
C-API equivalent: SES_rasterattr_is_origin_set ()
SeException
public boolean isInputMode()
true
if input mode,
else false
for output mode.
boolean
valuepublic boolean isMaskMode() throws SeException
true
if mask mode. For input mode only.
boolean
value
SeException
- if not input mode then throw exception with
SeError.SE_OPERATION_NOT_ALLOWED code.public void setColorMap(int colormapType, java.awt.image.DataBuffer colormapData) throws SeException, java.io.IOException
The colormapType
will determine the number of banks.
The colormapData
object will determine the data type
and the number of entries per bank.
colormapType
- as an int
value
SeRaster.SE_COLORMAP_RGB
-- need colormapData.getSize() = 3
banks
from colormapData
SeRaster.SE_COLORMAP_RGBA
-- need colormapData.getSize() = 4
banks
from colormapData
colormapData
- an awt.image.DataBuffer
value.
instanceof DataBufferByte
-- set data type to SeRaster.SE_COLORMAP_DATA_BYTE
instanceof DataBufferShort
-- set data type to SeRaster.SE_COLORMAP_DATA_SHORT
colormapData.getSize()
SeException
- if an error occurs
java.io.IOException
- if an error occursSeRasterBand.getColorMap()
,
SeRasterBand.getColorMapData()
public void setCompressionType(int compressionType) throws SeException
The compression_type argument accepts the following values:
SeRaster.SE_COMPRESSION_NONE
SeRaster.SE_COMPRESSION_LZ77
SeRaster.SE_COMPRESSION_JPEG
SeRaster.SE_COMPRESSION_JP2
compressionType
- an int
value
SeException
- if an error occursgetCompressionType()
public void setDeleteArea(SeExtent area) throws SeException
area
- a SeExtent
value.
SeException
- if an error occurssetExtent(com.esri.sde.sdk.client.SeExtent)
public void setExtent(SeExtent envelope) throws SeException
envelope
- a SeExtent
value.
SeException
- if an error occursgetExtent()
,
setDeleteArea(com.esri.sde.sdk.client.SeExtent)
public void setImageOrigin(double x, double y) throws SeException
x
- an double
valuey
- an double
value
SeException
- if an error occurssetBlockOrigin(double, double)
,
getBlockOrigin()
public void setImageSize(int bandWidth, int bandHeight, int numBands) throws SeException
bandWidth
- an int
valuebandHeight
- an int
valuenumBands
- an int
value
SeException
- if an error occursgetBandHeight()
,
getBandWidth()
,
getNumBands()
public void setImportMode(boolean importMode) throws SeException
This allow the client side to transport server native raste tile data block in compressed or uncompressed format.
importMode
- a boolean
value.
SeException
- if an error occurssetRasterProducer(com.esri.sde.sdk.client.SeRasterProducer)
,
SeRasterRenderedTile.setRasterTiles(com.esri.sde.sdk.client.SeRasterTile[])
,
SeRasterProducer
,
SeRasterConsumer
public void setInterleave(boolean is_scr_data, int interleave) throws SeException
is_scr_data
- a boolean
value.interleave
- an int
value.
SeException
- if an error occurspublic void setMaskMode(boolean maskMode) throws SeException
When set, the callback function specified in
is required to provide bitmask
information along with the pixel data. The bitmask data is used
to mask off no-data pixels.
setRasterCallBack(com.esri.sde.sdk.client.SeRasterCallBack, java.lang.Object)
maskMode
- a boolean
value.
SeException
- if an error occurssetRasterCallBack(com.esri.sde.sdk.client.SeRasterCallBack, java.lang.Object)
public void setMosaicMode(int mosaicMode) throws SeException
SE_MOSAIC_NONE -- is equivalent to mosaic mode OFF. SE_MOSAIC_MERGE -- is equivalent to mosaic mode ON. SE_MOSAIC_DELETE -- is mosaic mode ON with the following merge policy. For pixels in two overlapping tiles, if the new pixel's bitmask is 0, then delete the old pixel. If it is 1, then do nothing.
mosaicMode
- an int
value.
SeException
- if an error occurspublic void setPixelType(int pixelType) throws SeException
The pixelType argument accepts the following values:
SeRaster.SE_PIXEL_TYPE_1BIT
SeRaster.SE_PIXEL_TYPE_4BIT
SeRaster.SE_PIXEL_TYPE_8BIT_U
SeRaster.SE_PIXEL_TYPE_8BIT_S
SeRaster.SE_PIXEL_TYPE_16BIT_U
SeRaster.SE_PIXEL_TYPE_16BIT_S
SeRaster.SE_PIXEL_TYPE_32BIT_U
SeRaster.SE_PIXEL_TYPE_32BIT_S
SeRaster.SE_PIXEL_TYPE_32BIT_REAL
SeRaster.SE_PIXEL_TYPE_64BIT_REAL
pixelType
- an int
value
SeException
- if an error occursgetPixelType()
public void setPyramidInfo(int maxLevel, boolean skipLevelOne, int interpolation) throws SeException
maxLevel
- an int
valueskipLevelOne
- a boolean
value. If
true
, the first level is not counted.interpolation
- an int
value
SeException
- if an error occursgetInterpolation()
,
getMaxLevel()
,
skipLevelOne()
public void setPyramidProperty(java.lang.String propertyName, int propertyValue) throws SeException
propertyName
- a case insensitive String
.
Use value MaxLevel
, Interpolation
or AutoLevel
, or use
propertyValue
- an int
value
"maxLevel" = (int) propertyValue;
"interpolation" = (int) propertyValue;
"autoLevel" = if (propertyValue !=0)
autoLevel=SeRaster.SE_PYRAMID_AUTO_LEVEL;
SeException
- if an error occurssetPyramidInfo(int, boolean, int)
,
getPyramidProperty(java.lang.String)
,
getInterpolation()
,
getMaxLevel()
,
skipLevelOne()
public void setTileSize(int tileWidth, int tileHeight) throws SeException
tileWidth
- an int
valuetileHeight
- an int
value
SeException
- if an error occursgetTileHeight()
,
getTileWidth()
,
getTileOrigin()
public boolean skipLevelOne() throws SeException
true
, if skip pyramid level one.
boolean
value
SeException
- if an error occursgetInterpolation()
,
getMaxLevel()
,
setPyramidInfo(int, boolean, int)
public void setRasterCallBack(SeRasterCallBack rasterCallBack, java.lang.Object userContext) throws SeException
Note: Choose between one of the two available methods for input mode. (i.e, setRasterCallBack() or setRasterProducer()). If both methods are called, then the latest one will take affect.
SeInsert insert = new SeInsert (seConnection); insert.intoTable (toTableName, columnNames); boolean inputMode = true; SeRasterAttr toRasAttr = new SeRasterAttr (inputMode); // Set callback func Object userContext = null; SeRasterCallBackImp myCallBack = new SeRasterCallBackImp (toRasAttr, ..); toRasAttr.setRasterCallBack (myCallBack, userContext); SeRow toRow = insert.getRowToSet (); toRow.setRaster (toRasColPos, toRasAttr); insert.execute (); insert.close (); . .Where SeRasterCallBackImp object is
// ------------------------------------------------------------------ // Raster CallBack class // ------------------------------------------------------------------ class SeRasterCallBackImp extends SeRasterCallBack { // Class constructor SeRasterCallBackImpl (SeRasterAttr rasAttr, ...) { // constructor } // The C-API equivalent of callback function here. // See abstract class SeRasterCallBack for more info public SeRaterData getSeRasterData (Object userContext) { // Construct raster data and return as SeRasterData object type. } }
rasterCallBack
- a SeRasterCallBack
value.userContext
- an Object
value.
SeException
- if an error occurssetRasterProducer(com.esri.sde.sdk.client.SeRasterProducer)
,
SeRasterCallBack
public void setRasterProducer(SeRasterProducer rp) throws SeException
The
object is implemented as
SeRasterRenderedImage
SeRasterConsumer
for ScanLine mode load.
Note: Choose between one of the two available methods for input mode. (i.e, setRasterCallBack() or setRasterProducer()). If both methods are called, then the latest one will take affect.
String[] columnNames = {"attr1", "attr2", "rascol"}; SeInsert insert = new SeInsert (seConnection); insert.intoTable (toTableName, columnNames); boolean inputMode = true; SeRasterAttr toRasAttr = new SeRasterAttr (inputMode); . . . // Set callback func MyRasterProducer myProducer = new MyRasterProducer (...); toRasAttr.setRasterProducer (myProducer); SeRow toRow = insert.getRowToSet (); toRow.setRaster (toRasColPos, toRasAttr); insert.execute (); insert.close (); . .Where MyRasterProducer object is
// ------------------------------------------------------------------ // Raster renderable class // ------------------------------------------------------------------ class MyRasterProducer implements SeRasterProducer, Runnable { // Needed for SeRasterProducer interface private Vector _rasConsumers = null; private SeRasterConsumer _rc = null; private Thread _thread = null; // Class constructor MyRasterProducer (...) { _rasConsumers = new Vector (); } // The C-API equivalent of callback function here. // See abstract class SeRasterRenderedImage for more info public synchronized void startProduction (SeRasterConsumer rc) { if (!isConsumer (rc)) { System.out.print(" Invalid raster consumer"); return; } _rc = rc; // Save a copy if (_thread == null) { _thread = new Thread (this); _thread.setPriority (Thread.NORM_PRIORITY); } _thread.start (); // Will invoke the run() method } // The run method public void run () { for (...) { // As many times as needed _rc.setScanLines (...); // For ScanLine_Mode load. } _rc.rasterComplete (SeRasterConsumer.SINGLEFRAMEDONE); } // addConsumer method public void addConsumer (SeRasterConsumer rc) { if (_rasConsumers.contains(rc) == false) _rasConsumers.addElement (rc); } // isConsumer method public boolean isConsumer (SeRasterConsumer rc) { return (_rasConsumers.contains (rc)); } // removeConsumer method public void removeConsumer (SeRasterConsumer rc) { if (_rasConsumers.contains(rc) == true) _rasConsumers.removeElement (rc); } }
rp
- a SeRasterProducer
value.
SeException
- if an error occurssetRasterCallBack(com.esri.sde.sdk.client.SeRasterCallBack, java.lang.Object)
,
SeRasterProducer
,
SeRasterConsumer
,
SeRasterRenderedImage.setScanLines(int, byte[], byte[])
public java.lang.String toString()
toString
in class java.lang.Object
String
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |