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

Home » Public Forums » archive » Mac 32 bit color depth?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Mac 32 bit color depth? [message #24241] Tue, 20 March 2001 10:55 Go to next message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
I have a simple program that tries to reset the default value of
!P.COLOR for the current (Mac, Win or X) device using the following
code:

device, get_visual_depth=depth
!P.Color = 256L^(depth/8) - 1

I am told that this fails on IDL V5.4 on a Mac since
device,/get_visual_depth returns a value of 32 (whereas !P.COLOR is
256L^24 -1). Can other Mac users verify this? What is the meaning
of a 32 bit visual depth?

Thanks, --Wayne

Wayne
Landsman
landsman@mpb.gsfc.nasa.gov
Re: Mac 32 bit color depth? [message #24289 is a reply to message #24241] Sat, 24 March 2001 10:57 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Randall Frank (rjfrank1@home.com) writes:

> Man am I in a strange mood today... :)

A natural consequence of light and heat deprivation,
I hear.

Cheers,

David

P.S. Let's just say if the folks at Lawrence Livermore
can't power it up, who can? :-(

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Mac 32 bit color depth? [message #24290 is a reply to message #24241] Sat, 24 March 2001 09:55 Go to previous message
Randall Frank is currently offline  Randall Frank
Messages: 17
Registered: October 1999
Junior Member
Here he goes again...

<soapbox>
Let me try to add some context to things here. It
seems people are a bit confused as to what is meant by 32
and 24 bit color, particularly for 2D (Direct) graphics.
With the exception of a few (older) Macintosh gfx cards,
32 bit color generally means that pixels are addressed as
32 bit quantities instead of 24 bit quantities. 32 bit mode
is generally faster (due to pixel alignment issues) and in
many cases, the extra 8 bits are actually inaccessible (and
on some cards they do not exist). There are some Mac cards
that map the color space to CMYK (as noted earlier) for more
accurate color registration. Don't confuse issues of destination
alpha with those of source alpha. Supporting blended draws
(as Object Graphics do) is more a function of source alpha
and in most cases matters not if the destination is 24 or 32
bits. Just because a card has a "32 bit" visual, does not
mean it has a "transparency" HW channel. The biggest bang
for the buck comes in supporting source alpha, blended
drawing modes which have nothing to do with the question
of 32 vs 24 bit visual support.
</soapbox>

<blithering>
The real question is what abstraction of these
issues would be useful in IDL? Source alpha is in Object
Graphics already. It does not require HW alpha plane support,
and thus tends to be fairly universally supported by both 3D
and 2D APIs. Destination alpha is supported in common 3D APIs
but not as many 2D APIs. I have heard one request for destination
alpha (wrt png) in the previous discussions, but would ask
seriously how one intends to use the destination alpha
channel. Given the complexities of pixel formats exposed
in DG already, I might question the value of exposing
another, especially given cross-platform issues.
</blithering>

<IMHO>
In short, source alpha might be useful in DG
(but can easily be done yourself in the existing API for
many applications). Destination alpha should be considered
carefully, particularly outside of 3D APIs.
</IMHO>

>> In article <thierry-2203011142210001@dualpants.dev.rsinc.com>,
>> thierry@NOSPAM.rsinc.com (Thierry Faucounau) wrote:

<insidejoke>
Thierry, "dualpants.dev."? My preference, of course, "nicepants.",
the original :).
</insidejoke>

>>
>> Thierry, that sounds very reasonable --- but it would be great to be
>> able to access the transparency channel: I would love to be able to
>> create movies (e.g. with XINTERANIMATE) in IDL that include transparency
>> effects.

<ruminate>
Interesting, yes. But potentially a loaded issue, given the way
XINTERANIMATE works (e.g. its use of pixmaps). I might inquire what
kind of transparency effects? Cross fades and the like, accumulation
like effects or stenciling? You may be actually asking for quite
a bit more from XINTERANIMATE (e.g. multiple source channels).
</ruminate>

>
> And wouldn't it make the creation of .png files a little easier?
> Don't they support a native RGBA?

<tersecrypticreply>
IMHO, ATC, no.
</tersecryticreply>

Man am I in a strange mood today... :)

rjf.
Re: Mac 32 bit color depth? [message #24291 is a reply to message #24241] Fri, 23 March 2001 17:55 Go to previous message
William Daffer is currently offline  William Daffer
Messages: 34
Registered: February 1999
Member
"Joseph B. Gurman" <gurman@ari.net> writes:

> In article <thierry-2203011142210001@dualpants.dev.rsinc.com>,
> thierry@NOSPAM.rsinc.com (Thierry Faucounau) wrote:
>
> [snip]
>>
>> I am not averse to returning the "usable" (from an IDL standpoint) visual
>> depth from get_visual_depth which would be 24 (essentially ignoring the
>> fact that on the Mac, all "true color" buffers are in fact 32bits) for
>> the sake of portability.
>>
>> --
>> Thierry Faucounau
>> Research Systems, Inc.
>
> [snip]
>
> Thierry, that sounds very reasonable --- but it would be great to be
> able to access the transparency channel: I would love to be able to
> create movies (e.g. with XINTERANIMATE) in IDL that include transparency
> effects.
>
> Any chance?
>
> Thanks,
>
> Joe Gurman

And wouldn't it make the creation of .png files a little easier?
Don't they support a native RGBA?

whd
--
Outside of a dog, a book is man's best friend
Inside of a dog it's too dark to read
-- Groucho Marx
Re: Mac 32 bit color depth? [message #24303 is a reply to message #24241] Tue, 20 March 2001 11:52 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Hi,

Yes, I can confirm this behavior on a Mac G4 running system 9.04:

!P.Color = 256L^(depth /8) - 1
!p.color = -1
!P.Color = 256L^((depth < 24) /8) - 1
!p.color = 16777215
** Structure !VERSION, 7 tags, length=44:
ARCH STRING 'PowerMac'
OS STRING 'MacOS'
OS_FAMILY STRING 'MacOS'
RELEASE STRING '5.4'
BUILD_DATE STRING 'Nov 1 2000'
MEMORY_BITS INT 32
FILE_OFFSET_BITS
INT = 32

I don't understand the meaning of 32bit displays. It is possible to have
32 bit depths on Windows platforms also. I don't have a Windows machine
handy with IDL5.4, but it would be nice to see the results of the above
on those machines.

It maybe unrelated to what your asking, but note that David posted the
following recently (see Pavel's post on 'Open file in 5.4'):

> What I have noticed is that on a 32-bit display, it
> seems almost impossible to flip back and forth between
> Device, Decomposed=0 and Device, Decomposed=1. What is
> the best way to be able to display either a 24-bit or
> an 8-bit image? It seems to me the color table vectors
> have to be re-loaded every time you set Decomposed=0.
> Is this what you recommend?


Ben

Wayne Landsman wrote:
>
> I have a simple program that tries to reset the default value of
> !P.COLOR for the current (Mac, Win or X) device using the following
> code:
>
> device, get_visual_depth=depth
> !P.Color = 256L^(depth/8) - 1
>
> I am told that this fails on IDL V5.4 on a Mac since
> device,/get_visual_depth returns a value of 32 (whereas !P.COLOR is
> 256L^24 -1). Can other Mac users verify this? What is the meaning
> of a 32 bit visual depth?
>
> Thanks, --Wayne
>
> Wayne
> Landsman
> landsman@mpb.gsfc.nasa.gov

--
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575
btupper@bigelow.org
Re: Mac 32 bit color depth? [message #24309 is a reply to message #24241] Thu, 22 March 2001 16:05 Go to previous message
Joseph B. Gurman is currently offline  Joseph B. Gurman
Messages: 31
Registered: April 2000
Member
In article <thierry-2203011142210001@dualpants.dev.rsinc.com>,
thierry@NOSPAM.rsinc.com (Thierry Faucounau) wrote:

[snip]
>
> I am not averse to returning the "usable" (from an IDL standpoint) visual
> depth from get_visual_depth which would be 24 (essentially ignoring the
> fact that on the Mac, all "true color" buffers are in fact 32bits) for
> the sake of portability.
>
> --
> Thierry Faucounau
> Research Systems, Inc.

[snip]

Thierry, that sounds very reasonable --- but it would be great to be
able to access the transparency channel: I would love to be able to
create movies (e.g. with XINTERANIMATE) in IDL that include transparency
effects.

Any chance?

Thanks,

Joe Gurman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: correlating two arrays
Next Topic: Re: line graph problems

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

Current Time: Wed Oct 08 11:36:55 PDT 2025

Total time taken to generate the page: 0.00556 seconds