Skip to content
Snippets Groups Projects
Select Git revision
  • fdf13216f5776fc8d4bb6e748894de8c1e7bcbc8
  • master default protected
2 results

pgm_io.h

Blame
  • 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