File libluminate/importexport.c

RCS Header

This file contains functions for importing and exporting data to/from foreign file formats. Thus far only .tiff images are supported.


Included Files


Preprocessor definitions

#define _REENTRANT 1

#define ORBIT2 1

#define IMLIB2_EXISTS 1

#define DPRINTF( fmt, args... )

#define __FUNCT__ "IllImageWrite"

#define __FUNCT__ "IllImageSave"


Global Function IllImageSave()

This function stores one field as an image. In 2-D, it stores the whole thing; in 3-D, it stores one image per layer.

int IllImageSave ( MPI_Comm comm, DA theda, Vec X, char* basename, int redfield, int greenfield, int bluefield, PetscScalar* rgbmin, PetscScalar* rgbmax, int* coordrange, IllLayerStyle layer, IllImageFormat format )

int IllImageSave
It returns zero or an error code.
MPI_Comm comm
 
DA theda
Distributed array object controlling data saved.
Vec X
Vector whose data are actually being saved.
char* basename
Base file name.
int redfield
 
int greenfield
 
int bluefield
 
PetscScalar* rgbmin
Field values to use for image R,G,B zero.
PetscScalar* rgbmax
Field values to use for image R,G,B max.
int* coordrange
Minimum and maximum x, y, z to store (PETSC_NULL for the whole thing).
IllLayerStyle layer
Layer style to use for 3-D DA.
IllImageFormat format
Image format.
MPI_COMM comm MPI communicator, if NULL it uses PETSC_COMM_WORLD.
int field Field index.


Local Function IllImageWrite()

This writes a single monochrome .tif image from a double array for IllImageSave().

static inline int IllImageWrite ( double* array, int xm, int ym, int stride, int gxm, int goff, int boff, char* basename, PetscScalar minval, PetscScalar maxval )

double* array
Array of values to use as intensity values in the image, pointing to first red value.
int xm
Width of the array rows.
int ym
Number of rows in the array.
int stride
Number of doubles per point.
int gxm
Number of points between row starts.
int goff
Offest for green field.
int boff
Offest for blue field.
char* basename
Base file name; if the last four chars aren't ".tif" this appends that.
PetscScalar minval
Array value mapping to black.
PetscScalar maxval
Array value mapping to white.
inline int IllImageWrite It returns zero or an error code.