Skip to content
Snippets Groups Projects
Select Git revision
  • f9d2408fd255dc895d7c92d0a8b5c48e092c9945
  • main default protected
2 results

README.md

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