diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-10-21 09:50:44 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-10-21 09:50:44 -0300 |
commit | b59c86f6f953ce6957bccbcc1ec6f3ce4c55572d (patch) | |
tree | 39a74205feb03436beacf8c4dcf9d4fd70f2e344 /core/image.cpp | |
parent | f6a790d58c596773466437140f6d7e2a6a29e5e7 (diff) | |
download | redot-engine-b59c86f6f953ce6957bccbcc1ec6f3ce4c55572d.tar.gz |
-Ability to debug video memory usage
-Small fix to xml saver (swapping > and <)
Diffstat (limited to 'core/image.cpp')
-rw-r--r-- | core/image.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp index 4c0a23492b..06b7a78488 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -34,6 +34,33 @@ #include "print_string.h" #include <stdio.h> + +const char* Image::format_names[Image::FORMAT_MAX]={ + "Grayscale", + "Intensity", + "GrayscaleAlpha", + "RGB", + "RGBA", + "Indexed", + "IndexedAlpha", + "YUV422", + "YUV444", + "BC1", + "BC2", + "BC3", + "BC4", + "BC5", + "PVRTC2", + "PVRTC2Alpha", + "PVRTC4", + "PVRTC4Alpha", + "ETC", + "ATC", + "ATCAlphaExp", + "ATCAlphaInterp", + +}; + SavePNGFunc Image::save_png_func = NULL; void Image::_put_pixel(int p_x,int p_y, const BColor& p_color, unsigned char *p_data) { @@ -2355,6 +2382,12 @@ void Image::fix_alpha_edges() { } +String Image::get_format_name(Format p_format) { + + ERR_FAIL_INDEX_V(p_format,FORMAT_MAX,String()); + return format_names[p_format]; +} + Image::Image(const uint8_t* p_png,int p_len) { width=0; |