diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-15 12:56:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-15 12:56:57 +0200 |
commit | dc4b6165962536b53c4c1471fcf0be43c70e2335 (patch) | |
tree | e1b4b31cf0422121c9d140b3f8e37a0856bedfe6 /core/io/image.h | |
parent | 2942951a29ba22fe44ea7474ae25ca0f2c2d7c13 (diff) | |
parent | 072f6feabac70a6c4ed1a16f4e983bf31ad62d50 (diff) |
Merge pull request #63332 from KoBeWi/static_images_aka_photos
Make some Image methods static
Diffstat (limited to 'core/io/image.h')
-rw-r--r-- | core/io/image.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/core/io/image.h b/core/io/image.h index fd264a7a38..194ee05bc7 100644 --- a/core/io/image.h +++ b/core/io/image.h @@ -279,12 +279,12 @@ public: void normalize(); //for normal maps /** - * Create a new image of a given size and format. Current image will be lost + * Creates new internal image data of a given size and format. Current image will be lost. */ - void create(int p_width, int p_height, bool p_use_mipmaps, Format p_format); - void create(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const Vector<uint8_t> &p_data); + void initialize_data(int p_width, int p_height, bool p_use_mipmaps, Format p_format); + void initialize_data(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const Vector<uint8_t> &p_data); + void initialize_data(const char **p_xpm); - void create(const char **p_xpm); /** * returns true when the image is empty (0,0) in size */ @@ -303,13 +303,9 @@ public: Error save_webp(const String &p_path, const bool p_lossy = false, const float p_quality = 0.75f) const; Vector<uint8_t> save_webp_to_buffer(const bool p_lossy = false, const float p_quality = 0.75f) const; - void create_empty(int p_width, int p_height, bool p_use_mipmaps, Format p_format) { - create(p_width, p_height, p_use_mipmaps, p_format); - } - - void create_from_data(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const Vector<uint8_t> &p_data) { - create(p_width, p_height, p_use_mipmaps, p_format, p_data); - } + static Ref<Image> create_empty(int p_width, int p_height, bool p_use_mipmaps, Format p_format); + static Ref<Image> create_from_data(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const Vector<uint8_t> &p_data); + void set_data(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const Vector<uint8_t> &p_data); /** * create an empty image |