HostDisplay: Support resizing/compressing images on worker thread

This commit is contained in:
Connor McLaughlin
2020-11-26 22:40:58 +10:00
parent df14fa4d75
commit 125dfa7c40
2 changed files with 48 additions and 27 deletions

View File

@ -195,10 +195,12 @@ public:
/// Helper function to save texture data to a PNG. If flip_y is set, the image will be flipped aka OpenGL.
bool WriteTextureToFile(const void* texture_handle, u32 x, u32 y, u32 width, u32 height, const char* filename,
bool clear_alpha = true, bool flip_y = false, u32 resize_width = 0, u32 resize_height = 0);
bool clear_alpha = true, bool flip_y = false, u32 resize_width = 0, u32 resize_height = 0,
bool compress_on_thread = false);
/// Helper function to save current display texture to PNG.
bool WriteDisplayTextureToFile(const char* filename, bool full_resolution = true, bool apply_aspect_ratio = true);
bool WriteDisplayTextureToFile(const char* filename, bool full_resolution = true, bool apply_aspect_ratio = true,
bool compress_on_thread = false);
/// Helper function to save current display texture to a buffer.
bool WriteDisplayTextureToBuffer(std::vector<u32>* buffer, u32 resize_width = 0, u32 resize_height = 0,