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> /// </summary>
internal class Component : IDisposable internal class Component : IDisposable
{ {
#pragma warning disable SA1401
/// <summary> /// <summary>
/// Gets or sets the output /// Gets or sets the output
/// </summary> /// </summary>

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

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

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

@ -2,27 +2,36 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System; using System;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Memory;
namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
{ {
using System.Runtime.CompilerServices;
/// <summary> /// <summary>
/// Represents a single frame component /// Represents a single frame component
/// </summary> /// </summary>
internal class FrameComponent : IDisposable 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> /// <summary>
/// Gets the component Id /// Gets the component Id
/// </summary> /// </summary>
public byte Id { get; } public byte Id { get; }
/// <summary> /// <summary>
/// TODO: What does pred stand for? /// Gets or sets Pred TODO: What does pred stand for?
/// </summary> /// </summary>
public int Pred; public int Pred { get; set; }
/// <summary> /// <summary>
/// Gets the horizontal sampling factor. /// Gets the horizontal sampling factor.
@ -40,45 +49,36 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components
public byte QuantizationIdentifier { get; } public byte QuantizationIdentifier { get; }
/// <summary> /// <summary>
/// Gets or sets the block data /// Gets the block data
/// </summary> /// </summary>
public Buffer<short> BlockData; public Buffer<short> BlockData { get; private set; }
/// <summary> /// <summary>
/// Gets or sets the number of blocks per line /// Gets the number of blocks per line
/// </summary> /// </summary>
public int BlocksPerLine; public int BlocksPerLine { get; private set; }
/// <summary> /// <summary>
/// Gets or sets the number of blocks per column /// Gets the number of blocks per column
/// </summary> /// </summary>
public int BlocksPerColumn; public int BlocksPerColumn { get; private set; }
/// <summary> /// <summary>
/// Gets the index for the DC Huffman table /// Gets or sets the index for the DC Huffman table
/// </summary> /// </summary>
public int DCHuffmanTableId; public int DCHuffmanTableId { get; set; }
/// <summary> /// <summary>
/// Gets the index for the AC Huffman table /// Gets or sets the index for the AC Huffman table
/// </summary> /// </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 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/> /// <inheritdoc/>
public void Dispose() public void Dispose()
{ {

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

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

Loading…
Cancel
Save