📄 ppm_util.hpp
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -