Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
I tried to mail a reply but your posting software didn't include your mail address. Greening C M (greec) wrote: : Does anyone have, or know where to get hold of, code to read and : write .pgm format image files?. It is very simple, you really don't need much code. I assume that you want to read/write PGM files from your application program. Here are some bits of code I used to create/write PGM files in one of my programs. The image is a lineSize*1014 array of 8 bit values. I used the manual pages from the PBM software to get the file format specification. /* open PGM output file */ sprintf(ofName, "SNDR%.4d.PGM", serial); if ((pgmFile = fopen(ofName, "wb")) == NULL) { fprintf(stderr, "%s: can't open %s\n", pName, ofName); exit(1); } fprintf(pgmFile, "P5 %d %d %d\n", lineSize, 1014, 255); /* note: repeated 1014 times to output experiment video */ /* write PGM data */ for (j = 0; j < lineSize; ++j) putc(255 - lineBuf[j], pgmFile); /* close PGM file */ fclose(pgmFile);
In article <3mebvm$bk8@seralph9.essex.ac.uk> Greening C M <greec> writes: > Does anyone have, or know where to get hold of, code to read and > write .pgm format image files?. I assume you mean IDL code? I have a program 'getim.pro' that reads raw format pbm pgm and ppm files - ftp://hopper.colorado.edu/pub/optics/getim.pro Otherwise you can get the pbmplus package. last I heard it was available at ftp://export.lcs.mit.edu plus about a million other sites (check graphics or X11 contribution sites). -- Adam Fedor. CU, Boulder | Fudd's Law of Opposition: Push something fedor@boulder.colorado.edu (W) | hard enough and it will fall over. adam@bastille.rmnug.org (H,NeXTMail)|