> What is actually used to represent an "unsigned short" in the DataBuffer?
>
> What is the upper limit gray scale value?

The data values are stored in an array of shorts and are "interpretted"
as unsigned.  This is the same way that we deal with byte array data
for ByteIndexed images.  When you extract the byte you want an index
from 0 to ff, not from -80 to 7f.

The way you force data to be utilized as unsigned is to bit-and it with
the appropriate mask to remove the unwanted sign bits that were added
when the data was extended to an int:

        int data1 = bytearray[i] & 0xff;
        int data2 = shortarray[i] & 0xffff;

The values that end up in data1 and data2 are in the range of 0 ... (2^n)-1
and are essentially the "unsigned interpretation" of the original bits...

                                ...jim

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to