32 lines
674 B
C
32 lines
674 B
C
#ifndef IMAGEINPUT_H
|
|
#define IMAGEINPUT_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdio.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;
|
|
|
|
|
|
GrayScaleImageSeries *readImages(const char *path);
|
|
void clearSeries(GrayScaleImageSeries *series);
|
|
bool checkFileHeader(FILE *file);
|
|
unsigned short int readDimension(FILE *file);
|
|
GrayScaleImage readImage(FILE *file, unsigned short width, unsigned short height);
|
|
unsigned char readLabel(FILE *file);
|
|
|
|
#endif
|