Initialise the device.
Fortran:
subroutine vinit(device)
character *(*) device
C:
vinit(device);
char *device;
Pascal:
procedure Vinit(device: string_t)
Note 1 :- Currently available devices are:
PC native MSW PC driver; only tested from CygWin
X11 X11 windows (Black background)
x11 X11 windows (White background)
tek - tektronix 4010 and compatibles
[p]psm or [p]postscript - monochrome PostScript
[p]psg - grayscale PostScript
[p]psc - color PostScript
hpgl - HP Graphics language and compatibles
[p]pclland - monochrome PCL5 (obeys prefsize calls)
[p]pclport - monochrome PCL5 (obeys prefsize calls)
[p]hpgl2 - HPGL level 2 (obeys prefsize calls)
Pixmaps (color) and Bitmaps (monochrome)
-------------------
char - An ASCII file that can be displayed to most
xterm(1) terminal emulators that support
color
p1/pbm - Poskanzer (pbmplus/netplus) portable
ASCII bitmap file
p3/ppm - Poskanzer portable ASCII pixmap file
p4 - Poskanzer portable binary bitmap file
p6 - Poskanzer portable binary pixmap file
xbm - X11 bitmap file
bm - bitmap format for atobm(1)
Metafiles
---------
canvas - HTML5 CANVAS graphics element file
cgmt - a clear-text CGM (Computer Graphics Metatfile)
unixplot - Unix plot(1) metafile
gnu - GNU plot(1) metafile
mif - FrameMaker Interchange Format 3.0 (MIF) files
(16 colors)
mif4 - FrameMaker Interchange Format 4.0 (MIF) files
(user-definable colors, but breaks a MIF rule)
pdf - Adobe Public Document Format
svg - Scalable Vector Graphics
usemap - HTML image map
vml - MicroSoft Vector Markup Language
vog - Vogle low level call (debug)
Other
-----
fti - SGI vector-based icons
null - no output
:- Drivers I've dropped but code is there for
decX11 - the decstation window manager
dxy - roland DXY plotter language
sun - Sun workstations running sunview
next - NeXTStep and other NeXT platforms
apollo - Apollo workstations
:- Drivers I've dropped but are in the original distribution
hercules - IBM PC hercules graphics card
cga - IBM PC cga graphics card
ega - IBM PC ega graphics card
vga - IBM PC vga graphics card
sigma - IBM PC sigma graphics card.
mswin - IBM PC Microsoft Windows.
Note 2 :- If device is a NULL or a null string the value
of the environment variable "VDEVICE" is taken as the
device type to be opened.
Note 3 :- after vinit() it is wise to explicitly clear the screen.
e.g.: in C
color(BLACK);
clear();
or in Fortran
call color(BLACK)
call clear
or in Pascal
Color(BLACK);
Clear;
Note 4 : Sun, X11, decX11, apollo, hercules, cga and ega support
double buffering.
Notes:
The GNU plotutils package includes a program called plot(1) that can read in the gnu metafile and render images on an X11 display, PNG (Portable Network Graphics) format, portable anymap format (PBM/PGM/PPM), a pseudo-GIF format that does not use LZW encoding, the new XML-based Scalable Vector Graphics format, the format used by Adobe Illustrator, Postscript or Encapsulated Postscript (EPS) that can be edited with idraw(1), CGM format (by default, confirming to the WebCGM profile), the format used by the xfig(1) drawing editor, the Hewlett-Packard PCL 5 printer language, the Hewlett-Packard Graphics Language, ReGIS graphics format (which can be displayed by the dxterm(1) terminal emulator or by a VT330 or VT340 terminal), Tektronix format (which can be displayed by the xterm(1) terminal emulator), and device-independent GNU metafile format itself.
Popular PDF readers are the Adobe PDF viewer, which is often callable from Web browsers; the GhostScript-based gv(1) utility; or the xpdf program.
The xpdf(1) software , related utilitites ( pdftops(1), pdftotext(1), pdfinfo(1), pdffonts(1), pdftoppm(1), pdfimages(1), xpdfrc(5)) and documentation are copyright 1996-2004 Glyph & Cog, LLC. at http://www.foolabs.com/xpdf/
The GhostScript-based tools can convert PDF files to PostScript as well as view the files.
The ralcgm(1) and gplot(1) packages are two very complete CGM viewers.
The NetPBM package is available for almost every platform and lets you convert the PPM files to just about any pixmap or bitmap format, including PNG, JPEG, GIF/PseudoGIF, BPM, ..... Other popular pixmap products such as ImageMagick, gv, ... can read PPM files, convert them, and often edit them.
The vml, canvas, svg, and usemap drivers are primarily used to generate graphics for inclusion in HTML documents. Browsers such as Opera, Safari, Foxfire, and Chrome can easily incorporate graphics generated using the SVG (Scalable Vector Graphics) format or the HTML5 CANVAS element.
This driver writes out the edges of any polygon in a format that can be used with an HTML image map; if the same sizes are used a plot generated with the ppm driver; you will have clickable regions in your pixmap when converted to a GIF image.
If the polygons overlap you need to reverse the order of the polygon definitions in the output file. The numeric field in the<AREA> titles should help.
The VML format can be read in by any MicroSoft Office 2000+ product and MicroSoft's web browser Internet Explorer. If the plots contain more than about 9766 vectors MicroSoft Word starts choking (still true in 2005), but otherwise this is a very nice way to generate input for MicroSoft products.
I generally use this on a machine running MicroSoft Windows by installing CygWin with the X11 options (and ralcgm, the GhostScript software, the GNU plotutils packages and netpbm).
The xfig(1) command can be used to edit graphics generated with the VOGLE graphics library; and to convert the xfig(1)-format file to many other output formats. If you are generating pixmaps with the PPM driver and want to use them as image maps in your HTML documents the usemap driver can be used.
If you have xfig(1) installed, you will find that calling fig2dev(1) allows you to generate many output formats from a single file, including LaTex and encapsulated PostScript.
xfig(1) is an X11 Windows application that can be used to interactively edit figures. The HELP utility of xfig(1) provides a description of the xfig(1) file format (as well as a user guide and many other documents).
Unfortunately, the manual indicates the user defined colors must be defined before any other Fig objects. By default, 16 colors are defined. If undefined colors are used they are assigned a dash pattern or a fill pattern to help distinguish them. Use of hardware dash and VOGLE software dash could get confusing.
Also, in the current driver version all lines are drawn as a series of move-draw vectors, which can make the files relatively very large.
multiple pages appear to only work with the PostScript and PDF drivers of xfig(1); and even then pages must be all positive numbers from left to right and top to bottom, printing all pages in a rectangular area.
Alternatively, could use depth to keep up to 999 pages seperate
Reset the window/terminal (must be the last VOGLE routine called)
Fortran:
subroutine vexit
C:
vexit()
Pascal:
procedure Vexit;
Redirect output from *next* vinit() to file given by path. This routine only applies to device drivers that write to stdout e.g. PostScript and hpgl.
The special file names are
If the open of the file fails, an attempt is made to append to file "VOUTPUT". If this fails, standard output is used.
When vinit() is called if voutput() has not been called then the environmental variable VOUTPUT is checked and if it is defined and not a null string then voutput() is called with the VOUTPUT variable's value.
A common use of the |command option is to automatically call programs that convert PPM files to other common pixmap formats or converts the GNU metafile to other formats (typically via the GNU plotutils plot program).
Fortran:
subroutine voutput(path)
character*(*) path
C:
voutput(path)
char *path;
Pascal:
procedure Voutput(path: string_t)
Reinitialize VOGLE to use a new device without changing attributes, viewport etc. (eg. window and viewport specifications)
Fortran:
subroutine vnewdev(device)
character *(*) device
C:
vnewdev(device)
char *device;
Pascal:
VnewDev(device: string_t)
Gets the name of the current VOGLE device. The C version of the routine also returns a pointer to it's argument.
Fortran:
subroutine vgetdev(device)
character *(*) device
C:
char *
vgetdev(device)
char *device;
Pascal:
procedure VgetDev(var device: string_t)
Returns the number of bit planes (or color planes) for a particular device. The number of colors displayable by the device is then 2**(nplanes); ie. if nplanes=1,then there are two colors (black and white).
Fortran:
integer function getdepth()
C:
int
getdepth()
Pascal:
function GetDepth(): integer;
Initialize a new device without changing attributes, viewport etc, but save the previously initialised device on a stack.
Note, this is intended to completely change the device, it won't work if you pushdev the same device that you are already running. (This will be fixed at a later date).
Fortran:
subroutine pushdev(device)
character *(*) device
C:
pushdev(device)
char *device;
Pascal:
PushDev(device: string_t)
Pops a device off the device stack and reinstates the previously pushed device.
Fortran:
subroutine popdev()
C:
popdev()
Pascal:
PopDev