Browse Source

Update metadata names (#879)

af/merge-core
Jason Nelson 7 years ago
committed by James Jackson-South
parent
commit
fca697206a
  1. 4
      src/ImageSharp/Common/Helpers/UnitConverter.cs
  2. 26
      src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs
  3. 26
      src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs
  4. 4
      src/ImageSharp/Formats/Bmp/BmpFormat.cs
  5. 12
      src/ImageSharp/Formats/Bmp/BmpMetaData.cs
  6. 2
      src/ImageSharp/Formats/Gif/GifDecoder.cs
  7. 34
      src/ImageSharp/Formats/Gif/GifDecoderCore.cs
  8. 60
      src/ImageSharp/Formats/Gif/GifEncoderCore.cs
  9. 6
      src/ImageSharp/Formats/Gif/GifFormat.cs
  10. 12
      src/ImageSharp/Formats/Gif/GifFrameMetaData.cs
  11. 12
      src/ImageSharp/Formats/Gif/GifMetaData.cs
  12. 2
      src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs
  13. 24
      src/ImageSharp/Formats/IImageFormat.cs
  14. 2
      src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs
  15. 44
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs
  16. 30
      src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs
  17. 4
      src/ImageSharp/Formats/Jpeg/JpegFormat.cs
  18. 12
      src/ImageSharp/Formats/Jpeg/JpegMetaData.cs
  19. 4
      src/ImageSharp/Formats/Png/Chunks/PhysicalChunkData.cs
  20. 128
      src/ImageSharp/Formats/Png/PngDecoderCore.cs
  21. 54
      src/ImageSharp/Formats/Png/PngEncoderCore.cs
  22. 4
      src/ImageSharp/Formats/Png/PngFormat.cs
  23. 12
      src/ImageSharp/Formats/Png/PngMetaData.cs
  24. 4
      src/ImageSharp/IImageInfo.cs
  25. 6
      src/ImageSharp/Image.Decode.cs
  26. 18
      src/ImageSharp/Image.WrapMemory.cs
  27. 4
      src/ImageSharp/ImageFrameCollection.cs
  28. 42
      src/ImageSharp/ImageFrame{TPixel}.cs
  29. 10
      src/ImageSharp/ImageInfo.cs
  30. 28
      src/ImageSharp/Image{TPixel}.cs
  31. 2
      src/ImageSharp/MetaData/FrameDecodingMode.cs
  32. 42
      src/ImageSharp/MetaData/ImageFrameMetaData.cs
  33. 44
      src/ImageSharp/MetaData/ImageMetaData.cs
  34. 2
      src/ImageSharp/MetaData/ImageProperty.cs
  35. 2
      src/ImageSharp/MetaData/PixelResolutionUnit.cs
  36. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifConstants.cs
  37. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs
  38. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs
  39. 12
      src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs
  40. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs
  41. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs
  42. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs
  43. 4
      src/ImageSharp/MetaData/Profiles/Exif/ExifTags.cs
  44. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs
  45. 2
      src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs
  46. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs
  47. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs
  48. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs
  49. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs
  50. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs
  51. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs
  52. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs
  53. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs
  54. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs
  55. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs
  56. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs
  57. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs
  58. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs
  59. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs
  60. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs
  61. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs
  62. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs
  63. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs
  64. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs
  65. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs
  66. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs
  67. 2
      src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs
  68. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs
  69. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs
  70. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs
  71. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs
  72. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs
  73. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs
  74. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs
  75. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs
  76. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs
  77. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs
  78. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs
  79. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs
  80. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs
  81. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs
  82. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs
  83. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs
  84. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs
  85. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs
  86. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs
  87. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs
  88. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs
  89. 2
      src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs
  90. 2
      src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs
  91. 2
      src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs
  92. 2
      src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs
  93. 2
      src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs
  94. 2
      src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs
  95. 2
      src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs
  96. 2
      src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs
  97. 2
      src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs
  98. 2
      src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs
  99. 2
      src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs
  100. 2
      src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs

4
src/ImageSharp/Common/Helpers/UnitConverter.cs

@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.Metadata.Profiles.Exif;
namespace SixLabors.ImageSharp.Common.Helpers namespace SixLabors.ImageSharp.Common.Helpers
{ {

26
src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs

@ -9,7 +9,7 @@ using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Common.Helpers; using SixLabors.ImageSharp.Common.Helpers;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory; using SixLabors.Memory;
@ -66,12 +66,12 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <summary> /// <summary>
/// The metadata. /// The metadata.
/// </summary> /// </summary>
private ImageMetaData metaData; private ImageMetadata metadata;
/// <summary> /// <summary>
/// The bmp specific metadata. /// The bmp specific metadata.
/// </summary> /// </summary>
private BmpMetaData bmpMetaData; private BmpMetadata bmpMetadata;
/// <summary> /// <summary>
/// The file header containing general information. /// The file header containing general information.
@ -116,7 +116,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
{ {
int bytesPerColorMapEntry = this.ReadImageHeaders(stream, out bool inverted, out byte[] palette); int bytesPerColorMapEntry = this.ReadImageHeaders(stream, out bool inverted, out byte[] palette);
var image = new Image<TPixel>(this.configuration, this.infoHeader.Width, this.infoHeader.Height, this.metaData); var image = new Image<TPixel>(this.configuration, this.infoHeader.Width, this.infoHeader.Height, this.metadata);
Buffer2D<TPixel> pixels = image.GetRootFramePixelBuffer(); Buffer2D<TPixel> pixels = image.GetRootFramePixelBuffer();
@ -125,7 +125,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
case BmpCompression.RGB: case BmpCompression.RGB:
if (this.infoHeader.BitsPerPixel == 32) if (this.infoHeader.BitsPerPixel == 32)
{ {
if (this.bmpMetaData.InfoHeaderType == BmpInfoHeaderType.WinVersion3) if (this.bmpMetadata.InfoHeaderType == BmpInfoHeaderType.WinVersion3)
{ {
this.ReadRgb32Slow(pixels, this.infoHeader.Width, this.infoHeader.Height, inverted); this.ReadRgb32Slow(pixels, this.infoHeader.Width, this.infoHeader.Height, inverted);
} }
@ -188,7 +188,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
public IImageInfo Identify(Stream stream) public IImageInfo Identify(Stream stream)
{ {
this.ReadImageHeaders(stream, out _, out _); this.ReadImageHeaders(stream, out _, out _);
return new ImageInfo(new PixelTypeInfo(this.infoHeader.BitsPerPixel), this.infoHeader.Width, this.infoHeader.Height, this.metaData); return new ImageInfo(new PixelTypeInfo(this.infoHeader.BitsPerPixel), this.infoHeader.Width, this.infoHeader.Height, this.metadata);
} }
/// <summary> /// <summary>
@ -999,7 +999,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
} }
// Resolution is stored in PPM. // Resolution is stored in PPM.
var meta = new ImageMetaData var meta = new ImageMetadata
{ {
ResolutionUnits = PixelResolutionUnit.PixelsPerMeter ResolutionUnits = PixelResolutionUnit.PixelsPerMeter
}; };
@ -1011,21 +1011,21 @@ namespace SixLabors.ImageSharp.Formats.Bmp
else else
{ {
// Convert default metadata values to PPM. // Convert default metadata values to PPM.
meta.HorizontalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetaData.DefaultHorizontalResolution)); meta.HorizontalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetadata.DefaultHorizontalResolution));
meta.VerticalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetaData.DefaultVerticalResolution)); meta.VerticalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetadata.DefaultVerticalResolution));
} }
this.metaData = meta; this.metadata = meta;
short bitsPerPixel = this.infoHeader.BitsPerPixel; short bitsPerPixel = this.infoHeader.BitsPerPixel;
this.bmpMetaData = this.metaData.GetFormatMetaData(BmpFormat.Instance); this.bmpMetadata = this.metadata.GetFormatMetadata(BmpFormat.Instance);
this.bmpMetaData.InfoHeaderType = infoHeaderType; this.bmpMetadata.InfoHeaderType = infoHeaderType;
// We can only encode at these bit rates so far. // We can only encode at these bit rates so far.
if (bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel24) if (bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel24)
|| bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel32)) || bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel32))
{ {
this.bmpMetaData.BitsPerPixel = (BmpBitsPerPixel)bitsPerPixel; this.bmpMetadata.BitsPerPixel = (BmpBitsPerPixel)bitsPerPixel;
} }
// skip the remaining header because we can't read those parts // skip the remaining header because we can't read those parts

26
src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs

@ -7,7 +7,7 @@ using System.IO;
using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Common.Helpers; using SixLabors.ImageSharp.Common.Helpers;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory; using SixLabors.Memory;
@ -73,9 +73,9 @@ namespace SixLabors.ImageSharp.Formats.Bmp
Guard.NotNull(stream, nameof(stream)); Guard.NotNull(stream, nameof(stream));
this.configuration = image.GetConfiguration(); this.configuration = image.GetConfiguration();
ImageMetaData metaData = image.MetaData; ImageMetadata metadata = image.Metadata;
BmpMetaData bmpMetaData = metaData.GetFormatMetaData(BmpFormat.Instance); BmpMetadata bmpMetadata = metadata.GetFormatMetadata(BmpFormat.Instance);
this.bitsPerPixel = this.bitsPerPixel ?? bmpMetaData.BitsPerPixel; this.bitsPerPixel = this.bitsPerPixel ?? bmpMetadata.BitsPerPixel;
short bpp = (short)this.bitsPerPixel; short bpp = (short)this.bitsPerPixel;
int bytesPerLine = 4 * (((image.Width * bpp) + 31) / 32); int bytesPerLine = 4 * (((image.Width * bpp) + 31) / 32);
@ -85,27 +85,27 @@ namespace SixLabors.ImageSharp.Formats.Bmp
int hResolution = 0; int hResolution = 0;
int vResolution = 0; int vResolution = 0;
if (metaData.ResolutionUnits != PixelResolutionUnit.AspectRatio) if (metadata.ResolutionUnits != PixelResolutionUnit.AspectRatio)
{ {
if (metaData.HorizontalResolution > 0 && metaData.VerticalResolution > 0) if (metadata.HorizontalResolution > 0 && metadata.VerticalResolution > 0)
{ {
switch (metaData.ResolutionUnits) switch (metadata.ResolutionUnits)
{ {
case PixelResolutionUnit.PixelsPerInch: case PixelResolutionUnit.PixelsPerInch:
hResolution = (int)Math.Round(UnitConverter.InchToMeter(metaData.HorizontalResolution)); hResolution = (int)Math.Round(UnitConverter.InchToMeter(metadata.HorizontalResolution));
vResolution = (int)Math.Round(UnitConverter.InchToMeter(metaData.VerticalResolution)); vResolution = (int)Math.Round(UnitConverter.InchToMeter(metadata.VerticalResolution));
break; break;
case PixelResolutionUnit.PixelsPerCentimeter: case PixelResolutionUnit.PixelsPerCentimeter:
hResolution = (int)Math.Round(UnitConverter.CmToMeter(metaData.HorizontalResolution)); hResolution = (int)Math.Round(UnitConverter.CmToMeter(metadata.HorizontalResolution));
vResolution = (int)Math.Round(UnitConverter.CmToMeter(metaData.VerticalResolution)); vResolution = (int)Math.Round(UnitConverter.CmToMeter(metadata.VerticalResolution));
break; break;
case PixelResolutionUnit.PixelsPerMeter: case PixelResolutionUnit.PixelsPerMeter:
hResolution = (int)Math.Round(metaData.HorizontalResolution); hResolution = (int)Math.Round(metadata.HorizontalResolution);
vResolution = (int)Math.Round(metaData.VerticalResolution); vResolution = (int)Math.Round(metadata.VerticalResolution);
break; break;
} }

4
src/ImageSharp/Formats/Bmp/BmpFormat.cs

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <summary> /// <summary>
/// Registers the image encoders, decoders and mime type detectors for the bmp format. /// Registers the image encoders, decoders and mime type detectors for the bmp format.
/// </summary> /// </summary>
public sealed class BmpFormat : IImageFormat<BmpMetaData> public sealed class BmpFormat : IImageFormat<BmpMetadata>
{ {
private BmpFormat() private BmpFormat()
{ {
@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp.Formats.Bmp
public IEnumerable<string> FileExtensions => BmpConstants.FileExtensions; public IEnumerable<string> FileExtensions => BmpConstants.FileExtensions;
/// <inheritdoc/> /// <inheritdoc/>
public BmpMetaData CreateDefaultFormatMetaData() => new BmpMetaData(); public BmpMetadata CreateDefaultFormatMetadata() => new BmpMetadata();
} }
} }

12
src/ImageSharp/Formats/Bmp/BmpMetaData.cs

@ -6,20 +6,20 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <summary> /// <summary>
/// Provides Bmp specific metadata information for the image. /// Provides Bmp specific metadata information for the image.
/// </summary> /// </summary>
public class BmpMetaData : IDeepCloneable public class BmpMetadata : IDeepCloneable
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BmpMetaData"/> class. /// Initializes a new instance of the <see cref="BmpMetadata"/> class.
/// </summary> /// </summary>
public BmpMetaData() public BmpMetadata()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BmpMetaData"/> class. /// Initializes a new instance of the <see cref="BmpMetadata"/> class.
/// </summary> /// </summary>
/// <param name="other">The metadata to create an instance from.</param> /// <param name="other">The metadata to create an instance from.</param>
private BmpMetaData(BmpMetaData other) private BmpMetadata(BmpMetadata other)
{ {
this.BitsPerPixel = other.BitsPerPixel; this.BitsPerPixel = other.BitsPerPixel;
this.InfoHeaderType = other.InfoHeaderType; this.InfoHeaderType = other.InfoHeaderType;
@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24; public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
/// <inheritdoc/> /// <inheritdoc/>
public IDeepCloneable DeepClone() => new BmpMetaData(this); public IDeepCloneable DeepClone() => new BmpMetadata(this);
// TODO: Colors used once we support encoding palette bmps. // TODO: Colors used once we support encoding palette bmps.
} }

2
src/ImageSharp/Formats/Gif/GifDecoder.cs

@ -3,7 +3,7 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Gif namespace SixLabors.ImageSharp.Formats.Gif

34
src/ImageSharp/Formats/Gif/GifDecoderCore.cs

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
using System.Text; using System.Text;
using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory; using SixLabors.Memory;
using SixLabors.Primitives; using SixLabors.Primitives;
@ -63,12 +63,12 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// The abstract metadata. /// The abstract metadata.
/// </summary> /// </summary>
private ImageMetaData metaData; private ImageMetadata metadata;
/// <summary> /// <summary>
/// The gif specific metadata. /// The gif specific metadata.
/// </summary> /// </summary>
private GifMetaData gifMetaData; private GifMetadata gifMetadata;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifDecoderCore"/> class. /// Initializes a new instance of the <see cref="GifDecoderCore"/> class.
@ -223,7 +223,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
new PixelTypeInfo(this.logicalScreenDescriptor.BitsPerPixel), new PixelTypeInfo(this.logicalScreenDescriptor.BitsPerPixel),
this.logicalScreenDescriptor.Width, this.logicalScreenDescriptor.Width,
this.logicalScreenDescriptor.Height, this.logicalScreenDescriptor.Height,
this.metaData); this.metadata);
} }
/// <summary> /// <summary>
@ -276,7 +276,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
if (subBlockSize == GifConstants.NetscapeLoopingSubBlockSize) if (subBlockSize == GifConstants.NetscapeLoopingSubBlockSize)
{ {
this.stream.Read(this.buffer, 0, GifConstants.NetscapeLoopingSubBlockSize); this.stream.Read(this.buffer, 0, GifConstants.NetscapeLoopingSubBlockSize);
this.gifMetaData.RepeatCount = GifNetscapeLoopingApplicationExtension.Parse(this.buffer.AsSpan(1)).RepeatCount; this.gifMetadata.RepeatCount = GifNetscapeLoopingApplicationExtension.Parse(this.buffer.AsSpan(1)).RepeatCount;
this.stream.Skip(1); // Skip the terminator. this.stream.Skip(1); // Skip the terminator.
return; return;
} }
@ -334,7 +334,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
{ {
this.stream.Read(commentsBuffer.Array, 0, length); this.stream.Read(commentsBuffer.Array, 0, length);
string comments = this.TextEncoding.GetString(commentsBuffer.Array, 0, length); string comments = this.TextEncoding.GetString(commentsBuffer.Array, 0, length);
this.metaData.Properties.Add(new ImageProperty(GifConstants.Comments, comments)); this.metadata.Properties.Add(new ImageProperty(GifConstants.Comments, comments));
} }
} }
} }
@ -416,9 +416,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
if (previousFrame is null) if (previousFrame is null)
{ {
// This initializes the image to become fully transparent because the alpha channel is zero. // This initializes the image to become fully transparent because the alpha channel is zero.
image = new Image<TPixel>(this.configuration, imageWidth, imageHeight, this.metaData); image = new Image<TPixel>(this.configuration, imageWidth, imageHeight, this.metadata);
this.SetFrameMetaData(image.Frames.RootFrame.MetaData); this.SetFrameMetadata(image.Frames.RootFrame.Metadata);
imageFrame = image.Frames.RootFrame; imageFrame = image.Frames.RootFrame;
} }
@ -431,7 +431,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
currentFrame = image.Frames.AddFrame(previousFrame); // This clones the frame and adds it the collection currentFrame = image.Frames.AddFrame(previousFrame); // This clones the frame and adds it the collection
this.SetFrameMetaData(currentFrame.MetaData); this.SetFrameMetadata(currentFrame.Metadata);
imageFrame = currentFrame; imageFrame = currentFrame;
@ -549,11 +549,11 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// Sets the frames metadata. /// Sets the frames metadata.
/// </summary> /// </summary>
/// <param name="meta">The meta data.</param> /// <param name="meta">The metadata.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private void SetFrameMetaData(ImageFrameMetaData meta) private void SetFrameMetadata(ImageFrameMetadata meta)
{ {
GifFrameMetaData gifMeta = meta.GetFormatMetaData(GifFormat.Instance); GifFrameMetadata gifMeta = meta.GetFormatMetadata(GifFormat.Instance);
if (this.graphicsControlExtension.DelayTime > 0) if (this.graphicsControlExtension.DelayTime > 0)
{ {
gifMeta.FrameDelay = this.graphicsControlExtension.DelayTime; gifMeta.FrameDelay = this.graphicsControlExtension.DelayTime;
@ -586,7 +586,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
this.stream.Skip(6); this.stream.Skip(6);
this.ReadLogicalScreenDescriptor(); this.ReadLogicalScreenDescriptor();
var meta = new ImageMetaData(); var meta = new ImageMetadata();
// The Pixel Aspect Ratio is defined to be the quotient of the pixel's // The Pixel Aspect Ratio is defined to be the quotient of the pixel's
// width over its height. The value range in this field allows // width over its height. The value range in this field allows
@ -614,16 +614,16 @@ namespace SixLabors.ImageSharp.Formats.Gif
} }
} }
this.metaData = meta; this.metadata = meta;
this.gifMetaData = meta.GetFormatMetaData(GifFormat.Instance); this.gifMetadata = meta.GetFormatMetadata(GifFormat.Instance);
this.gifMetaData.ColorTableMode = this.logicalScreenDescriptor.GlobalColorTableFlag this.gifMetadata.ColorTableMode = this.logicalScreenDescriptor.GlobalColorTableFlag
? GifColorTableMode.Global ? GifColorTableMode.Global
: GifColorTableMode.Local; : GifColorTableMode.Local;
if (this.logicalScreenDescriptor.GlobalColorTableFlag) if (this.logicalScreenDescriptor.GlobalColorTableFlag)
{ {
int globalColorTableLength = this.logicalScreenDescriptor.GlobalColorTableSize * 3; int globalColorTableLength = this.logicalScreenDescriptor.GlobalColorTableSize * 3;
this.gifMetaData.GlobalColorTableLength = globalColorTableLength; this.gifMetadata.GlobalColorTableLength = globalColorTableLength;
this.globalColorTable = this.MemoryAllocator.AllocateManagedByteBuffer(globalColorTableLength, AllocationOptions.Clean); this.globalColorTable = this.MemoryAllocator.AllocateManagedByteBuffer(globalColorTableLength, AllocationOptions.Clean);

60
src/ImageSharp/Formats/Gif/GifEncoderCore.cs

@ -10,7 +10,7 @@ using System.Text;
using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.ImageSharp.Processing.Processors.Quantization;
using SixLabors.Memory; using SixLabors.Memory;
@ -58,9 +58,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
private int bitDepth; private int bitDepth;
/// <summary> /// <summary>
/// Gif specific meta data. /// Gif specific metadata.
/// </summary> /// </summary>
private GifMetaData gifMetaData; private GifMetadata gifMetadata;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifEncoderCore"/> class. /// Initializes a new instance of the <see cref="GifEncoderCore"/> class.
@ -89,9 +89,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
this.configuration = image.GetConfiguration(); this.configuration = image.GetConfiguration();
ImageMetaData metaData = image.MetaData; ImageMetadata metadata = image.Metadata;
this.gifMetaData = metaData.GetFormatMetaData(GifFormat.Instance); this.gifMetadata = metadata.GetFormatMetadata(GifFormat.Instance);
this.colorTableMode = this.colorTableMode ?? this.gifMetaData.ColorTableMode; this.colorTableMode = this.colorTableMode ?? this.gifMetadata.ColorTableMode;
bool useGlobalTable = this.colorTableMode == GifColorTableMode.Global; bool useGlobalTable = this.colorTableMode == GifColorTableMode.Global;
// Quantize the image returning a palette. // Quantize the image returning a palette.
@ -106,7 +106,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
// Write the LSD. // Write the LSD.
int index = this.GetTransparentIndex(quantized); int index = this.GetTransparentIndex(quantized);
this.WriteLogicalScreenDescriptor(metaData, image.Width, image.Height, index, useGlobalTable, stream); this.WriteLogicalScreenDescriptor(metadata, image.Width, image.Height, index, useGlobalTable, stream);
if (useGlobalTable) if (useGlobalTable)
{ {
@ -114,12 +114,12 @@ namespace SixLabors.ImageSharp.Formats.Gif
} }
// Write the comments. // Write the comments.
this.WriteComments(metaData, stream); this.WriteComments(metadata, stream);
// Write application extension to allow additional frames. // Write application extension to allow additional frames.
if (image.Frames.Count > 1) if (image.Frames.Count > 1)
{ {
this.WriteApplicationExtension(stream, this.gifMetaData.RepeatCount); this.WriteApplicationExtension(stream, this.gifMetadata.RepeatCount);
} }
if (useGlobalTable) if (useGlobalTable)
@ -147,9 +147,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
for (int i = 0; i < image.Frames.Count; i++) for (int i = 0; i < image.Frames.Count; i++)
{ {
ImageFrame<TPixel> frame = image.Frames[i]; ImageFrame<TPixel> frame = image.Frames[i];
ImageFrameMetaData metaData = frame.MetaData; ImageFrameMetadata metadata = frame.Metadata;
GifFrameMetaData frameMetaData = metaData.GetFormatMetaData(GifFormat.Instance); GifFrameMetadata frameMetadata = metadata.GetFormatMetadata(GifFormat.Instance);
this.WriteGraphicalControlExtension(frameMetaData, transparencyIndex, stream); this.WriteGraphicalControlExtension(frameMetadata, transparencyIndex, stream);
this.WriteImageDescriptor(frame, false, stream); this.WriteImageDescriptor(frame, false, stream);
if (i == 0) if (i == 0)
@ -170,20 +170,20 @@ namespace SixLabors.ImageSharp.Formats.Gif
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
ImageFrame<TPixel> previousFrame = null; ImageFrame<TPixel> previousFrame = null;
GifFrameMetaData previousMeta = null; GifFrameMetadata previousMeta = null;
foreach (ImageFrame<TPixel> frame in image.Frames) foreach (ImageFrame<TPixel> frame in image.Frames)
{ {
ImageFrameMetaData metaData = frame.MetaData; ImageFrameMetadata metadata = frame.Metadata;
GifFrameMetaData frameMetaData = metaData.GetFormatMetaData(GifFormat.Instance); GifFrameMetadata frameMetadata = metadata.GetFormatMetadata(GifFormat.Instance);
if (quantized is null) if (quantized is null)
{ {
// Allow each frame to be encoded at whatever color depth the frame designates if set. // Allow each frame to be encoded at whatever color depth the frame designates if set.
if (previousFrame != null && previousMeta.ColorTableLength != frameMetaData.ColorTableLength if (previousFrame != null && previousMeta.ColorTableLength != frameMetadata.ColorTableLength
&& frameMetaData.ColorTableLength > 0) && frameMetadata.ColorTableLength > 0)
{ {
quantized = this.quantizer.CreateFrameQuantizer<TPixel>( quantized = this.quantizer.CreateFrameQuantizer<TPixel>(
image.GetConfiguration(), image.GetConfiguration(),
frameMetaData.ColorTableLength).QuantizeFrame(frame); frameMetadata.ColorTableLength).QuantizeFrame(frame);
} }
else else
{ {
@ -193,7 +193,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
} }
this.bitDepth = ImageMaths.GetBitsNeededForColorDepth(quantized.Palette.Length).Clamp(1, 8); this.bitDepth = ImageMaths.GetBitsNeededForColorDepth(quantized.Palette.Length).Clamp(1, 8);
this.WriteGraphicalControlExtension(frameMetaData, this.GetTransparentIndex(quantized), stream); this.WriteGraphicalControlExtension(frameMetadata, this.GetTransparentIndex(quantized), stream);
this.WriteImageDescriptor(frame, true, stream); this.WriteImageDescriptor(frame, true, stream);
this.WriteColorTable(quantized, stream); this.WriteColorTable(quantized, stream);
this.WriteImageData(quantized, stream); this.WriteImageData(quantized, stream);
@ -201,7 +201,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
quantized?.Dispose(); quantized?.Dispose();
quantized = null; // So next frame can regenerate it quantized = null; // So next frame can regenerate it
previousFrame = frame; previousFrame = frame;
previousMeta = frameMetaData; previousMeta = frameMetadata;
} }
} }
@ -250,14 +250,14 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// Writes the logical screen descriptor to the stream. /// Writes the logical screen descriptor to the stream.
/// </summary> /// </summary>
/// <param name="metaData">The image metadata.</param> /// <param name="metadata">The image metadata.</param>
/// <param name="width">The image width.</param> /// <param name="width">The image width.</param>
/// <param name="height">The image height.</param> /// <param name="height">The image height.</param>
/// <param name="transparencyIndex">The transparency index to set the default background index to.</param> /// <param name="transparencyIndex">The transparency index to set the default background index to.</param>
/// <param name="useGlobalTable">Whether to use a global or local color table.</param> /// <param name="useGlobalTable">Whether to use a global or local color table.</param>
/// <param name="stream">The stream to write to.</param> /// <param name="stream">The stream to write to.</param>
private void WriteLogicalScreenDescriptor( private void WriteLogicalScreenDescriptor(
ImageMetaData metaData, ImageMetadata metadata,
int width, int width,
int height, int height,
int transparencyIndex, int transparencyIndex,
@ -277,10 +277,10 @@ namespace SixLabors.ImageSharp.Formats.Gif
// Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 // Aspect Ratio = (Pixel Aspect Ratio + 15) / 64
byte ratio = 0; byte ratio = 0;
if (metaData.ResolutionUnits == PixelResolutionUnit.AspectRatio) if (metadata.ResolutionUnits == PixelResolutionUnit.AspectRatio)
{ {
double hr = metaData.HorizontalResolution; double hr = metadata.HorizontalResolution;
double vr = metaData.VerticalResolution; double vr = metadata.VerticalResolution;
if (hr != vr) if (hr != vr)
{ {
if (hr > vr) if (hr > vr)
@ -326,7 +326,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// </summary> /// </summary>
/// <param name="metadata">The metadata to be extract the comment data.</param> /// <param name="metadata">The metadata to be extract the comment data.</param>
/// <param name="stream">The stream to write to.</param> /// <param name="stream">The stream to write to.</param>
private void WriteComments(ImageMetaData metadata, Stream stream) private void WriteComments(ImageMetadata metadata, Stream stream)
{ {
if (!metadata.TryGetProperty(GifConstants.Comments, out ImageProperty property) if (!metadata.TryGetProperty(GifConstants.Comments, out ImageProperty property)
|| string.IsNullOrEmpty(property.Value)) || string.IsNullOrEmpty(property.Value))
@ -350,18 +350,18 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// Writes the graphics control extension to the stream. /// Writes the graphics control extension to the stream.
/// </summary> /// </summary>
/// <param name="metaData">The metadata of the image or frame.</param> /// <param name="metadata">The metadata of the image or frame.</param>
/// <param name="transparencyIndex">The index of the color in the color palette to make transparent.</param> /// <param name="transparencyIndex">The index of the color in the color palette to make transparent.</param>
/// <param name="stream">The stream to write to.</param> /// <param name="stream">The stream to write to.</param>
private void WriteGraphicalControlExtension(GifFrameMetaData metaData, int transparencyIndex, Stream stream) private void WriteGraphicalControlExtension(GifFrameMetadata metadata, int transparencyIndex, Stream stream)
{ {
byte packedValue = GifGraphicControlExtension.GetPackedValue( byte packedValue = GifGraphicControlExtension.GetPackedValue(
disposalMethod: metaData.DisposalMethod, disposalMethod: metadata.DisposalMethod,
transparencyFlag: transparencyIndex > -1); transparencyFlag: transparencyIndex > -1);
var extension = new GifGraphicControlExtension( var extension = new GifGraphicControlExtension(
packed: packedValue, packed: packedValue,
delayTime: (ushort)metaData.FrameDelay, delayTime: (ushort)metadata.FrameDelay,
transparencyIndex: unchecked((byte)transparencyIndex)); transparencyIndex: unchecked((byte)transparencyIndex));
this.WriteExtension(extension, stream); this.WriteExtension(extension, stream);

6
src/ImageSharp/Formats/Gif/GifFormat.cs

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// Registers the image encoders, decoders and mime type detectors for the gif format. /// Registers the image encoders, decoders and mime type detectors for the gif format.
/// </summary> /// </summary>
public sealed class GifFormat : IImageFormat<GifMetaData, GifFrameMetaData> public sealed class GifFormat : IImageFormat<GifMetadata, GifFrameMetadata>
{ {
private GifFormat() private GifFormat()
{ {
@ -32,9 +32,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
public IEnumerable<string> FileExtensions => GifConstants.FileExtensions; public IEnumerable<string> FileExtensions => GifConstants.FileExtensions;
/// <inheritdoc/> /// <inheritdoc/>
public GifMetaData CreateDefaultFormatMetaData() => new GifMetaData(); public GifMetadata CreateDefaultFormatMetadata() => new GifMetadata();
/// <inheritdoc/> /// <inheritdoc/>
public GifFrameMetaData CreateDefaultFormatFrameMetaData() => new GifFrameMetaData(); public GifFrameMetadata CreateDefaultFormatFrameMetadata() => new GifFrameMetadata();
} }
} }

12
src/ImageSharp/Formats/Gif/GifFrameMetaData.cs

@ -6,20 +6,20 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// Provides Gif specific metadata information for the image frame. /// Provides Gif specific metadata information for the image frame.
/// </summary> /// </summary>
public class GifFrameMetaData : IDeepCloneable public class GifFrameMetadata : IDeepCloneable
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifFrameMetaData"/> class. /// Initializes a new instance of the <see cref="GifFrameMetadata"/> class.
/// </summary> /// </summary>
public GifFrameMetaData() public GifFrameMetadata()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifFrameMetaData"/> class. /// Initializes a new instance of the <see cref="GifFrameMetadata"/> class.
/// </summary> /// </summary>
/// <param name="other">The metadata to create an instance from.</param> /// <param name="other">The metadata to create an instance from.</param>
private GifFrameMetaData(GifFrameMetaData other) private GifFrameMetadata(GifFrameMetadata other)
{ {
this.ColorTableLength = other.ColorTableLength; this.ColorTableLength = other.ColorTableLength;
this.FrameDelay = other.FrameDelay; this.FrameDelay = other.FrameDelay;
@ -49,6 +49,6 @@ namespace SixLabors.ImageSharp.Formats.Gif
public GifDisposalMethod DisposalMethod { get; set; } public GifDisposalMethod DisposalMethod { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public IDeepCloneable DeepClone() => new GifFrameMetaData(this); public IDeepCloneable DeepClone() => new GifFrameMetadata(this);
} }
} }

12
src/ImageSharp/Formats/Gif/GifMetaData.cs

@ -6,20 +6,20 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary> /// <summary>
/// Provides Gif specific metadata information for the image. /// Provides Gif specific metadata information for the image.
/// </summary> /// </summary>
public class GifMetaData : IDeepCloneable public class GifMetadata : IDeepCloneable
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifMetaData"/> class. /// Initializes a new instance of the <see cref="GifMetadata"/> class.
/// </summary> /// </summary>
public GifMetaData() public GifMetadata()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="GifMetaData"/> class. /// Initializes a new instance of the <see cref="GifMetadata"/> class.
/// </summary> /// </summary>
/// <param name="other">The metadata to create an instance from.</param> /// <param name="other">The metadata to create an instance from.</param>
private GifMetaData(GifMetaData other) private GifMetadata(GifMetadata other)
{ {
this.RepeatCount = other.RepeatCount; this.RepeatCount = other.RepeatCount;
this.ColorTableMode = other.ColorTableMode; this.ColorTableMode = other.ColorTableMode;
@ -45,6 +45,6 @@ namespace SixLabors.ImageSharp.Formats.Gif
public int GlobalColorTableLength { get; set; } public int GlobalColorTableLength { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public IDeepCloneable DeepClone() => new GifMetaData(this); public IDeepCloneable DeepClone() => new GifMetadata(this);
} }
} }

2
src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System.Text; using System.Text;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp.Formats.Gif namespace SixLabors.ImageSharp.Formats.Gif
{ {

24
src/ImageSharp/Formats/IImageFormat.cs

@ -34,30 +34,30 @@ namespace SixLabors.ImageSharp.Formats
/// <summary> /// <summary>
/// Defines the contract for an image format containing metadata. /// Defines the contract for an image format containing metadata.
/// </summary> /// </summary>
/// <typeparam name="TFormatMetaData">The type of format metadata.</typeparam> /// <typeparam name="TFormatMetadata">The type of format metadata.</typeparam>
public interface IImageFormat<out TFormatMetaData> : IImageFormat public interface IImageFormat<out TFormatMetadata> : IImageFormat
where TFormatMetaData : class where TFormatMetadata : class
{ {
/// <summary> /// <summary>
/// Creates a default instance of the format metadata. /// Creates a default instance of the format metadata.
/// </summary> /// </summary>
/// <returns>The <typeparamref name="TFormatMetaData"/>.</returns> /// <returns>The <typeparamref name="TFormatMetadata"/>.</returns>
TFormatMetaData CreateDefaultFormatMetaData(); TFormatMetadata CreateDefaultFormatMetadata();
} }
/// <summary> /// <summary>
/// Defines the contract for an image format containing metadata with multiple frames. /// Defines the contract for an image format containing metadata with multiple frames.
/// </summary> /// </summary>
/// <typeparam name="TFormatMetaData">The type of format metadata.</typeparam> /// <typeparam name="TFormatMetadata">The type of format metadata.</typeparam>
/// <typeparam name="TFormatFrameMetaData">The type of format frame metadata.</typeparam> /// <typeparam name="TFormatFrameMetadata">The type of format frame metadata.</typeparam>
public interface IImageFormat<out TFormatMetaData, out TFormatFrameMetaData> : IImageFormat<TFormatMetaData> public interface IImageFormat<out TFormatMetadata, out TFormatFrameMetadata> : IImageFormat<TFormatMetadata>
where TFormatMetaData : class where TFormatMetadata : class
where TFormatFrameMetaData : class where TFormatFrameMetadata : class
{ {
/// <summary> /// <summary>
/// Creates a default instance of the format frame metadata. /// Creates a default instance of the format frame metadata.
/// </summary> /// </summary>
/// <returns>The <typeparamref name="TFormatFrameMetaData"/>.</returns> /// <returns>The <typeparamref name="TFormatFrameMetadata"/>.</returns>
TFormatFrameMetaData CreateDefaultFormatFrameMetaData(); TFormatFrameMetadata CreateDefaultFormatFrameMetadata();
} }
} }

2
src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System; using System;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
{ {

44
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -12,9 +12,9 @@ using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder; using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder;
using SixLabors.ImageSharp.IO; using SixLabors.ImageSharp.IO;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc; using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
using SixLabors.Memory; using SixLabors.Memory;
@ -149,9 +149,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public bool IgnoreMetadata { get; } public bool IgnoreMetadata { get; }
/// <summary> /// <summary>
/// Gets the <see cref="ImageMetaData"/> decoded by this decoder instance. /// Gets the <see cref="ImageMetadata"/> decoded by this decoder instance.
/// </summary> /// </summary>
public ImageMetaData MetaData { get; private set; } public ImageMetadata Metadata { get; private set; }
/// <inheritdoc/> /// <inheritdoc/>
public int ComponentCount { get; private set; } public int ComponentCount { get; private set; }
@ -222,7 +222,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.ParseStream(stream); this.ParseStream(stream);
this.InitExifProfile(); this.InitExifProfile();
this.InitIccProfile(); this.InitIccProfile();
this.InitDerivedMetaDataProperties(); this.InitDerivedMetadataProperties();
return this.PostProcessIntoImage<TPixel>(); return this.PostProcessIntoImage<TPixel>();
} }
@ -235,9 +235,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.ParseStream(stream, true); this.ParseStream(stream, true);
this.InitExifProfile(); this.InitExifProfile();
this.InitIccProfile(); this.InitIccProfile();
this.InitDerivedMetaDataProperties(); this.InitDerivedMetadataProperties();
return new ImageInfo(new PixelTypeInfo(this.BitsPerPixel), this.ImageWidth, this.ImageHeight, this.MetaData); return new ImageInfo(new PixelTypeInfo(this.BitsPerPixel), this.ImageWidth, this.ImageHeight, this.Metadata);
} }
/// <summary> /// <summary>
@ -247,7 +247,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <param name="metadataOnly">Whether to decode metadata only.</param> /// <param name="metadataOnly">Whether to decode metadata only.</param>
public void ParseStream(Stream stream, bool metadataOnly = false) public void ParseStream(Stream stream, bool metadataOnly = false)
{ {
this.MetaData = new ImageMetaData(); this.Metadata = new ImageMetadata();
this.InputStream = new DoubleBufferedStreamReader(this.configuration.MemoryAllocator, stream); this.InputStream = new DoubleBufferedStreamReader(this.configuration.MemoryAllocator, stream);
// Check for the Start Of Image marker. // Check for the Start Of Image marker.
@ -430,7 +430,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
{ {
if (this.isExif) if (this.isExif)
{ {
this.MetaData.ExifProfile = new ExifProfile(this.exifData); this.Metadata.ExifProfile = new ExifProfile(this.exifData);
} }
} }
@ -444,21 +444,21 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
var profile = new IccProfile(this.iccData); var profile = new IccProfile(this.iccData);
if (profile.CheckIsValid()) if (profile.CheckIsValid())
{ {
this.MetaData.IccProfile = profile; this.Metadata.IccProfile = profile;
} }
} }
} }
/// <summary> /// <summary>
/// Assigns derived metadata properties to <see cref="MetaData"/>, eg. horizontal and vertical resolution if it has a JFIF header. /// Assigns derived metadata properties to <see cref="Metadata"/>, eg. horizontal and vertical resolution if it has a JFIF header.
/// </summary> /// </summary>
private void InitDerivedMetaDataProperties() private void InitDerivedMetadataProperties()
{ {
if (this.jFif.XDensity > 0 && this.jFif.YDensity > 0) if (this.jFif.XDensity > 0 && this.jFif.YDensity > 0)
{ {
this.MetaData.HorizontalResolution = this.jFif.XDensity; this.Metadata.HorizontalResolution = this.jFif.XDensity;
this.MetaData.VerticalResolution = this.jFif.YDensity; this.Metadata.VerticalResolution = this.jFif.YDensity;
this.MetaData.ResolutionUnits = this.jFif.DensityUnits; this.Metadata.ResolutionUnits = this.jFif.DensityUnits;
} }
else if (this.isExif) else if (this.isExif)
{ {
@ -467,16 +467,16 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
if (horizontalValue > 0 && verticalValue > 0) if (horizontalValue > 0 && verticalValue > 0)
{ {
this.MetaData.HorizontalResolution = horizontalValue; this.Metadata.HorizontalResolution = horizontalValue;
this.MetaData.VerticalResolution = verticalValue; this.Metadata.VerticalResolution = verticalValue;
this.MetaData.ResolutionUnits = UnitConverter.ExifProfileToResolutionUnit(this.MetaData.ExifProfile); this.Metadata.ResolutionUnits = UnitConverter.ExifProfileToResolutionUnit(this.Metadata.ExifProfile);
} }
} }
} }
private double GetExifResolutionValue(ExifTag tag) private double GetExifResolutionValue(ExifTag tag)
{ {
if (!this.MetaData.ExifProfile.TryGetValue(tag, out ExifValue exifValue)) if (!this.Metadata.ExifProfile.TryGetValue(tag, out ExifValue exifValue))
{ {
return 0; return 0;
} }
@ -713,7 +713,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
JpegThrowHelper.ThrowBadMarker(nameof(JpegConstants.Markers.DQT), remaining); JpegThrowHelper.ThrowBadMarker(nameof(JpegConstants.Markers.DQT), remaining);
} }
this.MetaData.GetFormatMetaData(JpegFormat.Instance).Quality = QualityEvaluator.EstimateQuality(this.QuantizationTables); this.Metadata.GetFormatMetadata(JpegFormat.Instance).Quality = QualityEvaluator.EstimateQuality(this.QuantizationTables);
} }
/// <summary> /// <summary>
@ -992,7 +992,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.configuration, this.configuration,
this.ImageWidth, this.ImageWidth,
this.ImageHeight, this.ImageHeight,
this.MetaData); this.Metadata);
using (var postProcessor = new JpegImagePostProcessor(this.configuration, this)) using (var postProcessor = new JpegImagePostProcessor(this.configuration, this))
{ {

30
src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs

@ -10,9 +10,9 @@ using SixLabors.ImageSharp.Common.Helpers;
using SixLabors.ImageSharp.Formats.Jpeg.Components; using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder; using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder;
using SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder; using SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc; using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Jpeg namespace SixLabors.ImageSharp.Formats.Jpeg
@ -204,10 +204,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
} }
this.outputStream = stream; this.outputStream = stream;
ImageMetaData metaData = image.MetaData; ImageMetadata metadata = image.Metadata;
// System.Drawing produces identical output for jpegs with a quality parameter of 0 and 1. // System.Drawing produces identical output for jpegs with a quality parameter of 0 and 1.
int qlty = (this.quality ?? metaData.GetFormatMetaData(JpegFormat.Instance).Quality).Clamp(1, 100); int qlty = (this.quality ?? metadata.GetFormatMetadata(JpegFormat.Instance).Quality).Clamp(1, 100);
this.subsample = this.subsample ?? (qlty >= 91 ? JpegSubsample.Ratio444 : JpegSubsample.Ratio420); this.subsample = this.subsample ?? (qlty >= 91 ? JpegSubsample.Ratio444 : JpegSubsample.Ratio420);
// Convert from a quality rating to a scaling factor. // Convert from a quality rating to a scaling factor.
@ -229,10 +229,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
int componentCount = 3; int componentCount = 3;
// Write the Start Of Image marker. // Write the Start Of Image marker.
this.WriteApplicationHeader(metaData); this.WriteApplicationHeader(metadata);
// Write Exif and ICC profiles // Write Exif and ICC profiles
this.WriteProfiles(metaData); this.WriteProfiles(metadata);
// Write the quantization tables. // Write the quantization tables.
this.WriteDefineQuantizationTables(); this.WriteDefineQuantizationTables();
@ -448,8 +448,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary> /// <summary>
/// Writes the application header containing the JFIF identifier plus extra data. /// Writes the application header containing the JFIF identifier plus extra data.
/// </summary> /// </summary>
/// <param name="meta">The image meta data.</param> /// <param name="meta">The image metadata.</param>
private void WriteApplicationHeader(ImageMetaData meta) private void WriteApplicationHeader(ImageMetadata meta)
{ {
// Write the start of image marker. Markers are always prefixed with 0xff. // Write the start of image marker. Markers are always prefixed with 0xff.
this.buffer[0] = JpegConstants.Markers.XFF; this.buffer[0] = JpegConstants.Markers.XFF;
@ -791,17 +791,17 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary> /// <summary>
/// Writes the metadata profiles to the image. /// Writes the metadata profiles to the image.
/// </summary> /// </summary>
/// <param name="metaData">The image meta data.</param> /// <param name="metadata">The image metadata.</param>
private void WriteProfiles(ImageMetaData metaData) private void WriteProfiles(ImageMetadata metadata)
{ {
if (metaData is null) if (metadata is null)
{ {
return; return;
} }
metaData.SyncProfiles(); metadata.SyncProfiles();
this.WriteExifProfile(metaData.ExifProfile); this.WriteExifProfile(metadata.ExifProfile);
this.WriteIccProfile(metaData.IccProfile); this.WriteIccProfile(metadata.IccProfile);
} }
/// <summary> /// <summary>

4
src/ImageSharp/Formats/Jpeg/JpegFormat.cs

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary> /// <summary>
/// Registers the image encoders, decoders and mime type detectors for the jpeg format. /// Registers the image encoders, decoders and mime type detectors for the jpeg format.
/// </summary> /// </summary>
public sealed class JpegFormat : IImageFormat<JpegMetaData> public sealed class JpegFormat : IImageFormat<JpegMetadata>
{ {
private JpegFormat() private JpegFormat()
{ {
@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public IEnumerable<string> FileExtensions => JpegConstants.FileExtensions; public IEnumerable<string> FileExtensions => JpegConstants.FileExtensions;
/// <inheritdoc/> /// <inheritdoc/>
public JpegMetaData CreateDefaultFormatMetaData() => new JpegMetaData(); public JpegMetadata CreateDefaultFormatMetadata() => new JpegMetadata();
} }
} }

12
src/ImageSharp/Formats/Jpeg/JpegMetaData.cs

@ -6,20 +6,20 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary> /// <summary>
/// Provides Jpeg specific metadata information for the image. /// Provides Jpeg specific metadata information for the image.
/// </summary> /// </summary>
public class JpegMetaData : IDeepCloneable public class JpegMetadata : IDeepCloneable
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JpegMetaData"/> class. /// Initializes a new instance of the <see cref="JpegMetadata"/> class.
/// </summary> /// </summary>
public JpegMetaData() public JpegMetadata()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="JpegMetaData"/> class. /// Initializes a new instance of the <see cref="JpegMetadata"/> class.
/// </summary> /// </summary>
/// <param name="other">The metadata to create an instance from.</param> /// <param name="other">The metadata to create an instance from.</param>
private JpegMetaData(JpegMetaData other) => this.Quality = other.Quality; private JpegMetadata(JpegMetadata other) => this.Quality = other.Quality;
/// <summary> /// <summary>
/// Gets or sets the encoded quality. /// Gets or sets the encoded quality.
@ -27,6 +27,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public int Quality { get; set; } = 75; public int Quality { get; set; } = 75;
/// <inheritdoc/> /// <inheritdoc/>
public IDeepCloneable DeepClone() => new JpegMetaData(this); public IDeepCloneable DeepClone() => new JpegMetadata(this);
} }
} }

4
src/ImageSharp/Formats/Png/Chunks/PhysicalChunkData.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Buffers.Binary; using System.Buffers.Binary;
using SixLabors.ImageSharp.Common.Helpers; using SixLabors.ImageSharp.Common.Helpers;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp.Formats.Png.Chunks namespace SixLabors.ImageSharp.Formats.Png.Chunks
{ {
@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Chunks
/// </summary> /// </summary>
/// <param name="meta">The metadata.</param> /// <param name="meta">The metadata.</param>
/// <returns>The constructed PngPhysicalChunkData instance.</returns> /// <returns>The constructed PngPhysicalChunkData instance.</returns>
public static PhysicalChunkData FromMetadata(ImageMetaData meta) public static PhysicalChunkData FromMetadata(ImageMetadata meta)
{ {
byte unitSpecifier = 0; byte unitSpecifier = 0;
uint x; uint x;

128
src/ImageSharp/Formats/Png/PngDecoderCore.cs

@ -12,8 +12,8 @@ using SixLabors.ImageSharp.Formats.Png.Chunks;
using SixLabors.ImageSharp.Formats.Png.Filters; using SixLabors.ImageSharp.Formats.Png.Filters;
using SixLabors.ImageSharp.Formats.Png.Zlib; using SixLabors.ImageSharp.Formats.Png.Zlib;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory; using SixLabors.Memory;
@ -157,8 +157,8 @@ namespace SixLabors.ImageSharp.Formats.Png
public Image<TPixel> Decode<TPixel>(Stream stream) public Image<TPixel> Decode<TPixel>(Stream stream)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
var metaData = new ImageMetaData(); var metadata = new ImageMetadata();
PngMetaData pngMetaData = metaData.GetFormatMetaData(PngFormat.Instance); PngMetadata pngMetadata = metadata.GetFormatMetadata(PngFormat.Instance);
this.currentStream = stream; this.currentStream = stream;
this.currentStream.Skip(8); this.currentStream.Skip(8);
Image<TPixel> image = null; Image<TPixel> image = null;
@ -171,24 +171,24 @@ namespace SixLabors.ImageSharp.Formats.Png
switch (chunk.Type) switch (chunk.Type)
{ {
case PngChunkType.Header: case PngChunkType.Header:
this.ReadHeaderChunk(pngMetaData, chunk.Data.Array); this.ReadHeaderChunk(pngMetadata, chunk.Data.Array);
break; break;
case PngChunkType.Physical: case PngChunkType.Physical:
this.ReadPhysicalChunk(metaData, chunk.Data.GetSpan()); this.ReadPhysicalChunk(metadata, chunk.Data.GetSpan());
break; break;
case PngChunkType.Gamma: case PngChunkType.Gamma:
this.ReadGammaChunk(pngMetaData, chunk.Data.GetSpan()); this.ReadGammaChunk(pngMetadata, chunk.Data.GetSpan());
break; break;
case PngChunkType.Data: case PngChunkType.Data:
if (image is null) if (image is null)
{ {
this.InitializeImage(metaData, out image); this.InitializeImage(metadata, out image);
} }
using (var deframeStream = new ZlibInflateStream(this.currentStream, this.ReadNextDataChunk)) using (var deframeStream = new ZlibInflateStream(this.currentStream, this.ReadNextDataChunk))
{ {
deframeStream.AllocateNewBytes(chunk.Length); deframeStream.AllocateNewBytes(chunk.Length);
this.ReadScanlines(deframeStream.CompressedStream, image.Frames.RootFrame, pngMetaData); this.ReadScanlines(deframeStream.CompressedStream, image.Frames.RootFrame, pngMetadata);
} }
break; break;
@ -201,17 +201,17 @@ namespace SixLabors.ImageSharp.Formats.Png
byte[] alpha = new byte[chunk.Length]; byte[] alpha = new byte[chunk.Length];
Buffer.BlockCopy(chunk.Data.Array, 0, alpha, 0, chunk.Length); Buffer.BlockCopy(chunk.Data.Array, 0, alpha, 0, chunk.Length);
this.paletteAlpha = alpha; this.paletteAlpha = alpha;
this.AssignTransparentMarkers(alpha, pngMetaData); this.AssignTransparentMarkers(alpha, pngMetadata);
break; break;
case PngChunkType.Text: case PngChunkType.Text:
this.ReadTextChunk(metaData, chunk.Data.Array.AsSpan(0, chunk.Length)); this.ReadTextChunk(metadata, chunk.Data.Array.AsSpan(0, chunk.Length));
break; break;
case PngChunkType.Exif: case PngChunkType.Exif:
if (!this.ignoreMetadata) if (!this.ignoreMetadata)
{ {
byte[] exifData = new byte[chunk.Length]; byte[] exifData = new byte[chunk.Length];
Buffer.BlockCopy(chunk.Data.Array, 0, exifData, 0, chunk.Length); Buffer.BlockCopy(chunk.Data.Array, 0, exifData, 0, chunk.Length);
metaData.ExifProfile = new ExifProfile(exifData); metadata.ExifProfile = new ExifProfile(exifData);
} }
break; break;
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param>
public IImageInfo Identify(Stream stream) public IImageInfo Identify(Stream stream)
{ {
var metaData = new ImageMetaData(); var metadata = new ImageMetadata();
PngMetaData pngMetaData = metaData.GetFormatMetaData(PngFormat.Instance); PngMetadata pngMetadata = metadata.GetFormatMetadata(PngFormat.Instance);
this.currentStream = stream; this.currentStream = stream;
this.currentStream.Skip(8); this.currentStream.Skip(8);
try try
@ -259,19 +259,19 @@ namespace SixLabors.ImageSharp.Formats.Png
switch (chunk.Type) switch (chunk.Type)
{ {
case PngChunkType.Header: case PngChunkType.Header:
this.ReadHeaderChunk(pngMetaData, chunk.Data.Array); this.ReadHeaderChunk(pngMetadata, chunk.Data.Array);
break; break;
case PngChunkType.Physical: case PngChunkType.Physical:
this.ReadPhysicalChunk(metaData, chunk.Data.GetSpan()); this.ReadPhysicalChunk(metadata, chunk.Data.GetSpan());
break; break;
case PngChunkType.Gamma: case PngChunkType.Gamma:
this.ReadGammaChunk(pngMetaData, chunk.Data.GetSpan()); this.ReadGammaChunk(pngMetadata, chunk.Data.GetSpan());
break; break;
case PngChunkType.Data: case PngChunkType.Data:
this.SkipChunkDataAndCrc(chunk); this.SkipChunkDataAndCrc(chunk);
break; break;
case PngChunkType.Text: case PngChunkType.Text:
this.ReadTextChunk(metaData, chunk.Data.Array.AsSpan(0, chunk.Length)); this.ReadTextChunk(metadata, chunk.Data.Array.AsSpan(0, chunk.Length));
break; break;
case PngChunkType.End: case PngChunkType.End:
this.isEndChunkReached = true; this.isEndChunkReached = true;
@ -295,7 +295,7 @@ namespace SixLabors.ImageSharp.Formats.Png
throw new ImageFormatException("PNG Image does not contain a header chunk"); throw new ImageFormatException("PNG Image does not contain a header chunk");
} }
return new ImageInfo(new PixelTypeInfo(this.CalculateBitsPerPixel()), this.header.Width, this.header.Height, metaData); return new ImageInfo(new PixelTypeInfo(this.CalculateBitsPerPixel()), this.header.Width, this.header.Height, metadata);
} }
/// <summary> /// <summary>
@ -350,7 +350,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary> /// </summary>
/// <param name="metadata">The metadata to read to.</param> /// <param name="metadata">The metadata to read to.</param>
/// <param name="data">The data containing physical data.</param> /// <param name="data">The data containing physical data.</param>
private void ReadPhysicalChunk(ImageMetaData metadata, ReadOnlySpan<byte> data) private void ReadPhysicalChunk(ImageMetadata metadata, ReadOnlySpan<byte> data)
{ {
var physicalChunk = PhysicalChunkData.Parse(data); var physicalChunk = PhysicalChunkData.Parse(data);
@ -367,7 +367,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary> /// </summary>
/// <param name="pngMetadata">The metadata to read to.</param> /// <param name="pngMetadata">The metadata to read to.</param>
/// <param name="data">The data containing physical data.</param> /// <param name="data">The data containing physical data.</param>
private void ReadGammaChunk(PngMetaData pngMetadata, ReadOnlySpan<byte> data) private void ReadGammaChunk(PngMetadata pngMetadata, ReadOnlySpan<byte> data)
{ {
// The value is encoded as a 4-byte unsigned integer, representing gamma times 100000. // The value is encoded as a 4-byte unsigned integer, representing gamma times 100000.
// For example, a gamma of 1/2.2 would be stored as 45455. // For example, a gamma of 1/2.2 would be stored as 45455.
@ -380,7 +380,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The type the pixels will be</typeparam> /// <typeparam name="TPixel">The type the pixels will be</typeparam>
/// <param name="metadata">The metadata information for the image</param> /// <param name="metadata">The metadata information for the image</param>
/// <param name="image">The image that we will populate</param> /// <param name="image">The image that we will populate</param>
private void InitializeImage<TPixel>(ImageMetaData metadata, out Image<TPixel> image) private void InitializeImage<TPixel>(ImageMetadata metadata, out Image<TPixel> image)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
image = new Image<TPixel>(this.configuration, this.header.Width, this.header.Height, metadata); image = new Image<TPixel>(this.configuration, this.header.Width, this.header.Height, metadata);
@ -471,17 +471,17 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam> /// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="dataStream">The <see cref="MemoryStream"/> containing data.</param> /// <param name="dataStream">The <see cref="MemoryStream"/> containing data.</param>
/// <param name="image"> The pixel data.</param> /// <param name="image"> The pixel data.</param>
/// <param name="pngMetaData">The png meta data</param> /// <param name="pngMetadata">The png metadata</param>
private void ReadScanlines<TPixel>(Stream dataStream, ImageFrame<TPixel> image, PngMetaData pngMetaData) private void ReadScanlines<TPixel>(Stream dataStream, ImageFrame<TPixel> image, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
if (this.header.InterlaceMethod == PngInterlaceMode.Adam7) if (this.header.InterlaceMethod == PngInterlaceMode.Adam7)
{ {
this.DecodeInterlacedPixelData(dataStream, image, pngMetaData); this.DecodeInterlacedPixelData(dataStream, image, pngMetadata);
} }
else else
{ {
this.DecodePixelData(dataStream, image, pngMetaData); this.DecodePixelData(dataStream, image, pngMetadata);
} }
} }
@ -491,8 +491,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam> /// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="compressedStream">The compressed pixel data stream.</param> /// <param name="compressedStream">The compressed pixel data stream.</param>
/// <param name="image">The image to decode to.</param> /// <param name="image">The image to decode to.</param>
/// <param name="pngMetaData">The png meta data</param> /// <param name="pngMetadata">The png metadata</param>
private void DecodePixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetaData pngMetaData) private void DecodePixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
while (this.currentRow < this.header.Height) while (this.currentRow < this.header.Height)
@ -532,7 +532,7 @@ namespace SixLabors.ImageSharp.Formats.Png
throw new ImageFormatException("Unknown filter type."); throw new ImageFormatException("Unknown filter type.");
} }
this.ProcessDefilteredScanline(scanlineSpan, image, pngMetaData); this.ProcessDefilteredScanline(scanlineSpan, image, pngMetadata);
this.SwapBuffers(); this.SwapBuffers();
this.currentRow++; this.currentRow++;
@ -546,8 +546,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam> /// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="compressedStream">The compressed pixel data stream.</param> /// <param name="compressedStream">The compressed pixel data stream.</param>
/// <param name="image">The current image.</param> /// <param name="image">The current image.</param>
/// <param name="pngMetaData">The png meta data</param> /// <param name="pngMetadata">The png metadata.</param>
private void DecodeInterlacedPixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetaData pngMetaData) private void DecodeInterlacedPixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
while (true) while (true)
@ -604,7 +604,7 @@ namespace SixLabors.ImageSharp.Formats.Png
} }
Span<TPixel> rowSpan = image.GetPixelRowSpan(this.currentRow); Span<TPixel> rowSpan = image.GetPixelRowSpan(this.currentRow);
this.ProcessInterlacedDefilteredScanline(this.scanline.GetSpan(), rowSpan, pngMetaData, Adam7.FirstColumn[this.pass], Adam7.ColumnIncrement[this.pass]); this.ProcessInterlacedDefilteredScanline(this.scanline.GetSpan(), rowSpan, pngMetadata, Adam7.FirstColumn[this.pass], Adam7.ColumnIncrement[this.pass]);
this.SwapBuffers(); this.SwapBuffers();
@ -632,8 +632,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam> /// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="defilteredScanline">The de-filtered scanline</param> /// <param name="defilteredScanline">The de-filtered scanline</param>
/// <param name="pixels">The image</param> /// <param name="pixels">The image</param>
/// <param name="pngMetaData">The png meta data</param> /// <param name="pngMetadata">The png metadata.</param>
private void ProcessDefilteredScanline<TPixel>(ReadOnlySpan<byte> defilteredScanline, ImageFrame<TPixel> pixels, PngMetaData pngMetaData) private void ProcessDefilteredScanline<TPixel>(ReadOnlySpan<byte> defilteredScanline, ImageFrame<TPixel> pixels, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
Span<TPixel> rowSpan = pixels.GetPixelRowSpan(this.currentRow); Span<TPixel> rowSpan = pixels.GetPixelRowSpan(this.currentRow);
@ -653,9 +653,9 @@ namespace SixLabors.ImageSharp.Formats.Png
this.header, this.header,
scanlineSpan, scanlineSpan,
rowSpan, rowSpan,
pngMetaData.HasTrans, pngMetadata.HasTrans,
pngMetaData.TransparentGray16.GetValueOrDefault(), pngMetadata.TransparentGray16.GetValueOrDefault(),
pngMetaData.TransparentGray8.GetValueOrDefault()); pngMetadata.TransparentGray8.GetValueOrDefault());
break; break;
@ -687,9 +687,9 @@ namespace SixLabors.ImageSharp.Formats.Png
rowSpan, rowSpan,
this.bytesPerPixel, this.bytesPerPixel,
this.bytesPerSample, this.bytesPerSample,
pngMetaData.HasTrans, pngMetadata.HasTrans,
pngMetaData.TransparentRgb48.GetValueOrDefault(), pngMetadata.TransparentRgb48.GetValueOrDefault(),
pngMetaData.TransparentRgb24.GetValueOrDefault()); pngMetadata.TransparentRgb24.GetValueOrDefault());
break; break;
@ -714,10 +714,10 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam> /// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="defilteredScanline">The de-filtered scanline</param> /// <param name="defilteredScanline">The de-filtered scanline</param>
/// <param name="rowSpan">The current image row.</param> /// <param name="rowSpan">The current image row.</param>
/// <param name="pngMetaData">The png meta data</param> /// <param name="pngMetadata">The png metadata.</param>
/// <param name="pixelOffset">The column start index. Always 0 for none interlaced images.</param> /// <param name="pixelOffset">The column start index. Always 0 for none interlaced images.</param>
/// <param name="increment">The column increment. Always 1 for none interlaced images.</param> /// <param name="increment">The column increment. Always 1 for none interlaced images.</param>
private void ProcessInterlacedDefilteredScanline<TPixel>(ReadOnlySpan<byte> defilteredScanline, Span<TPixel> rowSpan, PngMetaData pngMetaData, int pixelOffset = 0, int increment = 1) private void ProcessInterlacedDefilteredScanline<TPixel>(ReadOnlySpan<byte> defilteredScanline, Span<TPixel> rowSpan, PngMetadata pngMetadata, int pixelOffset = 0, int increment = 1)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
// Trim the first marker byte from the buffer // Trim the first marker byte from the buffer
@ -737,9 +737,9 @@ namespace SixLabors.ImageSharp.Formats.Png
rowSpan, rowSpan,
pixelOffset, pixelOffset,
increment, increment,
pngMetaData.HasTrans, pngMetadata.HasTrans,
pngMetaData.TransparentGray16.GetValueOrDefault(), pngMetadata.TransparentGray16.GetValueOrDefault(),
pngMetaData.TransparentGray8.GetValueOrDefault()); pngMetadata.TransparentGray8.GetValueOrDefault());
break; break;
@ -776,9 +776,9 @@ namespace SixLabors.ImageSharp.Formats.Png
increment, increment,
this.bytesPerPixel, this.bytesPerPixel,
this.bytesPerSample, this.bytesPerSample,
pngMetaData.HasTrans, pngMetadata.HasTrans,
pngMetaData.TransparentRgb48.GetValueOrDefault(), pngMetadata.TransparentRgb48.GetValueOrDefault(),
pngMetaData.TransparentRgb24.GetValueOrDefault()); pngMetadata.TransparentRgb24.GetValueOrDefault());
break; break;
@ -799,11 +799,11 @@ namespace SixLabors.ImageSharp.Formats.Png
} }
/// <summary> /// <summary>
/// Decodes and assigns marker colors that identify transparent pixels in non indexed images /// Decodes and assigns marker colors that identify transparent pixels in non indexed images.
/// </summary> /// </summary>
/// <param name="alpha">The alpha tRNS array</param> /// <param name="alpha">The alpha tRNS array.</param>
/// <param name="pngMetaData">The png meta data</param> /// <param name="pngMetadata">The png metadata.</param>
private void AssignTransparentMarkers(ReadOnlySpan<byte> alpha, PngMetaData pngMetaData) private void AssignTransparentMarkers(ReadOnlySpan<byte> alpha, PngMetadata pngMetadata)
{ {
if (this.pngColorType == PngColorType.Rgb) if (this.pngColorType == PngColorType.Rgb)
{ {
@ -815,16 +815,16 @@ namespace SixLabors.ImageSharp.Formats.Png
ushort gc = BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(2, 2)); ushort gc = BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(2, 2));
ushort bc = BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(4, 2)); ushort bc = BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(4, 2));
pngMetaData.TransparentRgb48 = new Rgb48(rc, gc, bc); pngMetadata.TransparentRgb48 = new Rgb48(rc, gc, bc);
pngMetaData.HasTrans = true; pngMetadata.HasTrans = true;
return; return;
} }
byte r = ReadByteLittleEndian(alpha, 0); byte r = ReadByteLittleEndian(alpha, 0);
byte g = ReadByteLittleEndian(alpha, 2); byte g = ReadByteLittleEndian(alpha, 2);
byte b = ReadByteLittleEndian(alpha, 4); byte b = ReadByteLittleEndian(alpha, 4);
pngMetaData.TransparentRgb24 = new Rgb24(r, g, b); pngMetadata.TransparentRgb24 = new Rgb24(r, g, b);
pngMetaData.HasTrans = true; pngMetadata.HasTrans = true;
} }
} }
else if (this.pngColorType == PngColorType.Grayscale) else if (this.pngColorType == PngColorType.Grayscale)
@ -833,14 +833,14 @@ namespace SixLabors.ImageSharp.Formats.Png
{ {
if (this.header.BitDepth == 16) if (this.header.BitDepth == 16)
{ {
pngMetaData.TransparentGray16 = new Gray16(BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(0, 2))); pngMetadata.TransparentGray16 = new Gray16(BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(0, 2)));
} }
else else
{ {
pngMetaData.TransparentGray8 = new Gray8(ReadByteLittleEndian(alpha, 0)); pngMetadata.TransparentGray8 = new Gray8(ReadByteLittleEndian(alpha, 0));
} }
pngMetaData.HasTrans = true; pngMetadata.HasTrans = true;
} }
} }
} }
@ -848,16 +848,16 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <summary> /// <summary>
/// Reads a header chunk from the data. /// Reads a header chunk from the data.
/// </summary> /// </summary>
/// <param name="pngMetaData">The png metadata.</param> /// <param name="pngMetadata">The png metadata.</param>
/// <param name="data">The <see cref="T:ReadOnlySpan{byte}"/> containing data.</param> /// <param name="data">The <see cref="T:ReadOnlySpan{byte}"/> containing data.</param>
private void ReadHeaderChunk(PngMetaData pngMetaData, ReadOnlySpan<byte> data) private void ReadHeaderChunk(PngMetadata pngMetadata, ReadOnlySpan<byte> data)
{ {
this.header = PngHeader.Parse(data); this.header = PngHeader.Parse(data);
this.header.Validate(); this.header.Validate();
pngMetaData.BitDepth = (PngBitDepth)this.header.BitDepth; pngMetadata.BitDepth = (PngBitDepth)this.header.BitDepth;
pngMetaData.ColorType = this.header.ColorType; pngMetadata.ColorType = this.header.ColorType;
this.pngColorType = this.header.ColorType; this.pngColorType = this.header.ColorType;
} }
@ -867,7 +867,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary> /// </summary>
/// <param name="metadata">The metadata to decode to.</param> /// <param name="metadata">The metadata to decode to.</param>
/// <param name="data">The <see cref="T:Span"/> containing the data.</param> /// <param name="data">The <see cref="T:Span"/> containing the data.</param>
private void ReadTextChunk(ImageMetaData metadata, ReadOnlySpan<byte> data) private void ReadTextChunk(ImageMetadata metadata, ReadOnlySpan<byte> data)
{ {
if (this.ignoreMetadata) if (this.ignoreMetadata)
{ {

54
src/ImageSharp/Formats/Png/PngEncoderCore.cs

@ -14,7 +14,7 @@ using SixLabors.ImageSharp.Formats.Png.Chunks;
using SixLabors.ImageSharp.Formats.Png.Filters; using SixLabors.ImageSharp.Formats.Png.Filters;
using SixLabors.ImageSharp.Formats.Png.Zlib; using SixLabors.ImageSharp.Formats.Png.Zlib;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.ImageSharp.Processing.Processors.Quantization;
using SixLabors.Memory; using SixLabors.Memory;
@ -211,12 +211,12 @@ namespace SixLabors.ImageSharp.Formats.Png
this.height = image.Height; this.height = image.Height;
// Always take the encoder options over the metadata values. // Always take the encoder options over the metadata values.
ImageMetaData metaData = image.MetaData; ImageMetadata metadata = image.Metadata;
PngMetaData pngMetaData = metaData.GetFormatMetaData(PngFormat.Instance); PngMetadata pngMetadata = metadata.GetFormatMetadata(PngFormat.Instance);
this.gamma = this.gamma ?? pngMetaData.Gamma; this.gamma = this.gamma ?? pngMetadata.Gamma;
this.writeGamma = this.gamma > 0; this.writeGamma = this.gamma > 0;
this.pngColorType = this.pngColorType ?? pngMetaData.ColorType; this.pngColorType = this.pngColorType ?? pngMetadata.ColorType;
this.pngBitDepth = this.pngBitDepth ?? pngMetaData.BitDepth; this.pngBitDepth = this.pngBitDepth ?? pngMetadata.BitDepth;
this.use16Bit = this.pngBitDepth == PngBitDepth.Bit16; this.use16Bit = this.pngBitDepth == PngBitDepth.Bit16;
// Ensure we are not allowing impossible combinations. // Ensure we are not allowing impossible combinations.
@ -290,14 +290,14 @@ namespace SixLabors.ImageSharp.Formats.Png
this.WritePaletteChunk(stream, quantized); this.WritePaletteChunk(stream, quantized);
} }
if (pngMetaData.HasTrans) if (pngMetadata.HasTrans)
{ {
this.WriteTransparencyChunk(stream, pngMetaData); this.WriteTransparencyChunk(stream, pngMetadata);
} }
this.WritePhysicalChunk(stream, metaData); this.WritePhysicalChunk(stream, metadata);
this.WriteGammaChunk(stream); this.WriteGammaChunk(stream);
this.WriteExifChunk(stream, metaData); this.WriteExifChunk(stream, metadata);
this.WriteDataChunks(image.Frames.RootFrame, quantized, stream); this.WriteDataChunks(image.Frames.RootFrame, quantized, stream);
this.WriteEndChunk(stream); this.WriteEndChunk(stream);
stream.Flush(); stream.Flush();
@ -714,8 +714,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// Writes the physical dimension information to the stream. /// Writes the physical dimension information to the stream.
/// </summary> /// </summary>
/// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param>
/// <param name="meta">The image meta data.</param> /// <param name="meta">The image metadata.</param>
private void WritePhysicalChunk(Stream stream, ImageMetaData meta) private void WritePhysicalChunk(Stream stream, ImageMetadata meta)
{ {
PhysicalChunkData.FromMetadata(meta).WriteTo(this.chunkDataBuffer); PhysicalChunkData.FromMetadata(meta).WriteTo(this.chunkDataBuffer);
@ -723,11 +723,11 @@ namespace SixLabors.ImageSharp.Formats.Png
} }
/// <summary> /// <summary>
/// Writes the eXIf chunk to the stream, if any EXIF Profile values are present in the meta data. /// Writes the eXIf chunk to the stream, if any EXIF Profile values are present in the metadata.
/// </summary> /// </summary>
/// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param>
/// <param name="meta">The image meta data.</param> /// <param name="meta">The image metadata.</param>
private void WriteExifChunk(Stream stream, ImageMetaData meta) private void WriteExifChunk(Stream stream, ImageMetadata meta)
{ {
if (meta.ExifProfile?.Values.Count > 0) if (meta.ExifProfile?.Values.Count > 0)
{ {
@ -757,42 +757,42 @@ namespace SixLabors.ImageSharp.Formats.Png
/// Writes the transparency chunk to the stream /// Writes the transparency chunk to the stream
/// </summary> /// </summary>
/// <param name="stream">The <see cref="Stream"/> containing image data.</param> /// <param name="stream">The <see cref="Stream"/> containing image data.</param>
/// <param name="pngMetaData">The image meta data.</param> /// <param name="pngMetadata">The image metadata.</param>
private void WriteTransparencyChunk(Stream stream, PngMetaData pngMetaData) private void WriteTransparencyChunk(Stream stream, PngMetadata pngMetadata)
{ {
Span<byte> alpha = this.chunkDataBuffer.AsSpan(); Span<byte> alpha = this.chunkDataBuffer.AsSpan();
if (pngMetaData.ColorType == PngColorType.Rgb) if (pngMetadata.ColorType == PngColorType.Rgb)
{ {
if (pngMetaData.TransparentRgb48.HasValue && this.use16Bit) if (pngMetadata.TransparentRgb48.HasValue && this.use16Bit)
{ {
Rgb48 rgb = pngMetaData.TransparentRgb48.Value; Rgb48 rgb = pngMetadata.TransparentRgb48.Value;
BinaryPrimitives.WriteUInt16LittleEndian(alpha, rgb.R); BinaryPrimitives.WriteUInt16LittleEndian(alpha, rgb.R);
BinaryPrimitives.WriteUInt16LittleEndian(alpha.Slice(2, 2), rgb.G); BinaryPrimitives.WriteUInt16LittleEndian(alpha.Slice(2, 2), rgb.G);
BinaryPrimitives.WriteUInt16LittleEndian(alpha.Slice(4, 2), rgb.B); BinaryPrimitives.WriteUInt16LittleEndian(alpha.Slice(4, 2), rgb.B);
this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 6); this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 6);
} }
else if (pngMetaData.TransparentRgb24.HasValue) else if (pngMetadata.TransparentRgb24.HasValue)
{ {
alpha.Clear(); alpha.Clear();
Rgb24 rgb = pngMetaData.TransparentRgb24.Value; Rgb24 rgb = pngMetadata.TransparentRgb24.Value;
alpha[1] = rgb.R; alpha[1] = rgb.R;
alpha[3] = rgb.G; alpha[3] = rgb.G;
alpha[5] = rgb.B; alpha[5] = rgb.B;
this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 6); this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 6);
} }
} }
else if (pngMetaData.ColorType == PngColorType.Grayscale) else if (pngMetadata.ColorType == PngColorType.Grayscale)
{ {
if (pngMetaData.TransparentGray16.HasValue && this.use16Bit) if (pngMetadata.TransparentGray16.HasValue && this.use16Bit)
{ {
BinaryPrimitives.WriteUInt16LittleEndian(alpha, pngMetaData.TransparentGray16.Value.PackedValue); BinaryPrimitives.WriteUInt16LittleEndian(alpha, pngMetadata.TransparentGray16.Value.PackedValue);
this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 2); this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 2);
} }
else if (pngMetaData.TransparentGray8.HasValue) else if (pngMetadata.TransparentGray8.HasValue)
{ {
alpha.Clear(); alpha.Clear();
alpha[1] = pngMetaData.TransparentGray8.Value.PackedValue; alpha[1] = pngMetadata.TransparentGray8.Value.PackedValue;
this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 2); this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 2);
} }
} }

4
src/ImageSharp/Formats/Png/PngFormat.cs

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <summary> /// <summary>
/// Registers the image encoders, decoders and mime type detectors for the png format. /// Registers the image encoders, decoders and mime type detectors for the png format.
/// </summary> /// </summary>
public sealed class PngFormat : IImageFormat<PngMetaData> public sealed class PngFormat : IImageFormat<PngMetadata>
{ {
private PngFormat() private PngFormat()
{ {
@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp.Formats.Png
public IEnumerable<string> FileExtensions => PngConstants.FileExtensions; public IEnumerable<string> FileExtensions => PngConstants.FileExtensions;
/// <inheritdoc/> /// <inheritdoc/>
public PngMetaData CreateDefaultFormatMetaData() => new PngMetaData(); public PngMetadata CreateDefaultFormatMetadata() => new PngMetadata();
} }
} }

12
src/ImageSharp/Formats/Png/PngMetaData.cs

@ -8,20 +8,20 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <summary> /// <summary>
/// Provides Png specific metadata information for the image. /// Provides Png specific metadata information for the image.
/// </summary> /// </summary>
public class PngMetaData : IDeepCloneable public class PngMetadata : IDeepCloneable
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="PngMetaData"/> class. /// Initializes a new instance of the <see cref="PngMetadata"/> class.
/// </summary> /// </summary>
public PngMetaData() public PngMetadata()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="PngMetaData"/> class. /// Initializes a new instance of the <see cref="PngMetadata"/> class.
/// </summary> /// </summary>
/// <param name="other">The metadata to create an instance from.</param> /// <param name="other">The metadata to create an instance from.</param>
private PngMetaData(PngMetaData other) private PngMetadata(PngMetadata other)
{ {
this.BitDepth = other.BitDepth; this.BitDepth = other.BitDepth;
this.ColorType = other.ColorType; this.ColorType = other.ColorType;
@ -75,6 +75,6 @@ namespace SixLabors.ImageSharp.Formats.Png
public bool HasTrans { get; set; } public bool HasTrans { get; set; }
/// <inheritdoc/> /// <inheritdoc/>
public IDeepCloneable DeepClone() => new PngMetaData(this); public IDeepCloneable DeepClone() => new PngMetadata(this);
} }
} }

4
src/ImageSharp/IImageInfo.cs

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp namespace SixLabors.ImageSharp
{ {
@ -30,6 +30,6 @@ namespace SixLabors.ImageSharp
/// <summary> /// <summary>
/// Gets the metadata of the image. /// Gets the metadata of the image.
/// </summary> /// </summary>
ImageMetaData MetaData { get; } ImageMetadata Metadata { get; }
} }
} }

6
src/ImageSharp/Image.Decode.cs

@ -5,7 +5,7 @@ using System.IO;
using System.Linq; using System.Linq;
using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory; using SixLabors.Memory;
@ -25,13 +25,13 @@ namespace SixLabors.ImageSharp
/// <param name="configuration">The <see cref="Configuration"/></param> /// <param name="configuration">The <see cref="Configuration"/></param>
/// <param name="width">The width of the image</param> /// <param name="width">The width of the image</param>
/// <param name="height">The height of the image</param> /// <param name="height">The height of the image</param>
/// <param name="metadata">The <see cref="ImageMetaData"/></param> /// <param name="metadata">The <see cref="ImageMetadata"/></param>
/// <returns>The result <see cref="Image{TPixel}"/></returns> /// <returns>The result <see cref="Image{TPixel}"/></returns>
internal static Image<TPixel> CreateUninitialized<TPixel>( internal static Image<TPixel> CreateUninitialized<TPixel>(
Configuration configuration, Configuration configuration,
int width, int width,
int height, int height,
ImageMetaData metadata) ImageMetadata metadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
Buffer2D<TPixel> uninitializedMemoryBuffer = Buffer2D<TPixel> uninitializedMemoryBuffer =

18
src/ImageSharp/Image.WrapMemory.cs

@ -5,7 +5,7 @@ using System;
using System.Buffers; using System.Buffers;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp namespace SixLabors.ImageSharp
@ -24,18 +24,18 @@ namespace SixLabors.ImageSharp
/// <param name="pixelMemory">The pixel memory.</param> /// <param name="pixelMemory">The pixel memory.</param>
/// <param name="width">The width of the memory image.</param> /// <param name="width">The width of the memory image.</param>
/// <param name="height">The height of the memory image.</param> /// <param name="height">The height of the memory image.</param>
/// <param name="metaData">The <see cref="ImageMetaData"/>.</param> /// <param name="metadata">The <see cref="ImageMetadata"/>.</param>
/// <returns>An <see cref="Image{TPixel}"/> instance</returns> /// <returns>An <see cref="Image{TPixel}"/> instance</returns>
public static Image<TPixel> WrapMemory<TPixel>( public static Image<TPixel> WrapMemory<TPixel>(
Configuration config, Configuration config,
Memory<TPixel> pixelMemory, Memory<TPixel> pixelMemory,
int width, int width,
int height, int height,
ImageMetaData metaData) ImageMetadata metadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
var memorySource = new MemorySource<TPixel>(pixelMemory); var memorySource = new MemorySource<TPixel>(pixelMemory);
return new Image<TPixel>(config, memorySource, width, height, metaData); return new Image<TPixel>(config, memorySource, width, height, metadata);
} }
/// <summary> /// <summary>
@ -55,7 +55,7 @@ namespace SixLabors.ImageSharp
int height) int height)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
return WrapMemory(config, pixelMemory, width, height, new ImageMetaData()); return WrapMemory(config, pixelMemory, width, height, new ImageMetadata());
} }
/// <summary> /// <summary>
@ -89,18 +89,18 @@ namespace SixLabors.ImageSharp
/// <param name="pixelMemoryOwner">The <see cref="IMemoryOwner{T}"/> that is being transferred to the image</param> /// <param name="pixelMemoryOwner">The <see cref="IMemoryOwner{T}"/> that is being transferred to the image</param>
/// <param name="width">The width of the memory image.</param> /// <param name="width">The width of the memory image.</param>
/// <param name="height">The height of the memory image.</param> /// <param name="height">The height of the memory image.</param>
/// <param name="metaData">The <see cref="ImageMetaData"/></param> /// <param name="metadata">The <see cref="ImageMetadata"/></param>
/// <returns>An <see cref="Image{TPixel}"/> instance</returns> /// <returns>An <see cref="Image{TPixel}"/> instance</returns>
public static Image<TPixel> WrapMemory<TPixel>( public static Image<TPixel> WrapMemory<TPixel>(
Configuration config, Configuration config,
IMemoryOwner<TPixel> pixelMemoryOwner, IMemoryOwner<TPixel> pixelMemoryOwner,
int width, int width,
int height, int height,
ImageMetaData metaData) ImageMetadata metadata)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
var memorySource = new MemorySource<TPixel>(pixelMemoryOwner, false); var memorySource = new MemorySource<TPixel>(pixelMemoryOwner, false);
return new Image<TPixel>(config, memorySource, width, height, metaData); return new Image<TPixel>(config, memorySource, width, height, metadata);
} }
/// <summary> /// <summary>
@ -123,7 +123,7 @@ namespace SixLabors.ImageSharp
int height) int height)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
return WrapMemory(config, pixelMemoryOwner, width, height, new ImageMetaData()); return WrapMemory(config, pixelMemoryOwner, width, height, new ImageMetadata());
} }
/// <summary> /// <summary>

4
src/ImageSharp/ImageFrameCollection.cs

@ -192,7 +192,7 @@ namespace SixLabors.ImageSharp
this.frames.Remove(frame); this.frames.Remove(frame);
return new Image<TPixel>(this.parent.GetConfiguration(), this.parent.MetaData.DeepClone(), new[] { frame }); return new Image<TPixel>(this.parent.GetConfiguration(), this.parent.Metadata.DeepClone(), new[] { frame });
} }
/// <summary> /// <summary>
@ -205,7 +205,7 @@ namespace SixLabors.ImageSharp
{ {
ImageFrame<TPixel> frame = this[index]; ImageFrame<TPixel> frame = this[index];
ImageFrame<TPixel> clonedFrame = frame.Clone(); ImageFrame<TPixel> clonedFrame = frame.Clone();
return new Image<TPixel>(this.parent.GetConfiguration(), this.parent.MetaData.DeepClone(), new[] { clonedFrame }); return new Image<TPixel>(this.parent.GetConfiguration(), this.parent.Metadata.DeepClone(), new[] { clonedFrame });
} }
/// <summary> /// <summary>

42
src/ImageSharp/ImageFrame{TPixel}.cs

@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.ParallelUtils; using SixLabors.ImageSharp.ParallelUtils;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory; using SixLabors.Memory;
@ -30,7 +30,7 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
internal ImageFrame(Configuration configuration, int width, int height) internal ImageFrame(Configuration configuration, int width, int height)
: this(configuration, width, height, new ImageFrameMetaData()) : this(configuration, width, height, new ImageFrameMetadata())
{ {
} }
@ -39,9 +39,9 @@ namespace SixLabors.ImageSharp
/// </summary> /// </summary>
/// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param> /// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param>
/// <param name="size">The <see cref="Size"/> of the frame.</param> /// <param name="size">The <see cref="Size"/> of the frame.</param>
/// <param name="metaData">The meta data.</param> /// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, Size size, ImageFrameMetaData metaData) internal ImageFrame(Configuration configuration, Size size, ImageFrameMetadata metadata)
: this(configuration, size.Width, size.Height, metaData) : this(configuration, size.Width, size.Height, metadata)
{ {
} }
@ -51,9 +51,9 @@ namespace SixLabors.ImageSharp
/// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param> /// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param>
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="metaData">The meta data.</param> /// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, int width, int height, ImageFrameMetaData metaData) internal ImageFrame(Configuration configuration, int width, int height, ImageFrameMetadata metadata)
: this(configuration, width, height, default(TPixel), metaData) : this(configuration, width, height, default(TPixel), metadata)
{ {
} }
@ -65,7 +65,7 @@ namespace SixLabors.ImageSharp
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="backgroundColor">The color to clear the image with.</param> /// <param name="backgroundColor">The color to clear the image with.</param>
internal ImageFrame(Configuration configuration, int width, int height, TPixel backgroundColor) internal ImageFrame(Configuration configuration, int width, int height, TPixel backgroundColor)
: this(configuration, width, height, backgroundColor, new ImageFrameMetaData()) : this(configuration, width, height, backgroundColor, new ImageFrameMetadata())
{ {
} }
@ -76,8 +76,8 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="backgroundColor">The color to clear the image with.</param> /// <param name="backgroundColor">The color to clear the image with.</param>
/// <param name="metaData">The meta data.</param> /// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, int width, int height, TPixel backgroundColor, ImageFrameMetaData metaData) internal ImageFrame(Configuration configuration, int width, int height, TPixel backgroundColor, ImageFrameMetadata metadata)
{ {
Guard.NotNull(configuration, nameof(configuration)); Guard.NotNull(configuration, nameof(configuration));
Guard.MustBeGreaterThan(width, 0, nameof(width)); Guard.MustBeGreaterThan(width, 0, nameof(width));
@ -86,7 +86,7 @@ namespace SixLabors.ImageSharp
this.Configuration = configuration; this.Configuration = configuration;
this.MemoryAllocator = configuration.MemoryAllocator; this.MemoryAllocator = configuration.MemoryAllocator;
this.PixelBuffer = this.MemoryAllocator.Allocate2D<TPixel>(width, height); this.PixelBuffer = this.MemoryAllocator.Allocate2D<TPixel>(width, height);
this.MetaData = metaData ?? new ImageFrameMetaData(); this.Metadata = metadata ?? new ImageFrameMetadata();
this.Clear(configuration.GetParallelOptions(), backgroundColor); this.Clear(configuration.GetParallelOptions(), backgroundColor);
} }
@ -98,7 +98,7 @@ namespace SixLabors.ImageSharp
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="memorySource">The memory source.</param> /// <param name="memorySource">The memory source.</param>
internal ImageFrame(Configuration configuration, int width, int height, MemorySource<TPixel> memorySource) internal ImageFrame(Configuration configuration, int width, int height, MemorySource<TPixel> memorySource)
: this(configuration, width, height, memorySource, new ImageFrameMetaData()) : this(configuration, width, height, memorySource, new ImageFrameMetadata())
{ {
} }
@ -109,18 +109,18 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="memorySource">The memory source.</param> /// <param name="memorySource">The memory source.</param>
/// <param name="metaData">The meta data.</param> /// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, int width, int height, MemorySource<TPixel> memorySource, ImageFrameMetaData metaData) internal ImageFrame(Configuration configuration, int width, int height, MemorySource<TPixel> memorySource, ImageFrameMetadata metadata)
{ {
Guard.NotNull(configuration, nameof(configuration)); Guard.NotNull(configuration, nameof(configuration));
Guard.MustBeGreaterThan(width, 0, nameof(width)); Guard.MustBeGreaterThan(width, 0, nameof(width));
Guard.MustBeGreaterThan(height, 0, nameof(height)); Guard.MustBeGreaterThan(height, 0, nameof(height));
Guard.NotNull(metaData, nameof(metaData)); Guard.NotNull(metadata, nameof(metadata));
this.Configuration = configuration; this.Configuration = configuration;
this.MemoryAllocator = configuration.MemoryAllocator; this.MemoryAllocator = configuration.MemoryAllocator;
this.PixelBuffer = new Buffer2D<TPixel>(memorySource, width, height); this.PixelBuffer = new Buffer2D<TPixel>(memorySource, width, height);
this.MetaData = metaData; this.Metadata = metadata;
} }
/// <summary> /// <summary>
@ -137,7 +137,7 @@ namespace SixLabors.ImageSharp
this.MemoryAllocator = configuration.MemoryAllocator; this.MemoryAllocator = configuration.MemoryAllocator;
this.PixelBuffer = this.MemoryAllocator.Allocate2D<TPixel>(source.PixelBuffer.Width, source.PixelBuffer.Height); this.PixelBuffer = this.MemoryAllocator.Allocate2D<TPixel>(source.PixelBuffer.Width, source.PixelBuffer.Height);
source.PixelBuffer.GetSpan().CopyTo(this.PixelBuffer.GetSpan()); source.PixelBuffer.GetSpan().CopyTo(this.PixelBuffer.GetSpan());
this.MetaData = source.MetaData.DeepClone(); this.Metadata = source.Metadata.DeepClone();
} }
/// <summary> /// <summary>
@ -169,9 +169,9 @@ namespace SixLabors.ImageSharp
public int Height => this.PixelBuffer.Height; public int Height => this.PixelBuffer.Height;
/// <summary> /// <summary>
/// Gets the meta data of the frame. /// Gets the metadata of the frame.
/// </summary> /// </summary>
public ImageFrameMetaData MetaData { get; } public ImageFrameMetadata Metadata { get; }
/// <summary> /// <summary>
/// Gets or sets the pixel at the specified position. /// Gets or sets the pixel at the specified position.
@ -289,7 +289,7 @@ namespace SixLabors.ImageSharp
return this.Clone(configuration) as ImageFrame<TPixel2>; return this.Clone(configuration) as ImageFrame<TPixel2>;
} }
var target = new ImageFrame<TPixel2>(configuration, this.Width, this.Height, this.MetaData.DeepClone()); var target = new ImageFrame<TPixel2>(configuration, this.Width, this.Height, this.Metadata.DeepClone());
ParallelHelper.IterateRows( ParallelHelper.IterateRows(
this.Bounds(), this.Bounds(),

10
src/ImageSharp/ImageInfo.cs

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp namespace SixLabors.ImageSharp
{ {
@ -17,13 +17,13 @@ namespace SixLabors.ImageSharp
/// <param name="pixelType">The image pixel type information.</param> /// <param name="pixelType">The image pixel type information.</param>
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="metaData">The images metadata.</param> /// <param name="metadata">The images metadata.</param>
public ImageInfo(PixelTypeInfo pixelType, int width, int height, ImageMetaData metaData) public ImageInfo(PixelTypeInfo pixelType, int width, int height, ImageMetadata metadata)
{ {
this.PixelType = pixelType; this.PixelType = pixelType;
this.Width = width; this.Width = width;
this.Height = height; this.Height = height;
this.MetaData = metaData; this.Metadata = metadata;
} }
/// <inheritdoc /> /// <inheritdoc />
@ -36,6 +36,6 @@ namespace SixLabors.ImageSharp
public int Height { get; } public int Height { get; }
/// <inheritdoc /> /// <inheritdoc />
public ImageMetaData MetaData { get; } public ImageMetadata Metadata { get; }
} }
} }

28
src/ImageSharp/Image{TPixel}.cs

@ -9,7 +9,7 @@ using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp namespace SixLabors.ImageSharp
@ -31,7 +31,7 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
public Image(Configuration configuration, int width, int height) public Image(Configuration configuration, int width, int height)
: this(configuration, width, height, new ImageMetaData()) : this(configuration, width, height, new ImageMetadata())
{ {
} }
@ -44,7 +44,7 @@ namespace SixLabors.ImageSharp
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="backgroundColor">The color to initialize the pixels with.</param> /// <param name="backgroundColor">The color to initialize the pixels with.</param>
public Image(Configuration configuration, int width, int height, TPixel backgroundColor) public Image(Configuration configuration, int width, int height, TPixel backgroundColor)
: this(configuration, width, height, backgroundColor, new ImageMetaData()) : this(configuration, width, height, backgroundColor, new ImageMetadata())
{ {
} }
@ -67,11 +67,11 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="metadata">The images metadata.</param> /// <param name="metadata">The images metadata.</param>
internal Image(Configuration configuration, int width, int height, ImageMetaData metadata) internal Image(Configuration configuration, int width, int height, ImageMetadata metadata)
{ {
this.configuration = configuration ?? Configuration.Default; this.configuration = configuration ?? Configuration.Default;
this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8); this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
this.MetaData = metadata ?? new ImageMetaData(); this.Metadata = metadata ?? new ImageMetadata();
this.Frames = new ImageFrameCollection<TPixel>(this, width, height, default(TPixel)); this.Frames = new ImageFrameCollection<TPixel>(this, width, height, default(TPixel));
} }
@ -84,11 +84,11 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param> /// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="metadata">The images metadata.</param> /// <param name="metadata">The images metadata.</param>
internal Image(Configuration configuration, MemorySource<TPixel> memorySource, int width, int height, ImageMetaData metadata) internal Image(Configuration configuration, MemorySource<TPixel> memorySource, int width, int height, ImageMetadata metadata)
{ {
this.configuration = configuration; this.configuration = configuration;
this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8); this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
this.MetaData = metadata; this.Metadata = metadata;
this.Frames = new ImageFrameCollection<TPixel>(this, width, height, memorySource); this.Frames = new ImageFrameCollection<TPixel>(this, width, height, memorySource);
} }
@ -101,11 +101,11 @@ namespace SixLabors.ImageSharp
/// <param name="height">The height of the image in pixels.</param> /// <param name="height">The height of the image in pixels.</param>
/// <param name="backgroundColor">The color to initialize the pixels with.</param> /// <param name="backgroundColor">The color to initialize the pixels with.</param>
/// <param name="metadata">The images metadata.</param> /// <param name="metadata">The images metadata.</param>
internal Image(Configuration configuration, int width, int height, TPixel backgroundColor, ImageMetaData metadata) internal Image(Configuration configuration, int width, int height, TPixel backgroundColor, ImageMetadata metadata)
{ {
this.configuration = configuration ?? Configuration.Default; this.configuration = configuration ?? Configuration.Default;
this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8); this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
this.MetaData = metadata ?? new ImageMetaData(); this.Metadata = metadata ?? new ImageMetadata();
this.Frames = new ImageFrameCollection<TPixel>(this, width, height, backgroundColor); this.Frames = new ImageFrameCollection<TPixel>(this, width, height, backgroundColor);
} }
@ -116,11 +116,11 @@ namespace SixLabors.ImageSharp
/// <param name="configuration">The configuration providing initialization code which allows extending the library.</param> /// <param name="configuration">The configuration providing initialization code which allows extending the library.</param>
/// <param name="metadata">The images metadata.</param> /// <param name="metadata">The images metadata.</param>
/// <param name="frames">The frames that will be owned by this image instance.</param> /// <param name="frames">The frames that will be owned by this image instance.</param>
internal Image(Configuration configuration, ImageMetaData metadata, IEnumerable<ImageFrame<TPixel>> frames) internal Image(Configuration configuration, ImageMetadata metadata, IEnumerable<ImageFrame<TPixel>> frames)
{ {
this.configuration = configuration ?? Configuration.Default; this.configuration = configuration ?? Configuration.Default;
this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8); this.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
this.MetaData = metadata ?? new ImageMetaData(); this.Metadata = metadata ?? new ImageMetadata();
this.Frames = new ImageFrameCollection<TPixel>(this, frames); this.Frames = new ImageFrameCollection<TPixel>(this, frames);
} }
@ -140,7 +140,7 @@ namespace SixLabors.ImageSharp
public int Height => this.Frames.RootFrame.Height; public int Height => this.Frames.RootFrame.Height;
/// <inheritdoc/> /// <inheritdoc/>
public ImageMetaData MetaData { get; } public ImageMetadata Metadata { get; }
/// <summary> /// <summary>
/// Gets the frames. /// Gets the frames.
@ -193,7 +193,7 @@ namespace SixLabors.ImageSharp
public Image<TPixel> Clone(Configuration configuration) public Image<TPixel> Clone(Configuration configuration)
{ {
IEnumerable<ImageFrame<TPixel>> clonedFrames = this.Frames.Select(x => x.Clone(configuration)); IEnumerable<ImageFrame<TPixel>> clonedFrames = this.Frames.Select(x => x.Clone(configuration));
return new Image<TPixel>(configuration, this.MetaData.DeepClone(), clonedFrames); return new Image<TPixel>(configuration, this.Metadata.DeepClone(), clonedFrames);
} }
/// <summary> /// <summary>
@ -214,7 +214,7 @@ namespace SixLabors.ImageSharp
where TPixel2 : struct, IPixel<TPixel2> where TPixel2 : struct, IPixel<TPixel2>
{ {
IEnumerable<ImageFrame<TPixel2>> clonedFrames = this.Frames.Select(x => x.CloneAs<TPixel2>(configuration)); IEnumerable<ImageFrame<TPixel2>> clonedFrames = this.Frames.Select(x => x.CloneAs<TPixel2>(configuration));
return new Image<TPixel2>(configuration, this.MetaData.DeepClone(), clonedFrames); return new Image<TPixel2>(configuration, this.Metadata.DeepClone(), clonedFrames);
} }
/// <inheritdoc/> /// <inheritdoc/>

2
src/ImageSharp/MetaData/FrameDecodingMode.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData namespace SixLabors.ImageSharp.Metadata
{ {
/// <summary> /// <summary>
/// Enumerated frame process modes to apply to multi-frame images. /// Enumerated frame process modes to apply to multi-frame images.

42
src/ImageSharp/MetaData/ImageFrameMetaData.cs

@ -4,62 +4,62 @@
using System.Collections.Generic; using System.Collections.Generic;
using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats;
namespace SixLabors.ImageSharp.MetaData namespace SixLabors.ImageSharp.Metadata
{ {
/// <summary> /// <summary>
/// Encapsulates the metadata of an image frame. /// Encapsulates the metadata of an image frame.
/// </summary> /// </summary>
public sealed class ImageFrameMetaData : IDeepCloneable<ImageFrameMetaData> public sealed class ImageFrameMetadata : IDeepCloneable<ImageFrameMetadata>
{ {
private readonly Dictionary<IImageFormat, IDeepCloneable> formatMetaData = new Dictionary<IImageFormat, IDeepCloneable>(); private readonly Dictionary<IImageFormat, IDeepCloneable> formatMetadata = new Dictionary<IImageFormat, IDeepCloneable>();
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ImageFrameMetaData"/> class. /// Initializes a new instance of the <see cref="ImageFrameMetadata"/> class.
/// </summary> /// </summary>
internal ImageFrameMetaData() internal ImageFrameMetadata()
{ {
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ImageFrameMetaData"/> class /// Initializes a new instance of the <see cref="ImageFrameMetadata"/> class
/// by making a copy from other metadata. /// by making a copy from other metadata.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">
/// The other <see cref="ImageFrameMetaData"/> to create this instance from. /// The other <see cref="ImageFrameMetadata"/> to create this instance from.
/// </param> /// </param>
internal ImageFrameMetaData(ImageFrameMetaData other) internal ImageFrameMetadata(ImageFrameMetadata other)
{ {
DebugGuard.NotNull(other, nameof(other)); DebugGuard.NotNull(other, nameof(other));
foreach (KeyValuePair<IImageFormat, IDeepCloneable> meta in other.formatMetaData) foreach (KeyValuePair<IImageFormat, IDeepCloneable> meta in other.formatMetadata)
{ {
this.formatMetaData.Add(meta.Key, meta.Value.DeepClone()); this.formatMetadata.Add(meta.Key, meta.Value.DeepClone());
} }
} }
/// <inheritdoc/> /// <inheritdoc/>
public ImageFrameMetaData DeepClone() => new ImageFrameMetaData(this); public ImageFrameMetadata DeepClone() => new ImageFrameMetadata(this);
/// <summary> /// <summary>
/// Gets the metadata value associated with the specified key. /// Gets the metadata value associated with the specified key.
/// </summary> /// </summary>
/// <typeparam name="TFormatMetaData">The type of format metadata.</typeparam> /// <typeparam name="TFormatMetadata">The type of format metadata.</typeparam>
/// <typeparam name="TFormatFrameMetaData">The type of format frame metadata.</typeparam> /// <typeparam name="TFormatFrameMetadata">The type of format frame metadata.</typeparam>
/// <param name="key">The key of the value to get.</param> /// <param name="key">The key of the value to get.</param>
/// <returns> /// <returns>
/// The <typeparamref name="TFormatFrameMetaData"/>. /// The <typeparamref name="TFormatFrameMetadata"/>.
/// </returns> /// </returns>
public TFormatFrameMetaData GetFormatMetaData<TFormatMetaData, TFormatFrameMetaData>(IImageFormat<TFormatMetaData, TFormatFrameMetaData> key) public TFormatFrameMetadata GetFormatMetadata<TFormatMetadata, TFormatFrameMetadata>(IImageFormat<TFormatMetadata, TFormatFrameMetadata> key)
where TFormatMetaData : class where TFormatMetadata : class
where TFormatFrameMetaData : class, IDeepCloneable where TFormatFrameMetadata : class, IDeepCloneable
{ {
if (this.formatMetaData.TryGetValue(key, out IDeepCloneable meta)) if (this.formatMetadata.TryGetValue(key, out IDeepCloneable meta))
{ {
return (TFormatFrameMetaData)meta; return (TFormatFrameMetadata)meta;
} }
TFormatFrameMetaData newMeta = key.CreateDefaultFormatFrameMetaData(); TFormatFrameMetadata newMeta = key.CreateDefaultFormatFrameMetadata();
this.formatMetaData[key] = newMeta; this.formatMetadata[key] = newMeta;
return newMeta; return newMeta;
} }
} }

44
src/ImageSharp/MetaData/ImageMetaData.cs

@ -3,15 +3,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc; using SixLabors.ImageSharp.Metadata.Profiles.Icc;
namespace SixLabors.ImageSharp.MetaData namespace SixLabors.ImageSharp.Metadata
{ {
/// <summary> /// <summary>
/// Encapsulates the metadata of an image. /// Encapsulates the metadata of an image.
/// </summary> /// </summary>
public sealed class ImageMetaData : IDeepCloneable<ImageMetaData> public sealed class ImageMetadata : IDeepCloneable<ImageMetadata>
{ {
/// <summary> /// <summary>
/// The default horizontal resolution value (dots per inch) in x direction. /// The default horizontal resolution value (dots per inch) in x direction.
@ -31,14 +31,14 @@ namespace SixLabors.ImageSharp.MetaData
/// </summary> /// </summary>
public const PixelResolutionUnit DefaultPixelResolutionUnits = PixelResolutionUnit.PixelsPerInch; public const PixelResolutionUnit DefaultPixelResolutionUnits = PixelResolutionUnit.PixelsPerInch;
private readonly Dictionary<IImageFormat, IDeepCloneable> formatMetaData = new Dictionary<IImageFormat, IDeepCloneable>(); private readonly Dictionary<IImageFormat, IDeepCloneable> formatMetadata = new Dictionary<IImageFormat, IDeepCloneable>();
private double horizontalResolution; private double horizontalResolution;
private double verticalResolution; private double verticalResolution;
/// <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() internal ImageMetadata()
{ {
this.horizontalResolution = DefaultHorizontalResolution; this.horizontalResolution = DefaultHorizontalResolution;
this.verticalResolution = DefaultVerticalResolution; this.verticalResolution = DefaultVerticalResolution;
@ -46,21 +46,21 @@ 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
/// by making a copy from other metadata. /// by making a copy from other metadata.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">
/// The other <see cref="ImageMetaData"/> to create this instance from. /// The other <see cref="ImageMetadata"/> to create this instance from.
/// </param> /// </param>
private ImageMetaData(ImageMetaData other) private ImageMetadata(ImageMetadata other)
{ {
this.HorizontalResolution = other.HorizontalResolution; this.HorizontalResolution = other.HorizontalResolution;
this.VerticalResolution = other.VerticalResolution; this.VerticalResolution = other.VerticalResolution;
this.ResolutionUnits = other.ResolutionUnits; this.ResolutionUnits = other.ResolutionUnits;
foreach (KeyValuePair<IImageFormat, IDeepCloneable> meta in other.formatMetaData) foreach (KeyValuePair<IImageFormat, IDeepCloneable> meta in other.formatMetadata)
{ {
this.formatMetaData.Add(meta.Key, meta.Value.DeepClone()); this.formatMetadata.Add(meta.Key, meta.Value.DeepClone());
} }
foreach (ImageProperty property in other.Properties) foreach (ImageProperty property in other.Properties)
@ -135,26 +135,26 @@ namespace SixLabors.ImageSharp.MetaData
/// <summary> /// <summary>
/// Gets the metadata value associated with the specified key. /// Gets the metadata value associated with the specified key.
/// </summary> /// </summary>
/// <typeparam name="TFormatMetaData">The type of metadata.</typeparam> /// <typeparam name="TFormatMetadata">The type of metadata.</typeparam>
/// <param name="key">The key of the value to get.</param> /// <param name="key">The key of the value to get.</param>
/// <returns> /// <returns>
/// The <typeparamref name="TFormatMetaData"/>. /// The <typeparamref name="TFormatMetadata"/>.
/// </returns> /// </returns>
public TFormatMetaData GetFormatMetaData<TFormatMetaData>(IImageFormat<TFormatMetaData> key) public TFormatMetadata GetFormatMetadata<TFormatMetadata>(IImageFormat<TFormatMetadata> key)
where TFormatMetaData : class, IDeepCloneable where TFormatMetadata : class, IDeepCloneable
{ {
if (this.formatMetaData.TryGetValue(key, out IDeepCloneable meta)) if (this.formatMetadata.TryGetValue(key, out IDeepCloneable meta))
{ {
return (TFormatMetaData)meta; return (TFormatMetadata)meta;
} }
TFormatMetaData newMeta = key.CreateDefaultFormatMetaData(); TFormatMetadata newMeta = key.CreateDefaultFormatMetadata();
this.formatMetaData[key] = newMeta; this.formatMetadata[key] = newMeta;
return newMeta; return newMeta;
} }
/// <inheritdoc/> /// <inheritdoc/>
public ImageMetaData DeepClone() => new ImageMetaData(this); public ImageMetadata DeepClone() => new ImageMetadata(this);
/// <summary> /// <summary>
/// Looks up a property with the provided name. /// Looks up a property with the provided name.
@ -180,7 +180,7 @@ namespace SixLabors.ImageSharp.MetaData
} }
/// <summary> /// <summary>
/// Synchronizes the profiles with the current meta data. /// Synchronizes the profiles with the current metadata.
/// </summary> /// </summary>
internal void SyncProfiles() => this.ExifProfile?.Sync(this); internal void SyncProfiles() => this.ExifProfile?.Sync(this);
} }

2
src/ImageSharp/MetaData/ImageProperty.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData namespace SixLabors.ImageSharp.Metadata
{ {
/// <summary> /// <summary>
/// Stores meta information about a image, like the name of the author, /// Stores meta information about a image, like the name of the author,

2
src/ImageSharp/MetaData/PixelResolutionUnit.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData namespace SixLabors.ImageSharp.Metadata
{ {
/// <summary> /// <summary>
/// Provides enumeration of available pixel density units. /// Provides enumeration of available pixel density units.

2
src/ImageSharp/MetaData/Profiles/Exif/ExifConstants.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
internal static class ExifConstants internal static class ExifConstants
{ {

2
src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Specifies exif data types. /// Specifies exif data types.

2
src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Specifies which parts will be written when the profile is added to an image. /// Specifies which parts will be written when the profile is added to an image.

12
src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs

@ -7,7 +7,7 @@ using System.IO;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Represents an EXIF profile providing access to the collection of values. /// Represents an EXIF profile providing access to the collection of values.
@ -249,13 +249,13 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
public ExifProfile DeepClone() => new ExifProfile(this); public ExifProfile DeepClone() => new ExifProfile(this);
/// <summary> /// <summary>
/// Synchronizes the profiles with the specified meta data. /// Synchronizes the profiles with the specified metadata.
/// </summary> /// </summary>
/// <param name="metaData">The meta data.</param> /// <param name="metadata">The metadata.</param>
internal void Sync(ImageMetaData metaData) internal void Sync(ImageMetadata metadata)
{ {
this.SyncResolution(ExifTag.XResolution, metaData.HorizontalResolution); this.SyncResolution(ExifTag.XResolution, metadata.HorizontalResolution);
this.SyncResolution(ExifTag.YResolution, metaData.VerticalResolution); this.SyncResolution(ExifTag.YResolution, metadata.VerticalResolution);
} }
private void SyncResolution(ExifTag tag, double resolution) private void SyncResolution(ExifTag tag, double resolution)

2
src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs

@ -10,7 +10,7 @@ using System.Runtime.CompilerServices;
using System.Text; using System.Text;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Reads and parses EXIF data from a byte array. /// Reads and parses EXIF data from a byte array.

2
src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// All exif tags from the Exif standard 2.2 /// All exif tags from the Exif standard 2.2

2
src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Reflection; using System.Reflection;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Class that provides a description for an ExifTag value. /// Class that provides a description for an ExifTag value.

4
src/ImageSharp/MetaData/Profiles/Exif/ExifTags.cs

@ -1,9 +1,9 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using static SixLabors.ImageSharp.MetaData.Profiles.Exif.ExifTag; using static SixLabors.ImageSharp.Metadata.Profiles.Exif.ExifTag;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
internal static class ExifTags internal static class ExifTags
{ {

2
src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs

@ -6,7 +6,7 @@ using System.Globalization;
using System.Text; using System.Text;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Represent the value of the EXIF profile. /// Represent the value of the EXIF profile.

2
src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs

@ -7,7 +7,7 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{ {
/// <summary> /// <summary>
/// Contains methods for writing EXIF metadata. /// Contains methods for writing EXIF metadata.

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A segment of a curve /// A segment of a curve

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A formula based curve segment /// A formula based curve segment

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Linq; using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A one dimensional ICC curve. /// A one dimensional ICC curve.

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A parametric curve /// A parametric curve

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs

@ -5,7 +5,7 @@ using System;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A response curve /// A response curve

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A sampled curve segment /// A sampled curve segment

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs

@ -3,7 +3,7 @@
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs

@ -6,7 +6,7 @@ using System.Buffers.Binary;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text; using System.Text;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs

@ -5,7 +5,7 @@ using System;
using System.Globalization; using System.Globalization;
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Text; using System.Text;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to read ICC data types /// Provides methods to read ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs

@ -3,7 +3,7 @@
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <content> /// <content>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <content> /// <content>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs

@ -4,7 +4,7 @@
using System.Numerics; using System.Numerics;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Text; using System.Text;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs

@ -3,7 +3,7 @@
using System.Linq; using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs

@ -4,7 +4,7 @@
using System; using System;
using System.IO; using System.IO;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Provides methods to write ICC data types /// Provides methods to write ICC data types

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Color lookup table data type /// Color lookup table data type

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Color Space Type /// Color Space Type

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Colorant Encoding /// Colorant Encoding

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Curve Measurement Encodings /// Curve Measurement Encodings

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Curve Segment Signature /// Curve Segment Signature

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Enumerates the basic data types as defined in ICC.1:2010 version 4.3.0.0 /// Enumerates the basic data types as defined in ICC.1:2010 version 4.3.0.0

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Device attributes. Can be combined with a logical OR /// Device attributes. Can be combined with a logical OR

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Formula curve segment type /// Formula curve segment type

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Measurement Geometry /// Measurement Geometry

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Multi process element signature /// Multi process element signature

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Formula curve segment type /// Formula curve segment type

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Enumerates the primary platform/operating system framework for which the profile was created /// Enumerates the primary platform/operating system framework for which the profile was created

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Profile Class Name /// Profile Class Name

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Profile flags. Can be combined with a logical OR. /// Profile flags. Can be combined with a logical OR.

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Enumerates the ICC Profile Tags as defined in ICC.1:2010 version 4.3.0.0 /// Enumerates the ICC Profile Tags as defined in ICC.1:2010 version 4.3.0.0

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Rendering intent /// Rendering intent

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Screening flags. Can be combined with a logical OR. /// Screening flags. Can be combined with a logical OR.

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Enumerates the screening spot types /// Enumerates the screening spot types

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Signature Name /// Signature Name

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Standard Illuminant /// Standard Illuminant

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Standard Observer /// Standard Observer

2
src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Type Signature /// Type Signature

2
src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Represents an error that happened while reading or writing a corrupt/invalid ICC profile /// Represents an error that happened while reading or writing a corrupt/invalid ICC profile

2
src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Security.Cryptography; using System.Security.Cryptography;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Represents an ICC profile /// Represents an ICC profile

2
src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Numerics; using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Contains all values of an ICC profile header. /// Contains all values of an ICC profile header.

2
src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Reads and parses ICC data from a byte array /// Reads and parses ICC data from a byte array

2
src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// The data of an ICC tag entry /// The data of an ICC tag entry

2
src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs

@ -4,7 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// Contains methods for writing ICC profiles. /// Contains methods for writing ICC profiles.

2
src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A placeholder <see cref="IccMultiProcessElement"/> (might be used for future ICC versions) /// A placeholder <see cref="IccMultiProcessElement"/> (might be used for future ICC versions)

2
src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A CLUT (color lookup table) element to process data /// A CLUT (color lookup table) element to process data

2
src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Linq; using System.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A set of curves to process data /// A set of curves to process data

2
src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs

@ -3,7 +3,7 @@
using System; using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A placeholder <see cref="IccMultiProcessElement"/> (might be used for future ICC versions) /// A placeholder <see cref="IccMultiProcessElement"/> (might be used for future ICC versions)

2
src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs

@ -5,7 +5,7 @@ using System;
using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{ {
/// <summary> /// <summary>
/// A matrix element to process data /// A matrix element to process data

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save