summaryrefslogtreecommitdiff
path: root/src/libsstv.template.h
diff options
context:
space:
mode:
authorrimio <vasi.vilvoiu@gmail.com>2019-02-10 22:53:04 +0200
committerrimio <vasi.vilvoiu@gmail.com>2019-02-10 22:53:04 +0200
commita76e7ef6b9459d3b0f908eecebb33c4c76e1d36e (patch)
tree8f8d6307dcb19edb98d2e41c027b894672c42fcd /src/libsstv.template.h
parentde931b95f6dc358b20fdfdf493013fcd673ac70a (diff)
Internal colorspace conversion routine
Diffstat (limited to 'src/libsstv.template.h')
-rw-r--r--src/libsstv.template.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/libsstv.template.h b/src/libsstv.template.h
index 76c50ee..ce4cf26 100644
--- a/src/libsstv.template.h
+++ b/src/libsstv.template.h
@@ -43,6 +43,7 @@ typedef enum {
SSTV_BAD_FORMAT = 105,
SSTV_BAD_RESOLUTION = 106,
SSTV_BAD_SAMPLE_TYPE = 107,
+ SSTV_UNSUPPORTED_CONVERSION = 108,
SSTV_ALLOC_FAIL = 200,
@@ -178,6 +179,28 @@ extern sstv_error_t sstv_create_image_from_mode(sstv_image_t *out_img, sstv_mode
extern sstv_error_t sstv_create_image_from_props(sstv_image_t *out_img, size_t w, size_t h, sstv_image_format_t format);
/*
+ * Deletes an image.
+ * img(in): pointer to an image structure to delete
+ * returns: error code
+ *
+ * NOTE: This function deallocates the pixel buffer, so it requires a valid
+ * call to sstv_init().
+ */
+extern sstv_error_t sstv_delete_image(sstv_image_t *img);
+
+/*
+ * Converts an image.
+ * img(in): pointer to an image structure
+ * format(in): format to convert image to
+ * returns: error code
+ *
+ * NOTE: Conversions _from_ SSTV_FORMAT_Y to any format are NOT supported,
+ * since the conversion is performed in-place and extra memory would be
+ * required.
+ */
+extern sstv_error_t sstv_convert_image(sstv_image_t *img, sstv_image_format_t format);
+
+/*
* Pack an image into an image structure, given properties and buffer.
* out_img(out): pointer to an image structure to initialize
* width(in): width
@@ -192,16 +215,6 @@ extern sstv_error_t sstv_create_image_from_props(sstv_image_t *out_img, size_t w
extern sstv_error_t sstv_pack_image(sstv_image_t *out_img, size_t width, size_t height, sstv_image_format_t format, uint8_t *buffer);
/*
- * Deletes an image.
- * img(img): pointer to an image structure to delete
- * returns: error code
- *
- * NOTE: This function deallocates the pixel buffer, so it requires a valid
- * call to sstv_init().
- */
-extern sstv_error_t sstv_delete_image(sstv_image_t *img);
-
-/*
* Pack a signal buffer into a signal structure.
* sig(in): signal structure to initialize
* type(in): sample type