psImageJpeg.h

Go to the documentation of this file.
00001 /* @file  psImageJpeg.h
00002  * @brief functions to generate JPEG images from psImage
00003  * 
00004  * @author EAM
00005  * @version $Revision: 1.2 $ $Name:  $
00006  * @date $Date: 2007/01/23 22:47:23 $
00007  */
00008 
00009 #ifndef PS_IMAGE_JPEG_H
00010 #define PS_IMAGE_JPEG_H
00011 
00012 /// @addtogroup FileIO Input/Output
00013 /// @{
00014 
00015 #include "psImage.h"
00016 
00017 typedef struct
00018 {
00019     psVector *red;                      // Red colormap
00020     psVector *green;                    // Green colormap
00021     psVector *blue;                     // Blue colormap
00022 }
00023 psImageJpegColormap;
00024 
00025 #define PS_JPEG_RANGELIM(A)(PS_MAX(0,PS_MIN(255,(A))))
00026 
00027 #define PS_JPEG_SCALEVALUE(VALUE,ZERO,SCALE)(PS_MAX(0,PS_MIN(255,(SCALE*(VALUE-ZERO)))))
00028 
00029 // allocate a colormap (does not define the map values)
00030 psImageJpegColormap *psImageJpegColormapAlloc();
00031 
00032 // set the colormap values using the supplied name
00033 psImageJpegColormap *psImageJpegColormapSet(psImageJpegColormap *map, // Colormap to set
00034         const char *name // Name of colormap
00035                                            );
00036 
00037 // write out a JPEG file using the supplied image and colormap
00038 // output goes to the specified filename
00039 bool psImageJpeg(const psImageJpegColormap *map, // Color map
00040                  const psImage *image,  // Image to write
00041                  const char *filename,  // Filename of JPEG
00042                  float min, float max   // Minimum and maximum values
00043                 );
00044 
00045 /// @}
00046 #endif /* PS_IMAGE_JPEG_H */

Generated on Fri Feb 2 22:24:35 2007 for pslib by  doxygen 1.5.1