2025-11-27 16:30:01 +01:00

48 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef IMAGEINPUT_H
#define IMAGEINPUT_H
#include <stddef.h> // für size_t
// Datentyp für ein einzelnes Pixel (0255)
typedef unsigned char GrayScalePixelType;
// Struktur eines einzelnen Graustufenbildes
typedef struct
{
GrayScalePixelType *buffer; // Zeiger auf Pixel-Daten (width * height)
unsigned int width; // Bildbreite
unsigned int height; // Bildhöhe
} GrayScaleImage;
// Eine Serie von Bildern inklusive Labels
typedef struct
{
GrayScaleImage *images; // Array von Bildern
unsigned char *labels; // Array von Labels (0255)
unsigned int count; // Anzahl der Bilder
} GrayScaleImageSeries;
/**
* Liest eine Bilderserie aus einer Datei.
* Erwartetes Format:
* uint32 count
* für jedes Bild:
* uint32 width
* uint32 height
* width*height Bytes Bilddaten
* uint8 label
*
* @param path Pfad zur Datei
* @return Pointer auf GrayScaleImageSeries oder NULL bei Fehler
*/
GrayScaleImageSeries *readImages(const char *path);
/**
* Gibt den Speicher einer Serie wieder frei.
*
* @param series Pointer auf die Serie, darf auch NULL sein
*/
void clearSeries(GrayScaleImageSeries *series);
#endif // IMAGEINPUT_H