ppmio.h

来自「weilevoy算法实现纹理合成,分带与不带加速两个版本」· C头文件 代码 · 共 41 行

H
41
字号
/************************************************************************** * ppmIO.h * These functions read and write ppm files in the format output by  * cqcam and xv.  * Written by Elizabeth Gordon 6-98 * Modified to read xv output images by Bruce Maxwell 7-98 *************************************************************************/#ifndef PPMIO_H#define PPMIO_Htypedef struct {  unsigned char r;  unsigned char g;  unsigned char b;} Pixel;#define MAX_TEXPLANES 50typedef struct {  long rows;  long cols;  int planes;  float *d[MAX_TEXPLANES];} TexImage;Pixel *readPPM(int *rows, int *cols, int * colors, char *filename);void writePPM(Pixel *image, int rows, int cols, int colors, char *filename);void writeRPM(Pixel *image, int rows, int cols, int colors, char *filename);TexImage *CreateTEX(long rows, long cols, long planes);void FreeTEX(TexImage *);void writeTEX(TexImage *image, char *filename);TexImage *readTEX(char *filename);unsigned char *readPGM(int *rows, int *cols, int *intensities, char *filename);void writePGM(unsigned char *image, long rows, long cols, int intensities, char *filename);#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?