Hi!
At several points in my FORTRAN90 programs, I have 2D arrays. I’d like to have a diagnostic routine that dumps such arrays to simple bitmap files, e.g.
CALL Grid2BMP(OutputFileName,NX,NY,RedArray,GreenArray,BlueArray)
where I have already constructed a set of INTEGER arrays containing the RGB-components for the pixels, associated with the values in the original 2D array.
→ Question: Is there a simple routine that already does the job in PGF90?
→ If not: at
http://www.inf.u-szeged.hu/~ssip/2001/projects/files/project20/segmentation/
I found a set of C-routines, collected in files bmp_io.c and bmp_io.h
This library has a subroutine with header as follows:
/****/
int bmp_write ( char fileout_name, int xsize, int ysize, int rarray,
int garray, int barray ) {
//
Parameters:
Input, char *FILEOUT_NAME, the name of the output file.
Input, int XSIZE, YSIZE, the X and Y dimensions of the image.
Input, int *RARRAY, *GARRAY, *BARRAY, pointers to the red, green
and blue color arrays.
*/
FILE *fileout;
int result;
The compile-command “pgf90 -c bmp_io.c” generates an object-file “bmp_io.o”.
How can I make a call to the above C-routine and how can I link it with my program?
At present, my RGB-arrays in the F90 program are “regular INTEGER arrays”. How should I prepare my data in the calling F90 program, such that the C-subroutine is correcty called?
I am not familiar with programming in C. And in particular, I don’t look forward to coding the necessary F90 interface module blocks for all subroutines in the C-file. My experience with using pointers is very limited.
For the rest I have coded lots of PASCAL and F77.
Thanks,
Arjan
E-mail: [email protected]