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.
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
namespace SixLabors.ImageSharp.Common.Helpers
{

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

@ -9,7 +9,7 @@ using System.Numerics;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Common.Helpers;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory;
@ -66,12 +66,12 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <summary>
/// The metadata.
/// </summary>
private ImageMetaData metaData;
private ImageMetadata metadata;
/// <summary>
/// The bmp specific metadata.
/// </summary>
private BmpMetaData bmpMetaData;
private BmpMetadata bmpMetadata;
/// <summary>
/// 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);
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();
@ -125,7 +125,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
case BmpCompression.RGB:
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);
}
@ -188,7 +188,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
public IImageInfo Identify(Stream stream)
{
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>
@ -999,7 +999,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
}
// Resolution is stored in PPM.
var meta = new ImageMetaData
var meta = new ImageMetadata
{
ResolutionUnits = PixelResolutionUnit.PixelsPerMeter
};
@ -1011,21 +1011,21 @@ namespace SixLabors.ImageSharp.Formats.Bmp
else
{
// Convert default metadata values to PPM.
meta.HorizontalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetaData.DefaultHorizontalResolution));
meta.VerticalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetaData.DefaultVerticalResolution));
meta.HorizontalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetadata.DefaultHorizontalResolution));
meta.VerticalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetadata.DefaultVerticalResolution));
}
this.metaData = meta;
this.metadata = meta;
short bitsPerPixel = this.infoHeader.BitsPerPixel;
this.bmpMetaData = this.metaData.GetFormatMetaData(BmpFormat.Instance);
this.bmpMetaData.InfoHeaderType = infoHeaderType;
this.bmpMetadata = this.metadata.GetFormatMetadata(BmpFormat.Instance);
this.bmpMetadata.InfoHeaderType = infoHeaderType;
// We can only encode at these bit rates so far.
if (bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel24)
|| 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

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

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

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

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <summary>
/// Registers the image encoders, decoders and mime type detectors for the bmp format.
/// </summary>
public sealed class BmpFormat : IImageFormat<BmpMetaData>
public sealed class BmpFormat : IImageFormat<BmpMetadata>
{
private BmpFormat()
{
@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp.Formats.Bmp
public IEnumerable<string> FileExtensions => BmpConstants.FileExtensions;
/// <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>
/// Provides Bmp specific metadata information for the image.
/// </summary>
public class BmpMetaData : IDeepCloneable
public class BmpMetadata : IDeepCloneable
{
/// <summary>
/// Initializes a new instance of the <see cref="BmpMetaData"/> class.
/// Initializes a new instance of the <see cref="BmpMetadata"/> class.
/// </summary>
public BmpMetaData()
public BmpMetadata()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BmpMetaData"/> class.
/// Initializes a new instance of the <see cref="BmpMetadata"/> class.
/// </summary>
/// <param name="other">The metadata to create an instance from.</param>
private BmpMetaData(BmpMetaData other)
private BmpMetadata(BmpMetadata other)
{
this.BitsPerPixel = other.BitsPerPixel;
this.InfoHeaderType = other.InfoHeaderType;
@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
/// <inheritdoc/>
public IDeepCloneable DeepClone() => new BmpMetaData(this);
public IDeepCloneable DeepClone() => new BmpMetadata(this);
// 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.Text;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Gif

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

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
using System.Text;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory;
using SixLabors.Primitives;
@ -63,12 +63,12 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary>
/// The abstract metadata.
/// </summary>
private ImageMetaData metaData;
private ImageMetadata metadata;
/// <summary>
/// The gif specific metadata.
/// </summary>
private GifMetaData gifMetaData;
private GifMetadata gifMetadata;
/// <summary>
/// Initializes a new instance of the <see cref="GifDecoderCore"/> class.
@ -223,7 +223,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
new PixelTypeInfo(this.logicalScreenDescriptor.BitsPerPixel),
this.logicalScreenDescriptor.Width,
this.logicalScreenDescriptor.Height,
this.metaData);
this.metadata);
}
/// <summary>
@ -276,7 +276,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
if (subBlockSize == 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.
return;
}
@ -334,7 +334,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
{
this.stream.Read(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)
{
// 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;
}
@ -431,7 +431,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
currentFrame = image.Frames.AddFrame(previousFrame); // This clones the frame and adds it the collection
this.SetFrameMetaData(currentFrame.MetaData);
this.SetFrameMetadata(currentFrame.Metadata);
imageFrame = currentFrame;
@ -549,11 +549,11 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary>
/// Sets the frames metadata.
/// </summary>
/// <param name="meta">The meta data.</param>
/// <param name="meta">The metadata.</param>
[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)
{
gifMeta.FrameDelay = this.graphicsControlExtension.DelayTime;
@ -586,7 +586,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
this.stream.Skip(6);
this.ReadLogicalScreenDescriptor();
var meta = new ImageMetaData();
var meta = new ImageMetadata();
// 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
@ -614,16 +614,16 @@ namespace SixLabors.ImageSharp.Formats.Gif
}
}
this.metaData = meta;
this.gifMetaData = meta.GetFormatMetaData(GifFormat.Instance);
this.gifMetaData.ColorTableMode = this.logicalScreenDescriptor.GlobalColorTableFlag
this.metadata = meta;
this.gifMetadata = meta.GetFormatMetadata(GifFormat.Instance);
this.gifMetadata.ColorTableMode = this.logicalScreenDescriptor.GlobalColorTableFlag
? GifColorTableMode.Global
: GifColorTableMode.Local;
if (this.logicalScreenDescriptor.GlobalColorTableFlag)
{
int globalColorTableLength = this.logicalScreenDescriptor.GlobalColorTableSize * 3;
this.gifMetaData.GlobalColorTableLength = globalColorTableLength;
this.gifMetadata.GlobalColorTableLength = globalColorTableLength;
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.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors.Quantization;
using SixLabors.Memory;
@ -58,9 +58,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
private int bitDepth;
/// <summary>
/// Gif specific meta data.
/// Gif specific metadata.
/// </summary>
private GifMetaData gifMetaData;
private GifMetadata gifMetadata;
/// <summary>
/// Initializes a new instance of the <see cref="GifEncoderCore"/> class.
@ -89,9 +89,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
this.configuration = image.GetConfiguration();
ImageMetaData metaData = image.MetaData;
this.gifMetaData = metaData.GetFormatMetaData(GifFormat.Instance);
this.colorTableMode = this.colorTableMode ?? this.gifMetaData.ColorTableMode;
ImageMetadata metadata = image.Metadata;
this.gifMetadata = metadata.GetFormatMetadata(GifFormat.Instance);
this.colorTableMode = this.colorTableMode ?? this.gifMetadata.ColorTableMode;
bool useGlobalTable = this.colorTableMode == GifColorTableMode.Global;
// Quantize the image returning a palette.
@ -106,7 +106,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
// Write the LSD.
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)
{
@ -114,12 +114,12 @@ namespace SixLabors.ImageSharp.Formats.Gif
}
// Write the comments.
this.WriteComments(metaData, stream);
this.WriteComments(metadata, stream);
// Write application extension to allow additional frames.
if (image.Frames.Count > 1)
{
this.WriteApplicationExtension(stream, this.gifMetaData.RepeatCount);
this.WriteApplicationExtension(stream, this.gifMetadata.RepeatCount);
}
if (useGlobalTable)
@ -147,9 +147,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
for (int i = 0; i < image.Frames.Count; i++)
{
ImageFrame<TPixel> frame = image.Frames[i];
ImageFrameMetaData metaData = frame.MetaData;
GifFrameMetaData frameMetaData = metaData.GetFormatMetaData(GifFormat.Instance);
this.WriteGraphicalControlExtension(frameMetaData, transparencyIndex, stream);
ImageFrameMetadata metadata = frame.Metadata;
GifFrameMetadata frameMetadata = metadata.GetFormatMetadata(GifFormat.Instance);
this.WriteGraphicalControlExtension(frameMetadata, transparencyIndex, stream);
this.WriteImageDescriptor(frame, false, stream);
if (i == 0)
@ -170,20 +170,20 @@ namespace SixLabors.ImageSharp.Formats.Gif
where TPixel : struct, IPixel<TPixel>
{
ImageFrame<TPixel> previousFrame = null;
GifFrameMetaData previousMeta = null;
GifFrameMetadata previousMeta = null;
foreach (ImageFrame<TPixel> frame in image.Frames)
{
ImageFrameMetaData metaData = frame.MetaData;
GifFrameMetaData frameMetaData = metaData.GetFormatMetaData(GifFormat.Instance);
ImageFrameMetadata metadata = frame.Metadata;
GifFrameMetadata frameMetadata = metadata.GetFormatMetadata(GifFormat.Instance);
if (quantized is null)
{
// Allow each frame to be encoded at whatever color depth the frame designates if set.
if (previousFrame != null && previousMeta.ColorTableLength != frameMetaData.ColorTableLength
&& frameMetaData.ColorTableLength > 0)
if (previousFrame != null && previousMeta.ColorTableLength != frameMetadata.ColorTableLength
&& frameMetadata.ColorTableLength > 0)
{
quantized = this.quantizer.CreateFrameQuantizer<TPixel>(
image.GetConfiguration(),
frameMetaData.ColorTableLength).QuantizeFrame(frame);
frameMetadata.ColorTableLength).QuantizeFrame(frame);
}
else
{
@ -193,7 +193,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
}
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.WriteColorTable(quantized, stream);
this.WriteImageData(quantized, stream);
@ -201,7 +201,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
quantized?.Dispose();
quantized = null; // So next frame can regenerate it
previousFrame = frame;
previousMeta = frameMetaData;
previousMeta = frameMetadata;
}
}
@ -250,14 +250,14 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary>
/// Writes the logical screen descriptor to the stream.
/// </summary>
/// <param name="metaData">The image metadata.</param>
/// <param name="metadata">The image metadata.</param>
/// <param name="width">The image width.</param>
/// <param name="height">The image height.</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="stream">The stream to write to.</param>
private void WriteLogicalScreenDescriptor(
ImageMetaData metaData,
ImageMetadata metadata,
int width,
int height,
int transparencyIndex,
@ -277,10 +277,10 @@ namespace SixLabors.ImageSharp.Formats.Gif
// Aspect Ratio = (Pixel Aspect Ratio + 15) / 64
byte ratio = 0;
if (metaData.ResolutionUnits == PixelResolutionUnit.AspectRatio)
if (metadata.ResolutionUnits == PixelResolutionUnit.AspectRatio)
{
double hr = metaData.HorizontalResolution;
double vr = metaData.VerticalResolution;
double hr = metadata.HorizontalResolution;
double vr = metadata.VerticalResolution;
if (hr != vr)
{
if (hr > vr)
@ -326,7 +326,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// </summary>
/// <param name="metadata">The metadata to be extract the comment data.</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)
|| string.IsNullOrEmpty(property.Value))
@ -350,18 +350,18 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary>
/// Writes the graphics control extension to the stream.
/// </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="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(
disposalMethod: metaData.DisposalMethod,
disposalMethod: metadata.DisposalMethod,
transparencyFlag: transparencyIndex > -1);
var extension = new GifGraphicControlExtension(
packed: packedValue,
delayTime: (ushort)metaData.FrameDelay,
delayTime: (ushort)metadata.FrameDelay,
transparencyIndex: unchecked((byte)transparencyIndex));
this.WriteExtension(extension, stream);

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

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Gif
/// <summary>
/// Registers the image encoders, decoders and mime type detectors for the gif format.
/// </summary>
public sealed class GifFormat : IImageFormat<GifMetaData, GifFrameMetaData>
public sealed class GifFormat : IImageFormat<GifMetadata, GifFrameMetadata>
{
private GifFormat()
{
@ -32,9 +32,9 @@ namespace SixLabors.ImageSharp.Formats.Gif
public IEnumerable<string> FileExtensions => GifConstants.FileExtensions;
/// <inheritdoc/>
public GifMetaData CreateDefaultFormatMetaData() => new GifMetaData();
public GifMetadata CreateDefaultFormatMetadata() => new GifMetadata();
/// <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>
/// Provides Gif specific metadata information for the image frame.
/// </summary>
public class GifFrameMetaData : IDeepCloneable
public class GifFrameMetadata : IDeepCloneable
{
/// <summary>
/// Initializes a new instance of the <see cref="GifFrameMetaData"/> class.
/// Initializes a new instance of the <see cref="GifFrameMetadata"/> class.
/// </summary>
public GifFrameMetaData()
public GifFrameMetadata()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="GifFrameMetaData"/> class.
/// Initializes a new instance of the <see cref="GifFrameMetadata"/> class.
/// </summary>
/// <param name="other">The metadata to create an instance from.</param>
private GifFrameMetaData(GifFrameMetaData other)
private GifFrameMetadata(GifFrameMetadata other)
{
this.ColorTableLength = other.ColorTableLength;
this.FrameDelay = other.FrameDelay;
@ -49,6 +49,6 @@ namespace SixLabors.ImageSharp.Formats.Gif
public GifDisposalMethod DisposalMethod { get; set; }
/// <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>
/// Provides Gif specific metadata information for the image.
/// </summary>
public class GifMetaData : IDeepCloneable
public class GifMetadata : IDeepCloneable
{
/// <summary>
/// Initializes a new instance of the <see cref="GifMetaData"/> class.
/// Initializes a new instance of the <see cref="GifMetadata"/> class.
/// </summary>
public GifMetaData()
public GifMetadata()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="GifMetaData"/> class.
/// Initializes a new instance of the <see cref="GifMetadata"/> class.
/// </summary>
/// <param name="other">The metadata to create an instance from.</param>
private GifMetaData(GifMetaData other)
private GifMetadata(GifMetadata other)
{
this.RepeatCount = other.RepeatCount;
this.ColorTableMode = other.ColorTableMode;
@ -45,6 +45,6 @@ namespace SixLabors.ImageSharp.Formats.Gif
public int GlobalColorTableLength { get; set; }
/// <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.
using System.Text;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp.Formats.Gif
{

24
src/ImageSharp/Formats/IImageFormat.cs

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

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

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
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.IO;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives;
using SixLabors.Memory;
@ -149,9 +149,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public bool IgnoreMetadata { get; }
/// <summary>
/// Gets the <see cref="ImageMetaData"/> decoded by this decoder instance.
/// Gets the <see cref="ImageMetadata"/> decoded by this decoder instance.
/// </summary>
public ImageMetaData MetaData { get; private set; }
public ImageMetadata Metadata { get; private set; }
/// <inheritdoc/>
public int ComponentCount { get; private set; }
@ -222,7 +222,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.ParseStream(stream);
this.InitExifProfile();
this.InitIccProfile();
this.InitDerivedMetaDataProperties();
this.InitDerivedMetadataProperties();
return this.PostProcessIntoImage<TPixel>();
}
@ -235,9 +235,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.ParseStream(stream, true);
this.InitExifProfile();
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>
@ -247,7 +247,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <param name="metadataOnly">Whether to decode metadata only.</param>
public void ParseStream(Stream stream, bool metadataOnly = false)
{
this.MetaData = new ImageMetaData();
this.Metadata = new ImageMetadata();
this.InputStream = new DoubleBufferedStreamReader(this.configuration.MemoryAllocator, stream);
// Check for the Start Of Image marker.
@ -430,7 +430,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
{
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);
if (profile.CheckIsValid())
{
this.MetaData.IccProfile = profile;
this.Metadata.IccProfile = profile;
}
}
}
/// <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>
private void InitDerivedMetaDataProperties()
private void InitDerivedMetadataProperties()
{
if (this.jFif.XDensity > 0 && this.jFif.YDensity > 0)
{
this.MetaData.HorizontalResolution = this.jFif.XDensity;
this.MetaData.VerticalResolution = this.jFif.YDensity;
this.MetaData.ResolutionUnits = this.jFif.DensityUnits;
this.Metadata.HorizontalResolution = this.jFif.XDensity;
this.Metadata.VerticalResolution = this.jFif.YDensity;
this.Metadata.ResolutionUnits = this.jFif.DensityUnits;
}
else if (this.isExif)
{
@ -467,16 +467,16 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
if (horizontalValue > 0 && verticalValue > 0)
{
this.MetaData.HorizontalResolution = horizontalValue;
this.MetaData.VerticalResolution = verticalValue;
this.MetaData.ResolutionUnits = UnitConverter.ExifProfileToResolutionUnit(this.MetaData.ExifProfile);
this.Metadata.HorizontalResolution = horizontalValue;
this.Metadata.VerticalResolution = verticalValue;
this.Metadata.ResolutionUnits = UnitConverter.ExifProfileToResolutionUnit(this.Metadata.ExifProfile);
}
}
}
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;
}
@ -713,7 +713,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
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>
@ -992,7 +992,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.configuration,
this.ImageWidth,
this.ImageHeight,
this.MetaData);
this.Metadata);
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.Decoder;
using SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.MetaData.Profiles.Icc;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Formats.Jpeg
@ -204,10 +204,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
}
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.
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);
// Convert from a quality rating to a scaling factor.
@ -229,10 +229,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
int componentCount = 3;
// Write the Start Of Image marker.
this.WriteApplicationHeader(metaData);
this.WriteApplicationHeader(metadata);
// Write Exif and ICC profiles
this.WriteProfiles(metaData);
this.WriteProfiles(metadata);
// Write the quantization tables.
this.WriteDefineQuantizationTables();
@ -448,8 +448,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary>
/// Writes the application header containing the JFIF identifier plus extra data.
/// </summary>
/// <param name="meta">The image meta data.</param>
private void WriteApplicationHeader(ImageMetaData meta)
/// <param name="meta">The image metadata.</param>
private void WriteApplicationHeader(ImageMetadata meta)
{
// Write the start of image marker. Markers are always prefixed with 0xff.
this.buffer[0] = JpegConstants.Markers.XFF;
@ -791,17 +791,17 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary>
/// Writes the metadata profiles to the image.
/// </summary>
/// <param name="metaData">The image meta data.</param>
private void WriteProfiles(ImageMetaData metaData)
/// <param name="metadata">The image metadata.</param>
private void WriteProfiles(ImageMetadata metadata)
{
if (metaData is null)
if (metadata is null)
{
return;
}
metaData.SyncProfiles();
this.WriteExifProfile(metaData.ExifProfile);
this.WriteIccProfile(metaData.IccProfile);
metadata.SyncProfiles();
this.WriteExifProfile(metadata.ExifProfile);
this.WriteIccProfile(metadata.IccProfile);
}
/// <summary>

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

@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <summary>
/// Registers the image encoders, decoders and mime type detectors for the jpeg format.
/// </summary>
public sealed class JpegFormat : IImageFormat<JpegMetaData>
public sealed class JpegFormat : IImageFormat<JpegMetadata>
{
private JpegFormat()
{
@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public IEnumerable<string> FileExtensions => JpegConstants.FileExtensions;
/// <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>
/// Provides Jpeg specific metadata information for the image.
/// </summary>
public class JpegMetaData : IDeepCloneable
public class JpegMetadata : IDeepCloneable
{
/// <summary>
/// Initializes a new instance of the <see cref="JpegMetaData"/> class.
/// Initializes a new instance of the <see cref="JpegMetadata"/> class.
/// </summary>
public JpegMetaData()
public JpegMetadata()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="JpegMetaData"/> class.
/// Initializes a new instance of the <see cref="JpegMetadata"/> class.
/// </summary>
/// <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>
/// Gets or sets the encoded quality.
@ -27,6 +27,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
public int Quality { get; set; } = 75;
/// <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.Buffers.Binary;
using SixLabors.ImageSharp.Common.Helpers;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp.Formats.Png.Chunks
{
@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Chunks
/// </summary>
/// <param name="meta">The metadata.</param>
/// <returns>The constructed PngPhysicalChunkData instance.</returns>
public static PhysicalChunkData FromMetadata(ImageMetaData meta)
public static PhysicalChunkData FromMetadata(ImageMetadata meta)
{
byte unitSpecifier = 0;
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.Zlib;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory;
@ -157,8 +157,8 @@ namespace SixLabors.ImageSharp.Formats.Png
public Image<TPixel> Decode<TPixel>(Stream stream)
where TPixel : struct, IPixel<TPixel>
{
var metaData = new ImageMetaData();
PngMetaData pngMetaData = metaData.GetFormatMetaData(PngFormat.Instance);
var metadata = new ImageMetadata();
PngMetadata pngMetadata = metadata.GetFormatMetadata(PngFormat.Instance);
this.currentStream = stream;
this.currentStream.Skip(8);
Image<TPixel> image = null;
@ -171,24 +171,24 @@ namespace SixLabors.ImageSharp.Formats.Png
switch (chunk.Type)
{
case PngChunkType.Header:
this.ReadHeaderChunk(pngMetaData, chunk.Data.Array);
this.ReadHeaderChunk(pngMetadata, chunk.Data.Array);
break;
case PngChunkType.Physical:
this.ReadPhysicalChunk(metaData, chunk.Data.GetSpan());
this.ReadPhysicalChunk(metadata, chunk.Data.GetSpan());
break;
case PngChunkType.Gamma:
this.ReadGammaChunk(pngMetaData, chunk.Data.GetSpan());
this.ReadGammaChunk(pngMetadata, chunk.Data.GetSpan());
break;
case PngChunkType.Data:
if (image is null)
{
this.InitializeImage(metaData, out image);
this.InitializeImage(metadata, out image);
}
using (var deframeStream = new ZlibInflateStream(this.currentStream, this.ReadNextDataChunk))
{
deframeStream.AllocateNewBytes(chunk.Length);
this.ReadScanlines(deframeStream.CompressedStream, image.Frames.RootFrame, pngMetaData);
this.ReadScanlines(deframeStream.CompressedStream, image.Frames.RootFrame, pngMetadata);
}
break;
@ -201,17 +201,17 @@ namespace SixLabors.ImageSharp.Formats.Png
byte[] alpha = new byte[chunk.Length];
Buffer.BlockCopy(chunk.Data.Array, 0, alpha, 0, chunk.Length);
this.paletteAlpha = alpha;
this.AssignTransparentMarkers(alpha, pngMetaData);
this.AssignTransparentMarkers(alpha, pngMetadata);
break;
case PngChunkType.Text:
this.ReadTextChunk(metaData, chunk.Data.Array.AsSpan(0, chunk.Length));
this.ReadTextChunk(metadata, chunk.Data.Array.AsSpan(0, chunk.Length));
break;
case PngChunkType.Exif:
if (!this.ignoreMetadata)
{
byte[] exifData = new byte[chunk.Length];
Buffer.BlockCopy(chunk.Data.Array, 0, exifData, 0, chunk.Length);
metaData.ExifProfile = new ExifProfile(exifData);
metadata.ExifProfile = new ExifProfile(exifData);
}
break;
@ -246,8 +246,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
public IImageInfo Identify(Stream stream)
{
var metaData = new ImageMetaData();
PngMetaData pngMetaData = metaData.GetFormatMetaData(PngFormat.Instance);
var metadata = new ImageMetadata();
PngMetadata pngMetadata = metadata.GetFormatMetadata(PngFormat.Instance);
this.currentStream = stream;
this.currentStream.Skip(8);
try
@ -259,19 +259,19 @@ namespace SixLabors.ImageSharp.Formats.Png
switch (chunk.Type)
{
case PngChunkType.Header:
this.ReadHeaderChunk(pngMetaData, chunk.Data.Array);
this.ReadHeaderChunk(pngMetadata, chunk.Data.Array);
break;
case PngChunkType.Physical:
this.ReadPhysicalChunk(metaData, chunk.Data.GetSpan());
this.ReadPhysicalChunk(metadata, chunk.Data.GetSpan());
break;
case PngChunkType.Gamma:
this.ReadGammaChunk(pngMetaData, chunk.Data.GetSpan());
this.ReadGammaChunk(pngMetadata, chunk.Data.GetSpan());
break;
case PngChunkType.Data:
this.SkipChunkDataAndCrc(chunk);
break;
case PngChunkType.Text:
this.ReadTextChunk(metaData, chunk.Data.Array.AsSpan(0, chunk.Length));
this.ReadTextChunk(metadata, chunk.Data.Array.AsSpan(0, chunk.Length));
break;
case PngChunkType.End:
this.isEndChunkReached = true;
@ -295,7 +295,7 @@ namespace SixLabors.ImageSharp.Formats.Png
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>
@ -350,7 +350,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary>
/// <param name="metadata">The metadata to read to.</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);
@ -367,7 +367,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary>
/// <param name="pngMetadata">The metadata to read to.</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.
// 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>
/// <param name="metadata">The metadata information for the image</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>
{
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>
/// <param name="dataStream">The <see cref="MemoryStream"/> containing data.</param>
/// <param name="image"> The pixel data.</param>
/// <param name="pngMetaData">The png meta data</param>
private void ReadScanlines<TPixel>(Stream dataStream, ImageFrame<TPixel> image, PngMetaData pngMetaData)
/// <param name="pngMetadata">The png metadata</param>
private void ReadScanlines<TPixel>(Stream dataStream, ImageFrame<TPixel> image, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel>
{
if (this.header.InterlaceMethod == PngInterlaceMode.Adam7)
{
this.DecodeInterlacedPixelData(dataStream, image, pngMetaData);
this.DecodeInterlacedPixelData(dataStream, image, pngMetadata);
}
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>
/// <param name="compressedStream">The compressed pixel data stream.</param>
/// <param name="image">The image to decode to.</param>
/// <param name="pngMetaData">The png meta data</param>
private void DecodePixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetaData pngMetaData)
/// <param name="pngMetadata">The png metadata</param>
private void DecodePixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel>
{
while (this.currentRow < this.header.Height)
@ -532,7 +532,7 @@ namespace SixLabors.ImageSharp.Formats.Png
throw new ImageFormatException("Unknown filter type.");
}
this.ProcessDefilteredScanline(scanlineSpan, image, pngMetaData);
this.ProcessDefilteredScanline(scanlineSpan, image, pngMetadata);
this.SwapBuffers();
this.currentRow++;
@ -546,8 +546,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="compressedStream">The compressed pixel data stream.</param>
/// <param name="image">The current image.</param>
/// <param name="pngMetaData">The png meta data</param>
private void DecodeInterlacedPixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetaData pngMetaData)
/// <param name="pngMetadata">The png metadata.</param>
private void DecodeInterlacedPixelData<TPixel>(Stream compressedStream, ImageFrame<TPixel> image, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel>
{
while (true)
@ -604,7 +604,7 @@ namespace SixLabors.ImageSharp.Formats.Png
}
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();
@ -632,8 +632,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="defilteredScanline">The de-filtered scanline</param>
/// <param name="pixels">The image</param>
/// <param name="pngMetaData">The png meta data</param>
private void ProcessDefilteredScanline<TPixel>(ReadOnlySpan<byte> defilteredScanline, ImageFrame<TPixel> pixels, PngMetaData pngMetaData)
/// <param name="pngMetadata">The png metadata.</param>
private void ProcessDefilteredScanline<TPixel>(ReadOnlySpan<byte> defilteredScanline, ImageFrame<TPixel> pixels, PngMetadata pngMetadata)
where TPixel : struct, IPixel<TPixel>
{
Span<TPixel> rowSpan = pixels.GetPixelRowSpan(this.currentRow);
@ -653,9 +653,9 @@ namespace SixLabors.ImageSharp.Formats.Png
this.header,
scanlineSpan,
rowSpan,
pngMetaData.HasTrans,
pngMetaData.TransparentGray16.GetValueOrDefault(),
pngMetaData.TransparentGray8.GetValueOrDefault());
pngMetadata.HasTrans,
pngMetadata.TransparentGray16.GetValueOrDefault(),
pngMetadata.TransparentGray8.GetValueOrDefault());
break;
@ -687,9 +687,9 @@ namespace SixLabors.ImageSharp.Formats.Png
rowSpan,
this.bytesPerPixel,
this.bytesPerSample,
pngMetaData.HasTrans,
pngMetaData.TransparentRgb48.GetValueOrDefault(),
pngMetaData.TransparentRgb24.GetValueOrDefault());
pngMetadata.HasTrans,
pngMetadata.TransparentRgb48.GetValueOrDefault(),
pngMetadata.TransparentRgb24.GetValueOrDefault());
break;
@ -714,10 +714,10 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="defilteredScanline">The de-filtered scanline</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="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>
{
// Trim the first marker byte from the buffer
@ -737,9 +737,9 @@ namespace SixLabors.ImageSharp.Formats.Png
rowSpan,
pixelOffset,
increment,
pngMetaData.HasTrans,
pngMetaData.TransparentGray16.GetValueOrDefault(),
pngMetaData.TransparentGray8.GetValueOrDefault());
pngMetadata.HasTrans,
pngMetadata.TransparentGray16.GetValueOrDefault(),
pngMetadata.TransparentGray8.GetValueOrDefault());
break;
@ -776,9 +776,9 @@ namespace SixLabors.ImageSharp.Formats.Png
increment,
this.bytesPerPixel,
this.bytesPerSample,
pngMetaData.HasTrans,
pngMetaData.TransparentRgb48.GetValueOrDefault(),
pngMetaData.TransparentRgb24.GetValueOrDefault());
pngMetadata.HasTrans,
pngMetadata.TransparentRgb48.GetValueOrDefault(),
pngMetadata.TransparentRgb24.GetValueOrDefault());
break;
@ -799,11 +799,11 @@ namespace SixLabors.ImageSharp.Formats.Png
}
/// <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>
/// <param name="alpha">The alpha tRNS array</param>
/// <param name="pngMetaData">The png meta data</param>
private void AssignTransparentMarkers(ReadOnlySpan<byte> alpha, PngMetaData pngMetaData)
/// <param name="alpha">The alpha tRNS array.</param>
/// <param name="pngMetadata">The png metadata.</param>
private void AssignTransparentMarkers(ReadOnlySpan<byte> alpha, PngMetadata pngMetadata)
{
if (this.pngColorType == PngColorType.Rgb)
{
@ -815,16 +815,16 @@ namespace SixLabors.ImageSharp.Formats.Png
ushort gc = BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(2, 2));
ushort bc = BinaryPrimitives.ReadUInt16LittleEndian(alpha.Slice(4, 2));
pngMetaData.TransparentRgb48 = new Rgb48(rc, gc, bc);
pngMetaData.HasTrans = true;
pngMetadata.TransparentRgb48 = new Rgb48(rc, gc, bc);
pngMetadata.HasTrans = true;
return;
}
byte r = ReadByteLittleEndian(alpha, 0);
byte g = ReadByteLittleEndian(alpha, 2);
byte b = ReadByteLittleEndian(alpha, 4);
pngMetaData.TransparentRgb24 = new Rgb24(r, g, b);
pngMetaData.HasTrans = true;
pngMetadata.TransparentRgb24 = new Rgb24(r, g, b);
pngMetadata.HasTrans = true;
}
}
else if (this.pngColorType == PngColorType.Grayscale)
@ -833,14 +833,14 @@ namespace SixLabors.ImageSharp.Formats.Png
{
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
{
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>
/// Reads a header chunk from the data.
/// </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>
private void ReadHeaderChunk(PngMetaData pngMetaData, ReadOnlySpan<byte> data)
private void ReadHeaderChunk(PngMetadata pngMetadata, ReadOnlySpan<byte> data)
{
this.header = PngHeader.Parse(data);
this.header.Validate();
pngMetaData.BitDepth = (PngBitDepth)this.header.BitDepth;
pngMetaData.ColorType = this.header.ColorType;
pngMetadata.BitDepth = (PngBitDepth)this.header.BitDepth;
pngMetadata.ColorType = this.header.ColorType;
this.pngColorType = this.header.ColorType;
}
@ -867,7 +867,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary>
/// <param name="metadata">The metadata to decode to.</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)
{

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.Zlib;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors.Quantization;
using SixLabors.Memory;
@ -211,12 +211,12 @@ namespace SixLabors.ImageSharp.Formats.Png
this.height = image.Height;
// Always take the encoder options over the metadata values.
ImageMetaData metaData = image.MetaData;
PngMetaData pngMetaData = metaData.GetFormatMetaData(PngFormat.Instance);
this.gamma = this.gamma ?? pngMetaData.Gamma;
ImageMetadata metadata = image.Metadata;
PngMetadata pngMetadata = metadata.GetFormatMetadata(PngFormat.Instance);
this.gamma = this.gamma ?? pngMetadata.Gamma;
this.writeGamma = this.gamma > 0;
this.pngColorType = this.pngColorType ?? pngMetaData.ColorType;
this.pngBitDepth = this.pngBitDepth ?? pngMetaData.BitDepth;
this.pngColorType = this.pngColorType ?? pngMetadata.ColorType;
this.pngBitDepth = this.pngBitDepth ?? pngMetadata.BitDepth;
this.use16Bit = this.pngBitDepth == PngBitDepth.Bit16;
// Ensure we are not allowing impossible combinations.
@ -290,14 +290,14 @@ namespace SixLabors.ImageSharp.Formats.Png
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.WriteExifChunk(stream, metaData);
this.WriteExifChunk(stream, metadata);
this.WriteDataChunks(image.Frames.RootFrame, quantized, stream);
this.WriteEndChunk(stream);
stream.Flush();
@ -714,8 +714,8 @@ namespace SixLabors.ImageSharp.Formats.Png
/// Writes the physical dimension information to the stream.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
/// <param name="meta">The image meta data.</param>
private void WritePhysicalChunk(Stream stream, ImageMetaData meta)
/// <param name="meta">The image metadata.</param>
private void WritePhysicalChunk(Stream stream, ImageMetadata meta)
{
PhysicalChunkData.FromMetadata(meta).WriteTo(this.chunkDataBuffer);
@ -723,11 +723,11 @@ namespace SixLabors.ImageSharp.Formats.Png
}
/// <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>
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
/// <param name="meta">The image meta data.</param>
private void WriteExifChunk(Stream stream, ImageMetaData meta)
/// <param name="meta">The image metadata.</param>
private void WriteExifChunk(Stream stream, ImageMetadata meta)
{
if (meta.ExifProfile?.Values.Count > 0)
{
@ -757,42 +757,42 @@ namespace SixLabors.ImageSharp.Formats.Png
/// Writes the transparency chunk to the stream
/// </summary>
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
/// <param name="pngMetaData">The image meta data.</param>
private void WriteTransparencyChunk(Stream stream, PngMetaData pngMetaData)
/// <param name="pngMetadata">The image metadata.</param>
private void WriteTransparencyChunk(Stream stream, PngMetadata pngMetadata)
{
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.Slice(2, 2), rgb.G);
BinaryPrimitives.WriteUInt16LittleEndian(alpha.Slice(4, 2), rgb.B);
this.WriteChunk(stream, PngChunkType.Transparency, this.chunkDataBuffer, 0, 6);
}
else if (pngMetaData.TransparentRgb24.HasValue)
else if (pngMetadata.TransparentRgb24.HasValue)
{
alpha.Clear();
Rgb24 rgb = pngMetaData.TransparentRgb24.Value;
Rgb24 rgb = pngMetadata.TransparentRgb24.Value;
alpha[1] = rgb.R;
alpha[3] = rgb.G;
alpha[5] = rgb.B;
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);
}
else if (pngMetaData.TransparentGray8.HasValue)
else if (pngMetadata.TransparentGray8.HasValue)
{
alpha.Clear();
alpha[1] = pngMetaData.TransparentGray8.Value.PackedValue;
alpha[1] = pngMetadata.TransparentGray8.Value.PackedValue;
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>
/// Registers the image encoders, decoders and mime type detectors for the png format.
/// </summary>
public sealed class PngFormat : IImageFormat<PngMetaData>
public sealed class PngFormat : IImageFormat<PngMetadata>
{
private PngFormat()
{
@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp.Formats.Png
public IEnumerable<string> FileExtensions => PngConstants.FileExtensions;
/// <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>
/// Provides Png specific metadata information for the image.
/// </summary>
public class PngMetaData : IDeepCloneable
public class PngMetadata : IDeepCloneable
{
/// <summary>
/// Initializes a new instance of the <see cref="PngMetaData"/> class.
/// Initializes a new instance of the <see cref="PngMetadata"/> class.
/// </summary>
public PngMetaData()
public PngMetadata()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="PngMetaData"/> class.
/// Initializes a new instance of the <see cref="PngMetadata"/> class.
/// </summary>
/// <param name="other">The metadata to create an instance from.</param>
private PngMetaData(PngMetaData other)
private PngMetadata(PngMetadata other)
{
this.BitDepth = other.BitDepth;
this.ColorType = other.ColorType;
@ -75,6 +75,6 @@ namespace SixLabors.ImageSharp.Formats.Png
public bool HasTrans { get; set; }
/// <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.
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp
{
@ -30,6 +30,6 @@ namespace SixLabors.ImageSharp
/// <summary>
/// Gets the metadata of the image.
/// </summary>
ImageMetaData MetaData { get; }
ImageMetadata Metadata { get; }
}
}

6
src/ImageSharp/Image.Decode.cs

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

18
src/ImageSharp/Image.WrapMemory.cs

@ -5,7 +5,7 @@ using System;
using System.Buffers;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp
@ -24,18 +24,18 @@ namespace SixLabors.ImageSharp
/// <param name="pixelMemory">The pixel memory.</param>
/// <param name="width">The width 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>
public static Image<TPixel> WrapMemory<TPixel>(
Configuration config,
Memory<TPixel> pixelMemory,
int width,
int height,
ImageMetaData metaData)
ImageMetadata metadata)
where TPixel : struct, IPixel<TPixel>
{
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>
@ -55,7 +55,7 @@ namespace SixLabors.ImageSharp
int height)
where TPixel : struct, IPixel<TPixel>
{
return WrapMemory(config, pixelMemory, width, height, new ImageMetaData());
return WrapMemory(config, pixelMemory, width, height, new ImageMetadata());
}
/// <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="width">The width 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>
public static Image<TPixel> WrapMemory<TPixel>(
Configuration config,
IMemoryOwner<TPixel> pixelMemoryOwner,
int width,
int height,
ImageMetaData metaData)
ImageMetadata metadata)
where TPixel : struct, IPixel<TPixel>
{
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>
@ -123,7 +123,7 @@ namespace SixLabors.ImageSharp
int height)
where TPixel : struct, IPixel<TPixel>
{
return WrapMemory(config, pixelMemoryOwner, width, height, new ImageMetaData());
return WrapMemory(config, pixelMemoryOwner, width, height, new ImageMetadata());
}
/// <summary>

4
src/ImageSharp/ImageFrameCollection.cs

@ -192,7 +192,7 @@ namespace SixLabors.ImageSharp
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>
@ -205,7 +205,7 @@ namespace SixLabors.ImageSharp
{
ImageFrame<TPixel> frame = this[index];
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>

42
src/ImageSharp/ImageFrame{TPixel}.cs

@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.ParallelUtils;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory;
@ -30,7 +30,7 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width 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)
: this(configuration, width, height, new ImageFrameMetaData())
: this(configuration, width, height, new ImageFrameMetadata())
{
}
@ -39,9 +39,9 @@ namespace SixLabors.ImageSharp
/// </summary>
/// <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="metaData">The meta data.</param>
internal ImageFrame(Configuration configuration, Size size, ImageFrameMetaData metaData)
: this(configuration, size.Width, size.Height, metaData)
/// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, Size size, ImageFrameMetadata 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="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</param>
/// <param name="metaData">The meta data.</param>
internal ImageFrame(Configuration configuration, int width, int height, ImageFrameMetaData metaData)
: this(configuration, width, height, default(TPixel), metaData)
/// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, int width, int height, ImageFrameMetadata 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="backgroundColor">The color to clear the image with.</param>
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="height">The height of the image in pixels.</param>
/// <param name="backgroundColor">The color to clear the image with.</param>
/// <param name="metaData">The meta data.</param>
internal ImageFrame(Configuration configuration, int width, int height, TPixel backgroundColor, ImageFrameMetaData metaData)
/// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, int width, int height, TPixel backgroundColor, ImageFrameMetadata metadata)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.MustBeGreaterThan(width, 0, nameof(width));
@ -86,7 +86,7 @@ namespace SixLabors.ImageSharp
this.Configuration = configuration;
this.MemoryAllocator = configuration.MemoryAllocator;
this.PixelBuffer = this.MemoryAllocator.Allocate2D<TPixel>(width, height);
this.MetaData = metaData ?? new ImageFrameMetaData();
this.Metadata = metadata ?? new ImageFrameMetadata();
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="memorySource">The memory source.</param>
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="height">The height of the image in pixels.</param>
/// <param name="memorySource">The memory source.</param>
/// <param name="metaData">The meta data.</param>
internal ImageFrame(Configuration configuration, int width, int height, MemorySource<TPixel> memorySource, ImageFrameMetaData metaData)
/// <param name="metadata">The metadata.</param>
internal ImageFrame(Configuration configuration, int width, int height, MemorySource<TPixel> memorySource, ImageFrameMetadata metadata)
{
Guard.NotNull(configuration, nameof(configuration));
Guard.MustBeGreaterThan(width, 0, nameof(width));
Guard.MustBeGreaterThan(height, 0, nameof(height));
Guard.NotNull(metaData, nameof(metaData));
Guard.NotNull(metadata, nameof(metadata));
this.Configuration = configuration;
this.MemoryAllocator = configuration.MemoryAllocator;
this.PixelBuffer = new Buffer2D<TPixel>(memorySource, width, height);
this.MetaData = metaData;
this.Metadata = metadata;
}
/// <summary>
@ -137,7 +137,7 @@ namespace SixLabors.ImageSharp
this.MemoryAllocator = configuration.MemoryAllocator;
this.PixelBuffer = this.MemoryAllocator.Allocate2D<TPixel>(source.PixelBuffer.Width, source.PixelBuffer.Height);
source.PixelBuffer.GetSpan().CopyTo(this.PixelBuffer.GetSpan());
this.MetaData = source.MetaData.DeepClone();
this.Metadata = source.Metadata.DeepClone();
}
/// <summary>
@ -169,9 +169,9 @@ namespace SixLabors.ImageSharp
public int Height => this.PixelBuffer.Height;
/// <summary>
/// Gets the meta data of the frame.
/// Gets the metadata of the frame.
/// </summary>
public ImageFrameMetaData MetaData { get; }
public ImageFrameMetadata Metadata { get; }
/// <summary>
/// Gets or sets the pixel at the specified position.
@ -289,7 +289,7 @@ namespace SixLabors.ImageSharp
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(
this.Bounds(),

10
src/ImageSharp/ImageInfo.cs

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
namespace SixLabors.ImageSharp
{
@ -17,13 +17,13 @@ namespace SixLabors.ImageSharp
/// <param name="pixelType">The image pixel type information.</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="metaData">The images metadata.</param>
public ImageInfo(PixelTypeInfo pixelType, int width, int height, ImageMetaData metaData)
/// <param name="metadata">The images metadata.</param>
public ImageInfo(PixelTypeInfo pixelType, int width, int height, ImageMetadata metadata)
{
this.PixelType = pixelType;
this.Width = width;
this.Height = height;
this.MetaData = metaData;
this.Metadata = metadata;
}
/// <inheritdoc />
@ -36,6 +36,6 @@ namespace SixLabors.ImageSharp
public int Height { get; }
/// <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.Formats;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp
@ -31,7 +31,7 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width 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)
: 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="backgroundColor">The color to initialize the pixels with.</param>
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="height">The height of the image in pixels.</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.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));
}
@ -84,11 +84,11 @@ namespace SixLabors.ImageSharp
/// <param name="width">The width of the image in pixels.</param>
/// <param name="height">The height of the image in pixels.</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.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
this.MetaData = metadata;
this.Metadata = metadata;
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="backgroundColor">The color to initialize the pixels with.</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.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);
}
@ -116,11 +116,11 @@ namespace SixLabors.ImageSharp
/// <param name="configuration">The configuration providing initialization code which allows extending the library.</param>
/// <param name="metadata">The images metadata.</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.PixelType = new PixelTypeInfo(Unsafe.SizeOf<TPixel>() * 8);
this.MetaData = metadata ?? new ImageMetaData();
this.Metadata = metadata ?? new ImageMetadata();
this.Frames = new ImageFrameCollection<TPixel>(this, frames);
}
@ -140,7 +140,7 @@ namespace SixLabors.ImageSharp
public int Height => this.Frames.RootFrame.Height;
/// <inheritdoc/>
public ImageMetaData MetaData { get; }
public ImageMetadata Metadata { get; }
/// <summary>
/// Gets the frames.
@ -193,7 +193,7 @@ namespace SixLabors.ImageSharp
public Image<TPixel> Clone(Configuration 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>
@ -214,7 +214,7 @@ namespace SixLabors.ImageSharp
where TPixel2 : struct, IPixel<TPixel2>
{
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/>

2
src/ImageSharp/MetaData/FrameDecodingMode.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData
namespace SixLabors.ImageSharp.Metadata
{
/// <summary>
/// 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 SixLabors.ImageSharp.Formats;
namespace SixLabors.ImageSharp.MetaData
namespace SixLabors.ImageSharp.Metadata
{
/// <summary>
/// Encapsulates the metadata of an image frame.
/// </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>
/// Initializes a new instance of the <see cref="ImageFrameMetaData"/> class.
/// Initializes a new instance of the <see cref="ImageFrameMetadata"/> class.
/// </summary>
internal ImageFrameMetaData()
internal ImageFrameMetadata()
{
}
/// <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.
/// </summary>
/// <param name="other">
/// The other <see cref="ImageFrameMetaData"/> to create this instance from.
/// The other <see cref="ImageFrameMetadata"/> to create this instance from.
/// </param>
internal ImageFrameMetaData(ImageFrameMetaData other)
internal ImageFrameMetadata(ImageFrameMetadata 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/>
public ImageFrameMetaData DeepClone() => new ImageFrameMetaData(this);
public ImageFrameMetadata DeepClone() => new ImageFrameMetadata(this);
/// <summary>
/// Gets the metadata value associated with the specified key.
/// </summary>
/// <typeparam name="TFormatMetaData">The type of format metadata.</typeparam>
/// <typeparam name="TFormatFrameMetaData">The type of format frame metadata.</typeparam>
/// <typeparam name="TFormatMetadata">The type of format metadata.</typeparam>
/// <typeparam name="TFormatFrameMetadata">The type of format frame metadata.</typeparam>
/// <param name="key">The key of the value to get.</param>
/// <returns>
/// The <typeparamref name="TFormatFrameMetaData"/>.
/// The <typeparamref name="TFormatFrameMetadata"/>.
/// </returns>
public TFormatFrameMetaData GetFormatMetaData<TFormatMetaData, TFormatFrameMetaData>(IImageFormat<TFormatMetaData, TFormatFrameMetaData> key)
where TFormatMetaData : class
where TFormatFrameMetaData : class, IDeepCloneable
public TFormatFrameMetadata GetFormatMetadata<TFormatMetadata, TFormatFrameMetadata>(IImageFormat<TFormatMetadata, TFormatFrameMetadata> key)
where TFormatMetadata : class
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();
this.formatMetaData[key] = newMeta;
TFormatFrameMetadata newMeta = key.CreateDefaultFormatFrameMetadata();
this.formatMetadata[key] = newMeta;
return newMeta;
}
}

44
src/ImageSharp/MetaData/ImageMetaData.cs

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

2
src/ImageSharp/MetaData/ImageProperty.cs

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData
namespace SixLabors.ImageSharp.Metadata
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData
namespace SixLabors.ImageSharp.Metadata
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
internal static class ExifConstants
{

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

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

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

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// 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.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// 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);
/// <summary>
/// Synchronizes the profiles with the specified meta data.
/// Synchronizes the profiles with the specified metadata.
/// </summary>
/// <param name="metaData">The meta data.</param>
internal void Sync(ImageMetaData metaData)
/// <param name="metadata">The metadata.</param>
internal void Sync(ImageMetadata metadata)
{
this.SyncResolution(ExifTag.XResolution, metaData.HorizontalResolution);
this.SyncResolution(ExifTag.YResolution, metaData.VerticalResolution);
this.SyncResolution(ExifTag.XResolution, metadata.HorizontalResolution);
this.SyncResolution(ExifTag.YResolution, metadata.VerticalResolution);
}
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 SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// 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.Reflection;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// 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.
// 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
{

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

@ -6,7 +6,7 @@ using System.Globalization;
using System.Text;
using SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// 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 SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
{
/// <summary>
/// Contains methods for writing EXIF metadata.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.Text;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// Provides methods to read ICC data types

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

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

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

@ -3,7 +3,7 @@
using System.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <content>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <content>
/// 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 SixLabors.ImageSharp.Primitives;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.Numerics;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.Text;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// Provides methods to write ICC data types

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

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

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

@ -4,7 +4,7 @@
using System;
using System.IO;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// Color lookup table data type

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// Rendering intent

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

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// Enumerates the screening spot types

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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.Linq;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// Contains methods for writing ICC profiles.

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

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

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

@ -3,7 +3,7 @@
using System;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// 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;
namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
namespace SixLabors.ImageSharp.Metadata.Profiles.Icc
{
/// <summary>
/// A matrix element to process data

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

Loading…
Cancel
Save