2020-11-12 09:38:52 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2022-08-17 16:15:36 +02:00
|
|
|
#include <hex/api/task.hpp>
|
2020-11-12 09:38:52 +01:00
|
|
|
|
|
|
|
#include <array>
|
2021-12-12 00:41:44 +01:00
|
|
|
#include <atomic>
|
2020-11-12 09:38:52 +01:00
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2021-12-07 22:47:41 +01:00
|
|
|
namespace hex::plugin::builtin {
|
2020-11-12 09:38:52 +01:00
|
|
|
|
|
|
|
class ViewInformation : public View {
|
|
|
|
public:
|
2020-12-27 15:39:06 +01:00
|
|
|
explicit ViewInformation();
|
2020-11-12 09:38:52 +01:00
|
|
|
~ViewInformation() override;
|
|
|
|
|
2020-12-22 18:10:01 +01:00
|
|
|
void drawContent() override;
|
2020-11-12 09:38:52 +01:00
|
|
|
|
|
|
|
private:
|
2022-02-01 22:09:44 +01:00
|
|
|
bool m_dataValid = false;
|
|
|
|
u32 m_blockSize = 0;
|
|
|
|
float m_averageEntropy = 0;
|
2020-11-12 09:38:52 +01:00
|
|
|
float m_highestBlockEntropy = 0;
|
|
|
|
std::vector<float> m_blockEntropy;
|
|
|
|
|
2021-04-12 22:20:05 +02:00
|
|
|
double m_entropyHandlePosition;
|
|
|
|
|
2021-03-02 14:32:18 +01:00
|
|
|
std::array<ImU64, 256> m_valueCounts = { 0 };
|
2022-08-17 16:15:36 +02:00
|
|
|
TaskHolder m_analyzerTask;
|
2020-11-22 19:43:35 +01:00
|
|
|
|
2022-07-31 16:57:35 +02:00
|
|
|
Region m_analyzedRegion = { 0, 0 };
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2022-07-31 16:57:35 +02:00
|
|
|
std::string m_dataDescription;
|
|
|
|
std::string m_dataMimeType;
|
2021-02-22 13:08:06 +01:00
|
|
|
|
|
|
|
void analyze();
|
2020-11-12 09:38:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|