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

Home » Public Forums » archive » Postscript dump to a Laserwriter
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
Postscript dump to a Laserwriter [message #637] Thu, 17 December 1992 13:03 Go to next message
scowen is currently offline  scowen
Messages: 11
Registered: December 1992
Junior Member
Hi,

OK this seems the simplest thing in the universe right? Wrong.

Let me explain what I've been going through the last few days, and maybe
someone out there with a little more experience than I can help me.

Given that I currently have an image displayed into a window with a given
color table loaded (other than b/w linear) and that I have modified the
stretch to reveal more detail, this is what I'd like to do. I would like to
dump the window contents to a Postscript environment (set_plot, 'ps') with
the stretch being preserved.

1st pet peeve - tvrd() will only dump the screen displayed image - ie. if
you've created a display widget with scrollbars, because the image is too
big for your display and you need full resolution so rebin() is not an option
then tough! You get an array returned that is the size of your displayed
array, but only the visible part will be filled in. I mean what is the point
of including such useful things as scrollbars if you can't bloody access the
image data off screen - why doesn't tvrd() dump the window buffer instead of
doing a screendump?

Anyway, to continue. If I use a 'device, /color' inside the PS setup, then
we're off to the races, I can reload the tvrd() buffer and use tvlct with
the colors common block to reload the current stretch. However, the resulting
PS file will not print on anything but a color PS printer since it puts the
colormap in as a /COLORTAB call. OK, so I turn color off using
'device, color=0'. This has the remarkable effect of producing PS that will
print on a Laserwriter, BUT (and this is a big one) the colormap used is the
default setting of the b/w linear, with all stretch information lost. In
addition it doesn't even do a b/w conversion of the existing colortable (eg.
Rainbow) but instead reloads the b/w linear.

Now, after all these rantings there is a way to make this work, but it causes
something else to stop working. The above methodology allows you to annotate
the display, like add contours to an image, or somesuch. Then you ca just
dump the window contents using tvrd() and you can print the output. This
however breaks the color common block, with the r_curr, etc. being reset so
that a tvlct reloads the original colormap and not the strectched one.

The briefly mentioned solution to the Laserwriter PS problem is to actually
use tvscl and not use tvrd at all. This way, when you tvscl inside PS the
same colormap is used, and you can switch to bits_per_pixel=4 and get a
decent b/w rendition of your color stretch. BUT, again, if you have used
contour in a noerase mode, then the colormap is erased and a tvscl renders
the default map again.

So, after this lengthy explanation I have several request/questions:

1. Given a color strectched image with contours overlaid, how can I produce
*either* color or laserwriter PS from a tvrd() call (ignoring the screen-
dump bugaboo)?

2. Alternatively, using the tvscl method, is there anyway to stop the
colormap in colors (common) from being erased by the contour call, so we
could reload the strectched version of the colortable before tvscl is
called. And then (long winded I know) redo the contours inside the PS
setup?

3. Does RSI plan to fix this rather annoying feature in tvrd() since it
doesn't appear to be a terribly uncommon feature for such a function, to
grab the data that is off screen instead of dumping the actual screen
buffer itself?

Thanks for your (considerable) time in reading this. I hope someone
out there can help.

--
------------------------------------------------------------ -------------------
Paul A. Scowen INTERNET: scowen@wfpc3.la.asu.edu
Department of Physics & Astronomy uk1@spacsun.rice.edu
Arizona State University Tel: (602) 965-0938
Tempe, AZ 85287-1504 FAX: (602) 965-7954
------------------------------------------------------------ -------------------
Re: PostScript Dump [message #3109 is a reply to message #637] Wed, 16 November 1994 04:37 Go to previous message
Geoff.Sobering is currently offline  Geoff.Sobering
Messages: 14
Registered: June 1994
Junior Member
In article <3a8rheINNo45@lanews.la.asu.edu>
rouse@sevens.NOHOST.NODOMAIN (Roger Rouse) writes:

> |>Ken Ganga (ganga@physics23) wrote:
> |>: ...I would like
> |>: to be able to get an initial graph, muck around with it a bit, then
> |>: dump whatever is in the plot at the moment to a postscript file.

> You could do it by using JOURNAL. ... [then] do the SET_PLOT and
> DEVICE combination, execute the journal file ...

For interactive-mode stuff (which seesm to be what you're interested
in), I just use the command recall facility. I have a pair of short
procedures that set and reset the grapics device to PostScript, so it's
just a matter of doing:

1) Create graphic on-screen
2) run 'pso' (for PostScript Open)
3) Recall the command(s) that create the graphic
4) run 'psc' - which even sends the PostScript file off
to the printer.

I posted 'pso' and 'psc' awhile ago, thery're also available via ftp
from 'helix.nih.gov' in '/nmrctr/misc_idl'

Geoff Sobering Geoff.Sobering@nih.gov
In Vivo NMR Research Center (301) 402-3209 (voice)
National Institutes of Health (301) 402-0119 (FAX)
Bldg. 10, Rm. B1D-125
10 Center Drive MSC 1060
Bethesda, MD 20892-1060
Re: PostScript Dump [message #3114 is a reply to message #637] Mon, 14 November 1994 15:23 Go to previous message
rouse is currently offline  rouse
Messages: 17
Registered: July 1994
Junior Member
|>
|>Ken Ganga (ganga@physics23) wrote:
|>: Hello,
|>
|>: I got such swift and helpful advice last time I posted here that I
|>: thought I'd try again.
|>
|>: I am working on a program in which I have a single plot that changes a
|>: lot. If I like the plot at a certain point, I would like to be able to
|>: make a postscript file of the plot as it stands. That is, I would like
|>: to be able to get an initial graph, muck around with it a bit, then
|>: dump whatever is in the plot at the moment to a postscript file. Just
|>: a dump to a postscript file. Using SET_PLOT, 'PS' won't work because I
|>: would like to see what I am doing to the plot. I seem to be able to
|>: dump the graph in sun rasterfile format with WRITE_SRF (and I can even
|>: convert it with XV or whatever), but I would like to be able to make a
|>: postscript file completely within IDL.
|>
|>: Thanks for any help,
|>
|>: Ken
|>

You could do it by using JOURNAL. Turn JOURNAL on make your plot, turn
JOURNAL off, edit the journal file leaving only the plot commands you want,
do the SET_PLOT and DEVICE combination, execute the journal file using the
@ syntax, do DEVICE,/CLOSE.

Save the journal file as a permenant record of your plot commands.
E.g.:

journal, 'plotcmds'
plot,.....
Re: PostScript Dump [message #3132 is a reply to message #637] Sat, 12 November 1994 06:13 Go to previous message
soc is currently offline  soc
Messages: 12
Registered: October 1994
Junior Member
Ken Ganga (ganga@physics23) wrote:
: Hello,

: I got such swift and helpful advice last time I posted here that I
: thought I'd try again.

: I am working on a program in which I have a single plot that changes a
: lot. If I like the plot at a certain point, I would like to be able to
: make a postscript file of the plot as it stands. That is, I would like
: to be able to get an initial graph, muck around with it a bit, then
: dump whatever is in the plot at the moment to a postscript file. Just
: a dump to a postscript file. Using SET_PLOT, 'PS' won't work because I
: would like to see what I am doing to the plot. I seem to be able to
: dump the graph in sun rasterfile format with WRITE_SRF (and I can even
: convert it with XV or whatever), but I would like to be able to make a
: postscript file completely within IDL.

: Thanks for any help,

: Ken

Hi, this can easily be done (as a bit map at least!) by loading the
content sof the current graphics window into a variable with the command
a=tvrd()
then open a ps file in the normal way and do a tv,a to print the bit map
into the PS file, then close and print the file in the usual way.

hope this helps,
Rob


: --
: Ken Ganga | (510)642-3618
: 433 LeConte Hall | (510)643-5204 (Fax)
: Berkeley, CA 94720 | ganga@physics.berkeley.edu
: --
: Ken Ganga | (510)642-3618
: 433 LeConte Hall | (510)643-5204 (Fax)
: Berkeley, CA 94720 | ganga@physics.berkeley.edu
Re: PostScript Dump [message #3140 is a reply to message #637] Fri, 11 November 1994 07:09 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
ganga@physics23 (Ken Ganga) writes:


> Hello,

> I got such swift and helpful advice last time I posted here that I
> thought I'd try again.

> I am working on a program in which I have a single plot that changes a
> lot. If I like the plot at a certain point, I would like to be able to
> make a postscript file of the plot as it stands. That is, I would like
> to be able to get an initial graph, muck around with it a bit, then
> dump whatever is in the plot at the moment to a postscript file. Just
> a dump to a postscript file. Using SET_PLOT, 'PS' won't work because I
> would like to see what I am doing to the plot. I seem to be able to
> dump the graph in sun rasterfile format with WRITE_SRF (and I can even
> convert it with XV or whatever), but I would like to be able to make a
> postscript file completely within IDL.

Simplicity itself. Simply read in the window using TVRD, and then use TV or
TVSCL to write it out to the PostScript file.

Bill Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Plotting with both xstyle=1 and 4
Next Topic: Re: Debugging w/widgets

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

Current Time: Wed Oct 08 13:49:41 PDT 2025

Total time taken to generate the page: 0.00703 seconds