Browse Source

Revert "Make PixelTypeInfo a struct"

This reverts commit 9269aac086.
af/merge-core
Jason Nelson 8 years ago
parent
commit
3f196ee4a1
  1. 4
      src/ImageSharp/Formats/PixelTypeInfo.cs
  2. 2
      tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
  3. 2
      tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
  4. 4
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  5. 4
      tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs

4
src/ImageSharp/Formats/PixelTypeInfo.cs

@ -6,10 +6,10 @@ namespace SixLabors.ImageSharp.Formats
/// <summary>
/// Contains information about the pixels that make up an images visual data.
/// </summary>
public readonly struct PixelTypeInfo
public class PixelTypeInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> struct.
/// Initializes a new instance of the <see cref="PixelTypeInfo"/> class.
/// </summary>
/// <param name="bitsPerPixel">Color depth, in number of bits per pixel.</param>
internal PixelTypeInfo(int bitsPerPixel)

2
tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs

@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Tests
var testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}
}

2
tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs

@ -172,7 +172,7 @@ namespace SixLabors.ImageSharp.Tests
TestFile testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}

4
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

@ -397,10 +397,10 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
[InlineData(TestImages.Jpeg.Baseline.Snake, 24)]
public void DetectPixelSize(string imagePath, int expectedPixelSize)
{
var testFile = TestFile.Create(imagePath);
TestFile testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}
}

4
tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs

@ -228,10 +228,10 @@ namespace SixLabors.ImageSharp.Tests
[InlineData(TestImages.Png.Rgb48BppInterlaced, 48)]
public void DetectPixelSize(string imagePath, int expectedPixelSize)
{
var testFile = TestFile.Create(imagePath);
TestFile testFile = TestFile.Create(imagePath);
using (var stream = new MemoryStream(testFile.Bytes, false))
{
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType.BitsPerPixel);
Assert.Equal(expectedPixelSize, Image.Identify(stream)?.PixelType?.BitsPerPixel);
}
}

Loading…
Cancel
Save