|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.datasourcesraster.PixelBlock
public class PixelBlock
ESRI PixelBlock, a container of pixel data.
The PixelBlock object contains a pixel array that can be read from a raster or a raster band. The PixelBlock object is designed to handle generic pixel arrays from any raster data source. This means it must be able to handle single and multiband data, as well as support different pixel types. To support different pixel types, the PixelBlock transports pixels in a SafeArray, which has the ability to contain many different data types. To support multiple bands, or planes, of raster data, the PixelBlock provides a separate array for each band in the raster.
You can get the pixel data from the pixel block, modify the pixel values, and write the pixel block with the modified pixel values to a raster band. If the pixel block is created from a Raster, the modified pixel block can be written to raster dataset using IRasterEdit::Write.
The PixelBlock object can be created from both Raster and RasterBand. In addition, a RasterCursor can also create the PixelBlock object. A PixelBlock that is created for use with one object may not be usable with another object because of the way the PixelBlock is initialized.
The PixelBlock can be created in any size, but after it is created, its size cannot be changed. For small rasters, the PixelBlock can be the size of the entire dataset, which can usually be held in memory at one time.
Larger rasters can be read in as smaller pieces by creating a smaller PixelBlock and reading portions of the raster sequentially.
Constructor Summary | |
---|---|
PixelBlock()
Constructs a PixelBlock using ArcGIS Engine. |
|
PixelBlock(Object obj)
Construct a PixelBlock using a reference to such an object returned from ArcGIS Engine or Server. |
Method Summary | |
---|---|
void |
clear()
Clears the pixel block. |
void |
clear(int plane)
Clears a given plane (sets to NoData). |
void |
create(int planes,
int nCols,
int nRows,
int pixelType)
Initializes the pixel block. |
void |
createFromPixelBlock(IPixelBlock pBlock,
Object noData)
Initializes the pixel block using another pixel block. |
boolean |
equals(Object o)
Compare this object with another |
byte[] |
exportToBytes()
Exports to a byte array. |
int |
getBytesPerPixel()
The number of bytes per pixel for the PixelBlock. |
static String |
getClsid()
getClsid. |
int |
getHeight()
The height of the PixelBlock in pixels. |
Object |
getNoDataMask(int plane)
The NoData mask for a specified plane. |
Object |
getNoDataMaskByRef(int plane)
The NoData mask for a specified plane. |
Object |
getNoDataMaskVal(int plane,
int x,
int y)
Gets the NoData mask value for a specified pixel. |
Object |
getPixelData(int plane)
An array of pixels for a specified plane. |
Object |
getPixelDataByRef(int plane)
A pointer to an array of pixels for a specified plane. |
int |
getPixelType(int plane)
The pixel type of the PixelBlock. |
int |
getPlanes()
The number of pixel arrays contained in the PixelBlock. |
Object |
getSafeArray(int plane)
A variant SafeArray of pixels for a specified plane. |
Object |
getSafeArrayByRef(int plane)
A variant SafeArray of pixels for a specified plane. |
Object |
getVal(int plane,
int x,
int y)
The value for a specified pixel. |
int |
getWidth()
The width of the PixelBlock in pixels. |
boolean |
hasData()
Checks if a PixelBlock contains any data pixels. |
int |
hashCode()
the hashcode for this object |
boolean |
hasNoData()
Checks if a PixelBlock contains NoData. |
boolean |
hasNoData(int plane)
Checks if this PixelBlock contains NoData. |
void |
mask(Object noData)
Generates NoData Mask using a given NoData value. |
void |
setNoDataMask(int plane,
Object pVal)
The NoData mask for a specified plane. |
void |
setPixelData(int plane,
Object pVal)
An array of pixels for a specified plane. |
void |
setPixelType(int plane,
int val)
The pixel type of the PixelBlock. |
void |
setSafeArray(int plane,
Object val)
A variant SafeArray of pixels for a specified plane. |
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 |
---|
public PixelBlock() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic PixelBlock(Object obj) throws IOException
obj
to PixelBlock
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problems
PixelBlock thePixelBlock = (PixelBlock) obj;
Method Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int getPlanes() throws IOException, AutomationException
getPlanes
in interface IPixelBlock2
getPlanes
in interface IPixelBlock3
getPlanes
in interface IPixelBlock
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getWidth() throws IOException, AutomationException
getWidth
in interface IPixelBlock2
getWidth
in interface IPixelBlock3
getWidth
in interface IPixelBlock
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getHeight() throws IOException, AutomationException
getHeight
in interface IPixelBlock2
getHeight
in interface IPixelBlock3
getHeight
in interface IPixelBlock
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getPixelType(int plane) throws IOException, AutomationException
getPixelType
in interface IPixelBlock2
getPixelType
in interface IPixelBlock3
getPixelType
in interface IPixelBlock
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setPixelType(int plane, int val) throws IOException, AutomationException
setPixelType
in interface IPixelBlock2
setPixelType
in interface IPixelBlock3
setPixelType
in interface IPixelBlock
plane
- The plane (in)val
- A com.esri.arcgis.geodatabase.rstPixelType constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getBytesPerPixel() throws IOException, AutomationException
getBytesPerPixel
in interface IPixelBlock2
getBytesPerPixel
in interface IPixelBlock3
getBytesPerPixel
in interface IPixelBlock
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getSafeArray(int plane) throws IOException, AutomationException
getSafeArray
in interface IPixelBlock
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSafeArray(int plane, Object val) throws IOException, AutomationException
setSafeArray
in interface IPixelBlock
plane
- The plane (in)val
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getVal(int plane, int x, int y) throws IOException, AutomationException
getVal
in interface IPixelBlock2
getVal
in interface IPixelBlock3
getVal
in interface IPixelBlock
plane
- The plane (in)x
- The x (in)y
- The y (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getSafeArrayByRef(int plane) throws IOException, AutomationException
getSafeArrayByRef
in interface IPixelBlock2
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getPixelData(int plane) throws IOException, AutomationException
getPixelData
in interface IPixelBlock3
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setPixelData(int plane, Object pVal) throws IOException, AutomationException
setPixelData
in interface IPixelBlock3
plane
- The plane (in)pVal
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getPixelDataByRef(int plane) throws IOException, AutomationException
getPixelDataByRef
in interface IPixelBlock3
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setNoDataMask(int plane, Object pVal) throws IOException, AutomationException
setNoDataMask
in interface IPixelBlock3
plane
- The plane (in)pVal
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getNoDataMask(int plane) throws IOException, AutomationException
getNoDataMask
in interface IPixelBlock3
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getNoDataMaskByRef(int plane) throws IOException, AutomationException
getNoDataMaskByRef
in interface IPixelBlock3
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getNoDataMaskVal(int plane, int x, int y) throws IOException, AutomationException
The GetNoDataMaskVal property allows you to identify whether a specific pixel is NoData or not. Value 1 means this corresponding pixel has a value and 0 means this corresponding pixel is NoData
getNoDataMaskVal
in interface IPixelBlock3
plane
- The plane (in)x
- The x (in)y
- The y (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean hasNoData(int plane) throws IOException, AutomationException
The HasNoData property indicates whether the PixelBlock has NoData or not. True means it has NoData.
hasNoData
in interface IPixelBlock3
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clear(int plane) throws IOException, AutomationException
clear
in interface IPixelBlock3
plane
- The plane (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void mask(Object noData) throws IOException, AutomationException
mask
in interface IPixelBlock3
noData
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void create(int planes, int nCols, int nRows, int pixelType) throws IOException, AutomationException
create
in interface IPixelBlock4
planes
- The planes (in)nCols
- The nCols (in)nRows
- The nRows (in)pixelType
- A com.esri.arcgis.geodatabase.rstPixelType constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void createFromPixelBlock(IPixelBlock pBlock, Object noData) throws IOException, AutomationException
createFromPixelBlock
in interface IPixelBlock4
pBlock
- A reference to a com.esri.arcgis.geodatabase.IPixelBlock (in)noData
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void clear() throws IOException, AutomationException
clear
in interface IPixelBlock4
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public byte[] exportToBytes() throws IOException, AutomationException
exportToBytes
in interface IPixelBlock4
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean hasNoData() throws IOException, AutomationException
hasNoData
in interface IPixelBlock4
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean hasData() throws IOException, AutomationException
hasData
in interface IPixelBlock4
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |