[comp.windows.x] Bitmap scaling in X

brent@well.sf.ca.us (Brent Southard) (09/11/90)

I'm posting this query for my brother, who is presently lacking the ability
to post news...

Are there any functions in the X toolkit to provide for the scaling of
bitmaps (pixmaps, actually, I suppose)?  If not, what are the methods most
people are employing to quickly provide this capability over a range of
hardware?

Thanks,
Brent Southard

-- 
brent southard  (313) 656-8349   |   usenet:  ...!well!brent
ImageTech Corp  (313) 362-3141   |   

"When frog licking is outlawed, only outlaws will lick frogs."

klee@wsl.dec.com (Ken Lee) (09/12/90)

In article <20200@well.sf.ca.us>, brent@well.sf.ca.us (Brent Southard) writes:
|> Are there any functions in the X toolkit to provide for the scaling of
|> bitmaps (pixmaps, actually, I suppose)?  If not, what are the methods most
|> people are employing to quickly provide this capability over a range of
|> hardware?

Most graphics extensions to X, such as Display PostScript and PEX, have
facilities for image scaling.  If you want to do this by hand, most
books on computer graphics discuss something like "geometric
transformations of images".  The latest Foley & VanDam book has
pseudocode for some of the simpler algorithms.

-- 
Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee

envbvs@epb2.lbl.gov (Brian V. Smith) (09/12/90)

In article <1990Sep11.100202@wsl.dec.com>, klee@wsl.dec.com (Ken Lee) writes:
|> In article <20200@well.sf.ca.us>, brent@well.sf.ca.us (Brent
Southard) writes:
|> |> Are there any functions in the X toolkit to provide for the
scaling of
|> |> bitmaps (pixmaps, actually, I suppose)?  If not, what are the
methods most
|> |> people are employing to quickly provide this capability over a
range of
|> |> hardware?
|> 
|> Most graphics extensions to X, such as Display PostScript and PEX,
have
|> facilities for image scaling.  If you want to do this by hand, most
|> books on computer graphics discuss something like "geometric
|> transformations of images".  The latest Foley & VanDam book has
|> pseudocode for some of the simpler algorithms.
|> 

Or check out the pbmplus programs, written by Jef Poskanser, which will
scale, rotate, clip etc. "portable bitmaps".  There are also many
support
programs to convert to/from various formats and pbm.
The pbm package is available from expo.lcs.mit.edu (18.30.0.212) in the
/contrib directory (pbmplus.tar.Z).

--
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL; they don't pay me enough for that.

jimf@SABER.COM (09/12/90)

> Are there any functions in the X toolkit to provide for the scaling of
> bitmaps (pixmaps, actually, I suppose)?  If not, what are the methods most
> people are employing to quickly provide this capability over a range of
> hardware?

X does not provide any although several extensions to X do.  Sample
code to scale bitmap and color images exists within xloadimage in the
file zoom.c.  The algorithm used is simplistic but quite fast and
effective.  You can get xloadimage by anonymous ftp from
expo.lcs.mit.edu in /contrib/xloadimage.1.06.tar.Z or via email by
asking me.

Xloadimage version 1.07 will be available soon and will support
several more common image formats (eg MacPaint, xwd [even across
visual types], and all the PBM formats) and some other image
processing functions.  It will be announced on this forum when it is
available.

Happy hacking,

jim frost
saber software
jimf@saber.com