void ChangeResolutionAction::Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
	{
		TimeFrequencyData oldContaminated = artifacts.ContaminatedData();

		if(_timeDecreaseFactor != 1)
		{
			ArtifactSet artifactsCopy(artifacts);
			artifactsCopy.SetNoImageSet();
	
			DecreaseTime(artifactsCopy.OriginalData());
			DecreaseTime(artifactsCopy.ContaminatedData());
			DecreaseTime(artifactsCopy.RevisedData());
	
			PerformFrequencyChange(artifactsCopy, listener);
	
			IncreaseTime(artifacts.OriginalData(), artifactsCopy.OriginalData(), false, false);
			IncreaseTime(artifacts.ContaminatedData(), artifactsCopy.ContaminatedData(), _restoreContaminated, _restoreMasks);
			IncreaseTime(artifacts.RevisedData(), artifactsCopy.RevisedData(), _restoreRevised, _restoreMasks);
		} else {
			PerformFrequencyChange(artifacts, listener);
		}
		if(_restoreRevised && !_restoreContaminated)
		{
			oldContaminated.Subtract(artifacts.RevisedData());
			if(_restoreMasks)
				oldContaminated.SetMask(artifacts.ContaminatedData());
			artifacts.SetContaminatedData(oldContaminated);
		}
	}
Пример #2
0
	void ChangeResolutionAction::Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
	{
		if(_timeDecreaseFactor != 1)
		{
			ArtifactSet artifactsCopy(artifacts);
			artifactsCopy.SetNoImageSet();
	
			TimeFrequencyData oldContaminated = artifacts.ContaminatedData();

			DecreaseTime(artifactsCopy.OriginalData());
			DecreaseTime(artifactsCopy.ContaminatedData());
			DecreaseTime(artifactsCopy.RevisedData());
	
			PerformFrequencyChange(artifactsCopy, listener);
	
			IncreaseTime(artifacts.OriginalData(), artifactsCopy.OriginalData(), false, false);
			IncreaseTime(artifacts.ContaminatedData(), artifactsCopy.ContaminatedData(), _restoreContaminated, _restoreMasks);
			IncreaseTime(artifacts.RevisedData(), artifactsCopy.RevisedData(), _restoreRevised, _restoreMasks);

			if(_restoreRevised && !_restoreContaminated)
			{
				//TimeFrequencyData *contaminatedData =
				//	TimeFrequencyData::CreateTFDataFromDiff(oldContaminated, artifacts.RevisedData());
				//contaminatedData->SetMask(oldContaminated);
				//artifacts.SetContaminatedData(*contaminatedData);
				//delete contaminatedData;
				
				oldContaminated.Subtract(artifacts.RevisedData());
				artifacts.SetContaminatedData(oldContaminated);
			}
		} else {
			PerformFrequencyChange(artifacts, listener);
		}
	}