aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/image.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-05 21:38:20 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-05 21:38:20 +0100
commite2e7c0bf0747d55967c4be6374f3611cd96babb6 (patch)
tree7267f2086526ac780f57998ff93bae72266e8ddb /src/graphics/image.c
parentccb3e58071b3e807109918184727b305df8b96a0 (diff)
Add bounds calculation to text
Diffstat (limited to 'src/graphics/image.c')
-rw-r--r--src/graphics/image.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/graphics/image.c b/src/graphics/image.c
index 9934b42..0a6a88a 100644
--- a/src/graphics/image.c
+++ b/src/graphics/image.c
@@ -88,6 +88,10 @@ void mgl_image_unload(mgl_image *self) {
self->format = 0;
}
-size_t mgl_image_get_size(mgl_image *self) {
+size_t mgl_image_get_size(const mgl_image *self) {
return (size_t)self->width * (size_t)self->height * mgl_image_format_num_channels(self->format);
}
+
+int mgl_image_get_num_channels(const mgl_image *self) {
+ return mgl_image_format_num_channels(self->format);
+}