28 lines
655 B
C
28 lines
655 B
C
#ifndef IMAGEINPUT_H
|
|
#define IMAGEINPUT_H
|
|
|
|
typedef unsigned char GrayScalePixelType;
|
|
|
|
typedef struct
|
|
{
|
|
GrayScalePixelType *buffer;
|
|
unsigned int width;
|
|
unsigned int height;
|
|
} GrayScaleImage;
|
|
|
|
typedef struct
|
|
{
|
|
GrayScaleImage *images;
|
|
unsigned char *labels;
|
|
unsigned int count;
|
|
} GrayScaleImageSeries;
|
|
|
|
int readHeader(FILE *file);
|
|
int readDimensions(FILE *file, unsigned int *count, unsigned int *width, unsigned int *height);
|
|
int readImage(FILE *file, GrayScaleImage *image);
|
|
int readLabel(FILE *file, unsigned char* label);
|
|
GrayScaleImageSeries *readImages(const char *path);
|
|
void clearSeries(GrayScaleImageSeries *series);
|
|
|
|
#endif
|