Browse Source

Move TIFF internals into own namespace

pull/1570/head
Andrew Wilkinson 9 years ago
parent
commit
8af80459ba
  1. 2
      src/ImageSharp/Formats/Tiff/Compression/NoneTiffCompression.cs
  2. 2
      src/ImageSharp/Formats/Tiff/Compression/TiffCompressionType.cs
  3. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffCompression.cs
  4. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffConstants.cs
  5. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffExtraSamples.cs
  6. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffFillOrder.cs
  7. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffNewSubfileType.cs
  8. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffOrientation.cs
  9. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffPhotometricInterpretation.cs
  10. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffPlanarConfiguration.cs
  11. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffResolutionUnit.cs
  12. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffSubfileType.cs
  13. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffTags.cs
  14. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffThreshholding.cs
  15. 2
      src/ImageSharp/Formats/Tiff/Constants/TiffType.cs
  16. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/TiffColorType.cs
  17. 2
      src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero8TiffColor.cs
  18. 1
      src/ImageSharp/Formats/Tiff/TiffDecoderCore.cs
  19. 2
      src/ImageSharp/Formats/Tiff/TiffIfd/TiffIfd.cs
  20. 2
      src/ImageSharp/Formats/Tiff/TiffIfd/TiffIfdEntry.cs
  21. 2
      src/ImageSharp/Formats/Tiff/Utils/TiffUtils.cs
  22. 2
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/Compression/NoneTiffCompressionTests.cs
  23. 2
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/PhotometricInterpretation/WhiteIsZero8TiffColorTests.cs
  24. 1
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderIfdEntryTests.cs
  25. 33
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderIfdTests.cs
  26. 1
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderImageTests.cs
  27. 3
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffIfd/TiffIfdEntryTests.cs
  28. 2
      tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffIfd/TiffIfdTests.cs
  29. 2
      tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenEntry.cs

2
src/ImageSharp/Formats/Tiff/Compression/NoneTiffCompression.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
using System.IO;
using System.Runtime.CompilerServices;

2
src/ImageSharp/Formats/Tiff/Compression/TiffCompressionType.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Provides enumeration of the various TIFF compression types.

2
src/ImageSharp/Formats/Tiff/Constants/TiffCompression.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the compression formats defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffConstants.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Defines constants defined in the TIFF specification.

2
src/ImageSharp/Formats/Tiff/Constants/TiffExtraSamples.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the possible uses of extra components in TIFF format files.

2
src/ImageSharp/Formats/Tiff/Constants/TiffFillOrder.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the fill orders defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffNewSubfileType.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
using System;

2
src/ImageSharp/Formats/Tiff/Constants/TiffOrientation.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the image orientations defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffPhotometricInterpretation.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the photometric interpretation formats defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffPlanarConfiguration.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing how the components of each pixel are stored the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffResolutionUnit.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the resolution units defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffSubfileType.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the sub-file types defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffTags.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Constants representing tag IDs in the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffThreshholding.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the threshholding applied to image data defined by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/Constants/TiffType.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Enumeration representing the data types understood by the Tiff file-format.

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/TiffColorType.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Provides enumeration of the various TIFF photometric interpretation implementation types.

2
src/ImageSharp/Formats/Tiff/PhotometricInterpretation/WhiteIsZero8TiffColor.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
using System.Runtime.CompilerServices;
using ImageSharp;

1
src/ImageSharp/Formats/Tiff/TiffDecoderCore.cs

@ -9,6 +9,7 @@ namespace ImageSharp.Formats
using System.Buffers;
using System.IO;
using System.Text;
using ImageSharp.Formats.Tiff;
/// <summary>
/// Performs the tiff decoding operation.

2
src/ImageSharp/Formats/Tiff/TiffIfd/TiffIfd.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Data structure for holding details of each TIFF IFD.

2
src/ImageSharp/Formats/Tiff/TiffIfd/TiffIfdEntry.cs

@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
/// <summary>
/// Data structure for holding details of each TIFF IFD entry.

2
src/ImageSharp/Formats/Tiff/Utils/TiffUtils.cs

@ -2,7 +2,7 @@
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Formats
namespace ImageSharp.Formats.Tiff
{
using System.IO;

2
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/Compression/NoneTiffCompressionTests.cs

@ -8,7 +8,7 @@ namespace ImageSharp.Tests
using System.IO;
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class NoneTiffCompressionTests
{

2
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/PhotometricInterpretation/WhiteIsZero8TiffColorTests.cs

@ -8,7 +8,7 @@ namespace ImageSharp.Tests
using System.Collections.Generic;
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class WhiteIsZero8TiffColorTests : PhotometricInterpretationTestBase
{

1
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderIfdEntryTests.cs

@ -11,6 +11,7 @@ namespace ImageSharp.Tests
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class TiffDecoderIfdEntryTests
{

33
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderIfdTests.cs

@ -9,6 +9,7 @@ namespace ImageSharp.Tests
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class TiffDecoderIfdTests
{
@ -20,13 +21,13 @@ namespace ImageSharp.Tests
public void ReadIfd_ReadsNextIfdOffset_IfPresent(bool isLittleEndian)
{
Stream stream = new TiffGenIfd()
{
Entries =
{
Entries =
{
TiffGenEntry.Integer(TiffTags.ImageWidth, TiffType.Long, 150)
},
NextIfd = new TiffGenIfd()
}
NextIfd = new TiffGenIfd()
}
.ToStream(isLittleEndian);
TiffDecoderCore decoder = new TiffDecoderCore(stream, isLittleEndian, null);
@ -40,12 +41,12 @@ namespace ImageSharp.Tests
public void ReadIfd_ReadsNextIfdOffset_ZeroIfLastIfd(bool isLittleEndian)
{
Stream stream = new TiffGenIfd()
{
Entries =
{
Entries =
{
TiffGenEntry.Integer(TiffTags.ImageWidth, TiffType.Long, 150)
}
}
}
.ToStream(isLittleEndian);
TiffDecoderCore decoder = new TiffDecoderCore(stream, isLittleEndian, null);
@ -59,8 +60,8 @@ namespace ImageSharp.Tests
public void ReadIfd_ReturnsCorrectNumberOfEntries(bool isLittleEndian)
{
Stream stream = new TiffGenIfd()
{
Entries =
{
Entries =
{
TiffGenEntry.Integer(TiffTags.ImageWidth, TiffType.Long, 150),
TiffGenEntry.Integer(TiffTags.ImageLength, TiffType.Long, 210),
@ -68,8 +69,8 @@ namespace ImageSharp.Tests
TiffGenEntry.Ascii(TiffTags.Artist, "Image Artist Name"),
TiffGenEntry.Ascii(TiffTags.HostComputer, "Host Computer Name")
},
NextIfd = new TiffGenIfd()
}
NextIfd = new TiffGenIfd()
}
.ToStream(isLittleEndian);
TiffDecoderCore decoder = new TiffDecoderCore(stream, isLittleEndian, null);
@ -84,22 +85,22 @@ namespace ImageSharp.Tests
public void ReadIfd_ReadsRawTiffEntryData(bool isLittleEndian)
{
Stream stream = new TiffGenIfd()
{
Entries =
{
Entries =
{
TiffGenEntry.Integer(TiffTags.ImageWidth, TiffType.Long, 150),
TiffGenEntry.Integer(TiffTags.ImageLength, TiffType.Long, 210),
TiffGenEntry.Integer(TiffTags.Orientation, TiffType.Short, 1)
},
NextIfd = new TiffGenIfd()
}
NextIfd = new TiffGenIfd()
}
.ToStream(isLittleEndian);
TiffDecoderCore decoder = new TiffDecoderCore(stream, isLittleEndian, null);
TiffIfd ifd = decoder.ReadIfd(0);
TiffIfdEntry entry = ifd.Entries[1];
byte[] expectedData = isLittleEndian ? new byte[] {210,0,0,0} : new byte[] {0,0,0,210};
byte[] expectedData = isLittleEndian ? new byte[] { 210, 0, 0, 0 } : new byte[] { 0, 0, 0, 210 };
Assert.NotNull(entry);
Assert.Equal(TiffTags.ImageLength, entry.Tag);
Assert.Equal(TiffType.Long, entry.Type);

1
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffDecoderImageTests.cs

@ -10,6 +10,7 @@ namespace ImageSharp.Tests
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class TiffDecoderImageTests
{

3
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffIfd/TiffIfdEntryTests.cs

@ -5,10 +5,9 @@
namespace ImageSharp.Tests
{
using System.IO;
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class TiffIfdEntryTests
{

2
tests/ImageSharp.Formats.Tiff.Tests/Formats/Tiff/TiffIfd/TiffIfdTests.cs

@ -8,7 +8,7 @@ namespace ImageSharp.Tests
using System.IO;
using Xunit;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
public class TiffIfdTests
{

2
tests/ImageSharp.Formats.Tiff.Tests/TestUtilities/Tiff/TiffGenEntry.cs

@ -9,7 +9,7 @@ namespace ImageSharp.Tests
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ImageSharp.Formats;
using ImageSharp.Formats.Tiff;
/// <summary>
/// A utility data structure to represent Tiff IFD entries in unit tests.

Loading…
Cancel
Save