]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1341: debug of difference image
authorasl <asl@opencascade.com>
Wed, 15 Nov 2017 07:33:56 +0000 (10:33 +0300)
committerasl <asl@opencascade.com>
Wed, 15 Nov 2017 07:33:56 +0000 (10:33 +0300)
64 files changed:
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/TestViewer.h
src/HYDRO_tests/reference_data/CMakeLists.txt
src/HYDRO_tests/reference_data/linux/diff_image.png [new file with mode: 0644]
src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png [deleted file]
src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png [deleted file]
src/HYDRO_tests/reference_data/win32/diff_image.png [new file with mode: 0644]
src/HYDRO_tests/test_HYDROData_Image.cxx
src/HYDRO_tests/test_HYDROData_Image.h

index 6aa098d30102d561e784a52e51c7fb022bfa972f..2ad31f820e9961567ec0a0cc228454fda72e6f6a 100644 (file)
@@ -186,6 +186,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll,
   if( isFitAll )
     fitAll();
 }
+
 void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey,
                        int theUIANb, int theVIANb)
 {
@@ -277,6 +278,21 @@ bool AreImagesEqual( const QImage& theImage1, const QImage& theImage2, double th
   return true;
 }
 
+QImage TestViewer::diff( const QImage& theExpectedRefImage, const QImage& theActualImage )
+{
+  const QImage::Format aFormat = QImage::Format_RGB32;
+
+  QImage anExpectedRefImage = theExpectedRefImage.convertToFormat( aFormat );
+  QImage anActualImage = theActualImage.convertToFormat( aFormat );
+
+  QImage aDiff( anExpectedRefImage.width(), anExpectedRefImage.height(), aFormat );
+  QPainter aPainter( &aDiff );
+  aPainter.drawImage( 0, 0, anExpectedRefImage );
+  aPainter.setCompositionMode( QPainter::RasterOp_SourceXorDestination );
+  aPainter.drawImage( 0, 0, anActualImage );
+  return aDiff;
+}
+
 bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, const char* theCase, bool swapRGB )
 {
   QImage anActualImage;
@@ -321,11 +337,7 @@ bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, cons
   //std::cout << anActualImage.width() << "x" << anActualImage.height() << std::endl;
   theMessage = "The viewer contents does not correspond to the reference image: " + myKey;
   
-  QImage aDiff( anExpectedRefImage.width(), anExpectedRefImage.height(), QImage::Format_ARGB32 );
-  QPainter aPainter( &aDiff );
-  aPainter.drawImage( 0, 0, anExpectedRefImage );
-  aPainter.setCompositionMode( QPainter::RasterOp_SourceXorDestination );
-  aPainter.drawImage( 0, 0, anActualImage );
+  QImage aDiff = diff( anExpectedRefImage, anActualImage );
 
   QString aDiffFilePath = temp + "/" + myKey + "_diff.png";
   aDiff.save( aDiffFilePath );
index af8400f01c16f9b6b8985762fa20d5269e9a58a0..7a0fcab32fddc9d03bb6e956cdefdbb919ac91b8 100644 (file)
@@ -62,6 +62,7 @@ public:
 
   static void setKey( const QString& );
   static void fitAll();
+  static QImage diff( const QImage& im1, const QImage& im2 );
 
 private:
   static OCCViewer_ViewManager* myViewManager;
index 14e651d87e14eb6835e770dee4ffaec6cced1640..d7d2238f906bc968b340e4718aba8a08ea603921 100644 (file)
@@ -146,6 +146,7 @@ SET(REFERENCE_DATA
     bathy_text_labels.png
     bathy_prs_fit_selected.png
     zone_random_colors.png
+    diff_image.png
 )
 
 # Application tests
diff --git a/src/HYDRO_tests/reference_data/linux/diff_image.png b/src/HYDRO_tests/reference_data/linux/diff_image.png
new file mode 100644 (file)
index 0000000..f20ddb7
Binary files /dev/null and b/src/HYDRO_tests/reference_data/linux/diff_image.png differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png b/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png
deleted file mode 100644 (file)
index 6c1f2ed..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png b/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png
deleted file mode 100644 (file)
index 8f43edb..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png
deleted file mode 100644 (file)
index 314bea8..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png
deleted file mode 100644 (file)
index 93abf40..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png
deleted file mode 100644 (file)
index a9e5c6a..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png
deleted file mode 100644 (file)
index 1141907..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png
deleted file mode 100644 (file)
index 9facc99..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png
deleted file mode 100644 (file)
index 3d9a279..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png
deleted file mode 100644 (file)
index 8d30147..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png
deleted file mode 100644 (file)
index 2046ed9..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png
deleted file mode 100644 (file)
index 93db9e5..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png
deleted file mode 100644 (file)
index fdfd0dd..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png
deleted file mode 100644 (file)
index 1889710..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png
deleted file mode 100644 (file)
index 52a22cc..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png
deleted file mode 100644 (file)
index 888b2a0..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png b/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png
deleted file mode 100644 (file)
index d7f8ba3..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png
deleted file mode 100644 (file)
index c90a95d..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png
deleted file mode 100644 (file)
index fe572e5..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png b/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png
deleted file mode 100644 (file)
index 907b2c7..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png b/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png
deleted file mode 100644 (file)
index b548c8c..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png
deleted file mode 100644 (file)
index 1e15738..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png b/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png
deleted file mode 100644 (file)
index 8280fec..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png
deleted file mode 100644 (file)
index e5275ac..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png
deleted file mode 100644 (file)
index cfe5d65..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png b/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png
deleted file mode 100644 (file)
index 42b1f50..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png
deleted file mode 100644 (file)
index b96b1d9..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png
deleted file mode 100644 (file)
index 9bb3729..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png b/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png
deleted file mode 100644 (file)
index 368185a..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png b/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png
deleted file mode 100644 (file)
index bd03835..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png
deleted file mode 100644 (file)
index 20fefe6..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png b/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png
deleted file mode 100644 (file)
index 8b3bcab..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png b/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png
deleted file mode 100644 (file)
index 5b8d679..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png
deleted file mode 100644 (file)
index c5d6a45..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png b/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png
deleted file mode 100644 (file)
index a1bb0c2..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png b/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png
deleted file mode 100644 (file)
index eca9f5f..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png
deleted file mode 100644 (file)
index 86a9272..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png
deleted file mode 100644 (file)
index 491394c..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png
deleted file mode 100644 (file)
index 1e37efd..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png
deleted file mode 100644 (file)
index 029ff75..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png
deleted file mode 100644 (file)
index 1a5ea8c..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png
deleted file mode 100644 (file)
index c2b37cf..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png
deleted file mode 100644 (file)
index 84904bc..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png
deleted file mode 100644 (file)
index 287adbf..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png
deleted file mode 100644 (file)
index 417780e..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png
deleted file mode 100644 (file)
index b304fe5..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png
deleted file mode 100644 (file)
index 1c2106a..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png
deleted file mode 100644 (file)
index 2944ba5..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png
deleted file mode 100644 (file)
index 30c5fd8..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png b/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png
deleted file mode 100644 (file)
index 1e2851a..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png b/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png
deleted file mode 100644 (file)
index f5483cf..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png
deleted file mode 100644 (file)
index 3d1e01a..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png b/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png
deleted file mode 100644 (file)
index 504e2cf..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png b/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png
deleted file mode 100644 (file)
index b036205..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png
deleted file mode 100644 (file)
index 0aa4e2b..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png b/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png
deleted file mode 100644 (file)
index 13a7187..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png b/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png
deleted file mode 100644 (file)
index ea1c4d3..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png
deleted file mode 100644 (file)
index ab925f1..0000000
Binary files a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png and /dev/null differ
diff --git a/src/HYDRO_tests/reference_data/win32/diff_image.png b/src/HYDRO_tests/reference_data/win32/diff_image.png
new file mode 100644 (file)
index 0000000..f20ddb7
Binary files /dev/null and b/src/HYDRO_tests/reference_data/win32/diff_image.png differ
index ddeeeb87193851436a5a3e33b695b811eb95fd73..4ab09f269524937de54409ab8dda9318b543d2fd 100644 (file)
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Image.h>
+#include <TestViewer.h>
 #include <QPainter>
+#include <QImage>
+
+extern QString REF_DATA_PATH;
 
 static QImage TestImage() {
   QImage aPic(50, 40, QImage::Format_RGB32);
@@ -164,3 +168,13 @@ void test_HYDROData_Image::testCopy()
 
   aDoc->Close();
 }
+
+void test_HYDROData_Image::testDiff()
+{
+  QImage im1, im2;
+  im1.load( REF_DATA_PATH + "/LandCover_Triangles.png" );
+  im2.load( REF_DATA_PATH + "/LandCover_Triangles_Split.png" );
+
+  QImage im3 = TestViewer::diff( im1, im2 );
+  CPPUNIT_ASSERT_IMAGES3( &im3, "diff_image", false );
+}
index c649ece770cca93c7bfd9875d92ee5be2665e6f5..36001373b508334643617470da0b0d105fb391e6 100644 (file)
@@ -24,6 +24,7 @@ class test_HYDROData_Image : public CppUnit::TestFixture {
   CPPUNIT_TEST(testTrsf);
   CPPUNIT_TEST(testReferences);
   CPPUNIT_TEST(testCopy);
+  CPPUNIT_TEST(testDiff);
   CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -45,6 +46,7 @@ public:
 
   // checks the image properties copy/paste
   void testCopy();
+  void testDiff();
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROData_Image);