mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
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:
parent
8f36064131
commit
f0b1f1f84d
2 changed files with 39 additions and 9 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue