template<class Archive1T, class Archive2T>
Definition at line 14 of file ImageArchiveDiff.h. References ILOG_DEBUG, ILOG_ERROR, and ILOG_VAR. Referenced by Impala::Samples::MonetTest::DoCheckFrameArchive(). 00015 { 00016 ILOG_VAR(Impala.Core.Array.ImageArchiveDiff); 00017 00018 if (ar1->NrImages() != ar2->NrImages()) 00019 { 00020 ILOG_ERROR("nrImages differs: " << ar1->NrImages() << " vs " << 00021 ar2->NrImages()); 00022 return 1; 00023 } 00024 int nDiff = 0; 00025 for (int i=0 ; i<ar1->NrImages() ; i++) 00026 { 00027 size_t size1 = 0; 00028 UInt8* data1 = ar1->GetImageData(i, size1); 00029 size_t size2 = 1; 00030 UInt8* data2 = ar2->GetImageData(i, size2); 00031 if (size1 != size2) 00032 { 00033 ILOG_DEBUG("image " << i << " size differs " << size1 << " vs " << 00034 size2); 00035 nDiff++; 00036 } 00037 else 00038 { 00039 for (int j=0 ; j<size1 ; j++) 00040 { 00041 if (data1[j] != data2[j]) 00042 { 00043 ILOG_DEBUG("image " << i << " byte " << j << " differs"); 00044 nDiff++; 00045 break; 00046 } 00047 } 00048 } 00049 delete data1; 00050 delete data2; 00051 } 00052 if (nDiff > 0) 00053 ILOG_ERROR("Found " << nDiff << " differences"); 00054 return nDiff; 00055 }
|