mirror of https://github.com/SixLabors/ImageSharp
27 changed files with 410 additions and 204 deletions
@ -0,0 +1,21 @@ |
|||
// <copyright file="BmpDecoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
|
|||
using ImageSharp.PixelFormats; |
|||
|
|||
/// <summary>
|
|||
/// Image decoder options for decoding Windows bitmap streams.
|
|||
/// </summary>
|
|||
internal interface IBmpDecoderOptions |
|||
{ |
|||
// added this for consistancy so we can add stuff as required, no options currently availible
|
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
// <copyright file="BmpEncoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
|
|||
using ImageSharp.PixelFormats; |
|||
|
|||
/// <summary>
|
|||
/// Configuration options for use during bmp encoding
|
|||
/// </summary>
|
|||
/// <remarks>The encoder can currently only write 24-bit rgb images to streams.</remarks>
|
|||
internal interface IBmpEncoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets the number of bits per pixel.
|
|||
/// </summary>
|
|||
BmpBitsPerPixel BitsPerPixel { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
// <copyright file="GifDecoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Text; |
|||
using ImageSharp.PixelFormats; |
|||
|
|||
/// <summary>
|
|||
/// Decoder for generating an image out of a gif encoded stream.
|
|||
/// </summary>
|
|||
internal interface IGifDecoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets a value indicating whether the metadata should be ignored when the image is being decoded.
|
|||
/// </summary>
|
|||
bool IgnoreMetadata { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the encoding that should be used when reading comments.
|
|||
/// </summary>
|
|||
Encoding TextEncoding { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
// <copyright file="GifEncoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Text; |
|||
using ImageSharp.PixelFormats; |
|||
using ImageSharp.Quantizers; |
|||
|
|||
/// <summary>
|
|||
/// The configuration options used for encoding gifs
|
|||
/// </summary>
|
|||
internal interface IGifEncoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets a value indicating whether the metadata should be ignored when the image is being encoded.
|
|||
/// </summary>
|
|||
bool IgnoreMetadata { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the encoding that should be used when writing comments.
|
|||
/// </summary>
|
|||
Encoding TextEncoding { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the size of the color palette to use. For gifs the value ranges from 1 to 256. Leave as zero for default size.
|
|||
/// </summary>
|
|||
int PaletteSize { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the transparency threshold.
|
|||
/// </summary>
|
|||
byte Threshold { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the quantizer for reducing the color count.
|
|||
/// </summary>
|
|||
IQuantizer Quantizer { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
// <copyright file="JpegDecoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
|
|||
using ImageSharp.PixelFormats; |
|||
|
|||
/// <summary>
|
|||
/// Image decoder for generating an image out of a jpg stream.
|
|||
/// </summary>
|
|||
internal interface IJpegDecoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets a value indicating whether the metadata should be ignored when the image is being decoded.
|
|||
/// </summary>
|
|||
bool IgnoreMetadata { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
// <copyright file="JpegEncoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
|
|||
using ImageSharp.PixelFormats; |
|||
|
|||
/// <summary>
|
|||
/// Encoder for writing the data image to a stream in jpeg format.
|
|||
/// </summary>
|
|||
internal interface IJpegEncoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets a value indicating whether the metadata should be ignored when the image is being decoded.
|
|||
/// </summary>
|
|||
bool IgnoreMetadata { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the quality, that will be used to encode the image. Quality
|
|||
/// index must be between 0 and 100 (compression from max to min).
|
|||
/// </summary>
|
|||
/// <value>The quality of the jpg image from 0 to 100.</value>
|
|||
int Quality { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the subsample ration, that will be used to encode the image.
|
|||
/// </summary>
|
|||
/// <value>The subsample ratio of the jpg image.</value>
|
|||
JpegSubsample? Subsample { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
// <copyright file="PngDecoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Text; |
|||
using ImageSharp.PixelFormats; |
|||
|
|||
/// <summary>
|
|||
/// The optioas for decoding png images
|
|||
/// </summary>
|
|||
internal interface IPngDecoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets a value indicating whether the metadata should be ignored when the image is being decoded.
|
|||
/// </summary>
|
|||
bool IgnoreMetadata { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the encoding that should be used when reading text chunks.
|
|||
/// </summary>
|
|||
Encoding TextEncoding { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
// <copyright file="PngEncoder.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageSharp.Formats |
|||
{ |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
|
|||
using ImageSharp.PixelFormats; |
|||
using ImageSharp.Quantizers; |
|||
|
|||
/// <summary>
|
|||
/// The options availible for manipulating the encoder pipeline
|
|||
/// </summary>
|
|||
internal interface IPngEncoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Gets a value indicating whether the metadata should be ignored when the image is being encoded.
|
|||
/// </summary>
|
|||
bool IgnoreMetadata { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the size of the color palette to use. Set to zero to leav png encoding to use pixel data.
|
|||
/// </summary>
|
|||
int PaletteSize { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the png color type
|
|||
/// </summary>
|
|||
PngColorType PngColorType { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the compression level 1-9.
|
|||
/// <remarks>Defaults to 6.</remarks>
|
|||
/// </summary>
|
|||
int CompressionLevel { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the gamma value, that will be written
|
|||
/// the the stream, when the <see cref="WriteGamma"/> property
|
|||
/// is set to true. The default value is 2.2F.
|
|||
/// </summary>
|
|||
/// <value>The gamma value of the image.</value>
|
|||
float Gamma { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets quantizer for reducing the color count.
|
|||
/// </summary>
|
|||
IQuantizer Quantizer { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the transparency threshold.
|
|||
/// </summary>
|
|||
byte Threshold { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets a value indicating whether this instance should write
|
|||
/// gamma information to the stream. The default value is false.
|
|||
/// </summary>
|
|||
bool WriteGamma { get; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue