Mercurial > molko
comparison libmlk-core/mlk/core/image.h @ 525:00e7ad6938ae
core: doxygenize image
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 04 Mar 2023 19:26:51 +0100 |
parents | 6e8f6640e05b |
children | d307f93d79af |
comparison
equal
deleted
inserted
replaced
524:c2124ecb2423 | 525:00e7ad6938ae |
---|---|
17 */ | 17 */ |
18 | 18 |
19 #ifndef MLK_CORE_IMAGE_H | 19 #ifndef MLK_CORE_IMAGE_H |
20 #define MLK_CORE_IMAGE_H | 20 #define MLK_CORE_IMAGE_H |
21 | 21 |
22 /* | |
23 * \file mlk/core/image.h | |
24 * \brief Basic image management | |
25 */ | |
26 | |
22 #include <stddef.h> | 27 #include <stddef.h> |
23 | 28 |
24 struct mlk_texture; | 29 struct mlk_texture; |
25 | 30 |
26 #if defined(__cplusplus) | 31 #if defined(__cplusplus) |
27 extern "C" { | 32 extern "C" { |
28 #endif | 33 #endif |
29 | 34 |
35 /** | |
36 * Open an image from the given filesystem path. | |
37 * | |
38 * The texture must be destroyed using ::mlk_texture_finish once no longer | |
39 * needed. | |
40 * | |
41 * \pre texture != NULL | |
42 * \param texture the texture to initialize | |
43 * \param path path to the image file (e.g. .png, .jpeg, etc) | |
44 * \return 0 on success or any error code instead | |
45 */ | |
30 int | 46 int |
31 mlk_image_open(struct mlk_texture *, const char *); | 47 mlk_image_open(struct mlk_texture *texture, const char *path); |
32 | 48 |
49 /** | |
50 * Open an image from a const binary data. | |
51 * | |
52 * The binary data must be kept alive until the texture is no longer used. | |
53 * | |
54 * \pre texture != NULL | |
55 * \param texture the texture to initialize | |
56 * \param data the image content | |
57 * \param datasz the image content length | |
58 * \return 0 on success or any error code instead | |
59 */ | |
33 int | 60 int |
34 mlk_image_openmem(struct mlk_texture *, const void *, size_t); | 61 mlk_image_openmem(struct mlk_texture *texture, const void *data, size_t datasz); |
35 | 62 |
36 #if defined(__cplusplus) | 63 #if defined(__cplusplus) |
37 } | 64 } |
38 #endif | 65 #endif |
39 | 66 |