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

Home » Public Forums » archive » Re: Force 8bit display ?
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
Re: Force 8bit display ? [message #47262] Thu, 02 February 2006 01:49
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
L. Testut wrote:

> Hi everybody
> Do you know if it is possible to set the display depth at 8 bit
> instead of 24bits. I'll try :
> IDL> device, /pseudo_color ;but values are always set to default
> values
> By default when I start IDL visual_depth=24, and visual_name=TrueColor
> and Decomposed=1. I work on a laptop under LINUX debian.

Whether you can get an 8-bit display depends entirely on your X server and your
graphics card. Very few PC graphics cards have the ability to support different
bit-depth displays simultaneously, so you restricted to either an 8-bit display
or a 24-bit display; you can't have both at the same time. The XFree86/Xorg X
server doesn't currently provide any simulation of this either.

To see if your X server/graphics card supports different depth visuals you can
ask it. Run the command 'xdpyinfo' and it will tell you every visual that it
supports. If there is no PseudoColor 8 then you are out of luck. When you ask
IDL for a 8bit PseudoColor, if there is none available it will pick another
which most closely matches the one you asked for. How close that is is rather
"fuzzy".

If you really, really want an 8 bit display you could start up another X server
running at 8 bit, and then use that for IDL display. When I've done this on
RedHat I get two X displays, one accessed via the normal ctrl-alt-F7 and the
second by ctrl-alt-F8.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Re: Force 8bit display ? [message #47275 is a reply to message #47262] Wed, 01 February 2006 10:14 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Wed, 01 Feb 2006 10:47:44 -0700, David Fanning wrote:

> Karl Schultz writes:
>
>> Right. The 8-bit PseudoColor visual was almost a de facto standard on
>> early X servers because it was very efficient on the hardware available at
>> the time. Today's hardware handles the TrueColor 24-bit model well
>> and you don't see the 8-bit stuff as much anymore. Some SUN X servers
>> provide both 8 and 24 bit Visuals.
>
> I'm going to regret saying this, I know, but you
> *might* try asking for a 24-bit DirectColor visual.
> This normally won't work worth a damn, but I have heard
> of an undocumented keyword that is *suppose* to fix
> the problem. After setting to 24-bit direct color,
> try issuing this statement:
>
> DEVICE, /INSTALL_COLORMAP
>
> Now if you change color tables, you graphics window *might*
> change, too. Let us know. :-)
>

Right. If I do:

DEVICE, direct_color=24, /install_colormap
LOADCT, 5
TVSCL, dist(400)

I'll get the correct colors when I move my mouse over the IDL graphics
window. Of course, the rest the screen gets false colors, but it works,
at least on Fedora Core 2.

I can then do subsequent LOADCT commands to change the colors immediately
if I leave colormap focus on the graphics window and keyboard focus in the
xterm.

The reason why /INSTALL_COLORMAP is needed is because SOME of the window
managers in the newer desktops either purposely or accidentially do not
install private colormaps themselves when colormap focus changes. So, the
application (IDL) needs to watch for the focus change and (un)install the
colormap itself. This is considered evil from an ICCCM point of view, and
that's why it is a keyword. I've filed bugs with these components, and
the response was along the lines of "we look forward to your patch".

Karl
Re: Force 8bit display ? [message #47276 is a reply to message #47275] Wed, 01 February 2006 09:47 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Karl Schultz writes:

> Right. The 8-bit PseudoColor visual was almost a de facto standard on
> early X servers because it was very efficient on the hardware available at
> the time. Today's hardware handles the TrueColor 24-bit model well
> and you don't see the 8-bit stuff as much anymore. Some SUN X servers
> provide both 8 and 24 bit Visuals.

I'm going to regret saying this, I know, but you
*might* try asking for a 24-bit DirectColor visual.
This normally won't work worth a damn, but I have heard
of an undocumented keyword that is *suppose* to fix
the problem. After setting to 24-bit direct color,
try issuing this statement:

DEVICE, /INSTALL_COLORMAP

Now if you change color tables, you graphics window *might*
change, too. Let us know. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Force 8bit display ? [message #47277 is a reply to message #47276] Wed, 01 February 2006 09:39 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Wed, 01 Feb 2006 09:13:38 -0700, David Fanning wrote:

> L. Testut writes:
>
>> This doesn't set my display to a PseudoColor 8-bit ?
>> my display seems to be is locked to TrueColor 24-bit.
>> IDL> device, get_visual_name=name, get_visual_depeth=depth
>> always return me depth=24 and name=TrueColor even after invoking the
>> magic formula device, pseudo_color=8 ? (because of LINUX and not UNIX
>> ??)
>
> Humm. I was afraid of that. It probably has more to do
> with the kind of hardware you are using. People have
> moved on and no one making 24-bit machines today can imagine
> why *anyone* would want to cripple the darn things like
> this. :-)

Right. The 8-bit PseudoColor visual was almost a de facto standard on
early X servers because it was very efficient on the hardware available at
the time. Today's hardware handles the TrueColor 24-bit model well
and you don't see the 8-bit stuff as much anymore. Some SUN X servers
provide both 8 and 24 bit Visuals.

> I have a LINUX OS on my laptop now (a LONG story...), so maybe I'll have
> a chance to play with this later.

You'll probably find that you can pick between 16 and 24/32 bpp but not
8-bits. The newer Xorg servers look like that they have some sort of
PseudoColor emulation layer, but I'm not clear on how it works or if it
works on all drivers.

Anyway, as pointed out elsewhere, DECOMPOSED=0 causes IDL to use its color
table.

Karl
Re: Force 8bit display ? [message #47283 is a reply to message #47277] Wed, 01 February 2006 08:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
L. Testut writes:

> This doesn't set my display to a PseudoColor 8-bit ?
> my display seems to be is locked to TrueColor 24-bit.
> IDL> device, get_visual_name=name, get_visual_depeth=depth
> always return me depth=24 and name=TrueColor even after invoking the
> magic formula device, pseudo_color=8 ? (because of LINUX and not UNIX
> ??)

Humm. I was afraid of that. It probably has more to do
with the kind of hardware you are using. People have
moved on and no one making 24-bit machines today can imagine
why *anyone* would want to cripple the darn things like
this. :-)

I have a LINUX OS on my laptop now (a LONG story...),
so maybe I'll have a chance to play with this later.

> As the sixties-seventies period are very fashionnable at the moment, I
> propose that you build a special color table dedicated to this period

> mycolor = getcolor(/seventies) ; marvellous beatnik color table

A great idea! But how would this differ from HardCandy or
Nature, two colortables I *know* were created when the
authors were on acid?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Force 8bit display ? [message #47284 is a reply to message #47283] Wed, 01 February 2006 07:51 Go to previous message
L. Testut is currently offline  L. Testut
Messages: 16
Registered: January 2006
Junior Member
> I'd try DEVICE, PSEUDO_COLOR=8 if you are *really* convinced
> this retro look is what you want.

This doesn't set my display to a PseudoColor 8-bit ?
my display seems to be is locked to TrueColor 24-bit.
IDL> device, get_visual_name=name, get_visual_depeth=depth
always return me depth=24 and name=TrueColor even after invoking the
magic formula device, pseudo_color=8 ? (because of LINUX and not UNIX
??)

What I want to do is like the example you give in your book (i.e.
change the color whitout plotting again)

IDL> tvlct, 255,0,0,180
IDL> plot,findgen(10),color=180
IDL> tvlct, 255,255,0,180 -> automatically change the color of the plot
to yellow whithout replotting it ?

> I noticed the fans are now dressed in retro basketball outfits,
> with short shorts, etc. You never know about these young people.
> It's a good thing I haven't thrown out all those wide paisley ties!

As the sixties-seventies period are very fashionnable at the moment, I
propose that you build a special color table dedicated to this period

mycolor = getcolor(/seventies) ; return a marvellous beatnik color
table

Cheers,
Laurent
Re: Force 8bit display ? [message #47286 is a reply to message #47284] Wed, 01 February 2006 06:21 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
L. Testut writes:

> Do you know if it is possible to set the display depth at 8 bit
> instead of 24bits. I'll try :
> IDL> device, /pseudo_color ;but values are always set to default
> values

What you are asking for here is a 1-bit pseudo color visual.
I'm guessing you don't get it because even those guys from
the 1970's needed more colors than that. :-)

I'd try DEVICE, PSEUDO_COLOR=8 if you are *really* convinced
this retro look is what you want.

I guess this could be a trend. I've had several questions
this week about 1970s-era programming techniques. And last
night, when I went to a high-school basketball game with my son,
I noticed the fans are now dressed in retro basketball outfits,
with short shorts, etc. You never know about these young people.
It's a good thing I haven't thrown out all those wide paisley ties!

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Force 8bit display ? [message #47290 is a reply to message #47286] Wed, 01 February 2006 05:18 Go to previous message
peter.albert@gmx.de is currently offline  peter.albert@gmx.de
Messages: 108
Registered: July 2005
Senior Member
Hi Laurent,

it is sufficient to use

device, decomposed = 0

before loading and using a colour table.

It is even better to use David's fsc_color routine, because with it,
you don't have to bother at all about the device settings any more.
Citing David's webpage:

IDL> d = FSC_COLOR(/AllColors, ColorStructure=c)
IDL> Plot, Findgen(11), Color=c.green, Background=c.charcoal,
/NoData
IDL> OPlot, Findgen(11), Color=c.dodgerblue

Cheers,

Peter
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Perpendicular symbol
Next Topic: Re: display line numbers in idlde?

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

Current Time: Wed Oct 08 13:48:21 PDT 2025

Total time taken to generate the page: 0.00732 seconds