|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.sde.sdk.client.SeRasterData
public class SeRasterData
For constructing image data and can be use to pass around between the client application and the ArcSDE Java API. Callback function from SeInsert and SeUpdate accept image data through the use of this object.
SeRasterAttr
,
SeRasterConsumer
,
SeRasterRenderedImage
Constructor Summary | |
---|---|
SeRasterData(int bandWidth,
int bitsPerPixel,
boolean maskMode)
Constructs SeRasterData object. |
Method Summary | |
---|---|
void |
clear()
Removes all image scan line data and bit mask from this object. |
static void |
decodePixelsConvertToObject(int srcPixelType,
byte[] src,
int srcPos,
double srcStatsMin,
double srcStatsMax,
java.lang.Object dstObj,
int dstPos,
double dstMax,
int dstLen)
Decode source byte[] array as srcPixelType
and try to convert it value to the destination Object type. |
byte[] |
getBitMaskData()
Gets scan line's bit mask data, if exist. |
int |
getNumLines()
Gets number of scan lines. |
byte[] |
getScanLineData()
Gets scan lines pixel data. |
boolean |
hasBitMask()
Return true if bit mask exist. |
int |
setScanLine(int num_lines,
byte[] i_line,
int i_lineLen,
byte[] i_mask,
int i_maskLen)
Sets one or more image scan line of pixel data for any supported pixel depth and each scan line end on a byte boundary, and any existing data in current object will be overwrite. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SeRasterData(int bandWidth, int bitsPerPixel, boolean maskMode)
SeRasterData
object.
Top of
class.
SeRasterData
Method Detail |
---|
public void clear()
setScanLine(int, byte[], int, byte[], int)
public byte[] getBitMaskData()
null
byte[]
valuehasBitMask()
,
getScanLineData()
,
setScanLine(int, byte[], int, byte[], int)
public int getNumLines()
int
value of number of scan lines.getScanLineData()
,
setScanLine(int, byte[], int, byte[], int)
public byte[] getScanLineData()
byte[]
valuegetNumLines()
,
getBitMaskData()
,
hasBitMask()
,
setScanLine(int, byte[], int, byte[], int)
public boolean hasBitMask()
true
if bit mask exist.
boolean
valuegetBitMaskData()
,
setScanLine(int, byte[], int, byte[], int)
public int setScanLine(int num_lines, byte[] i_line, int i_lineLen, byte[] i_mask, int i_maskLen)
For instance, if the space needed for a scan line doesn't end on a byte boundary, then the remaining bit(s) on the last byte is/are not use, and the next scan line is starting on the next byte boundary.
If mask_mode is set, then also sets bit_mask which is always ONE bit per pixel and fully packed byte array.
For example:
// Assumes int mBitsPerPixel = 1; int mBandWidth = 3; int num_lines = 3; // Expected i_line and i_lineLen parameters would have the // following format and layout mBytesPerLine = (mBandWidth * mBitsPerPixel + 7) / 8; i_lineLen = 3; // mBytesPerLine * num_lines i_line = [aaa?????][bbb?????][ccc?????]; // where [ ] -- Indicate a byte. Each char within represent one bit value // abc -- Indicate pixel value. In this case a 1 or a 0. // a-values for line 1, b-values for line 2 and etc ... // ? -- Indicate non-pixel value which will be discarded. // If mask_mode is set, // then the expected i_mask and i_maskLen parameters would have the // following format and layout i_maskLen = 2; // (mBandWidth * num_lines + 7) / 8 i_mask = [AAABBBCC][C???????]
num_lines
- an int
valuei_line
- a byte[]
value, input scan_line.i_lineLen
- input scan_line's length. Starting from i_line[0],
and i_lineLen can be <= i_line.lengthi_mask
- Optionally input bit_mask data.i_maskLen
- an int
value
int
value of SeError codegetScanLineData()
,
getNumLines()
,
getBitMaskData()
,
hasBitMask()
,
clear()
public static void decodePixelsConvertToObject(int srcPixelType, byte[] src, int srcPos, double srcStatsMin, double srcStatsMax, java.lang.Object dstObj, int dstPos, double dstMax, int dstLen) throws java.lang.Exception
byte[]
array as srcPixelType
and try to convert it value to the destination Object type.
Covert input value as is (if srcStatsMin == srcStatsMax
) or
stretch/shrink input value (if srcStatsMin != srcStatsMax
)
base on srcStatsMin, srcStatsMax
and dstMax
with the following formula.
double f = dstMax / (srcStatsMax - srcStatsMin); for (int i=0; i < dstLen; i++) { dstObj_val[i] = (src_value[i] - srcStatsMin) * f; }if
(srcStatsMin == srcStatsMax)
Convert input value as is and try to cast it to the output Object's type. Thrown an ClassCastException if the input value may not be able to cast it into the output Object type.
if (srcStatsMin != srcStatsMax)
Stretch or shrink input value with
(srcStatsMax - srcStatsMin)
as the input range to the
output range of (0.0 to dstMax)
.
if (dstMax == 0.0)
set dstMax = dstObj.MAX_VALUE;
if (dstMax != 0.0)
then (dstMax <= dstObj.MAX_VALUE)
must be TRUE
srcPixelType
- source's pixel_type.src
- the input source byte[]
array, with
the packed pixel values.srcPos
- start position on the source array (value in byte).srcStatsMin
- source array's statistic min value.srcStatsMax
- source array's statistic max value.dstObj
- pre-allocated destination Object array. The
Object's type determine how we map the ouput value.
Supported Object type are byte[], int[], float[]
and double[].dstPos
- start position on the destination Object array.dstMax
- destination Object's maximum value. Is ignore
if (srcStatsMin == srcStatsMax)
dstLen
- number of elements to put out as dstObj type.
java.lang.Exception
- if an error occurs.SeRasterTile.getPixels(byte[])
,
SeRasterTile.getPixels(double, double, byte[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |