#include #include #include #include #include namespace hex::plugin::builtin { void drawChunkBasedEntropyVisualizer(pl::ptrn::Pattern &, pl::ptrn::IIterable &, bool shouldReset, std::span arguments) { // Variable used to store the result to avoid having to recalculate the result at each frame static DiagramChunkBasedEntropyAnalysis analyzer; // Compute data if (shouldReset) { auto pattern = arguments[0].toPattern(); auto chunkSize = arguments[1].toUnsigned(); analyzer.process(pattern->getBytes(), chunkSize); } // Show results analyzer.draw(ImVec2(400, 250), ImPlotFlags_CanvasOnly); } }