Esempio n. 1
0
        // Constructor
        public ComparisonPairForBindings(ImageSourceBinding _binding0, ImageSourceBinding _binding1)
        {
            // Copy parameters
            m_binding0 = _binding0;
            m_binding1 = _binding1;

            // Compute comparator's ID
            m_pairID = 17;
            m_pairID = m_pairID * 31 + m_binding0.SourceReference.FilePath.GetHashCode();
            m_pairID = m_pairID * 31 + m_binding1.SourceReference.FilePath.GetHashCode();
        }
 // Constructor
 public UnfoldedBindingComparisonPair(int _threshold, ImageSourceBinding _binding0, ImageSourceBinding _binding1,
                                      ImageSource _src0, ImageSource _src1, ComparativeData _radish,
                                      ComparativeData _dct, ComparativeData _wavelet, ComparativeData _bmb)
 {
     // Copy
     m_threshold       = _threshold;
     m_binding0        = _binding0;
     m_binding1        = _binding1;
     m_sourceBinding0  = _src0;
     m_sourceBinding1  = _src1;
     m_compDataRADISH  = _radish;
     m_compDataDCT     = _dct;
     m_compDataWavelet = _wavelet;
     m_compDataBMB     = _bmb;
 }
Esempio n. 3
0
        // Retrieves the timings for a certain image and technique
        private bool getTimingsFor(ImageSourceBinding _binding, TechniqueID _id, out double _loadingTime, out double _computationTime)
        {
            // Local variables
            HashDataTimings timings = null;

            // Check parameter
            if (_binding == null || _binding.getComparisonDataFor(_id) == null || _binding.getComparisonDataFor(_id).HashData.getTimings() == null)
            {
                _loadingTime = _computationTime = 0.0;
                return(false);
            }
            timings = _binding.getComparisonDataFor(_id).HashData.getTimings();

            // Set data
            _loadingTime     = timings.ImageLoadingTimeMS;
            _computationTime = timings.HashComputationTimeMS;

            return(true);
        }
Esempio n. 4
0
        // Sets the timings for a certain technique
        private void setTimingsFor(TechniqueID _id, ImageSourceBinding _b0, ImageSourceBinding _b1)
        {
            // Local variables
            Label  loadingLabel       = null;
            Label  computationLabel   = null;
            Label  totalLabel         = null;
            bool   validData          = false;
            string loadingString0     = "-";
            string computationString0 = "-";
            string totalString0       = "-";
            string loadingString1     = "-";
            string computationString1 = "-";
            string totalString1       = "-";

            // Get label references
            if (_id == TechniqueID.RADISH)
            {
                // Set references
                loadingLabel     = CC_Label_Loading_RADISH;
                computationLabel = CC_Label_Computation_RADISH;
                totalLabel       = CC_Label_Total_RADISH;
            }
            else if (_id == TechniqueID.DCT)
            {
                // Set references
                loadingLabel     = CC_Label_Loading_DCT;
                computationLabel = CC_Label_Computation_DCT;
                totalLabel       = CC_Label_Total_DCT;
            }
            else if (_id == TechniqueID.WAVELET)
            {
                // Set references
                loadingLabel     = CC_Label_Loading_Wavelet;
                computationLabel = CC_Label_Computation_Wavelet;
                totalLabel       = CC_Label_Total_Wavelet;
            }
            else
            {
                // Set references
                loadingLabel     = CC_Label_Loading_BMB;
                computationLabel = CC_Label_Computation_BMB;
                totalLabel       = CC_Label_Total_BMB;
            }

            // Get timings for the first image
            if (_b0.getComparisonDataFor(_id) != null && _b0.getComparisonDataFor(_id).HashData.getTimings() != null)
            {
                loadingString0     = _b0.getComparisonDataFor(_id).HashData.getTimings().getFormattedLoadingTime();
                computationString0 = _b0.getComparisonDataFor(_id).HashData.getTimings().getFormattedComputationTime();
                totalString0       = _b0.getComparisonDataFor(_id).HashData.getTimings().getFormattedTotalTime();
                validData          = true;
            }

            // Get timings for the second image
            if (_b1.getComparisonDataFor(_id) != null && _b1.getComparisonDataFor(_id).HashData.getTimings() != null)
            {
                loadingString1     = _b1.getComparisonDataFor(_id).HashData.getTimings().getFormattedLoadingTime();
                computationString1 = _b1.getComparisonDataFor(_id).HashData.getTimings().getFormattedComputationTime();
                totalString1       = _b1.getComparisonDataFor(_id).HashData.getTimings().getFormattedTotalTime();
                validData          = true;
            }

            // Set timings
            if (loadingLabel != null)
            {
                if (validData == true)
                {
                    loadingLabel.Text     = string.Format(TEXT_TEMPLATE_TIMING, loadingString0, loadingString1);
                    computationLabel.Text = string.Format(TEXT_TEMPLATE_TIMING, computationString0, computationString1);
                    totalLabel.Text       = string.Format(TEXT_TEMPLATE_TIMING, totalString0, totalString1);
                }
                else
                {
                    loadingLabel.Text     = "-";
                    computationLabel.Text = "-";
                    totalLabel.Text       = "-";
                }
            }
        }