#ifndef SWIFT_IMAGE_IMAGE_H
#define SWIFT_IMAGE_IMAGE_H

#include <swift/maths.h>
#include <swift/stdlib.h>

#include <swift/image/api.h>
#include <swift/image/pixfmt.h>

typedef struct swift_image_t swift_image_t;

struct swift_image_t {
	swift_pixfmt_t *fmt;
	void *data;
	unsigned int width, height, pitch;
};

SWIFT_IMAGE_API bool swift_init_images(const char *path);
SWIFT_IMAGE_API void swift_term_images(void);

SWIFT_IMAGE_API swift_image_t *swift_new_image(swift_pixfmt_t *fmt,
	unsigned int width, unsigned int height);
SWIFT_IMAGE_API void swift_del_image(swift_image_t *image);
SWIFT_IMAGE_API void swift_get_image_pixel(swift_image_t *image, size_t x,
	size_t y, swift_vec4u_t *colour);
SWIFT_IMAGE_API void swift_set_image_pixel(swift_image_t *image, size_t x,
	size_t y, swift_vec4u_t colour);

#endif /* SWIFT_IMAGE_IMAGE_H */
