Hi Jason,

The byte data is actually treated as unsigned values
in the image. The sample code you quoted was
inverting values, not making them negative. To
invert short data, you'd have to do something
like this instead, to reflect the greater size of
the short:

  chlut[j]=(short)(65536 - j);

And, of course, you'd want to use a ShortLookupTable
instead of a ByteLookupTable.

The following article contains three lookup table
examples: inverting, single-channel inverting, and
posterizing.

  http://www.javaworld.com/javaworld/jw-09-1998/jw-09-media.html

It uses ShortLookupTables to process byte data, but this
is OK because shorts are bigger than bytes.

I hope this helps.

Jonathan

Java 2D Graphics: http://www.oreilly.com/catalog/java2d/
Java Cryptography: http://www.oreilly.com/catalog/javacrypt/
Bite-Size Java: http://java.oreilly.com/news/knudsen/
O'Reilly's Java Center: http://java.oreilly.com/

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/

Reply via email to