Skip to content

Commit

Permalink
Allow live-update to work even if import button hasn't been pressed. …
Browse files Browse the repository at this point in the history
…Added raw import test images for various pixel formats, with and without multiple surfaces and mipmaps. Both HDR (lRGB) and LDR (sRGB) examples were included and tested.
  • Loading branch information
bluescan committed Jul 1, 2024
1 parent 24bb59a commit ee73529
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Src/ImportRaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,17 @@ bool Viewer::ShowImportRawOverlay(bool* popen, bool justOpened)
"order set this checkbox to true."
);

if (!ImportRaw::ImportedDstFile.IsValid())
Gutil::PushDisable();
ImGui::SetNextItemWidth(itemWidth);
ImGui::Checkbox("Live Updates", &profile.ImportRawLiveUpdate);
if (!ImportRaw::ImportedDstFile.IsValid())
Gutil::PopDisable();
if (ImGui::Checkbox("Live Updates", &profile.ImportRawLiveUpdate))
{
// If turned it on need an immediate update.
if (profile.ImportRawLiveUpdate) liveUpdated = true;
}
ImGui::SameLine();
Gutil::HelpMark
(
"Automatically re-import on any change. This can be slow as the entire raw\n"
"input file is re-parsed, decoded, saved, and re-bound for display. This\n"
"option is only available after you have successfully imported at least once."
"input file is read, parsed, decoded, saved, and re-bound for display."
);

Gutil::Separator();
Expand Down Expand Up @@ -333,7 +332,11 @@ bool Viewer::ShowImportRawOverlay(bool* popen, bool justOpened)

tString resultText;
tsPrintf(resultText, "Import Result: %s", importResultMessage.IsEmpty() ? "None" : importResultMessage.Chr());
if (importResultMessage.IsValid() && (importResultMessage != "Success"))
ImGui::PushStyleColor(ImGuiCol_Text, tVector4(1.0f, 0.3f, 0.31f, 1.0f) );
ImGui::Text(resultText.Chr());
if (importResultMessage.IsValid() && (importResultMessage != "Success"))
ImGui::PopStyleColor();

tString previewModeText;
if (profile.ImportRawFilename.IsValid() && ImportRaw::ImportedDstFile.IsValid())
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions TestImages/RawImport/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Raw pixel data file names follow the convention:
PixelFormat_WidthxHeight_ColourSpace_Offset_RowOrder_SurfOrMipCount

ColourSpace may be sRGB or lRGB.
Offset is ONN where NN is the offset count in bytes.
RowOrder is NR for no row-reversal and RR for row reversal.
SurfOfMipCount is SNN for surfaces and MNN for mipmaps. NN is count.

0 comments on commit ee73529

Please sign in to comment.