-
-
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.
Merge pull request #2180 from SixLabors/js/decoder-options
Introduce Shared General Decoder Options plus Specialization
- Loading branch information
Showing
128 changed files
with
3,493 additions
and
3,941 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
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,20 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
namespace SixLabors.ImageSharp.Formats.Bmp | ||
{ | ||
/// <summary> | ||
/// Configuration options for decoding Windows Bitmap images. | ||
/// </summary> | ||
public sealed class BmpDecoderOptions : ISpecializedDecoderOptions | ||
{ | ||
/// <inheritdoc/> | ||
public DecoderOptions GeneralOptions { get; set; } = new(); | ||
|
||
/// <summary> | ||
/// Gets or sets the value indicating how to deal with skipped pixels, | ||
/// which can occur during decoding run length encoded bitmaps. | ||
/// </summary> | ||
public RleSkippedPixelHandling RleSkippedPixelHandling { get; set; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
// Copyright (c) Six Labors. | ||
// Licensed under the Six Labors Split License. | ||
|
||
using System; | ||
using SixLabors.ImageSharp.Processing; | ||
using SixLabors.ImageSharp.Processing.Processors.Transforms; | ||
|
||
namespace SixLabors.ImageSharp.Formats | ||
{ | ||
/// <summary> | ||
/// Provides general configuration options for decoding image formats. | ||
/// </summary> | ||
public sealed class DecoderOptions | ||
{ | ||
private static readonly Lazy<DecoderOptions> LazyOptions = new(() => new()); | ||
|
||
private uint maxFrames = int.MaxValue; | ||
|
||
/// <summary> | ||
/// Gets the shared default general decoder options instance. | ||
/// </summary> | ||
internal static DecoderOptions Default { get; } = LazyOptions.Value; | ||
|
||
/// <summary> | ||
/// Gets or sets a custom Configuration instance to be used by the image processing pipeline. | ||
/// </summary> | ||
public Configuration Configuration { get; set; } = Configuration.Default; | ||
|
||
/// <summary> | ||
/// Gets or sets the target size to decode the image into. | ||
/// </summary> | ||
public Size? TargetSize { get; set; } = null; | ||
|
||
/// <summary> | ||
/// Gets or sets the sampler to use when resizing during decoding. | ||
/// </summary> | ||
public IResampler Sampler { get; set; } = KnownResamplers.Box; | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether to ignore encoded metadata when decoding. | ||
/// </summary> | ||
public bool SkipMetadata { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Gets or sets the maximum number of image frames to decode, inclusive. | ||
/// </summary> | ||
public uint MaxFrames { get => this.maxFrames; set => this.maxFrames = Math.Clamp(value, 1, int.MaxValue); } | ||
} | ||
} |
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
Oops, something went wrong.