mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-06-08 02:05:56 +02:00
update stb lib
This commit is contained in:
parent
31e500f4e3
commit
f4d9f23ac6
6 changed files with 12180 additions and 3993 deletions
|
@ -23,6 +23,7 @@
|
||||||
#define STBI_ONLY_JPEG
|
#define STBI_ONLY_JPEG
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
#define STBI_WINDOWS_UTF8
|
#define STBI_WINDOWS_UTF8
|
||||||
|
#define STBIW_WINDOWS_UTF8
|
||||||
#endif
|
#endif
|
||||||
#include "stb/stb_image.h"
|
#include "stb/stb_image.h"
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
#include "stb/stb_image_write.h"
|
#include "stb/stb_image_write.h"
|
||||||
|
|
||||||
#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
||||||
#include "stb/stb_image_resize.h"
|
#include "stb/stb_image_resize2.h"
|
||||||
|
|
||||||
struct File_Data {
|
struct File_Data {
|
||||||
std::string name{};
|
std::string name{};
|
||||||
|
@ -883,13 +884,13 @@ std::string Local_Storage::load_image_resized(std::string const& image_path, std
|
||||||
PRINT_DEBUG("stbi_load('%s') -> %s", image_path.c_str(), (img == nullptr ? stbi_failure_reason() : "loaded"));
|
PRINT_DEBUG("stbi_load('%s') -> %s", image_path.c_str(), (img == nullptr ? stbi_failure_reason() : "loaded"));
|
||||||
if (img != nullptr) {
|
if (img != nullptr) {
|
||||||
std::vector<char> out_resized(resized_img_size);
|
std::vector<char> out_resized(resized_img_size);
|
||||||
stbir_resize_uint8(img, width, height, 0, (unsigned char*)&out_resized[0], resolution, resolution, 0, 4);
|
stbir_resize_uint8_linear(img, width, height, 0, (unsigned char*)&out_resized[0], resolution, resolution, 0, STBIR_RGBA);
|
||||||
resized_image = std::string((char*)&out_resized[0], out_resized.size());
|
resized_image = std::string((char*)&out_resized[0], out_resized.size());
|
||||||
stbi_image_free(img);
|
stbi_image_free(img);
|
||||||
}
|
}
|
||||||
} else if (image_data.length() > 0) {
|
} else if (image_data.length() > 0) {
|
||||||
std::vector<char> out_resized(resized_img_size);
|
std::vector<char> out_resized(resized_img_size);
|
||||||
stbir_resize_uint8((unsigned char*)image_data.c_str(), 184, 184, 0, (unsigned char*)&out_resized[0], resolution, resolution, 0, 4);
|
stbir_resize_uint8_linear((unsigned char*)image_data.c_str(), 184, 184, 0, (unsigned char*)&out_resized[0], resolution, resolution, 0, STBIR_RGBA);
|
||||||
resized_image = std::string((char*)&out_resized[0], out_resized.size());
|
resized_image = std::string((char*)&out_resized[0], out_resized.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
============================================================================ INFO
|
||||||
|
https://github.com/nothings/stb
|
||||||
|
|
||||||
|
VERSION: https://github.com/nothings/stb/tree/f75e8d1cad7d90d72ef7a4661f1b994ef78b4e31
|
||||||
|
|
||||||
|
============================================================================ LICENSE MIT / PUBLIC DOMAIN
|
||||||
This software is available under 2 licenses -- choose whichever you prefer.
|
This software is available under 2 licenses -- choose whichever you prefer.
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
ALTERNATIVE A - MIT License
|
ALTERNATIVE A - MIT License
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
10572
libs/stb/stb_image_resize2.h
Normal file
10572
libs/stb/stb_image_resize2.h
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue