Added ReduceColorEffect (using the WuQuantizer in the effect). Changed the way the ApplyEffect works, an effect might decide to do nothing and return null.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2471 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-02-08 16:01:19 +00:00
parent 8f36064131
commit f0b1f1f84d
2 changed files with 39 additions and 9 deletions

View file

@ -357,18 +357,20 @@ namespace GreenshotPlugin.Core {
// Default out value for the offset, will be modified there where needed
offset = new Point(0, 0);
Point tmpPoint;
Image tmpImage = null;
foreach (IEffect effect in effects) {
tmpImage = effect.Apply(currentImage, out tmpPoint);
offset.Offset(tmpPoint);
if (disposeImage) {
currentImage.Dispose();
Image tmpImage = effect.Apply(currentImage, out tmpPoint);
if (tmpImage != null) {
offset.Offset(tmpPoint);
if (disposeImage) {
currentImage.Dispose();
}
currentImage = tmpImage;
tmpImage = null;
// Make sure the "new" image is disposed
disposeImage = true;
}
currentImage = tmpImage;
// Make sure the "new" image is disposed
disposeImage = true;
}
return tmpImage;
return currentImage;
}
/// <summary>