From cc64dee592cf03113a88d5b7c87f9f1aa6d313f9 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 10 Mar 2022 15:33:07 +0100 Subject: [PATCH] Added a new helper method to image. --- core/image/image.cpp | 3 +++ core/image/image.h | 1 + 2 files changed, 4 insertions(+) diff --git a/core/image/image.cpp b/core/image/image.cpp index 74d5e2b..7f38daa 100644 --- a/core/image/image.cpp +++ b/core/image/image.cpp @@ -1685,6 +1685,9 @@ const uint8_t *Image::datar() const { uint8_t *Image::dataw() { return data.dataw(); } +int Image::get_data_size() const { + return data.size(); +} void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format) { ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0."); diff --git a/core/image/image.h b/core/image/image.h index 8585bdd..1958fc3 100644 --- a/core/image/image.h +++ b/core/image/image.h @@ -212,6 +212,7 @@ public: Vector get_data() const; const uint8_t* datar() const; uint8_t* dataw(); + int get_data_size() const; Image(); Image(int p_width, int p_height, bool p_use_mipmaps, Format p_format);