read Width, Height, Count implementiert. Ausgelesen wird in UNSIGNED SHORT!!
This commit is contained in:
parent
793f92202d
commit
f7aafbb596
25
imageInput.c
25
imageInput.c
@ -32,6 +32,31 @@ static FILE* openFileCheckHeader(const char *path)
|
||||
///dass nun der header Teil gelesen wurde und somit die nächste Funktion ab dieser Stelle weiter liest.
|
||||
///NULL, wenn falscher header.
|
||||
// TODO Vervollständigen Sie die Funktion readImages unter Benutzung Ihrer Hilfsfunktionen
|
||||
static int readWidthHeightCount(FILE *fp, unsigned int *count, unsigned int *width, unsigned int *height)
|
||||
{
|
||||
unsigned short count_s;
|
||||
unsigned short width_s;
|
||||
unsigned short height_s;
|
||||
if(fread(&count_s, sizeof(unsigned short), 1, fp) != 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if(fread(&width_s, sizeof(unsigned short), 1, fp) != 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if(fread(&height_s, sizeof(unsigned short), 1, fp) != 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
*count = (unsigned int)count_s;
|
||||
*width = (unsigned int)width_s;
|
||||
*height = (unsigned int)height_s;
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
readWidthHeightCount: liest die drei shorts ein, welche Hoehe, Breite und Anzahl sind. (SHORT!!)
|
||||
*/
|
||||
GrayScaleImageSeries *readImages(const char *path)
|
||||
{
|
||||
GrayScaleImageSeries *series = NULL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user