136 float *out,
int out_h,
int out_w);
void image_to_grayscale(Image *img)
Convert an Image to grayscale in-place.
Definition image.c:189
Image * image_load_png(const char *path)
Load a PNG file into an Image.
Definition image.c:52
int image_load_normalised(const char *path, const PreprocessParams *p, float *out, int out_h, int out_w)
Full pipeline: load PNG → preprocess → resize → float array.
Definition image.c:340
int image_save_png(const Image *img, const char *path)
Save an Image as a PNG file.
Definition image.c:143
Image * image_rotate(const Image *img, float angle_deg)
Rotate an Image by angle_deg degrees clockwise.
Definition image.c:257
void image_free(Image *img)
Free an Image allocated by image_load_png().
Definition image.c:40
void image_binarize(Image *img)
Binarise a grayscale Image in-place using a global threshold.
Definition image.c:204
Image * image_resize(const Image *img, int w, int h)
Resize an Image to the given dimensions (nearest-neighbour).
Definition image.c:227
void image_to_float(const Image *img, float *out)
Convert an Image to a flat normalised float array.
Definition image.c:328
Heap-allocated RGBA pixel buffer (row-major, 4 bytes per pixel).
Definition image.h:27
int height
Definition image.h:30
uint8_t * pixels
Definition image.h:28
int width
Definition image.h:29
Parameters for the full preprocessing pipeline.
Definition image.h:40
float rotation_deg
Definition image.h:41
int invert
Definition image.h:42