made imageInput completely contcorrect
This commit is contained in:
parent
ccfceba21c
commit
659121f65d
16
imageInput.c
16
imageInput.c
@ -8,9 +8,9 @@
|
||||
|
||||
|
||||
// DONE Implementieren Sie geeignete Hilfsfunktionen für das Lesen der Bildserie aus einer Datei
|
||||
unsigned int readStatusInfo (FILE *source, char *const headerString, GrayScaleImageSeries *series, int const sizeToRead, int const amountToRead);
|
||||
void readImagedata (FILE *source, GrayScaleImageSeries *series, int const amountToRead);
|
||||
unsigned int checkHeaderString (char header[]);
|
||||
unsigned int readStatusInfo (FILE *const source, GrayScaleImageSeries *const series, char *const headerString, int const sizeToRead, int const amountToRead);
|
||||
void readImagedata (FILE *const source, GrayScaleImageSeries *const series, int const amountToRead);
|
||||
unsigned int checkHeaderString (const char *const header);
|
||||
|
||||
|
||||
// DONE Vervollständigen Sie die Funktion readImages unter Benutzung Ihrer Hilfsfunktionen
|
||||
@ -32,7 +32,7 @@ GrayScaleImageSeries *readImages(const char *path)
|
||||
series = calloc(sizeof(unsigned int) + 3* sizeof(headerString), amountOfStatusInfoToRead);
|
||||
series->images = calloc(2*sizeof(unsigned int) + sizeof(headerString), amountOfStatusInfoToRead);
|
||||
|
||||
numberOfBytesToRead = readStatusInfo(readSource, headerString, series, sizeOfStausInfoElementsInBytes, amountOfStatusInfoToRead);
|
||||
numberOfBytesToRead = readStatusInfo(readSource, series, headerString, sizeOfStausInfoElementsInBytes, amountOfStatusInfoToRead);
|
||||
|
||||
expectedHeader = checkHeaderString(headerString);
|
||||
|
||||
@ -65,7 +65,7 @@ GrayScaleImageSeries *readImages(const char *path)
|
||||
|
||||
|
||||
// DONE Vervollständigen Sie die Funktion clearSeries, welche eine Bildserie vollständig aus dem Speicher freigibt
|
||||
void clearSeries(GrayScaleImageSeries *series)
|
||||
void clearSeries(GrayScaleImageSeries * series)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -101,7 +101,7 @@ void clearSeries(GrayScaleImageSeries *series)
|
||||
|
||||
|
||||
// reads headerString, pictureCount, pictureWidth, pictureHight
|
||||
unsigned int readStatusInfo(FILE *source, char *const headerString, GrayScaleImageSeries *series, int const sizeToRead, int const amountToRead)
|
||||
unsigned int readStatusInfo(FILE *const source, GrayScaleImageSeries *const series, char *const headerString, int const sizeToRead, int const amountToRead)
|
||||
{
|
||||
unsigned int bytesToRead = 0;
|
||||
|
||||
@ -119,7 +119,7 @@ unsigned int readStatusInfo(FILE *source, char *const headerString, GrayScaleIma
|
||||
|
||||
|
||||
// reads the imagebytes and the label of all images
|
||||
void readImagedata(FILE *source, GrayScaleImageSeries *series, int const amountOfBytes)
|
||||
void readImagedata(FILE *const source, GrayScaleImageSeries *const series, int const amountOfBytes)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -133,7 +133,7 @@ void readImagedata(FILE *source, GrayScaleImageSeries *series, int const amount
|
||||
|
||||
|
||||
// checks if the read headerString matches the expected headerString
|
||||
unsigned int checkHeaderString(char header[])
|
||||
unsigned int checkHeaderString(const char *const header)
|
||||
{
|
||||
int i = 0;
|
||||
int notIdenticall = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user