feat: Added RGB565 color row to data inspector
This commit is contained in:
parent
3859336f0c
commit
bed9f324ce
@ -539,6 +539,20 @@ namespace hex::plugin::builtin {
|
||||
return copyValue;
|
||||
};
|
||||
});
|
||||
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.rgb565", sizeof(u16), [](auto buffer, auto endian, auto style) {
|
||||
hex::unused(style);
|
||||
|
||||
auto value = hex::changeEndianess(*reinterpret_cast<u16 *>(buffer.data()), endian);
|
||||
ImColor color((value & 0x1F) << 3, ((value >> 5) & 0x3F) << 2, ((value >> 11) & 0x1F) << 3, 0xFF);
|
||||
|
||||
auto copyValue = hex::format("#{:02X}{:02X}{:02X}", u8(0xFF * (color.Value.x)), u8(0xFF * (color.Value.y)), u8(0xFF * (color.Value.z)), 0xFF);
|
||||
|
||||
return [color, copyValue] {
|
||||
ImGui::ColorButton("##inspectorColor", color, ImGuiColorEditFlags_None, ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetTextLineHeight()));
|
||||
return copyValue;
|
||||
};
|
||||
});
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
|
@ -440,6 +440,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.inspector.dos_time", "DOS Time" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 Farbe" },
|
||||
{ "hex.builtin.inspector.rgb565", "RGB565 Farbe" },
|
||||
|
||||
{ "hex.builtin.nodes.common.input", "Input" },
|
||||
{ "hex.builtin.nodes.common.input.a", "Input A" },
|
||||
|
@ -444,7 +444,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.inspector.dos_date", "DOS Date" },
|
||||
{ "hex.builtin.inspector.dos_time", "DOS Time" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 color" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 Color" },
|
||||
{ "hex.builtin.inspector.rgb565", "RGB565 Color" },
|
||||
|
||||
{ "hex.builtin.nodes.common.input", "Input" },
|
||||
{ "hex.builtin.nodes.common.input.a", "Input A" },
|
||||
|
@ -443,6 +443,7 @@ namespace hex::plugin::builtin {
|
||||
//{ "hex.builtin.inspector.dos_time", "DOS Time" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "Colori RGBA8" },
|
||||
{ "hex.builtin.inspector.rgb565", "Colori RGB565" },
|
||||
|
||||
{ "hex.builtin.nodes.constants", "Costanti" },
|
||||
{ "hex.builtin.nodes.constants.int", "Intero" },
|
||||
|
@ -443,7 +443,8 @@ namespace hex::plugin::builtin {
|
||||
//{ "hex.builtin.inspector.dos_date", "DOS Date" },
|
||||
//{ "hex.builtin.inspector.dos_time", "DOS Time" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 color" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 Color" },
|
||||
{ "hex.builtin.inspector.rgb565", "RGB565 Color" },
|
||||
|
||||
{ "hex.builtin.nodes.common.input", "入力" },
|
||||
{ "hex.builtin.nodes.common.input.a", "入力 A" },
|
||||
|
@ -440,7 +440,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.inspector.dos_date", "DOS Date" },
|
||||
{ "hex.builtin.inspector.dos_time", "DOS Time" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 color" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 Color" },
|
||||
{ "hex.builtin.inspector.rgb565", "RGB565 Color" },
|
||||
|
||||
{ "hex.builtin.nodes.common.input", "Input" },
|
||||
{ "hex.builtin.nodes.common.input.a", "Input A" },
|
||||
|
@ -445,6 +445,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.inspector.dos_time", "DOS 时间" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 颜色" },
|
||||
{ "hex.builtin.inspector.rgb565", "RGB565 颜色" },
|
||||
|
||||
{ "hex.builtin.nodes.common.input", "输入" },
|
||||
{ "hex.builtin.nodes.common.input.a", "输入 A" },
|
||||
|
@ -442,6 +442,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.inspector.dos_time", "DOS 時間" },
|
||||
{ "hex.builtin.inspector.guid", "GUID" },
|
||||
{ "hex.builtin.inspector.rgba8", "RGBA8 顏色" },
|
||||
{ "hex.builtin.inspector.rgb565", "RGB565 顏色" },
|
||||
|
||||
{ "hex.builtin.nodes.common.input", "輸入" },
|
||||
{ "hex.builtin.nodes.common.input.a", "輸入 A" },
|
||||
|
Loading…
Reference in New Issue
Block a user