Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!violet.berkeley.edu!izumi From: izumi@violet.berkeley.edu (Izumi Ohzawa) Newsgroups: comp.sys.next Subject: Re: How do I display a byte image ??? Message-ID: <1989Sep2.235409.8890@agate.uucp> Date: 2 Sep 89 23:54:09 GMT References: <438@dftsrv.gsfc.nasa.gov> <11638@polya.Stanford.EDU> Sender: usenet@agate.uucp (USENET Administrator;;;;ZU44) Organization: University of California, Berkeley Lines: 38 In article <11638@polya.Stanford.EDU> aozer@NeXT.com (Ali Ozer) writes: >In article <438@dftsrv.gsfc.nasa.gov> Bob Cahalan writes: >>help me with code? The image is 1024X1024 8-bit pixels, and >>the file has no header -- just 1024 bytes for line 1 followed >>by 1024 bytes for line 2, etc to EOF, altogether 1 Megabyte. > >You can try appending a PS header on top of it and executing it >in Yap. Here's a header that might work; it worked for me when I Thanks Ali, but is there a way to use the `image` operator in a PSWRAPped function which can receive a pointer to binary image data directly? I think Bob's image file contains a straight binary image. For occasional viewing, your method of viewing with Yap will work well. However, it seems that I should be able to use a pswrapped function of the form: defineps displayBinaryImage( float x, y, width, height; int xnum_pixels, ynum_pixels; int bits_per_pixel; unsigned char *imagedata) ..... endps which will diplay the binary image pointed to by imagedata into a rectangle of 'width' and 'height' with its lower left corner at (x,y). I know that 'image' operator takes a procedure which leaves a (HEX ASCII) string on stack as its last argument, but I am asking if it is possible to directly pass a pointer to binary image data. Is this possible? Izumi Ohzawa, izumi@violet.berkeley.edu