Skip to content

Commit d918502

Browse files
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
2 parents dc79124 + b4662e6 commit d918502

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/ImageSharp/Formats/PixelTypeInfo.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ public class PixelTypeInfo
1515
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
1616
/// </summary>
1717
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
18-
/// <param name="alpha">Tthe pixel alpha transparency behavior.</param>
19-
internal PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation? alpha = null)
18+
public PixelTypeInfo(int bitsPerPixel)
19+
{
20+
this.BitsPerPixel = bitsPerPixel;
21+
}
22+
23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
25+
/// </summary>
26+
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
27+
/// <param name="alpha">The pixel alpha transparency behavior.</param>
28+
public PixelTypeInfo(int bitsPerPixel, PixelAlphaRepresentation alpha)
2029
{
2130
this.BitsPerPixel = bitsPerPixel;
2231
this.AlphaRepresentation = alpha;

src/ImageSharp/Metadata/ImageMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public sealed class ImageMetadata : IDeepCloneable<ImageMetadata>
4040
/// <summary>
4141
/// Initializes a new instance of the <see cref="ImageMetadata"/> class.
4242
/// </summary>
43-
internal ImageMetadata()
43+
public ImageMetadata()
4444
{
4545
this.horizontalResolution = DefaultHorizontalResolution;
4646
this.verticalResolution = DefaultVerticalResolution;

0 commit comments

Comments
 (0)