1
0
mirror of synced 2025-02-15 18:12:39 +01:00

fix: RGBA8 data processor node not working correctly

This commit is contained in:
WerWolv 2025-02-09 23:38:35 +01:00
parent ea3d4b41a9
commit 3a7578879f

View File

@ -320,7 +320,7 @@ namespace hex::plugin::builtin {
void drawNode() override {
if (!m_texture.isValid() && !m_data.empty()) {
m_texture = ImGuiExt::Texture::fromImage(m_data.data(), m_data.size(), ImGuiExt::Texture::Filter::Nearest);
m_texture = ImGuiExt::Texture::fromBitmap(m_data.data(), m_data.size(), m_width, m_height, ImGuiExt::Texture::Filter::Nearest);
}
ImGui::Image(m_texture, scaled(ImVec2(m_texture.getAspectRatio() * 200, 200)));
@ -343,12 +343,15 @@ namespace hex::plugin::builtin {
throwNodeError(hex::format("Image requires at least {} bytes of data, but only {} bytes are available", requiredBytes, rawData.size()));
m_data = rawData;
m_width = width;
m_height = height;
m_texture.reset();
}
private:
std::vector<u8> m_data;
ImGuiExt::Texture m_texture;
u32 m_width, m_height;
};
class NodeVisualizerByteDistribution : public dp::Node {