[comp.windows.x] Targa board images under X ?

carm@umd5.umd.edu (Rick Chimera) (08/30/89)

Is anyone out there familiar with what one would need to do in order
to have the X Window System be able to display video images from the
Targa 16 (or similar) board ?  I have been able to track down a generic
Unix SysV driver for the Targa board, and now I have to figure out whether
it is possible to have that driver interact with X in a nice way to have
things work "as one would naturally expect."  Or perhaps some ideas on how
I would have to modify such a generic driver to have it work thusly with X.

Some of my questions include:
	-How does one put the targa controlled image into an X window?

	-When I resize, do I clip and get empty spaces if I resize such that
		the window is not exactly the same size as the default targa
		image or can the targa image be scaled as well?

	-Will X be able to obscure the targa window if another window is 
		brought on top of the targa window or does targa do nasty
		hardware/monitor things that X won't be able to override
		or handle "normally"?

Typical answers I might expect would be: "It's straightforward, here's
how..", "the targa image is one size and not scalable so clipping and
empty spaces will occur if you don't control the size of the X window
explicitly by the program", and "Since it's in an X window per question
one, of course things get handled normally".

Any comment/help large or small would be greatly appreciated.  Persons
with similar interests but no answers are also welcome to send me a
note.

				Rick Chimera

pusateri@romeo.cs.duke.edu (Thomas J. Pusateri) (09/01/89)

In article <5284@umd5.umd.edu> carm@umd5.umd.edu (Rick Chimera) writes:
>Is anyone out there familiar with what one would need to do in order
>to have the X Window System be able to display video images from the
>Targa 16 (or similar) board ?

There is a package called the utah raster toolkit that will convert from
targa to their rle format. Then you also need the Fuzzy bitmap package
and through an unobvious process of separating the RGB components and
and then using the fbm rawtofbm converter you can then convert to gif.
	There is a xgif program for displaying gif images under the X
window system. Alternatively, you can convert from fuzzy bit map to
portable bit map and then using Jeff Pozankers PBM package, you can
convert to x bitmaps. 

	Overall, the process is quite painstaking however, if you obtain
these packages mentioned above, you can convert to most formats. Of course,
there is a TIFF package from CMU that is nice to have if you are needing
to convert to or from this format. 

	Since the step above to convert from rle to fbm is not obvious, I
will include c shell script to do so.

	FBM was recently posted to comp.sources.unix
	PBM is included in the X windows distributioin and is also
		obtainable for anon ftp from expo.lcs.mit.edu
	UTAH RASTER TOOLKIT (RLE) is available for anon ftp from
		wsmr-simtel20.army.mil
	

----------------- rle2fbm---------cut here-------------------------------
#!/bin/csh
if ($#argv != 3) then
	echo "Usage: rle2fbm image width height"
else
	repos $1.rle | rleflip -v | rletogray -p $1
	cat $1.red $1.green $1.blue > $1.rgb
	rm -f $1.alpha $1.red $1.green $1.blue
	raw2fbm -d3 -a1.0 -w$2 -h$3 < $1.rgb > $1.fbm
	rm -f $1.rgb
endif


--------------------------------------------------------------------------

Tom Pusateri
National Biomedical Simulation Resource
Duke University Medical Center

pusateri@nbsr.mc.duke.edu

pokey@well.UUCP (Jef Poskanzer) (09/02/89)

In the referenced message, pusateri@romeo.UUCP (Thomas J. Pusateri) wrote:
[amazingly complicated conversion procedure deleted]

Yow, I had no idea things were so bad.  You'll probably be happy to
find out that I have just added a Targa reader to the new color-capable
PBM.  Also, this is the only Targa reader I know of that handles the
entire Targa spec (except for the undocumented types 32 and 33 Huffman
encoded files).

As for when the new PBM will be distributed, it's still Real Soon Now.
---
Jef

    Jef Poskanzer  pokey@well.sf.ca.us  {ucbvax, apple, hplabs}!well!pokey
                    Fools rush in and get the best seats.