Browse Source

more consistent naming

pull/181/head
Johannes Bildstein 9 years ago
parent
commit
5cf24fa844
  1. 16
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs
  2. 12
      src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs

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

@ -16,7 +16,7 @@ namespace ImageSharp
/// Reads an 8bit lookup table /// Reads an 8bit lookup table
/// </summary> /// </summary>
/// <returns>The read LUT</returns> /// <returns>The read LUT</returns>
public IccLut ReadLUT8() public IccLut ReadLut8()
{ {
return new IccLut(this.ReadBytes(256)); return new IccLut(this.ReadBytes(256));
} }
@ -26,7 +26,7 @@ namespace ImageSharp
/// </summary> /// </summary>
/// <param name="count">The number of entries</param> /// <param name="count">The number of entries</param>
/// <returns>The read LUT</returns> /// <returns>The read LUT</returns>
public IccLut ReadLUT16(int count) public IccLut ReadLut16(int count)
{ {
ushort[] values = new ushort[count]; ushort[] values = new ushort[count];
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
@ -56,11 +56,11 @@ namespace ImageSharp
byte size = this.data[this.AddIndex(4)]; // First byte is info, last 3 bytes are reserved byte size = this.data[this.AddIndex(4)]; // First byte is info, last 3 bytes are reserved
if (size == 1) if (size == 1)
{ {
return this.ReadCLUT8(inChannelCount, outChannelCount, gridPointCount); return this.ReadClut8(inChannelCount, outChannelCount, gridPointCount);
} }
else if (size == 2) else if (size == 2)
{ {
return this.ReadCLUT16(inChannelCount, outChannelCount, gridPointCount); return this.ReadClut16(inChannelCount, outChannelCount, gridPointCount);
} }
else else
{ {
@ -69,7 +69,7 @@ namespace ImageSharp
} }
else else
{ {
return this.ReadCLUTf32(inChannelCount, outChannelCount, gridPointCount); return this.ReadClutF32(inChannelCount, outChannelCount, gridPointCount);
} }
} }
@ -80,7 +80,7 @@ namespace ImageSharp
/// <param name="outChannelCount">Output channel count</param> /// <param name="outChannelCount">Output channel count</param>
/// <param name="gridPointCount">Grid point count for each CLUT channel</param> /// <param name="gridPointCount">Grid point count for each CLUT channel</param>
/// <returns>The read CLUT8</returns> /// <returns>The read CLUT8</returns>
public IccClut ReadCLUT8(int inChannelCount, int outChannelCount, byte[] gridPointCount) public IccClut ReadClut8(int inChannelCount, int outChannelCount, byte[] gridPointCount)
{ {
int start = this.index; int start = this.index;
int length = 0; int length = 0;
@ -114,7 +114,7 @@ namespace ImageSharp
/// <param name="outChannelCount">Output channel count</param> /// <param name="outChannelCount">Output channel count</param>
/// <param name="gridPointCount">Grid point count for each CLUT channel</param> /// <param name="gridPointCount">Grid point count for each CLUT channel</param>
/// <returns>The read CLUT16</returns> /// <returns>The read CLUT16</returns>
public IccClut ReadCLUT16(int inChannelCount, int outChannelCount, byte[] gridPointCount) public IccClut ReadClut16(int inChannelCount, int outChannelCount, byte[] gridPointCount)
{ {
int start = this.index; int start = this.index;
int length = 0; int length = 0;
@ -148,7 +148,7 @@ namespace ImageSharp
/// <param name="outChCount">Output channel count</param> /// <param name="outChCount">Output channel count</param>
/// <param name="gridPointCount">Grid point count for each CLUT channel</param> /// <param name="gridPointCount">Grid point count for each CLUT channel</param>
/// <returns>The read CLUTf32</returns> /// <returns>The read CLUTf32</returns>
public IccClut ReadCLUTf32(int inChCount, int outChCount, byte[] gridPointCount) public IccClut ReadClutF32(int inChCount, int outChCount, byte[] gridPointCount)
{ {
int start = this.index; int start = this.index;
int length = 0; int length = 0;

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

@ -263,18 +263,18 @@ namespace ImageSharp
byte[] gridPointCount = new byte[inChCount]; byte[] gridPointCount = new byte[inChCount];
for (int i = 0; i < inChCount; i++) for (int i = 0; i < inChCount; i++)
{ {
inValues[i] = this.ReadLUT16(inTableCount); inValues[i] = this.ReadLut16(inTableCount);
gridPointCount[i] = clutPointCount; gridPointCount[i] = clutPointCount;
} }
// CLUT // CLUT
IccClut clut = this.ReadCLUT16(inChCount, outChCount, gridPointCount); IccClut clut = this.ReadClut16(inChCount, outChCount, gridPointCount);
// Output LUT // Output LUT
IccLut[] outValues = new IccLut[outChCount]; IccLut[] outValues = new IccLut[outChCount];
for (int i = 0; i < outChCount; i++) for (int i = 0; i < outChCount; i++)
{ {
outValues[i] = this.ReadLUT16(outTableCount); outValues[i] = this.ReadLut16(outTableCount);
} }
return new IccLut16TagDataEntry(matrix, inValues, clut, outValues); return new IccLut16TagDataEntry(matrix, inValues, clut, outValues);
@ -298,18 +298,18 @@ namespace ImageSharp
byte[] gridPointCount = new byte[inChCount]; byte[] gridPointCount = new byte[inChCount];
for (int i = 0; i < inChCount; i++) for (int i = 0; i < inChCount; i++)
{ {
inValues[i] = this.ReadLUT8(); inValues[i] = this.ReadLut8();
gridPointCount[i] = clutPointCount; gridPointCount[i] = clutPointCount;
} }
// CLUT // CLUT
IccClut clut = this.ReadCLUT8(inChCount, outChCount, gridPointCount); IccClut clut = this.ReadClut8(inChCount, outChCount, gridPointCount);
// Output LUT // Output LUT
IccLut[] outValues = new IccLut[outChCount]; IccLut[] outValues = new IccLut[outChCount];
for (int i = 0; i < outChCount; i++) for (int i = 0; i < outChCount; i++)
{ {
outValues[i] = this.ReadLUT8(); outValues[i] = this.ReadLut8();
} }
return new IccLut8TagDataEntry(matrix, inValues, clut, outValues); return new IccLut8TagDataEntry(matrix, inValues, clut, outValues);

Loading…
Cancel
Save