comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 16 bit / 8 bit depth colors on the mac
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 16 bit / 8 bit depth colors on the mac [message #7396 is a reply to message #7309] Tue, 05 November 1996 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Rick Shafer <rick.shafer@gsfc.nasa.gov>writes:

> Someone *please* tell me how to get genuine 16 bit colors on my mac with
> IDL. The default basicly packs the three RGB values into 15 bits,
> cutting off the lowest 3 significant bits, which is NOT what I want.
>
> I used to know the magic incantation to do this, but have forgotten.

I think your question is not how to get thousands of colors on
your Macintosh, because the answer is to set your monitor to
thousands of colors and use 3D images. For example:

TV, image3d, TRUE=1

I am sure you know this. Rather, I suspect your question has to do
with your data. You probably have 16-bit unsigned data and you want
to know how to display that image data properly in IDL, which does
not have an unsigned integer data type. That is a different question.

Here is what you can do. Read the image data into 16-bit integers (the default
or short IDL integer size). To convert the signed integer array to an
unsigned integer array, you will have to convert the array to long integers,
like this:

image = INTARR(256, 256)
READU, lun, image
image = LONG(image) AND 'FFFF'x

(I learned this in a news post compliments of Bill Thompson at NASA
Goddard and Peter Mason at CSIRO in Australia.)

Now, I know on *my* Mac I would want to display this kind of
data in 256-color mode, so that color tables, etc. still work.
I set my monitor to 256-color mode and display the image
like this:

TV, BYTSCL(image, TOP=!D.N_COLORS-1)

> (I won't even talk about how IDL crashes if I should change the
> screen depth while running...

Uh, IDL!? I don't think so. Try MacOS. (This from a devoted Mac user.)

David

--
David Fanning, Ph.D.
Phone: 970-221-0438
Fax: 970-221-4728
E-Mail: davidf@fortnet.org
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: ENVI
Next Topic: idl.el version 1.31

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Tue Oct 14 07:49:55 PDT 2025

Total time taken to generate the page: 3.52890 seconds