Select Git revision
pgm_io.h 536 B
#ifndef PGM_IO_HEADER
#define PGM_IO_HEADER
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "Matrix.h"
typedef enum _pgm_error {
success, failure
} pgm_error;
typedef struct _pgm {
int32_t max;
matrix pixels;
} pgm;
pgm_error pgm_read_from_file(pgm *p,const char* const filename);
pgm_error pgm_write_from_file(pgm *p,char *filename);
pgm_error pgm_duplicate(char *filename,char *newfile);
pgm_error pgm_read_header(const char* const filename,int *sizex,int *sizey,int *gray_scale);
#endif