Skip to content

Commit

Permalink
Image Compare: Make it possible to change the blink interval and over…
Browse files Browse the repository at this point in the history
…lay animation interval.
  • Loading branch information
sdottaka committed Jul 23, 2024
1 parent 5c6abac commit 70f6019
Show file tree
Hide file tree
Showing 49 changed files with 454 additions and 8 deletions.
8 changes: 4 additions & 4 deletions DownloadDeps.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2
https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.14-x64.zip!Build\x64\Release ^
https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.14-ARM.zip!Build\ARM\Release ^
https://github.com/WinMerge/frhed/releases/download/0.10904.2017/frhed-0.10904.2017.14-ARM64.zip!Build\ARM64\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.44/winimerge-1.0.44.0-x86.zip!Build\x86\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.44/winimerge-1.0.44.0-x64.zip!Build\x64\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.44/winimerge-1.0.44.0-ARM.zip!Build\ARM\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.44/winimerge-1.0.44.0-ARM64.zip!Build\ARM64\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.45/winimerge-1.0.45.0-x86.zip!Build\x86\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.45/winimerge-1.0.45.0-x64.zip!Build\x64\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.45/winimerge-1.0.45.0-ARM.zip!Build\ARM\Release ^
https://github.com/WinMerge/winimerge/releases/download/v1.0.45/winimerge-1.0.45.0-ARM64.zip!Build\ARM64\Release ^
https://github.com/WinMerge/winwebdiff/releases/download/v1.0.15/winwebdiff-1.0.15.0-x86.zip!Build\x86\Release ^
https://github.com/WinMerge/winwebdiff/releases/download/v1.0.15/winwebdiff-1.0.15.0-x64.zip!Build\x64\Release ^
https://github.com/WinMerge/winwebdiff/releases/download/v1.0.15/winwebdiff-1.0.15.0-ARM64.zip!Build\ARM64\Release ^
Expand Down
2 changes: 1 addition & 1 deletion Externals/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This file lists versions of the external components we are using.
- POCO: 1.13.3
- boost: 1.85.0
- frhed: 0.10904.2017.14
- WinIMerge: 1.0.44.0
- WinIMerge: 1.0.45.0
- freeimage: 3.18.0
- LibXDiff: 611e42a on Nov 2, 2018 (https://github.com/git/git/tree/master/xdiff)
- WinWebDiff: 1.0.15.0
Expand Down
32 changes: 32 additions & 0 deletions Src/ImgMergeFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#define new DEBUG_NEW
#endif

static const int INTERVALS[] = { 200, 400, 600, 800, 1000, 1200, 1500, 2000, 3000, 4000 };

/////////////////////////////////////////////////////////////////////////////
// CImgMergeFrame

Expand Down Expand Up @@ -157,6 +159,10 @@ BEGIN_MESSAGE_MAP(CImgMergeFrame, CMergeFrameCommon)
ON_UPDATE_COMMAND_UI(ID_IMG_USEBACKCOLOR, OnUpdateImgUseBackColor)
ON_COMMAND_RANGE(ID_IMG_VECTORIMAGESCALING_25, ID_IMG_VECTORIMAGESCALING_800, OnImgVectorImageScaling)
ON_UPDATE_COMMAND_UI_RANGE(ID_IMG_VECTORIMAGESCALING_25, ID_IMG_VECTORIMAGESCALING_800, OnUpdateImgVectorImageScaling)
ON_COMMAND_RANGE(ID_IMG_BLINKINTERVAL_200, ID_IMG_BLINKINTERVAL_4000, OnImgBlinkInterval)
ON_UPDATE_COMMAND_UI_RANGE(ID_IMG_BLINKINTERVAL_200, ID_IMG_BLINKINTERVAL_4000, OnUpdateImgBlinkInterval)
ON_COMMAND_RANGE(ID_IMG_OVERLAYANIMINTERVAL_200, ID_IMG_OVERLAYANIMINTERVAL_4000, OnImgOverlayAnimationInterval)
ON_UPDATE_COMMAND_UI_RANGE(ID_IMG_OVERLAYANIMINTERVAL_200, ID_IMG_OVERLAYANIMINTERVAL_4000, OnUpdateImgOverlayAnimationInterval)
ON_COMMAND(ID_IMG_COMPARE_EXTRACTED_TEXT, OnImgCompareExtractedText)
// [Tools] menu
ON_COMMAND(ID_TOOLS_GENERATEREPORT, OnToolsGenerateReport)
Expand Down Expand Up @@ -646,6 +652,8 @@ void CImgMergeFrame::LoadOptions()
m_pImgMergeWindow->SetColorDistanceThreshold(GetOptionsMgr()->GetInt(OPT_CMP_IMG_THRESHOLD) / 1000.0);
m_pImgMergeWindow->SetInsertionDeletionDetectionMode(static_cast<IImgMergeWindow::INSERTION_DELETION_DETECTION_MODE>(GetOptionsMgr()->GetInt(OPT_CMP_IMG_INSERTIONDELETIONDETECTION_MODE)));
m_pImgMergeWindow->SetVectorImageZoomRatio(GetOptionsMgr()->GetInt(OPT_CMP_IMG_VECTOR_IMAGE_ZOOM_RATIO) / 1000.0f);
m_pImgMergeWindow->SetBlinkInterval(GetOptionsMgr()->GetInt(OPT_CMP_IMG_BLINKINTERVAL));
m_pImgMergeWindow->SetOverlayAnimationInterval(GetOptionsMgr()->GetInt(OPT_CMP_IMG_OVERLAYANIMATIONINTERVAL));
}

void CImgMergeFrame::SaveOptions()
Expand All @@ -663,6 +671,8 @@ void CImgMergeFrame::SaveOptions()
GetOptionsMgr()->SaveOption(OPT_CMP_IMG_THRESHOLD, static_cast<int>(m_pImgMergeWindow->GetColorDistanceThreshold() * 1000));
GetOptionsMgr()->SaveOption(OPT_CMP_IMG_INSERTIONDELETIONDETECTION_MODE, static_cast<int>(m_pImgMergeWindow->GetInsertionDeletionDetectionMode()));
GetOptionsMgr()->SaveOption(OPT_CMP_IMG_VECTOR_IMAGE_ZOOM_RATIO, static_cast<int>(m_pImgMergeWindow->GetVectorImageZoomRatio() * 1000));
GetOptionsMgr()->SaveOption(OPT_CMP_IMG_BLINKINTERVAL, m_pImgMergeWindow->GetBlinkInterval());
GetOptionsMgr()->SaveOption(OPT_CMP_IMG_OVERLAYANIMATIONINTERVAL, m_pImgMergeWindow->GetOverlayAnimationInterval());
}
/**
* @brief Save coordinates of the frame, splitters, and bars
Expand Down Expand Up @@ -2194,6 +2204,28 @@ void CImgMergeFrame::OnUpdateImgVectorImageScaling(CCmdUI* pCmdUI)
pCmdUI->SetRadio(pow(2.0, int(pCmdUI->m_nID - ID_IMG_VECTORIMAGESCALING_100)) == m_pImgMergeWindow->GetVectorImageZoomRatio());
}

void CImgMergeFrame::OnImgBlinkInterval(UINT nId)
{
m_pImgMergeWindow->SetBlinkInterval(INTERVALS[nId - ID_IMG_BLINKINTERVAL_200]);
SaveOptions();
}

void CImgMergeFrame::OnUpdateImgBlinkInterval(CCmdUI* pCmdUI)
{
pCmdUI->SetRadio(INTERVALS[pCmdUI->m_nID - ID_IMG_BLINKINTERVAL_200] == m_pImgMergeWindow->GetBlinkInterval());
}

void CImgMergeFrame::OnImgOverlayAnimationInterval(UINT nId)
{
m_pImgMergeWindow->SetOverlayAnimationInterval(INTERVALS[nId - ID_IMG_OVERLAYANIMINTERVAL_200]);
SaveOptions();
}

void CImgMergeFrame::OnUpdateImgOverlayAnimationInterval(CCmdUI* pCmdUI)
{
pCmdUI->SetRadio(INTERVALS[pCmdUI->m_nID - ID_IMG_OVERLAYANIMINTERVAL_200] == m_pImgMergeWindow->GetOverlayAnimationInterval());
}

void CImgMergeFrame::OnImgCompareExtractedText()
{
String text[3];
Expand Down
4 changes: 4 additions & 0 deletions Src/ImgMergeFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ class CImgMergeFrame : public CMergeFrameCommon,public IMergeDoc
afx_msg void OnImgUseBackColor();
afx_msg void OnImgVectorImageScaling(UINT nId);
afx_msg void OnUpdateImgVectorImageScaling(CCmdUI* pCmdUI);
afx_msg void OnImgBlinkInterval(UINT nId);
afx_msg void OnUpdateImgBlinkInterval(CCmdUI* pCmdUI);
afx_msg void OnImgOverlayAnimationInterval(UINT nId);
afx_msg void OnUpdateImgOverlayAnimationInterval(CCmdUI* pCmdUI);
afx_msg void OnUpdateImgUseBackColor(CCmdUI* pCmdUI);
afx_msg void OnImgCompareExtractedText();
afx_msg void OnToolsGenerateReport();
Expand Down
29 changes: 29 additions & 0 deletions Src/Merge.rc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,35 @@ BEGIN
MENUITEM "&50%", ID_IMG_VECTORIMAGESCALING_50
MENUITEM "25%", ID_IMG_VECTORIMAGESCALING_25
END
POPUP "&Animation Settings"
BEGIN
POPUP "&Blink interval"
BEGIN
MENUITEM "200[ms]", ID_IMG_BLINKINTERVAL_200
MENUITEM "400[ms]", ID_IMG_BLINKINTERVAL_400
MENUITEM "600[ms]", ID_IMG_BLINKINTERVAL_600
MENUITEM "800[ms]", ID_IMG_BLINKINTERVAL_800
MENUITEM "1000[ms]", ID_IMG_BLINKINTERVAL_1000
MENUITEM "1200[ms]", ID_IMG_BLINKINTERVAL_1200
MENUITEM "1500[ms]", ID_IMG_BLINKINTERVAL_1500
MENUITEM "2000[ms]", ID_IMG_BLINKINTERVAL_2000
MENUITEM "3000[ms]", ID_IMG_BLINKINTERVAL_3000
MENUITEM "4000[ms]", ID_IMG_BLINKINTERVAL_4000
END
POPUP "&Overlay animation interval"
BEGIN
MENUITEM "200[ms]", ID_IMG_OVERLAYANIMINTERVAL_200
MENUITEM "400[ms]", ID_IMG_OVERLAYANIMINTERVAL_400
MENUITEM "600[ms]", ID_IMG_OVERLAYANIMINTERVAL_600
MENUITEM "800[ms]", ID_IMG_OVERLAYANIMINTERVAL_800
MENUITEM "1000[ms]", ID_IMG_OVERLAYANIMINTERVAL_1000
MENUITEM "1200[ms]", ID_IMG_OVERLAYANIMINTERVAL_1200
MENUITEM "1500[ms]", ID_IMG_OVERLAYANIMINTERVAL_1500
MENUITEM "2000[ms]", ID_IMG_OVERLAYANIMINTERVAL_2000
MENUITEM "3000[ms]", ID_IMG_OVERLAYANIMINTERVAL_3000
MENUITEM "4000[ms]", ID_IMG_OVERLAYANIMINTERVAL_4000
END
END
MENUITEM SEPARATOR
MENUITEM "Compare Extracted &Text From Images", ID_IMG_COMPARE_EXTRACTED_TEXT
END
Expand Down
3 changes: 3 additions & 0 deletions Src/OptionsDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ inline const String OPT_CMP_IMG_DIFFCOLORALPHA {_T("Settings/ImageDiffColorAlpha
inline const String OPT_CMP_IMG_THRESHOLD {_T("Settings/ImageColorDistanceThreshold"s)};
inline const String OPT_CMP_IMG_INSERTIONDELETIONDETECTION_MODE {_T("Settings/ImageInsertionDeletionDetectionMode"s)};
inline const String OPT_CMP_IMG_VECTOR_IMAGE_ZOOM_RATIO {_T("Settings/ImageVectorImageZoomRatio"s)};
inline const String OPT_CMP_IMG_BLINKINTERVAL {_T("Settings/ImageBlinkInterval"s)};
inline const String OPT_CMP_IMG_OVERLAYANIMATIONINTERVAL {_T("Settings/ImageOverlayAnimationInterval"s)};

inline const String OPT_CMP_ENABLE_IMGCMP_IN_DIRCMP {_T("Settings/EnableImageCompareInFolderCompare"s)};
inline const String OPT_CMP_IMG_OCR_RESULT_TYPE {_T("Settings/ImageOcrResultType"s)};

Expand Down
2 changes: 2 additions & 0 deletions Src/OptionsInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ void Init(COptionsMgr *pOptions)
pOptions->InitOption(OPT_CMP_IMG_THRESHOLD, 0, 0, 442 * 1000);
pOptions->InitOption(OPT_CMP_IMG_INSERTIONDELETIONDETECTION_MODE, 0, 0, 2);
pOptions->InitOption(OPT_CMP_IMG_VECTOR_IMAGE_ZOOM_RATIO, 1000, 1, 8000);
pOptions->InitOption(OPT_CMP_IMG_BLINKINTERVAL, 800, 200, 8000);
pOptions->InitOption(OPT_CMP_IMG_OVERLAYANIMATIONINTERVAL, 1000, 200, 8000);
pOptions->InitOption(OPT_CMP_IMG_OCR_RESULT_TYPE, 0, 0, 2);

pOptions->InitOption(OPT_CMP_WEB_USERDATAFOLDER_TYPE, 0, 0, 1);
Expand Down
4 changes: 4 additions & 0 deletions Src/WinIMergeLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ struct IImgMergeWindow
virtual DIFF_ALGORITHM GetDiffAlgorithm() const = 0;
virtual void SetDiffAlgorithm(DIFF_ALGORITHM diffAlgorithm) = 0;
virtual bool IsSaveSupported(int pane) const = 0;
virtual int GetBlinkInterval() const = 0;
virtual void SetBlinkInterval(int interval) = 0;
virtual int GetOverlayAnimationInterval() const = 0;
virtual void SetOverlayAnimationInterval(int interval) = 0;
};

struct IImgToolWindow
Expand Down
20 changes: 20 additions & 0 deletions Src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,26 @@
#define ID_IMG_VECTORIMAGESCALING_400 33723
#define ID_IMG_VECTORIMAGESCALING_800 33724
#define ID_IMG_COMPARE_EXTRACTED_TEXT 33725
#define ID_IMG_BLINKINTERVAL_200 33726
#define ID_IMG_BLINKINTERVAL_400 33727
#define ID_IMG_BLINKINTERVAL_600 33728
#define ID_IMG_BLINKINTERVAL_800 33729
#define ID_IMG_BLINKINTERVAL_1000 33730
#define ID_IMG_BLINKINTERVAL_1200 33731
#define ID_IMG_BLINKINTERVAL_1500 33732
#define ID_IMG_BLINKINTERVAL_2000 33733
#define ID_IMG_BLINKINTERVAL_3000 33734
#define ID_IMG_BLINKINTERVAL_4000 33735
#define ID_IMG_OVERLAYANIMINTERVAL_200 33736
#define ID_IMG_OVERLAYANIMINTERVAL_400 33737
#define ID_IMG_OVERLAYANIMINTERVAL_600 33738
#define ID_IMG_OVERLAYANIMINTERVAL_800 33739
#define ID_IMG_OVERLAYANIMINTERVAL_1000 33740
#define ID_IMG_OVERLAYANIMINTERVAL_1200 33741
#define ID_IMG_OVERLAYANIMINTERVAL_1500 33742
#define ID_IMG_OVERLAYANIMINTERVAL_2000 33743
#define ID_IMG_OVERLAYANIMINTERVAL_3000 33744
#define ID_IMG_OVERLAYANIMINTERVAL_4000 33745
#define ID_WEB_VIEWDIFFERENCES 33749
#define ID_WEB_SIZE_FIT_TO_WINDOW 33750
#define ID_WEB_SIZE_320x512 33751
Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Arabic.po
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ msgstr "&تغيير لون الخلفية"
msgid "&Vector Image Scaling"
msgstr ""

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr ""

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Basque.po
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ msgstr ""
msgid "&Vector Image Scaling"
msgstr ""

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr ""

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Brazilian.po
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ msgstr "&Definir a Cor do 2º Plano"
msgid "&Vector Image Scaling"
msgstr "&Dimensionamento da Imagem Vetorial"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr "Comparar o Texto &Extraído da Imagens"

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Bulgarian.po
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ msgstr "&Настройка на фоновия цвят"
msgid "&Vector Image Scaling"
msgstr "Мащабиране на &векторно изображение"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr ""

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Catalan.po
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ msgstr "Tria el color de fon&s"
msgid "&Vector Image Scaling"
msgstr "Escala de la imatge &vectorial"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr "Compara el &text extret de les imatges"

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/ChineseSimplified.po
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ msgstr "设置背景颜色(&S)"
msgid "&Vector Image Scaling"
msgstr "矢量图形缩放 (&V)"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr "比较从图像中解析的文字(&T)"

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/ChineseTraditional.po
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ msgstr "設定背景顏色 (&S)"
msgid "&Vector Image Scaling"
msgstr "向量圖縮放 (&V)"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr "比較從圖片中擷取的文字 (&T)"

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Corsican.po
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ msgstr "&Definisce u culore di u fondu"
msgid "&Vector Image Scaling"
msgstr "Messa à a scala di a fiura &vettoriale"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr "Paragunà u &testu estrattu da e fiure"

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Croatian.po
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ msgstr ""
msgid "&Vector Image Scaling"
msgstr ""

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr ""

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Czech.po
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ msgstr ""
msgid "&Vector Image Scaling"
msgstr ""

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr ""

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Danish.po
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ msgstr ""
msgid "&Vector Image Scaling"
msgstr ""

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr ""

Expand Down
9 changes: 9 additions & 0 deletions Translations/WinMerge/Dutch.po
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ msgstr "Achtergrondkleur instellen"
msgid "&Vector Image Scaling"
msgstr "Vectorafbeeldingsschaling"

msgid "&Animation Settings"
msgstr ""

msgid "&Blink interval"
msgstr ""

msgid "&Overlay animation interval"
msgstr ""

msgid "Compare Extracted &Text From Images"
msgstr "Uitgepakte tekst van afbeeldingen vergelijken"

Expand Down
Loading

0 comments on commit 70f6019

Please sign in to comment.