2020-11-12 09:38:52 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/views/view.hpp>
|
2020-11-12 09:38:52 +01:00
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
namespace prv { class Provider; }
|
|
|
|
|
|
|
|
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;
|
|
|
|
void drawMenu() override;
|
2020-11-12 09:38:52 +01:00
|
|
|
|
|
|
|
private:
|
2020-11-22 19:43:35 +01:00
|
|
|
bool m_dataValid = false;
|
2020-11-14 14:41:15 +01:00
|
|
|
u32 m_blockSize = 0;
|
2020-11-12 09:38:52 +01:00
|
|
|
float m_averageEntropy = 0;
|
|
|
|
float m_highestBlockEntropy = 0;
|
|
|
|
std::vector<float> m_blockEntropy;
|
|
|
|
|
|
|
|
std::array<float, 256> m_valueCounts = { 0 };
|
2021-02-22 13:08:06 +01:00
|
|
|
bool m_analyzing = false;
|
2020-11-22 19:43:35 +01:00
|
|
|
|
|
|
|
std::pair<u64, u64> m_analyzedRegion = { 0, 0 };
|
2020-11-12 09:38:52 +01:00
|
|
|
|
|
|
|
std::string m_fileDescription;
|
|
|
|
std::string m_mimeType;
|
2021-02-22 13:08:06 +01:00
|
|
|
|
|
|
|
void analyze();
|
2020-11-12 09:38:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|