fixed errors that occured when building imageInputTests
This commit is contained in:
parent
07012e5c35
commit
a2c2aae0fb
11
imageInput.c
11
imageInput.c
@ -10,8 +10,8 @@
|
||||
// übersichtlich aufgeteilt werden!
|
||||
|
||||
// TODO Implementieren Sie geeignete Hilfsfunktionen für das Lesen der Bildserie aus einer Datei
|
||||
int readStatusInfo(FILE **source, char *const headerString, unsigned int *const imageCount, int *const imageWidth, int *const imageHeight, int const amountToRead);
|
||||
void readImagedata(FILE **source, char *const imageBuffer, char *const labelBuffer,int const imageCount ,int const amountToRead);
|
||||
int readStatusInfo(FILE **source, char *const headerString, unsigned int *const imageCount, unsigned int *const imageWidth, unsigned int *const imageHeight, int const amountToRead);
|
||||
void readImagedata(FILE **source, unsigned char *const imageBuffer, unsigned char *const labelBuffer,int const imageCount ,int const amountToRead);
|
||||
|
||||
|
||||
// TODO Vervollständigen Sie die Funktion readImages unter Benutzung Ihrer Hilfsfunktionen
|
||||
@ -21,7 +21,6 @@ GrayScaleImageSeries *readImages(const char *path)
|
||||
|
||||
// selbst geschriebene Variablen
|
||||
FILE *readSource;
|
||||
int i = 0;
|
||||
unsigned int numberOfBytesToRead = 0;
|
||||
const unsigned int amountOfStatusInfoToRead = 1;
|
||||
char headerString[sizeof("__info2_image_file_format__")];
|
||||
@ -31,7 +30,7 @@ GrayScaleImageSeries *readImages(const char *path)
|
||||
|
||||
if (readSource != NULL)
|
||||
{
|
||||
|
||||
printf("hier\n");
|
||||
numberOfBytesToRead = readStatusInfo(&readSource, headerString, &series->count, &series->images->width, &series->images->height, amountOfStatusInfoToRead);
|
||||
|
||||
series->images->buffer = calloc((series->count) * numberOfBytesToRead, sizeof(GrayScalePixelType));
|
||||
@ -80,7 +79,7 @@ void clearSeries(GrayScaleImageSeries *series)
|
||||
|
||||
|
||||
// reads string, pictureCount, pictureWidth, pictureHight
|
||||
int readStatusInfo(FILE **source, char *const headerString, unsigned int *const imageCount, int *const imageWidth, int *const imageHeight, int const amountToRead)
|
||||
int readStatusInfo(FILE **source, char *const headerString, unsigned int *const imageCount, unsigned int *const imageWidth, unsigned int *const imageHeight, int const amountToRead)
|
||||
{
|
||||
int bytesToRead = 0;
|
||||
|
||||
@ -95,7 +94,7 @@ int readStatusInfo(FILE **source, char *const headerString, unsigned int *const
|
||||
}
|
||||
|
||||
// reads the imagebytes and the label of all images
|
||||
void readImagedata(FILE **source, char *const imageBuffer, char *const labelBuffer,int const imageCount , int const amountOfBytes)
|
||||
void readImagedata(FILE **source, unsigned char *const imageBuffer, unsigned char *const labelBuffer,int const imageCount , int const amountOfBytes)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user