From 91ae7a230d148233db337ef66d99ea68c85b0c84 Mon Sep 17 00:00:00 2001 From: John Neumeier Date: Sun, 16 Nov 2025 18:37:10 +0100 Subject: [PATCH] clearSeries funktion --- .idea/Neuronales_Netz_Geh_Sch_Neu.iml | 2 + .idea/editor.xml | 580 ++++++++++++++++++++++++++ .idea/modules.xml | 8 + .idea/workspace.xml | 102 +++++ imageInput.c | 21 + matrix.h | 6 +- testFile.info2 | 1 + 7 files changed, 719 insertions(+), 1 deletion(-) create mode 100644 .idea/Neuronales_Netz_Geh_Sch_Neu.iml create mode 100644 .idea/editor.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/workspace.xml create mode 100644 testFile.info2 diff --git a/.idea/Neuronales_Netz_Geh_Sch_Neu.iml b/.idea/Neuronales_Netz_Geh_Sch_Neu.iml new file mode 100644 index 0000000..4c94235 --- /dev/null +++ b/.idea/Neuronales_Netz_Geh_Sch_Neu.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/editor.xml b/.idea/editor.xml new file mode 100644 index 0000000..1f0ef49 --- /dev/null +++ b/.idea/editor.xml @@ -0,0 +1,580 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..176ec75 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..c55762a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "customColor": "", + "associatedIndex": 6 +} + + + + + + + + + + + + + 1763287436969 + + + + + + \ No newline at end of file diff --git a/imageInput.c b/imageInput.c index 4c2822d..199e0d6 100644 --- a/imageInput.c +++ b/imageInput.c @@ -114,4 +114,25 @@ GrayScaleImageSeries *readImages(const char *path) // TODO Vervollständigen Sie die Funktion clearSeries, welche eine Bildserie vollständig aus dem Speicher freigibt void clearSeries(GrayScaleImageSeries *series) { + if (series == NULL) { + return; + } + // Alle Bilder durchgehen und deren Buffer freigeben + for (int i = 0; i < series->count; i++) { + if (series->images[i].buffer != NULL) { + free(series->images[i].buffer); + series->images[i].buffer = NULL; + } + } + // Arrays freigeben + if (series->images != NULL) { + free(series->images); + series->images = NULL; + } + if (series->labels != NULL) { + free(series->labels); + series->labels = NULL; + } + // Schließlich die gesamte Serie freigeben + free(series); } \ No newline at end of file diff --git a/matrix.h b/matrix.h index cc640d1..ff77f24 100644 --- a/matrix.h +++ b/matrix.h @@ -6,7 +6,11 @@ typedef float MatrixType; // TODO Matrixtyp definieren - +typedef struct { + MatrixType *buffer; + MatrixType rows; + MatrixType cols; +}Matrix; Matrix createMatrix(unsigned int rows, unsigned int cols); void clearMatrix(Matrix *matrix); diff --git a/testFile.info2 b/testFile.info2 new file mode 100644 index 0000000..1ea3b4c --- /dev/null +++ b/testFile.info2 @@ -0,0 +1 @@ +some_tag \ No newline at end of file