mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
nodes: Added Image visualizer
Supports JPG, PNG, TGA, BMP, PSD, GIF, HDR and PIC via stb_image
This commit is contained in:
@@ -29,8 +29,8 @@ enum ImGuiCustomCol {
|
||||
namespace ImGui {
|
||||
|
||||
struct Texture {
|
||||
ImTextureID textureId;
|
||||
int width, height;
|
||||
ImTextureID textureId = nullptr;
|
||||
int width = 0, height = 0;
|
||||
|
||||
[[nodiscard]] constexpr bool valid() const noexcept {
|
||||
return this->textureId != nullptr;
|
||||
@@ -43,6 +43,12 @@ namespace ImGui {
|
||||
[[nodiscard]] auto size() const noexcept {
|
||||
return ImVec2(this->width, this->height);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr auto aspectRatio() const noexcept {
|
||||
if (this->height == 0) return 1.0F;
|
||||
|
||||
return float(this->width) / float(this->height);
|
||||
}
|
||||
};
|
||||
|
||||
int UpdateStringSizeCallback(ImGuiInputTextCallbackData *data);
|
||||
|
||||
Reference in New Issue
Block a user