Browse Source

stylecopping stuff

pull/299/head
Anton Firszov 9 years ago
parent
commit
a8a82ae603
  1. 1
      src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/Component.cs
  2. 3
      src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/Frame.cs
  3. 52
      src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FrameComponent.cs
  4. 28
      src/ImageSharp/Formats/Jpeg/PdfJsPort/JpegDecoderCore.cs

1
src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/Component.cs

@ -12,6 +12,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
/// </summary>
internal class Component : IDisposable
{
#pragma warning disable SA1401
/// <summary>
/// Gets or sets the output
/// </summary>

3
src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/Frame.cs

@ -5,8 +5,6 @@ using System;
namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
{
using SixLabors.ImageSharp.Memory;
/// <summary>
/// Represent a single jpeg frame
/// </summary>
@ -100,6 +98,5 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
component.Init();
}
}
}
}

52
src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FrameComponent.cs

@ -2,27 +2,36 @@
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
{
using System.Runtime.CompilerServices;
/// <summary>
/// Represents a single frame component
/// </summary>
internal class FrameComponent : IDisposable
{
#pragma warning disable SA1401 // Fields should be private
#pragma warning disable SA1401 // Fields should be private
public FrameComponent(Frame frame, byte id, int horizontalFactor, int verticalFactor, byte quantizationIdentifier)
{
this.Frame = frame;
this.Id = id;
this.HorizontalFactor = horizontalFactor;
this.VerticalFactor = verticalFactor;
this.QuantizationIdentifier = quantizationIdentifier;
}
/// <summary>
/// Gets the component Id
/// </summary>
public byte Id { get; }
/// <summary>
/// TODO: What does pred stand for?
/// Gets or sets Pred TODO: What does pred stand for?
/// </summary>
public int Pred;
public int Pred { get; set; }
/// <summary>
/// Gets the horizontal sampling factor.
@ -40,45 +49,36 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
public byte QuantizationIdentifier { get; }
/// <summary>
/// Gets or sets the block data
/// Gets the block data
/// </summary>
public Buffer<short> BlockData;
public Buffer<short> BlockData { get; private set; }
/// <summary>
/// Gets or sets the number of blocks per line
/// Gets the number of blocks per line
/// </summary>
public int BlocksPerLine;
public int BlocksPerLine { get; private set; }
/// <summary>
/// Gets or sets the number of blocks per column
/// Gets the number of blocks per column
/// </summary>
public int BlocksPerColumn;
public int BlocksPerColumn { get; private set; }
/// <summary>
/// Gets the index for the DC Huffman table
/// Gets or sets the index for the DC Huffman table
/// </summary>
public int DCHuffmanTableId;
public int DCHuffmanTableId { get; set; }
/// <summary>
/// Gets the index for the AC Huffman table
/// Gets or sets the index for the AC Huffman table
/// </summary>
public int ACHuffmanTableId;
public int ACHuffmanTableId { get; set; }
internal int BlocksPerLineForMcu;
internal int BlocksPerLineForMcu { get; private set; }
internal int BlocksPerColumnForMcu;
internal int BlocksPerColumnForMcu { get; private set; }
public Frame Frame { get; }
public FrameComponent(Frame frame, byte id, int horizontalFactor, int verticalFactor, byte quantizationIdentifier)
{
this.Frame = frame;
this.Id = id;
this.HorizontalFactor = horizontalFactor;
this.VerticalFactor = verticalFactor;
this.QuantizationIdentifier = quantizationIdentifier;
}
/// <inheritdoc/>
public void Dispose()
{

28
src/ImageSharp/Formats/Jpeg/PdfJsPort/JpegDecoderCore.cs

@ -38,20 +38,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
private HuffmanTables acHuffmanTables;
internal Frame Frame;
private ComponentBlocks components;
private JpegPixelArea pixelArea;
private ushort resetInterval;
internal int ImageWidth { get; private set; }
internal int ImageHeight { get; private set; }
internal int NumberOfComponents { get; private set; }
/// <summary>
/// Whether the image has a EXIF header
/// </summary>
@ -86,6 +78,26 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
this.IgnoreMetadata = options.IgnoreMetadata;
}
/// <summary>
/// Gets the frame
/// </summary>
public Frame Frame { get; private set; }
/// <summary>
/// Gets the image width
/// </summary>
public int ImageWidth { get; private set; }
/// <summary>
/// Gets the image height
/// </summary>
public int ImageHeight { get; private set; }
/// <summary>
/// Gets the number of components
/// </summary>
public int NumberOfComponents { get; private set; }
/// <summary>
/// Gets the input stream.
/// </summary>

Loading…
Cancel
Save