Browse Source

Merge pull request #1929 from jz5/metadata

Change the constructor of PixelTypeInfo and ImageMetadata from internal to public so that a user can implement IImageInfo
pull/1936/head
James Jackson-South 5 years ago
committed by GitHub
parent
commit
d918502d87
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/ImageSharp/Formats/PixelTypeInfo.cs
  2. 2
      src/ImageSharp/Metadata/ImageMetadata.cs

13
src/ImageSharp/Formats/PixelTypeInfo.cs

@ -15,8 +15,17 @@ namespace SixLabors.ImageSharp.Formats
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> class. /// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
/// </summary> /// </summary>
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param> /// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
/// <param name="alpha">Tthe pixel alpha transparency behavior.</param> public PixelTypeInfo(int bitsPerPixel)
internal PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null) {
this.BitsPerPixel = bitsPerPixel;
}
/// <summary>
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
/// </summary>
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
/// <param name="alpha">The pixel alpha transparency behavior.</param>
public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation alpha)
{ {
this.BitsPerPixel = bitsPerPixel; this.BitsPerPixel = bitsPerPixel;
this.AlphaRepresentation = alpha; this.AlphaRepresentation = alpha;

2
src/ImageSharp/Metadata/ImageMetadata.cs

@ -40,7 +40,7 @@ namespace SixLabors.ImageSharp.Metadata
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ImageMetadata"/> class. /// Initializes a new instance of the <see cref="ImageMetadata"/> class.
/// </summary> /// </summary>
internal ImageMetadata() public ImageMetadata()
{ {
this.horizontalResolution = DefaultHorizontalResolution; this.horizontalResolution = DefaultHorizontalResolution;
this.verticalResolution = DefaultVerticalResolution; this.verticalResolution = DefaultVerticalResolution;

Loading…
Cancel
Save