-
-
Notifications
You must be signed in to change notification settings - Fork 851
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add webp decoder option BackgroundColorHandling to decide howto handl…
…e the background color in the ANIM chunk
- Loading branch information
1 parent
63d1d2c
commit a80ae33
Showing
7 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
namespace SixLabors.ImageSharp.Formats.Webp; | ||
|
||
/// <summary> | ||
/// Enum to decide how to handle the background color of the Animation chunk during decoding. | ||
/// </summary> | ||
public enum BackgroundColorHandling | ||
{ | ||
/// <summary> | ||
/// The background color of the ANIM chunk will be used to initialize the canvas to fill the unused space on the canvas around the frame. | ||
/// Also, if AnimationDisposalMethod.Dispose is used, this color will be used to restore the canvas background. | ||
/// </summary> | ||
Standard = 0, | ||
|
||
/// <summary> | ||
/// The background color of the ANIM chunk is ignored and instead the canvas is initialized with black, BGRA(0, 0, 0, 0). | ||
/// </summary> | ||
Ignore = 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
namespace SixLabors.ImageSharp.Formats.Webp; | ||
|
||
/// <summary> | ||
/// Configuration options for decoding webp images. | ||
/// </summary> | ||
public sealed class WebpDecoderOptions : ISpecializedDecoderOptions | ||
{ | ||
/// <inheritdoc/> | ||
public DecoderOptions GeneralOptions { get; init; } = new(); | ||
|
||
/// <summary> | ||
/// Gets the flag to decide how to handle the background color Animation Chunk. | ||
/// The specification is vague on how to handle the background color of the animation chunk. | ||
/// This option let's the user choose how to deal with it. | ||
/// </summary> | ||
/// <see href="https://developers.google.com/speed/webp/docs/riff_container#animation"/> | ||
public BackgroundColorHandling BackgroundColorHandling { get; init; } = BackgroundColorHandling.Standard; | ||
} |