summaryrefslogtreecommitdiff
path: root/image.h
diff options
context:
space:
mode:
Diffstat (limited to 'image.h')
-rw-r--r--image.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/image.h b/image.h
index d854fcc..0e36c02 100644
--- a/image.h
+++ b/image.h
@@ -23,6 +23,11 @@
* Email: <nico at ni.fr.eu.org>
*/
#include <stdint.h>
+#include <stdbool.h>
+#include <glib.h>
+
+/* Error domain for image related errors. */
+#define IMAGE_ERROR image_error_quark()
/* Image format. */
enum image_format
@@ -69,6 +74,16 @@ struct image_white_balance_reference {
uint8_t r, g, b;
};
+/* Error codes. */
+enum ImageError {
+ /* Error writing an image to disk. */
+ IMAGE_ERROR_SAVE,
+};
+
+/* Return quark of error domain for image related errors. */
+GQuark
+image_error_quark(void);
+
/* Allocate an image using system allocator. */
struct image *
image_new(int width, int height, int stride, enum image_format format);
@@ -100,7 +115,7 @@ void
image_convert(struct image *dst, const struct image *src);
/* Save image to PNG. */
-void
-image_save(const struct image *image, const char *name);
+bool
+image_save(const struct image *image, const char *name, GError **error);
#endif /* image_h */