ppm_util.hpp

来自「The goal of this project is to explore t」· HPP 代码 · 共 69 行

HPP
69
字号
#if !defined(BRL_PPM_UTIL_HPP)
#define BRL_PPM_UTIL_HPP

#include <stdio.h> // for FILE type

/*+-----------------------------------------------------------------------------

  Ben Landon
  CSCI E-235

  Assignment 3 
  
  Read/write PPM files.

*/


/*+-----------------------------------------------------------------------------
  read_PPM_file

  Reads a named PPM file and returns the data, the width and the
  height.

*/
bool read_PPM_file (FILE* file, 
                    unsigned char** ppData, 
                    unsigned int* width, 
                    unsigned int* height,
                    unsigned int* colorDepth
                    );

/*+-----------------------------------------------------------------------------
  save_PPM_file

  Given a filename and the image parameters, writes our a type 6 
  PPM file.

*/
bool save_PPM_file (FILE* file,
                    unsigned char* pData,
                    unsigned int width,
                    unsigned int height,
                    unsigned int maxChannelValue
                    );


/*+-------------------------------------------------------------------
  
  flip_PPM_image
  
  PPM images are top down, and OpenGL images are bottom up.  For using
  PPM images as textures, it is sometimes useful to flip them.
  
  This function flips the PPM image, from top to bottom, in place. 
  
*/
void flip_PPM_image (unsigned char* pData,
		     unsigned int width, 
		     unsigned int height, 
		     unsigned int maxChannelValue);


#endif





⌨️ 快捷键说明

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