Skip to content

Commit cd9067b

Browse files
committed
Update version bitness logic and improve About dialog
1 parent 348d8cc commit cd9067b

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ list(APPEND CMD "-D" "CMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}")
126126
list(APPEND CMD "-D" "CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
127127
list(APPEND CMD "-D" "EMSCRIPTEN=${EMSCRIPTEN}")
128128
list(APPEND CMD "-D" "HDRVIEW_TARGET_ARCH=${HDRVIEW_TARGET_ARCH}")
129-
list(APPEND CMD "-D" "HDRVIEW_BITNESS=${HDRVIEW_BITNESS}")
130129
list(APPEND CMD "-P" "${CMAKE_SOURCE_DIR}/cmake/generate_version.cmake")
131130
add_custom_command(
132131
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp ${CMAKE_CURRENT_BINARY_DIR}/src/_version.cpp

cmake/generate_version.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ set(VERSION_PATCH ${version_patch})
132132
string(TIMESTAMP BUILD_TIME "%Y-%m-%d %H:%M")
133133
message(STATUS "Saving build timestamp: ${BUILD_TIME}")
134134

135-
set(VERSION_LONG "${GIT_DESCRIBE} (${HDRVIEW_BITNESS} bit)")
135+
# Multiply CMAKE_SIZEOF_VOID_P by 8 to get the bitness
136+
math(EXPR BITNESS "${CMAKE_SIZEOF_VOID_P} * 8")
137+
set(VERSION_LONG "${GIT_DESCRIBE} (${BITNESS} bit)")
136138

137139
configure_file("${SRC_DIR}/version.cpp.in" "${BIN_DIR}/version.cpp" @ONLY)

src/app-gui.cpp

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,27 +1101,36 @@ void HDRViewApp::draw_about_dialog(bool &open)
11011101
platform_backend, renderer_backend);
11021102
ImGui::PopFont();
11031103
ImGui::PopTextWrapPos();
1104+
1105+
ImGui::Spacing();
1106+
1107+
{
1108+
ImGui::PushTextWrapPos(0.f);
1109+
ImGui::PushFont(m_sans_bold, ImGui::GetStyle().FontSizeBase * 16.f / 14.f);
1110+
ImGui::TextUnformatted(
1111+
"HDRView is a simple research-oriented tool for examining, comparing, manipulating, and "
1112+
"converting high-dynamic range images.");
1113+
ImGui::PopFont();
1114+
1115+
ImGui::PopTextWrapPos();
1116+
}
1117+
1118+
ImGui::Spacing();
1119+
11041120
ImGui::EndTable();
11051121
}
11061122

11071123
ImGui::Spacing();
11081124

11091125
{
11101126
ImGui::PushTextWrapPos(0.f);
1111-
ImGui::PushFont(m_sans_bold, ImGui::GetStyle().FontSizeBase * 16.f / 14.f);
1112-
ImGui::TextUnformatted(
1113-
"HDRView is a simple research-oriented tool for examining, comparing, manipulating, and "
1114-
"converting high-dynamic range images.");
1115-
ImGui::PopFont();
1116-
1117-
ImGui::Spacing();
1118-
11191127
ImGui::TextUnformatted(
11201128
"It is developed by Wojciech Jarosz, and is available under a 3-clause BSD license.");
11211129
ImGui::PopTextWrapPos();
11221130
}
11231131

1124-
// #if 0
1132+
ImGui::Spacing();
1133+
11251134
if (ImGui::BeginTabBar("AboutTabBar"))
11261135
{
11271136
if (ImGui::BeginTabItem("Keybindings", nullptr))
@@ -1180,6 +1189,8 @@ void HDRViewApp::draw_about_dialog(bool &open)
11801189
#endif
11811190
ImGui::PopFont();
11821191

1192+
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 2));
1193+
11831194
if (ImGui::PE::Begin("about_table2", 0))
11841195
{
11851196
ImGui::TableSetupColumn("one", ImGuiTableColumnFlags_WidthFixed, col_width);
@@ -1263,11 +1274,14 @@ void HDRViewApp::draw_about_dialog(bool &open)
12631274

12641275
ImGui::PE::End();
12651276
}
1277+
1278+
ImGui::PopStyleVar();
12661279
ImGui::PopTextWrapPos();
12671280
ImGui::EndChild();
12681281
ImGui::PopStyleColor();
12691282
ImGui::EndTabItem();
12701283
}
1284+
12711285
if (ImGui::BeginTabItem("Build info"))
12721286
{
12731287
// Build the info text string for display and clipboard
@@ -1417,7 +1431,6 @@ void HDRViewApp::draw_about_dialog(bool &open)
14171431
}
14181432
ImGui::EndTabBar();
14191433
}
1420-
// #endif
14211434

14221435
if (ImGui::Button("Dismiss", EmToVec2(8.f, 0.f)) || ImGui::Shortcut(ImGuiKey_Escape) ||
14231436
ImGui::Shortcut(ImGuiKey_Enter) || ImGui::Shortcut(ImGuiKey_Space) ||

src/image-gui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void Image::draw_info()
580580

581581
float w = ImGui::GetContentRegionAvail().x - 1.f * (button_size.x + ImGui::GetStyle().ItemSpacing.x);
582582

583-
static bool expand_to_listbox = true;
583+
static bool expand_to_listbox = false;
584584

585585
auto show_view_options = [&]()
586586
{

src/imageio/stb.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,6 @@ vector<ImagePtr> load_stb_image(istream &is, const string_view filename, const I
367367
for (int c = 0; c < size.z; ++c)
368368
image->channels[c].copy_from_interleaved(float_pixels.data(), size.x, size.y, size.z, c,
369369
[](float v) { return v; });
370-
371-
// // then apply transfer function
372-
// int num_color_channels = size.z >= 3 ? 3 : 1;
373-
// to_linear(image->channels[0].data(), size.z > 1 ? image->channels[1].data() : nullptr,
374-
// size.z > 2 ? image->channels[2].data() : nullptr, size.x * size.y, num_color_channels, tf, 1);
375370
}
376371
spdlog::debug("Copying image channels took: {} seconds.", (timer.elapsed() / 1000.f));
377372

0 commit comments

Comments
 (0)