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

Home » Public Forums » archive » Re: DirectColor on linux
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: DirectColor on linux [message #17977] Tue, 23 November 1999 00:00
Vincent Favre-Nicolin is currently offline  Vincent Favre-Nicolin
Messages: 8
Registered: November 1999
Junior Member
David Fanning wrote:
>
> Vincent FAVRE-NICOLIN (favre@polycnrs-gre.fr) writes:
>
>> CONCLUSION : IMHO, it looks like DirectColor is *not possible* under
>> Linux with Xfree86 in 24,and 32 bpp (IDL does not work in 16bpp). Color
>> Table manipulation is thus only possible in 8bpp visual mode (a real
>> shame considering today's video cards...). There seems to be 3 ways out
>> of this problem :
>> 1) easiest, cheapest : use 8bpp mode
>
> UUghhh. What will your wife say about all that money you
> spent for equipment you said you absolutely NEEDED?

Yep, so we'll end up saying we desperatly NEED ;-) to buy solution
(3)

>> 2) harder : change the IDL program for a specific support of TrueColor
>> mode (ie you have to change the way you write colors when you *create*
>> the graphics, I haven't much experimented in that...)
>
> Perhaps a *bit* harder, but almost trivial these days, what
> with all the free stuff hanging around people's web
> pages. All you really have to do is figure out a way
> to re-display your graphics once you muck with the
> color table. There are any number of ways to do this,
> none of which would take more than 15 minutes to
> implement, I shouldn't think. In this case, it is
> probably nothing more than re-executing a TV command
> once the colors have been changed. Not too hard.

Right. My choice, too. Just a change of colors before TV/plot/whatever,
for most cases. It's clearly not *hard*, but just annoying since IDL
should work for all
platforms with very limited changes,and -IMHO-, without any change
between
one *nix to another. I will indeed be using this solution,and duplicate
every display/graphic procedure for TrueColor... That should't take more
than
2 hours for 3-4 procedures... But I have a feeling it will be a bit more
funny
when using XOR to display text (reversibly) over images. I'm in for some
groovy colors =-)

>> 3) expensive : buy a commercial X-Windows driver that supports
>> DirectColor in 24 or 32 bpp.
>
> Uh, uh. No. The boss ain't goin' for THAT solution! :-(

Probably not, but considering the price of IDL, it may not be
*so* expensive !! It mainly depends whether the IDL user is a programmer
or not...


############################################################ ##########
Vincent FAVRE-NICOLIN # Tel Labo :(33) 4 76 88 74 04
Laboratoire de Cristallographie-BP 166 # Tel Perso:(33) 4 76 03 19 66
38042 GRENOBLE Cedex 09 FRANCE #
Re: DirectColor on linux [message #17979 is a reply to message #17977] Tue, 23 November 1999 00:00 Go to previous message
doosh is currently offline  doosh
Messages: 3
Registered: November 1999
Junior Member
In article <MPG.12a45980c2253867989993@news.frii.com>,
David Fanning <davidf@dfanning.com> wrote:
)Vincent FAVRE-NICOLIN (favre@polycnrs-gre.fr) writes:
)
)> 3) expensive : buy a commercial X-Windows driver that supports
)> DirectColor in 24 or 32 bpp.
)
)Uh, uh. No. The boss ain't goin' for THAT solution! :-(

Actually my boss would be quite happy with it (And I responded to Vincent
already in e-mail; I can't imagine why people send e-mail when they've
also posted a response to Usenet). The problem is, it doesn't seem
to help. Accelerated X claims to support DirectColor, but the behavior
I saw running in demo mode was the same as under XFree86.
-Tom
Re: DirectColor on linux [message #17983 is a reply to message #17977] Tue, 23 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Vincent FAVRE-NICOLIN (favre@polycnrs-gre.fr) writes:

> CONCLUSION : IMHO, it looks like DirectColor is *not possible* under
> Linux with Xfree86 in 24,and 32 bpp (IDL does not work in 16bpp). Color
> Table manipulation is thus only possible in 8bpp visual mode (a real
> shame considering today's video cards...). There seems to be 3 ways out
> of this problem :
> 1) easiest, cheapest : use 8bpp mode

UUghhh. What will your wife say about all that money you
spent for equipment you said you absolutely NEEDED?

> 2) harder : change the IDL program for a specific support of TrueColor
> mode (ie you have to change the way you write colors when you *create*
> the graphics, I haven't much experimented in that...)

Perhaps a *bit* harder, but almost trivial these days, what
with all the free stuff hanging around people's web
pages. All you really have to do is figure out a way
to re-display your graphics once you muck with the
color table. There are any number of ways to do this,
none of which would take more than 15 minutes to
implement, I shouldn't think. In this case, it is
probably nothing more than re-executing a TV command
once the colors have been changed. Not too hard.

> 3) expensive : buy a commercial X-Windows driver that supports
> DirectColor in 24 or 32 bpp.

Uh, uh. No. The boss ain't goin' for THAT solution! :-(

Cheers,

David

--
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: DirectColor on linux [message #17985 is a reply to message #17977] Tue, 23 November 1999 00:00 Go to previous message
Vincent Favre-Nicolin is currently offline  Vincent Favre-Nicolin
Messages: 8
Registered: November 1999
Junior Member
Hi,

I'm just having the same problem as you : using an IDL program with a
solid use of graphics under Linux. I've been using IDL a lot under
HP/UX, and now I would like to use the programs I've written under
Linux. Note that I am not a Linux nor an X-Windows specialist.
Nevertheless, here are the fact I've been collecting :

You say that you are using direct color with xfree86 : that makes me
wondering, since XFRee86 only supports TrueColor mode in 16 and 32 bpp
(see the excerpt from the XF86Config man page at the end of this email).
DirectColor is *not* supported in these modes. Which practically means
that you cannot modify the color table, since TrueColor mode has
read-only color tables (ie loadct, tvlct and any procedure trying to
change are useless).(see IDL Documentation "The X Windows Device")

It would be interesting to know which visual modes are supported by
your computer : use "xdpyinfo" in a shell, the visual modes will be
listed. If it is the same as on my Linux computer under 32 (and 24)
bpp, it will give :

number of visuals: 1
default visual id: 0x22
visual:
visual id: 0x22
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits

As far as you don't have DirectColor or PseudoColor modes available,
you cannot modify the color table. The only way to have control over the
color table using XFree is then to switch back to using 8 bpp mode, for
which the PseudoColor visual mode is implemented.
My programs work exactly the same under HP/UX and Linux using this 8
bpp mode. Of course, if you want to use a full private color table,
color tables will switch when the mouse goes over IDL graphics windows,
which is annoying...


CONCLUSION : IMHO, it looks like DirectColor is *not possible* under
Linux with Xfree86 in 24,and 32 bpp (IDL does not work in 16bpp). Color
Table manipulation is thus only possible in 8bpp visual mode (a real
shame considering today's video cards...). There seems to be 3 ways out
of this problem :
1) easiest, cheapest : use 8bpp mode
2) harder : change the IDL program for a specific support of TrueColor
mode (ie you have to change the way you write colors when you *create*
the graphics, I haven't much experimented in that...)
3) expensive : buy a commercial X-Windows driver that supports
DirectColor in 24 or 32 bpp.

The problem comes from the absence of DirectColor visual mode support
in XFree86. Maybe this will be added in XFree v4 ?


Hope that helps... If you have any more information, please inform me !
I have the same problem and am annoyed at the idea of changing my
programs using "device,get_visual_name=t" and "if t eq 'TrueColor'
then...". Particularly, if you find a commercial, not over-expensive
X-Windows driver, that would be interesting...


Vincent FAVRE-NICOLIN


Tom Holub wrote:
> One of the professors I support has a procedure he's using on Solaris
> with IDL that he wants to move over to a linux machine. However,
> there appears to be some fundamental differences in the way Solaris
> handles colors, and the procedure isn't working.
>
> Basically, what the procedure does is use direct color to change the
> color table, thereby changing the colors of the images in window 0.
> This is useful in astronomy because it allows you to highlight different
> parts of the spectrum. So if you diddle the red from 255 down to 0,
> all the red will be drained out of the image. I've seen this work
> on a Solaris machine. I am trying to do it on a Linux machine with
> a Diamond Viper 770 (32MB) video card.
>
> The problem is, it doesn't work. I can set device,direct=24 under
> XFree86 or Accelerated X, and IDL reports that it's using direct color,
> but running the diddle procedure (attached below) doesn't change the
> colors in window 0.
>
> I don't really understand the issues involved; is it something IDL needs
> to support, or the X server, or the video card? Is it possible to do
> this with IDL on Linux at all?
> -Tom

********************Detail of "man
XF86Config"******************************

 Visual "visual-name"
This optional entry sets the default root visual
type. This may also
be specified fromthe command line (see Xserver(1)). The visual
types
available for 8bpp X servers are
(default is PseudoColor):

StaticGray
GrayScale
StaticColor
PseudoColor
TrueColor
DirectColor

The visual type available for the 16bpp and 32bpp X
servers is TrueColor.

The visual type available for the 1bpp X server is
StaticGray.

The visual types available for the 4bpp X server are
(default is
StaticColor):

StaticGray
GrayScale
StaticColor
PseudoColor
******************** "man XF86Config" ******************************
Re: DirectColor on linux [message #17992 is a reply to message #17977] Mon, 22 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Tom Holub (doosh@best.com) writes:

> I don't really understand the issues involved; is it something IDL needs
> to support, or the X server, or the video card? Is it possible to do
> this with IDL on Linux at all?

I'll be honest with you, I don't think *anyone* understands
the issues involved in Direct Color. Or--at least--if
someone does, I haven't had the pleasure of meeting him
or her. :-(

Cheers,

David

--
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: X window display sizes
Next Topic: Re: Number of colors of widget appliation

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

Current Time: Wed Oct 08 17:25:06 PDT 2025

Total time taken to generate the page: 0.00689 seconds