From bd4eb34b48a533e0e5b932ad751195cd8787ff0d Mon Sep 17 00:00:00 2001 From: jz5 Date: Sat, 8 Jan 2022 18:28:40 +0900 Subject: [PATCH 1/2] internal constructor to public constructor --- src/ImageSharp/Formats/PixelTypeInfo.cs | 2 +- src/ImageSharp/Metadata/ImageMetadata.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/PixelTypeInfo.cs b/src/ImageSharp/Formats/PixelTypeInfo.cs index 718b05e33a..1bc717cbbd 100644 --- a/src/ImageSharp/Formats/PixelTypeInfo.cs +++ b/src/ImageSharp/Formats/PixelTypeInfo.cs @@ -16,7 +16,7 @@ public class PixelTypeInfo /// /// Color depth, in number of bits per pixel. /// Tthe pixel alpha transparency behavior. - internal PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null) + public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null) { this.BitsPerPixel = bitsPerPixel; this.AlphaRepresentation = alpha; diff --git a/src/ImageSharp/Metadata/ImageMetadata.cs b/src/ImageSharp/Metadata/ImageMetadata.cs index 425fd9b47f..450f1b6aeb 100644 --- a/src/ImageSharp/Metadata/ImageMetadata.cs +++ b/src/ImageSharp/Metadata/ImageMetadata.cs @@ -39,7 +39,7 @@ public sealed class ImageMetadata : IDeepCloneable /// /// Initializes a new instance of the class. /// - internal ImageMetadata() + public ImageMetadata() { this.horizontalResolution = DefaultHorizontalResolution; this.verticalResolution = DefaultVerticalResolution; From 92f47fc628a44e11a2553ead6304cded078711e9 Mon Sep 17 00:00:00 2001 From: jz5 Date: Mon, 10 Jan 2022 22:55:19 +0900 Subject: [PATCH 2/2] Update the PixelTypeInfo constructor to use separate overloads with and without the PixelAlphaRepresentation (not nullable) parameter. --- src/ImageSharp/Formats/PixelTypeInfo.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/PixelTypeInfo.cs b/src/ImageSharp/Formats/PixelTypeInfo.cs index 1bc717cbbd..afa3b19a22 100644 --- a/src/ImageSharp/Formats/PixelTypeInfo.cs +++ b/src/ImageSharp/Formats/PixelTypeInfo.cs @@ -15,8 +15,17 @@ public class PixelTypeInfo /// Initializes a new instance of the class. /// /// Color depth, in number of bits per pixel. - /// Tthe pixel alpha transparency behavior. - public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null) + public PixelTypeInfo(int bitsPerPixel) + { + this.BitsPerPixel = bitsPerPixel; + } + + /// + /// Initializes a new instance of the class. + /// + /// Color depth, in number of bits per pixel. + /// The pixel alpha transparency behavior. + public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation alpha) { this.BitsPerPixel = bitsPerPixel; this.AlphaRepresentation = alpha;