00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: ImageIO.h,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.17 $ $Date: 2019年01月17日 21:20:59 $ 00015 * 00016 *************************************************************************** 00017 * DESCRIPTION: 00018 * Write an RGB image to a file. Image routines donated by John Stone, 00019 * derived from Tachyon source code. For now these image file writing 00020 * routines are statically linked into VMD and are not even in an extensible 00021 * list structure. Long-term the renderer interface should abstract from 00022 * most of the details, and use a plugin interface for extensibility. 00023 * For the short-term, this gets the job done. 00024 * 00025 ***************************************************************************/ 00026 00027 #ifndef IMAGEIO_H 00028 #define IMAGEIO_H 00029 00030 #include <stdio.h> 00031 #include <stdlib.h> 00032 00034 unsigned char * cvt_rgb4u_rgb3u(const unsigned char * rgb4u, int xs, int ys); 00035 00037 unsigned char * cvt_rgb4f_rgb3u(const float *rgb4f, int xs, int ys); 00038 00040 int write_image_file_rgb3u(const char *filename, 00041 const unsigned char *rgb3u, int xs, int ys); 00042 00044 int write_image_file_rgb4u(const char *filename, 00045 const unsigned char *rgb4u, int xs, int ys); 00046 00049 int write_image_file_rgba4u(const char *filename, 00050 const unsigned char *rgba4u, int xs, int ys); 00051 00053 int write_image_file_rgb4f(const char *filename, 00054 const float *rgb4f, int xs, int ys); 00055 00058 int write_image_file_rgba4f(const char *filename, 00059 const float *rgb4f, int xs, int ys); 00060 00062 void vmd_writergb(FILE *dfile, const unsigned char * img, int xs, int ys); 00063 00065 void vmd_writebmp(FILE *dfile, const unsigned char * img, int xs, int ys); 00066 00068 void vmd_writeppm(FILE *dfile, const unsigned char * img, int xs, int ys); 00069 00071 void vmd_writetga(FILE *dfile, const unsigned char * img, int xs, int ys); 00072 00073 #if defined(VMDLIBPNG) 00074 00075 void vmd_writepng(FILE *dfile, const unsigned char * img, int xs, int ys); 00076 00078 void vmd_writepng_alpha(FILE *dfile, const unsigned char * img, int xs, int ys); 00079 #endif 00080 00081 #endif