Skip to content

Commit 48bac7b

Browse files
iamcarbonJimBobSquarePants
authored andcommitted
Update metadata names (#879)
1 parent 0dfa2f9 commit 48bac7b

File tree

208 files changed

+699
-699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+699
-699
lines changed

src/ImageSharp/Common/Helpers/UnitConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Licensed under the Apache License, Version 2.0.
33

44
using System.Runtime.CompilerServices;
5-
using SixLabors.ImageSharp.MetaData;
6-
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
5+
using SixLabors.ImageSharp.Metadata;
6+
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
77

88
namespace SixLabors.ImageSharp.Common.Helpers
99
{

src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Runtime.CompilerServices;
1010
using SixLabors.ImageSharp.Common.Helpers;
1111
using SixLabors.ImageSharp.Memory;
12-
using SixLabors.ImageSharp.MetaData;
12+
using SixLabors.ImageSharp.Metadata;
1313
using SixLabors.ImageSharp.PixelFormats;
1414
using SixLabors.Memory;
1515

@@ -66,12 +66,12 @@ internal sealed class BmpDecoderCore
6666
/// <summary>
6767
/// The metadata.
6868
/// </summary>
69-
private ImageMetaData metaData;
69+
private ImageMetadata metadata;
7070

7171
/// <summary>
7272
/// The bmp specific metadata.
7373
/// </summary>
74-
private BmpMetaData bmpMetaData;
74+
private BmpMetadata bmpMetadata;
7575

7676
/// <summary>
7777
/// The file header containing general information.
@@ -116,7 +116,7 @@ public Image<TPixel> Decode<TPixel>(Stream stream)
116116
{
117117
int bytesPerColorMapEntry = this.ReadImageHeaders(stream, out bool inverted, out byte[] palette);
118118

119-
var image = new Image<TPixel>(this.configuration, this.infoHeader.Width, this.infoHeader.Height, this.metaData);
119+
var image = new Image<TPixel>(this.configuration, this.infoHeader.Width, this.infoHeader.Height, this.metadata);
120120

121121
Buffer2D<TPixel> pixels = image.GetRootFramePixelBuffer();
122122

@@ -125,7 +125,7 @@ public Image<TPixel> Decode<TPixel>(Stream stream)
125125
case BmpCompression.RGB:
126126
if (this.infoHeader.BitsPerPixel == 32)
127127
{
128-
if (this.bmpMetaData.InfoHeaderType == BmpInfoHeaderType.WinVersion3)
128+
if (this.bmpMetadata.InfoHeaderType == BmpInfoHeaderType.WinVersion3)
129129
{
130130
this.ReadRgb32Slow(pixels, this.infoHeader.Width, this.infoHeader.Height, inverted);
131131
}
@@ -188,7 +188,7 @@ public Image<TPixel> Decode<TPixel>(Stream stream)
188188
public IImageInfo Identify(Stream stream)
189189
{
190190
this.ReadImageHeaders(stream, out _, out _);
191-
return new ImageInfo(new PixelTypeInfo(this.infoHeader.BitsPerPixel), this.infoHeader.Width, this.infoHeader.Height, this.metaData);
191+
return new ImageInfo(new PixelTypeInfo(this.infoHeader.BitsPerPixel), this.infoHeader.Width, this.infoHeader.Height, this.metadata);
192192
}
193193

194194
/// <summary>
@@ -999,7 +999,7 @@ private void ReadInfoHeader()
999999
}
10001000

10011001
// Resolution is stored in PPM.
1002-
var meta = new ImageMetaData
1002+
var meta = new ImageMetadata
10031003
{
10041004
ResolutionUnits = PixelResolutionUnit.PixelsPerMeter
10051005
};
@@ -1011,21 +1011,21 @@ private void ReadInfoHeader()
10111011
else
10121012
{
10131013
// Convert default metadata values to PPM.
1014-
meta.HorizontalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetaData.DefaultHorizontalResolution));
1015-
meta.VerticalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetaData.DefaultVerticalResolution));
1014+
meta.HorizontalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetadata.DefaultHorizontalResolution));
1015+
meta.VerticalResolution = Math.Round(UnitConverter.InchToMeter(ImageMetadata.DefaultVerticalResolution));
10161016
}
10171017

1018-
this.metaData = meta;
1018+
this.metadata = meta;
10191019

10201020
short bitsPerPixel = this.infoHeader.BitsPerPixel;
1021-
this.bmpMetaData = this.metaData.GetFormatMetaData(BmpFormat.Instance);
1022-
this.bmpMetaData.InfoHeaderType = infoHeaderType;
1021+
this.bmpMetadata = this.metadata.GetFormatMetadata(BmpFormat.Instance);
1022+
this.bmpMetadata.InfoHeaderType = infoHeaderType;
10231023

10241024
// We can only encode at these bit rates so far.
10251025
if (bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel24)
10261026
|| bitsPerPixel.Equals((short)BmpBitsPerPixel.Pixel32))
10271027
{
1028-
this.bmpMetaData.BitsPerPixel = (BmpBitsPerPixel)bitsPerPixel;
1028+
this.bmpMetadata.BitsPerPixel = (BmpBitsPerPixel)bitsPerPixel;
10291029
}
10301030

10311031
// skip the remaining header because we can't read those parts

src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using SixLabors.ImageSharp.Advanced;
88
using SixLabors.ImageSharp.Common.Helpers;
99
using SixLabors.ImageSharp.Memory;
10-
using SixLabors.ImageSharp.MetaData;
10+
using SixLabors.ImageSharp.Metadata;
1111
using SixLabors.ImageSharp.PixelFormats;
1212
using SixLabors.Memory;
1313

@@ -73,9 +73,9 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream)
7373
Guard.NotNull(stream, nameof(stream));
7474

7575
this.configuration = image.GetConfiguration();
76-
ImageMetaData metaData = image.MetaData;
77-
BmpMetaData bmpMetaData = metaData.GetFormatMetaData(BmpFormat.Instance);
78-
this.bitsPerPixel = this.bitsPerPixel ?? bmpMetaData.BitsPerPixel;
76+
ImageMetadata metadata = image.Metadata;
77+
BmpMetadata bmpMetadata = metadata.GetFormatMetadata(BmpFormat.Instance);
78+
this.bitsPerPixel = this.bitsPerPixel ?? bmpMetadata.BitsPerPixel;
7979

8080
short bpp = (short)this.bitsPerPixel;
8181
int bytesPerLine = 4 * (((image.Width * bpp) + 31) / 32);
@@ -85,27 +85,27 @@ public void Encode<TPixel>(Image<TPixel> image, Stream stream)
8585
int hResolution = 0;
8686
int vResolution = 0;
8787

88-
if (metaData.ResolutionUnits != PixelResolutionUnit.AspectRatio)
88+
if (metadata.ResolutionUnits != PixelResolutionUnit.AspectRatio)
8989
{
90-
if (metaData.HorizontalResolution > 0 && metaData.VerticalResolution > 0)
90+
if (metadata.HorizontalResolution > 0 && metadata.VerticalResolution > 0)
9191
{
92-
switch (metaData.ResolutionUnits)
92+
switch (metadata.ResolutionUnits)
9393
{
9494
case PixelResolutionUnit.PixelsPerInch:
9595

96-
hResolution = (int)Math.Round(UnitConverter.InchToMeter(metaData.HorizontalResolution));
97-
vResolution = (int)Math.Round(UnitConverter.InchToMeter(metaData.VerticalResolution));
96+
hResolution = (int)Math.Round(UnitConverter.InchToMeter(metadata.HorizontalResolution));
97+
vResolution = (int)Math.Round(UnitConverter.InchToMeter(metadata.VerticalResolution));
9898
break;
9999

100100
case PixelResolutionUnit.PixelsPerCentimeter:
101101

102-
hResolution = (int)Math.Round(UnitConverter.CmToMeter(metaData.HorizontalResolution));
103-
vResolution = (int)Math.Round(UnitConverter.CmToMeter(metaData.VerticalResolution));
102+
hResolution = (int)Math.Round(UnitConverter.CmToMeter(metadata.HorizontalResolution));
103+
vResolution = (int)Math.Round(UnitConverter.CmToMeter(metadata.VerticalResolution));
104104
break;
105105

106106
case PixelResolutionUnit.PixelsPerMeter:
107-
hResolution = (int)Math.Round(metaData.HorizontalResolution);
108-
vResolution = (int)Math.Round(metaData.VerticalResolution);
107+
hResolution = (int)Math.Round(metadata.HorizontalResolution);
108+
vResolution = (int)Math.Round(metadata.VerticalResolution);
109109

110110
break;
111111
}

src/ImageSharp/Formats/Bmp/BmpFormat.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
88
/// <summary>
99
/// Registers the image encoders, decoders and mime type detectors for the bmp format.
1010
/// </summary>
11-
public sealed class BmpFormat : IImageFormat<BmpMetaData>
11+
public sealed class BmpFormat : IImageFormat<BmpMetadata>
1212
{
1313
private BmpFormat()
1414
{
@@ -32,6 +32,6 @@ private BmpFormat()
3232
public IEnumerable<string> FileExtensions => BmpConstants.FileExtensions;
3333

3434
/// <inheritdoc/>
35-
public BmpMetaData CreateDefaultFormatMetaData() => new BmpMetaData();
35+
public BmpMetadata CreateDefaultFormatMetadata() => new BmpMetadata();
3636
}
3737
}

src/ImageSharp/Formats/Bmp/BmpMetaData.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ namespace SixLabors.ImageSharp.Formats.Bmp
66
/// <summary>
77
/// Provides Bmp specific metadata information for the image.
88
/// </summary>
9-
public class BmpMetaData : IDeepCloneable
9+
public class BmpMetadata : IDeepCloneable
1010
{
1111
/// <summary>
12-
/// Initializes a new instance of the <see cref="BmpMetaData"/> class.
12+
/// Initializes a new instance of the <see cref="BmpMetadata"/> class.
1313
/// </summary>
14-
public BmpMetaData()
14+
public BmpMetadata()
1515
{
1616
}
1717

1818
/// <summary>
19-
/// Initializes a new instance of the <see cref="BmpMetaData"/> class.
19+
/// Initializes a new instance of the <see cref="BmpMetadata"/> class.
2020
/// </summary>
2121
/// <param name="other">The metadata to create an instance from.</param>
22-
private BmpMetaData(BmpMetaData other)
22+
private BmpMetadata(BmpMetadata other)
2323
{
2424
this.BitsPerPixel = other.BitsPerPixel;
2525
this.InfoHeaderType = other.InfoHeaderType;
@@ -36,7 +36,7 @@ private BmpMetaData(BmpMetaData other)
3636
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
3737

3838
/// <inheritdoc/>
39-
public IDeepCloneable DeepClone() => new BmpMetaData(this);
39+
public IDeepCloneable DeepClone() => new BmpMetadata(this);
4040

4141
// TODO: Colors used once we support encoding palette bmps.
4242
}

src/ImageSharp/Formats/Gif/GifDecoder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.IO;
55
using System.Text;
6-
using SixLabors.ImageSharp.MetaData;
6+
using SixLabors.ImageSharp.Metadata;
77
using SixLabors.ImageSharp.PixelFormats;
88

99
namespace SixLabors.ImageSharp.Formats.Gif

src/ImageSharp/Formats/Gif/GifDecoderCore.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Text;
99
using SixLabors.ImageSharp.Advanced;
1010
using SixLabors.ImageSharp.Memory;
11-
using SixLabors.ImageSharp.MetaData;
11+
using SixLabors.ImageSharp.Metadata;
1212
using SixLabors.ImageSharp.PixelFormats;
1313
using SixLabors.Memory;
1414
using SixLabors.Primitives;
@@ -63,12 +63,12 @@ internal sealed class GifDecoderCore
6363
/// <summary>
6464
/// The abstract metadata.
6565
/// </summary>
66-
private ImageMetaData metaData;
66+
private ImageMetadata metadata;
6767

6868
/// <summary>
6969
/// The gif specific metadata.
7070
/// </summary>
71-
private GifMetaData gifMetaData;
71+
private GifMetadata gifMetadata;
7272

7373
/// <summary>
7474
/// Initializes a new instance of the <see cref="GifDecoderCore"/> class.
@@ -223,7 +223,7 @@ public IImageInfo Identify(Stream stream)
223223
new PixelTypeInfo(this.logicalScreenDescriptor.BitsPerPixel),
224224
this.logicalScreenDescriptor.Width,
225225
this.logicalScreenDescriptor.Height,
226-
this.metaData);
226+
this.metadata);
227227
}
228228

229229
/// <summary>
@@ -276,7 +276,7 @@ private void ReadApplicationExtension()
276276
if (subBlockSize == GifConstants.NetscapeLoopingSubBlockSize)
277277
{
278278
this.stream.Read(this.buffer, 0, GifConstants.NetscapeLoopingSubBlockSize);
279-
this.gifMetaData.RepeatCount = GifNetscapeLoopingApplicationExtension.Parse(this.buffer.AsSpan(1)).RepeatCount;
279+
this.gifMetadata.RepeatCount = GifNetscapeLoopingApplicationExtension.Parse(this.buffer.AsSpan(1)).RepeatCount;
280280
this.stream.Skip(1); // Skip the terminator.
281281
return;
282282
}
@@ -334,7 +334,7 @@ private void ReadComments()
334334
{
335335
this.stream.Read(commentsBuffer.Array, 0, length);
336336
string comments = this.TextEncoding.GetString(commentsBuffer.Array, 0, length);
337-
this.metaData.Properties.Add(new ImageProperty(GifConstants.Comments, comments));
337+
this.metadata.Properties.Add(new ImageProperty(GifConstants.Comments, comments));
338338
}
339339
}
340340
}
@@ -416,9 +416,9 @@ private void ReadFrameColors<TPixel>(ref Image<TPixel> image, ref ImageFrame<TPi
416416
if (previousFrame is null)
417417
{
418418
// This initializes the image to become fully transparent because the alpha channel is zero.
419-
image = new Image<TPixel>(this.configuration, imageWidth, imageHeight, this.metaData);
419+
image = new Image<TPixel>(this.configuration, imageWidth, imageHeight, this.metadata);
420420

421-
this.SetFrameMetaData(image.Frames.RootFrame.MetaData);
421+
this.SetFrameMetadata(image.Frames.RootFrame.Metadata);
422422

423423
imageFrame = image.Frames.RootFrame;
424424
}
@@ -431,7 +431,7 @@ private void ReadFrameColors<TPixel>(ref Image<TPixel> image, ref ImageFrame<TPi
431431

432432
currentFrame = image.Frames.AddFrame(previousFrame); // This clones the frame and adds it the collection
433433

434-
this.SetFrameMetaData(currentFrame.MetaData);
434+
this.SetFrameMetadata(currentFrame.Metadata);
435435

436436
imageFrame = currentFrame;
437437

@@ -549,11 +549,11 @@ private void RestoreToBackground<TPixel>(ImageFrame<TPixel> frame)
549549
/// <summary>
550550
/// Sets the frames metadata.
551551
/// </summary>
552-
/// <param name="meta">The meta data.</param>
552+
/// <param name="meta">The metadata.</param>
553553
[MethodImpl(MethodImplOptions.AggressiveInlining)]
554-
private void SetFrameMetaData(ImageFrameMetaData meta)
554+
private void SetFrameMetadata(ImageFrameMetadata meta)
555555
{
556-
GifFrameMetaData gifMeta = meta.GetFormatMetaData(GifFormat.Instance);
556+
GifFrameMetadata gifMeta = meta.GetFormatMetadata(GifFormat.Instance);
557557
if (this.graphicsControlExtension.DelayTime > 0)
558558
{
559559
gifMeta.FrameDelay = this.graphicsControlExtension.DelayTime;
@@ -586,7 +586,7 @@ private void ReadLogicalScreenDescriptorAndGlobalColorTable(Stream stream)
586586
this.stream.Skip(6);
587587
this.ReadLogicalScreenDescriptor();
588588

589-
var meta = new ImageMetaData();
589+
var meta = new ImageMetadata();
590590

591591
// The Pixel Aspect Ratio is defined to be the quotient of the pixel's
592592
// width over its height. The value range in this field allows
@@ -614,16 +614,16 @@ private void ReadLogicalScreenDescriptorAndGlobalColorTable(Stream stream)
614614
}
615615
}
616616

617-
this.metaData = meta;
618-
this.gifMetaData = meta.GetFormatMetaData(GifFormat.Instance);
619-
this.gifMetaData.ColorTableMode = this.logicalScreenDescriptor.GlobalColorTableFlag
617+
this.metadata = meta;
618+
this.gifMetadata = meta.GetFormatMetadata(GifFormat.Instance);
619+
this.gifMetadata.ColorTableMode = this.logicalScreenDescriptor.GlobalColorTableFlag
620620
? GifColorTableMode.Global
621621
: GifColorTableMode.Local;
622622

623623
if (this.logicalScreenDescriptor.GlobalColorTableFlag)
624624
{
625625
int globalColorTableLength = this.logicalScreenDescriptor.GlobalColorTableSize * 3;
626-
this.gifMetaData.GlobalColorTableLength = globalColorTableLength;
626+
this.gifMetadata.GlobalColorTableLength = globalColorTableLength;
627627

628628
this.globalColorTable = this.MemoryAllocator.AllocateManagedByteBuffer(globalColorTableLength, AllocationOptions.Clean);
629629

0 commit comments

Comments
 (0)