|
|
|
@ -60,17 +60,6 @@ namespace SixLabors.ImageSharp |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Bmp format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="path">The file path to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsBmpAsync(this Image source, string path, BmpEncoder encoder) |
|
|
|
=> SaveAsBmpAsync(source, path, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Bmp format.
|
|
|
|
/// </summary>
|
|
|
|
@ -80,7 +69,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsBmpAsync(this Image source, string path, BmpEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsBmpAsync(this Image source, string path, BmpEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance), |
|
|
|
@ -95,15 +84,6 @@ namespace SixLabors.ImageSharp |
|
|
|
public static void SaveAsBmp(this Image source, Stream stream) |
|
|
|
=> SaveAsBmp(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Bmp format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsBmpAsync(this Image source, Stream stream) => SaveAsBmpAsync(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Bmp format.
|
|
|
|
/// </summary>
|
|
|
|
@ -112,7 +92,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsBmpAsync(this Image source, Stream stream, CancellationToken cancellationToken) |
|
|
|
public static Task SaveAsBmpAsync(this Image source, Stream stream, CancellationToken cancellationToken = default) |
|
|
|
=> SaveAsBmpAsync(source, stream, null, cancellationToken); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -128,17 +108,6 @@ namespace SixLabors.ImageSharp |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Bmp format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsBmpAsync(this Image source, Stream stream, BmpEncoder encoder) |
|
|
|
=> SaveAsBmpAsync(source, stream, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Bmp format.
|
|
|
|
/// </summary>
|
|
|
|
@ -148,7 +117,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsBmpAsync(this Image source, Stream stream, BmpEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsBmpAsync(this Image source, Stream stream, BmpEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance), |
|
|
|
@ -194,17 +163,6 @@ namespace SixLabors.ImageSharp |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(GifFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Gif format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="path">The file path to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsGifAsync(this Image source, string path, GifEncoder encoder) |
|
|
|
=> SaveAsGifAsync(source, path, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Gif format.
|
|
|
|
/// </summary>
|
|
|
|
@ -214,7 +172,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsGifAsync(this Image source, string path, GifEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsGifAsync(this Image source, string path, GifEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(GifFormat.Instance), |
|
|
|
@ -229,15 +187,6 @@ namespace SixLabors.ImageSharp |
|
|
|
public static void SaveAsGif(this Image source, Stream stream) |
|
|
|
=> SaveAsGif(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Gif format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsGifAsync(this Image source, Stream stream) => SaveAsGifAsync(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Gif format.
|
|
|
|
/// </summary>
|
|
|
|
@ -246,7 +195,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsGifAsync(this Image source, Stream stream, CancellationToken cancellationToken) |
|
|
|
public static Task SaveAsGifAsync(this Image source, Stream stream, CancellationToken cancellationToken = default) |
|
|
|
=> SaveAsGifAsync(source, stream, null, cancellationToken); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -262,17 +211,6 @@ namespace SixLabors.ImageSharp |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(GifFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Gif format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsGifAsync(this Image source, Stream stream, GifEncoder encoder) |
|
|
|
=> SaveAsGifAsync(source, stream, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Gif format.
|
|
|
|
/// </summary>
|
|
|
|
@ -282,7 +220,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsGifAsync(this Image source, Stream stream, GifEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsGifAsync(this Image source, Stream stream, GifEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(GifFormat.Instance), |
|
|
|
@ -328,17 +266,6 @@ namespace SixLabors.ImageSharp |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(JpegFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Jpeg format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="path">The file path to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsJpegAsync(this Image source, string path, JpegEncoder encoder) |
|
|
|
=> SaveAsJpegAsync(source, path, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Jpeg format.
|
|
|
|
/// </summary>
|
|
|
|
@ -348,7 +275,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsJpegAsync(this Image source, string path, JpegEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsJpegAsync(this Image source, string path, JpegEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(JpegFormat.Instance), |
|
|
|
@ -363,15 +290,6 @@ namespace SixLabors.ImageSharp |
|
|
|
public static void SaveAsJpeg(this Image source, Stream stream) |
|
|
|
=> SaveAsJpeg(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Jpeg format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsJpegAsync(this Image source, Stream stream) => SaveAsJpegAsync(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Jpeg format.
|
|
|
|
/// </summary>
|
|
|
|
@ -380,7 +298,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsJpegAsync(this Image source, Stream stream, CancellationToken cancellationToken) |
|
|
|
public static Task SaveAsJpegAsync(this Image source, Stream stream, CancellationToken cancellationToken = default) |
|
|
|
=> SaveAsJpegAsync(source, stream, null, cancellationToken); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -396,17 +314,6 @@ namespace SixLabors.ImageSharp |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(JpegFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Jpeg format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsJpegAsync(this Image source, Stream stream, JpegEncoder encoder) |
|
|
|
=> SaveAsJpegAsync(source, stream, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Jpeg format.
|
|
|
|
/// </summary>
|
|
|
|
@ -416,7 +323,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsJpegAsync(this Image source, Stream stream, JpegEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsJpegAsync(this Image source, Stream stream, JpegEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(JpegFormat.Instance), |
|
|
|
@ -462,17 +369,6 @@ namespace SixLabors.ImageSharp |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(PngFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Png format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="path">The file path to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsPngAsync(this Image source, string path, PngEncoder encoder) |
|
|
|
=> SaveAsPngAsync(source, path, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Png format.
|
|
|
|
/// </summary>
|
|
|
|
@ -482,7 +378,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsPngAsync(this Image source, string path, PngEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsPngAsync(this Image source, string path, PngEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(PngFormat.Instance), |
|
|
|
@ -497,15 +393,6 @@ namespace SixLabors.ImageSharp |
|
|
|
public static void SaveAsPng(this Image source, Stream stream) |
|
|
|
=> SaveAsPng(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Png format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsPngAsync(this Image source, Stream stream) => SaveAsPngAsync(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Png format.
|
|
|
|
/// </summary>
|
|
|
|
@ -514,7 +401,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsPngAsync(this Image source, Stream stream, CancellationToken cancellationToken) |
|
|
|
public static Task SaveAsPngAsync(this Image source, Stream stream, CancellationToken cancellationToken = default) |
|
|
|
=> SaveAsPngAsync(source, stream, null, cancellationToken); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -530,17 +417,6 @@ namespace SixLabors.ImageSharp |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(PngFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Png format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsPngAsync(this Image source, Stream stream, PngEncoder encoder) |
|
|
|
=> SaveAsPngAsync(source, stream, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Png format.
|
|
|
|
/// </summary>
|
|
|
|
@ -550,7 +426,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsPngAsync(this Image source, Stream stream, PngEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsPngAsync(this Image source, Stream stream, PngEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(PngFormat.Instance), |
|
|
|
@ -596,17 +472,6 @@ namespace SixLabors.ImageSharp |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(TgaFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Tga format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="path">The file path to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsTgaAsync(this Image source, string path, TgaEncoder encoder) |
|
|
|
=> SaveAsTgaAsync(source, path, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Tga format.
|
|
|
|
/// </summary>
|
|
|
|
@ -616,7 +481,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsTgaAsync(this Image source, string path, TgaEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsTgaAsync(this Image source, string path, TgaEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
path, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(TgaFormat.Instance), |
|
|
|
@ -631,15 +496,6 @@ namespace SixLabors.ImageSharp |
|
|
|
public static void SaveAsTga(this Image source, Stream stream) |
|
|
|
=> SaveAsTga(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Tga format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsTgaAsync(this Image source, Stream stream) => SaveAsTgaAsync(source, stream, null); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Tga format.
|
|
|
|
/// </summary>
|
|
|
|
@ -648,7 +504,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsTgaAsync(this Image source, Stream stream, CancellationToken cancellationToken) |
|
|
|
public static Task SaveAsTgaAsync(this Image source, Stream stream, CancellationToken cancellationToken = default) |
|
|
|
=> SaveAsTgaAsync(source, stream, null, cancellationToken); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -664,17 +520,6 @@ namespace SixLabors.ImageSharp |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(TgaFormat.Instance)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Tga format.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The image this method extends.</param>
|
|
|
|
/// <param name="stream">The stream to save the image to.</param>
|
|
|
|
/// <param name="encoder">The encoder to save the image with.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsTgaAsync(this Image source, Stream stream, TgaEncoder encoder) |
|
|
|
=> SaveAsTgaAsync(source, stream, encoder, default); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the image to the given stream with the Tga format.
|
|
|
|
/// </summary>
|
|
|
|
@ -684,7 +529,7 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|
|
|
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
|
|
|
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
|
|
|
public static Task SaveAsTgaAsync(this Image source, Stream stream, TgaEncoder encoder, CancellationToken cancellationToken) => |
|
|
|
public static Task SaveAsTgaAsync(this Image source, Stream stream, TgaEncoder encoder, CancellationToken cancellationToken = default) => |
|
|
|
source.SaveAsync( |
|
|
|
stream, |
|
|
|
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(TgaFormat.Instance), |
|
|
|
|