|
|
@ -7,6 +7,7 @@ namespace ImageProcessor.Formats |
|
|
{ |
|
|
{ |
|
|
using System; |
|
|
using System; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Performs the gif decoding operation.
|
|
|
/// Performs the gif decoding operation.
|
|
|
@ -404,19 +405,20 @@ namespace ImageProcessor.Formats |
|
|
{ |
|
|
{ |
|
|
if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToBackground) |
|
|
if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToBackground) |
|
|
{ |
|
|
{ |
|
|
for (int y = descriptor.Top; y < descriptor.Top + descriptor.Height; y++) |
|
|
Parallel.For(descriptor.Top, descriptor.Top + descriptor.Height, |
|
|
{ |
|
|
y => |
|
|
for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++) |
|
|
{ |
|
|
{ |
|
|
for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++) |
|
|
offset = ((y * imageWidth) + x) * 4; |
|
|
{ |
|
|
|
|
|
offset = ((y * imageWidth) + x) * 4; |
|
|
// Stored in r-> g-> b-> a order.
|
|
|
|
|
|
this.currentFrame[offset + 0] = 0; |
|
|
// Stored in r-> g-> b-> a order.
|
|
|
this.currentFrame[offset + 1] = 0; |
|
|
this.currentFrame[offset + 0] = 0; |
|
|
this.currentFrame[offset + 2] = 0; |
|
|
this.currentFrame[offset + 1] = 0; |
|
|
this.currentFrame[offset + 3] = 0; |
|
|
this.currentFrame[offset + 2] = 0; |
|
|
} |
|
|
this.currentFrame[offset + 3] = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
else if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToPrevious) |
|
|
else if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToPrevious) |
|
|
{ |
|
|
{ |
|
|
|