Skip to content

Commit ad327e3

Browse files
committed
Expose get_format_name
1 parent 53be3b7 commit ad327e3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

core/io/image.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,6 +3520,7 @@ void Image::_bind_methods() {
35203520
ClassDB::bind_method(D_METHOD("get_size"), &Image::get_size);
35213521
ClassDB::bind_method(D_METHOD("has_mipmaps"), &Image::has_mipmaps);
35223522
ClassDB::bind_method(D_METHOD("get_format"), &Image::get_format);
3523+
ClassDB::bind_static_method("Image", D_METHOD("get_format_name", "format"), &Image::get_format_name);
35233524
ClassDB::bind_method(D_METHOD("get_data"), &Image::get_data);
35243525
ClassDB::bind_method(D_METHOD("get_data_size"), &Image::get_data_size);
35253526

doc/classes/Image.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@
237237
Returns this image's format.
238238
</description>
239239
</method>
240+
<method name="get_format_name" qualifiers="static">
241+
<return type="String" />
242+
<param index="0" name="format" type="int" enum="Image.Format" />
243+
<description>
244+
Returns the name of the image format specified by [param format]. The returned string corresponds to the [constant FORMAT_*] constants.
245+
</description>
246+
</method>
240247
<method name="get_height" qualifiers="const">
241248
<return type="int" />
242249
<description>

0 commit comments

Comments
 (0)