changeset 525:00e7ad6938ae

core: doxygenize image
author David Demelier <markand@malikania.fr>
date Sat, 04 Mar 2023 19:26:51 +0100
parents c2124ecb2423
children 8e1f4e17bc80
files libmlk-core/mlk/core/image.h
diffstat 1 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmlk-core/mlk/core/image.h	Sat Mar 04 19:22:06 2023 +0100
+++ b/libmlk-core/mlk/core/image.h	Sat Mar 04 19:26:51 2023 +0100
@@ -19,6 +19,11 @@
 #ifndef MLK_CORE_IMAGE_H
 #define MLK_CORE_IMAGE_H
 
+/*
+ * \file mlk/core/image.h
+ * \brief Basic image management
+ */
+
 #include <stddef.h>
 
 struct mlk_texture;
@@ -27,11 +32,33 @@
 extern "C" {
 #endif
 
+/**
+ * Open an image from the given filesystem path.
+ *
+ * The texture must be destroyed using ::mlk_texture_finish once no longer
+ * needed.
+ *
+ * \pre texture != NULL
+ * \param texture the texture to initialize
+ * \param path path to the image file (e.g. .png, .jpeg, etc)
+ * \return 0 on success or any error code instead
+ */
 int
-mlk_image_open(struct mlk_texture *, const char *);
+mlk_image_open(struct mlk_texture *texture, const char *path);
 
+/**
+ * Open an image from a const binary data.
+ *
+ * The binary data must be kept alive until the texture is no longer used.
+ *
+ * \pre texture != NULL
+ * \param texture the texture to initialize
+ * \param data the image content
+ * \param datasz the image content length
+ * \return 0 on success or any error code instead
+ */
 int
-mlk_image_openmem(struct mlk_texture *, const void *, size_t);
+mlk_image_openmem(struct mlk_texture *texture, const void *data, size_t datasz);
 
 #if defined(__cplusplus)
 }