@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// Performs the jpeg decoding operation.
/// Ported from <see href="https://github.com/mozilla/pdf.js/blob/master/src/core/jpg.js"/> with additional fixes to handle common encoding errors
/// </summary>
internal sealed class JpegDecoderCore : IDisposable
internal sealed class PdfJs JpegDecoderCore : IDisposable
{
#pragma warning disable SA1401 // Fields should be private
/// <summary>
@ -32,15 +32,15 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
private readonly byte [ ] markerBuffer = new byte [ 2 ] ;
private QuantizationTables quantizationTables ;
private PdfJs QuantizationTables quantizationTables ;
private HuffmanTables dcHuffmanTables ;
private PdfJs HuffmanTables dcHuffmanTables ;
private HuffmanTables acHuffmanTables ;
private PdfJs HuffmanTables acHuffmanTables ;
private ComponentBlocks components ;
private PdfJs ComponentBlocks components ;
private JpegPixelArea pixelArea ;
private PdfJs JpegPixelArea pixelArea ;
private ushort resetInterval ;
@ -52,27 +52,27 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// <summary>
/// Contains information about the JFIF marker
/// </summary>
private JFif jFif ;
private PdfJs JFif jFif ;
/// <summary>
/// Contains information about the Adobe marker
/// </summary>
private Adobe adobe ;
private PdfJs Adobe adobe ;
/// <summary>
/// Initializes static members of the <see cref="JpegDecoderCore"/> class.
/// Initializes static members of the <see cref="PdfJs JpegDecoderCore"/> class.
/// </summary>
static JpegDecoderCore ( )
static PdfJs JpegDecoderCore( )
{
YCbCrToRgbTables . Create ( ) ;
PdfJs YCbCrToRgbTables. Create ( ) ;
}
/// <summary>
/// Initializes a new instance of the <see cref="JpegDecoderCore" /> class.
/// Initializes a new instance of the <see cref="PdfJs JpegDecoderCore" /> class.
/// </summary>
/// <param name="configuration">The configuration.</param>
/// <param name="options">The options.</param>
public JpegDecoderCore ( Configuration configuration , IJpegDecoderOptions options )
public PdfJs JpegDecoderCore( Configuration configuration , IJpegDecoderOptions options )
{
this . configuration = configuration ? ? Configuration . Default ;
this . IgnoreMetadata = options . IgnoreMetadata ;
@ -81,7 +81,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// <summary>
/// Gets the frame
/// </summary>
public Frame Frame { get ; private set ; }
public PdfJs Frame Frame { get ; private set ; }
/// <summary>
/// Gets the image width
@ -113,35 +113,35 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// </summary>
/// <param name="marker">The buffer to read file markers to</param>
/// <param name="stream">The input stream</param>
/// <returns>The <see cref="FileMarker"/></returns>
public static FileMarker FindNextFileMarker ( byte [ ] marker , Stream stream )
/// <returns>The <see cref="PdfJs FileMarker"/></returns>
public static PdfJs FileMarker FindNextFileMarker ( byte [ ] marker , Stream stream )
{
int value = stream . Read ( marker , 0 , 2 ) ;
if ( value = = 0 )
{
return new FileMarker ( JpegConstants . Markers . EOI , ( int ) stream . Length - 2 ) ;
return new PdfJs FileMarker( PdfJs JpegConstants. Markers . EOI , ( int ) stream . Length - 2 ) ;
}
if ( marker [ 0 ] = = JpegConstants . Markers . Prefix )
if ( marker [ 0 ] = = PdfJs JpegConstants. Markers . Prefix )
{
// According to Section B.1.1.2:
// "Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code 0xFF."
while ( marker [ 1 ] = = JpegConstants . Markers . Prefix )
while ( marker [ 1 ] = = PdfJs JpegConstants. Markers . Prefix )
{
int suffix = stream . ReadByte ( ) ;
if ( suffix = = - 1 )
{
return new FileMarker ( JpegConstants . Markers . EOI , ( int ) stream . Length - 2 ) ;
return new PdfJs FileMarker( PdfJs JpegConstants. Markers . EOI , ( int ) stream . Length - 2 ) ;
}
marker [ 1 ] = ( byte ) value ;
}
return new FileMarker ( ( ushort ) ( ( marker [ 0 ] < < 8 ) | marker [ 1 ] ) , ( int ) ( stream . Position - 2 ) ) ;
return new PdfJs FileMarker( ( ushort ) ( ( marker [ 0 ] < < 8 ) | marker [ 1 ] ) , ( int ) ( stream . Position - 2 ) ) ;
}
return new FileMarker ( ( ushort ) ( ( marker [ 0 ] < < 8 ) | marker [ 1 ] ) , ( int ) ( stream . Position - 2 ) , true ) ;
return new PdfJs FileMarker( ( ushort ) ( ( marker [ 0 ] < < 8 ) | marker [ 1 ] ) , ( int ) ( stream . Position - 2 ) , true ) ;
}
/// <summary>
@ -191,7 +191,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static int GetBlockBufferOffset ( ref Component component , int row , int col )
private static int GetBlockBufferOffset ( ref PdfJs Component component , int row , int col )
{
return 6 4 * ( ( ( component . BlocksPerLine + 1 ) * row ) + col ) ;
}
@ -205,79 +205,79 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
{
// TODO: metadata only logic
// Check for the Start Of Image marker.
var fileMarker = new FileMarker ( this . ReadUint16 ( ) , 0 ) ;
if ( fileMarker . Marker ! = JpegConstants . Markers . SOI )
var fileMarker = new PdfJs FileMarker( this . ReadUint16 ( ) , 0 ) ;
if ( fileMarker . Marker ! = PdfJs JpegConstants. Markers . SOI )
{
throw new ImageFormatException ( "Missing SOI marker." ) ;
}
ushort marker = this . ReadUint16 ( ) ;
fileMarker = new FileMarker ( marker , ( int ) this . InputStream . Position - 2 ) ;
fileMarker = new PdfJs FileMarker( marker , ( int ) this . InputStream . Position - 2 ) ;
this . quantizationTables = new QuantizationTables ( ) ;
this . dcHuffmanTables = new HuffmanTables ( ) ;
this . acHuffmanTables = new HuffmanTables ( ) ;
this . quantizationTables = new PdfJs QuantizationTables( ) ;
this . dcHuffmanTables = new PdfJs HuffmanTables( ) ;
this . acHuffmanTables = new PdfJs HuffmanTables( ) ;
while ( fileMarker . Marker ! = JpegConstants . Markers . EOI )
while ( fileMarker . Marker ! = PdfJs JpegConstants. Markers . EOI )
{
// Get the marker length
int remaining = this . ReadUint16 ( ) - 2 ;
switch ( fileMarker . Marker )
{
case JpegConstants . Markers . APP0 :
case PdfJs JpegConstants. Markers . APP0 :
this . ProcessApplicationHeaderMarker ( remaining ) ;
break ;
case JpegConstants . Markers . APP1 :
case PdfJs JpegConstants. Markers . APP1 :
this . ProcessApp1Marker ( remaining , metaData ) ;
break ;
case JpegConstants . Markers . APP2 :
case PdfJs JpegConstants. Markers . APP2 :
this . ProcessApp2Marker ( remaining , metaData ) ;
break ;
case JpegConstants . Markers . APP3 :
case JpegConstants . Markers . APP4 :
case JpegConstants . Markers . APP5 :
case JpegConstants . Markers . APP6 :
case JpegConstants . Markers . APP7 :
case JpegConstants . Markers . APP8 :
case JpegConstants . Markers . APP9 :
case JpegConstants . Markers . APP10 :
case JpegConstants . Markers . APP11 :
case JpegConstants . Markers . APP12 :
case JpegConstants . Markers . APP13 :
case PdfJs JpegConstants. Markers . APP3 :
case PdfJs JpegConstants. Markers . APP4 :
case PdfJs JpegConstants. Markers . APP5 :
case PdfJs JpegConstants. Markers . APP6 :
case PdfJs JpegConstants. Markers . APP7 :
case PdfJs JpegConstants. Markers . APP8 :
case PdfJs JpegConstants. Markers . APP9 :
case PdfJs JpegConstants. Markers . APP10 :
case PdfJs JpegConstants. Markers . APP11 :
case PdfJs JpegConstants. Markers . APP12 :
case PdfJs JpegConstants. Markers . APP13 :
this . InputStream . Skip ( remaining ) ;
break ;
case JpegConstants . Markers . APP14 :
case PdfJs JpegConstants. Markers . APP14 :
this . ProcessApp14Marker ( remaining ) ;
break ;
case JpegConstants . Markers . APP15 :
case JpegConstants . Markers . COM :
case PdfJs JpegConstants. Markers . APP15 :
case PdfJs JpegConstants. Markers . COM :
this . InputStream . Skip ( remaining ) ;
break ;
case JpegConstants . Markers . DQT :
case PdfJs JpegConstants. Markers . DQT :
this . ProcessDefineQuantizationTablesMarker ( remaining ) ;
break ;
case JpegConstants . Markers . SOF0 :
case JpegConstants . Markers . SOF1 :
case JpegConstants . Markers . SOF2 :
case PdfJs JpegConstants. Markers . SOF0 :
case PdfJs JpegConstants. Markers . SOF1 :
case PdfJs JpegConstants. Markers . SOF2 :
this . ProcessStartOfFrameMarker ( remaining , fileMarker ) ;
break ;
case JpegConstants . Markers . DHT :
case PdfJs JpegConstants. Markers . DHT :
this . ProcessDefineHuffmanTablesMarker ( remaining ) ;
break ;
case JpegConstants . Markers . DRI :
case PdfJs JpegConstants. Markers . DRI :
this . ProcessDefineRestartIntervalMarker ( remaining ) ;
break ;
case JpegConstants . Markers . SOS :
case PdfJs JpegConstants. Markers . SOS :
this . ProcessStartOfScanMarker ( ) ;
break ;
}
@ -288,12 +288,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
this . ImageWidth = this . Frame . SamplesPerLine ;
this . ImageHeight = this . Frame . Scanlines ;
this . components = new ComponentBlocks { Components = new Component [ this . Frame . ComponentCount ] } ;
this . components = new PdfJs ComponentBlocks { Components = new PdfJs Component[ this . Frame . ComponentCount ] } ;
for ( int i = 0 ; i < this . components . Components . Length ; i + + )
{
FrameComponent frameComponent = this . Frame . Components [ i ] ;
var component = new Component
PdfJs FrameComponent frameComponent = this . Frame . Components [ i ] ;
var component = new PdfJs Component
{
Scale = new System . Numerics . Vector2 (
frameComponent . HorizontalFactor / ( float ) this . Frame . MaxHorizontalFactor ,
@ -313,8 +313,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
{
for ( int i = 0 ; i < this . components . Components . Length ; i + + )
{
FrameComponent frameComponent = this . Frame . Components [ i ] ;
Component component = this . components . Components [ i ] ;
PdfJs FrameComponent frameComponent = this . Frame . Components [ i ] ;
PdfJs Component component = this . components . Components [ i ] ;
this . QuantizeAndInverseComponentData ( component , frameComponent ) ;
}
@ -333,7 +333,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
throw new ImageFormatException ( $"Unsupported color mode. Max components 4; found {this.NumberOfComponents}" ) ;
}
this . pixelArea = new JpegPixelArea ( image . Width , image . Height , this . NumberOfComponents ) ;
this . pixelArea = new PdfJs JpegPixelArea( image . Width , image . Height , this . NumberOfComponents ) ;
this . pixelArea . LinearizeBlockData ( this . components , image . Width , image . Height ) ;
if ( this . NumberOfComponents = = 1 )
@ -344,11 +344,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
if ( this . NumberOfComponents = = 3 )
{
if ( this . adobe . Equals ( default ( Adobe ) ) | | this . adobe . ColorTransform = = JpegConstants . Markers . Adobe . ColorTransformYCbCr )
if ( this . adobe . Equals ( default ( PdfJs Adobe) ) | | this . adobe . ColorTransform = = PdfJs JpegConstants. Markers . Adobe . ColorTransformYCbCr )
{
this . FillYCbCrImage ( image ) ;
}
else if ( this . adobe . ColorTransform = = JpegConstants . Markers . Adobe . ColorTransformUnknown )
else if ( this . adobe . ColorTransform = = PdfJs JpegConstants. Markers . Adobe . ColorTransformUnknown )
{
this . FillRgbImage ( image ) ;
}
@ -356,7 +356,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
if ( this . NumberOfComponents = = 4 )
{
if ( this . adobe . ColorTransform = = JpegConstants . Markers . Adobe . ColorTransformYcck )
if ( this . adobe . ColorTransform = = PdfJs JpegConstants. Markers . Adobe . ColorTransformYcck )
{
this . FillYcckImage ( image ) ;
}
@ -411,15 +411,15 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
this . InputStream . Read ( this . temp , 0 , 1 3 ) ;
remaining - = 1 3 ;
bool isJfif = this . temp [ 0 ] = = JpegConstants . Markers . JFif . J & &
this . temp [ 1 ] = = JpegConstants . Markers . JFif . F & &
this . temp [ 2 ] = = JpegConstants . Markers . JFif . I & &
this . temp [ 3 ] = = JpegConstants . Markers . JFif . F & &
this . temp [ 4 ] = = JpegConstants . Markers . JFif . Null ;
bool isJfif = this . temp [ 0 ] = = PdfJs JpegConstants. Markers . JFif . J & &
this . temp [ 1 ] = = PdfJs JpegConstants. Markers . JFif . F & &
this . temp [ 2 ] = = PdfJs JpegConstants. Markers . JFif . I & &
this . temp [ 3 ] = = PdfJs JpegConstants. Markers . JFif . F & &
this . temp [ 4 ] = = PdfJs JpegConstants. Markers . JFif . Null ;
if ( isJfif )
{
this . jFif = new JFif
this . jFif = new PdfJs JFif
{
MajorVersion = this . temp [ 5 ] ,
MinorVersion = this . temp [ 6 ] ,
@ -453,12 +453,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
byte [ ] profile = new byte [ remaining ] ;
this . InputStream . Read ( profile , 0 , remaining ) ;
if ( profile [ 0 ] = = JpegConstants . Markers . Exif . E & &
profile [ 1 ] = = JpegConstants . Markers . Exif . X & &
profile [ 2 ] = = JpegConstants . Markers . Exif . I & &
profile [ 3 ] = = JpegConstants . Markers . Exif . F & &
profile [ 4 ] = = JpegConstants . Markers . Exif . Null & &
profile [ 5 ] = = JpegConstants . Markers . Exif . Null )
if ( profile [ 0 ] = = PdfJs JpegConstants. Markers . Exif . E & &
profile [ 1 ] = = PdfJs JpegConstants. Markers . Exif . X & &
profile [ 2 ] = = PdfJs JpegConstants. Markers . Exif . I & &
profile [ 3 ] = = PdfJs JpegConstants. Markers . Exif . F & &
profile [ 4 ] = = PdfJs JpegConstants. Markers . Exif . Null & &
profile [ 5 ] = = PdfJs JpegConstants. Markers . Exif . Null )
{
this . isExif = true ;
metadata . ExifProfile = new ExifProfile ( profile ) ;
@ -484,18 +484,18 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
this . InputStream . Read ( identifier , 0 , Icclength ) ;
remaining - = Icclength ; // We have read it by this point
if ( identifier [ 0 ] = = JpegConstants . Markers . ICC . I & &
identifier [ 1 ] = = JpegConstants . Markers . ICC . C & &
identifier [ 2 ] = = JpegConstants . Markers . ICC . C & &
identifier [ 3 ] = = JpegConstants . Markers . ICC . UnderScore & &
identifier [ 4 ] = = JpegConstants . Markers . ICC . P & &
identifier [ 5 ] = = JpegConstants . Markers . ICC . R & &
identifier [ 6 ] = = JpegConstants . Markers . ICC . O & &
identifier [ 7 ] = = JpegConstants . Markers . ICC . F & &
identifier [ 8 ] = = JpegConstants . Markers . ICC . I & &
identifier [ 9 ] = = JpegConstants . Markers . ICC . L & &
identifier [ 1 0 ] = = JpegConstants . Markers . ICC . E & &
identifier [ 1 1 ] = = JpegConstants . Markers . ICC . Null )
if ( identifier [ 0 ] = = PdfJs JpegConstants. Markers . ICC . I & &
identifier [ 1 ] = = PdfJs JpegConstants. Markers . ICC . C & &
identifier [ 2 ] = = PdfJs JpegConstants. Markers . ICC . C & &
identifier [ 3 ] = = PdfJs JpegConstants. Markers . ICC . UnderScore & &
identifier [ 4 ] = = PdfJs JpegConstants. Markers . ICC . P & &
identifier [ 5 ] = = PdfJs JpegConstants. Markers . ICC . R & &
identifier [ 6 ] = = PdfJs JpegConstants. Markers . ICC . O & &
identifier [ 7 ] = = PdfJs JpegConstants. Markers . ICC . F & &
identifier [ 8 ] = = PdfJs JpegConstants. Markers . ICC . I & &
identifier [ 9 ] = = PdfJs JpegConstants. Markers . ICC . L & &
identifier [ 1 0 ] = = PdfJs JpegConstants. Markers . ICC . E & &
identifier [ 1 1 ] = = PdfJs JpegConstants. Markers . ICC . Null )
{
byte [ ] profile = new byte [ remaining ] ;
this . InputStream . Read ( profile , 0 , remaining ) ;
@ -533,15 +533,15 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
this . InputStream . Read ( this . temp , 0 , 1 2 ) ;
remaining - = 1 2 ;
bool isAdobe = this . temp [ 0 ] = = JpegConstants . Markers . Adobe . A & &
this . temp [ 1 ] = = JpegConstants . Markers . Adobe . D & &
this . temp [ 2 ] = = JpegConstants . Markers . Adobe . O & &
this . temp [ 3 ] = = JpegConstants . Markers . Adobe . B & &
this . temp [ 4 ] = = JpegConstants . Markers . Adobe . E ;
bool isAdobe = this . temp [ 0 ] = = PdfJs JpegConstants. Markers . Adobe . A & &
this . temp [ 1 ] = = PdfJs JpegConstants. Markers . Adobe . D & &
this . temp [ 2 ] = = PdfJs JpegConstants. Markers . Adobe . O & &
this . temp [ 3 ] = = PdfJs JpegConstants. Markers . Adobe . B & &
this . temp [ 4 ] = = PdfJs JpegConstants. Markers . Adobe . E ;
if ( isAdobe )
{
this . adobe = new Adobe
this . adobe = new PdfJs Adobe
{
DCTEncodeVersion = ( short ) ( ( this . temp [ 5 ] < < 8 ) | this . temp [ 6 ] ) ,
APP14Flags0 = ( short ) ( ( this . temp [ 7 ] < < 8 ) | this . temp [ 8 ] ) ,
@ -588,7 +588,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
Span < short > tableSpan = this . quantizationTables . Tables . GetRowSpan ( quantizationTableSpec & 1 5 ) ;
for ( int j = 0 ; j < 6 4 ; j + + )
{
tableSpan [ QuantizationTables . DctZigZag [ j ] ] = this . temp [ j ] ;
tableSpan [ PdfJs QuantizationTables. DctZigZag [ j ] ] = this . temp [ j ] ;
}
}
@ -608,7 +608,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
Span < short > tableSpan = this . quantizationTables . Tables . GetRowSpan ( quantizationTableSpec & 1 5 ) ;
for ( int j = 0 ; j < 6 4 ; j + + )
{
tableSpan [ QuantizationTables . DctZigZag [ j ] ] = ( short ) ( ( this . temp [ 2 * j ] < < 8 ) | this . temp [ ( 2 * j ) + 1 ] ) ;
tableSpan [ PdfJs QuantizationTables. DctZigZag [ j ] ] = ( short ) ( ( this . temp [ 2 * j ] < < 8 ) | this . temp [ ( 2 * j ) + 1 ] ) ;
}
}
@ -634,7 +634,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// </summary>
/// <param name="remaining">The remaining bytes in the segment block.</param>
/// <param name="frameMarker">The current frame marker.</param>
private void ProcessStartOfFrameMarker ( int remaining , FileMarker frameMarker )
private void ProcessStartOfFrameMarker ( int remaining , PdfJs FileMarker frameMarker )
{
if ( this . Frame ! = null )
{
@ -643,10 +643,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
this . InputStream . Read ( this . temp , 0 , remaining ) ;
this . Frame = new Frame
this . Frame = new PdfJs Frame
{
Extended = frameMarker . Marker = = JpegConstants . Markers . SOF1 ,
Progressive = frameMarker . Marker = = JpegConstants . Markers . SOF2 ,
Extended = frameMarker . Marker = = PdfJs JpegConstants. Markers . SOF1 ,
Progressive = frameMarker . Marker = = PdfJs JpegConstants. Markers . SOF2 ,
Precision = this . temp [ 0 ] ,
Scanlines = ( short ) ( ( this . temp [ 1 ] < < 8 ) | this . temp [ 2 ] ) ,
SamplesPerLine = ( short ) ( ( this . temp [ 3 ] < < 8 ) | this . temp [ 4 ] ) ,
@ -659,7 +659,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
// No need to pool this. They max out at 4
this . Frame . ComponentIds = new byte [ this . Frame . ComponentCount ] ;
this . Frame . Components = new FrameComponent [ this . Frame . ComponentCount ] ;
this . Frame . Components = new PdfJs FrameComponent[ this . Frame . ComponentCount ] ;
for ( int i = 0 ; i < this . Frame . Components . Length ; i + + )
{
@ -676,7 +676,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
maxV = v ;
}
var component = new FrameComponent ( this . Frame , this . temp [ index ] , h , v , this . temp [ index + 2 ] ) ;
var component = new PdfJs FrameComponent( this . Frame , this . temp [ index ] , h , v , this . temp [ index + 2 ] ) ;
this . Frame . Components [ i ] = component ;
this . Frame . ComponentIds [ i ] = component . Id ;
@ -775,7 +775,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
throw new ImageFormatException ( "Unknown component selector" ) ;
}
ref FrameComponent component = ref this . Frame . Components [ componentIndex ] ;
ref PdfJs FrameComponent component = ref this . Frame . Components [ componentIndex ] ;
int tableSpec = this . InputStream . ReadByte ( ) ;
component . DCHuffmanTableId = tableSpec > > 4 ;
component . ACHuffmanTableId = tableSpec & 1 5 ;
@ -786,7 +786,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
int spectralStart = this . temp [ 0 ] ;
int spectralEnd = this . temp [ 1 ] ;
int successiveApproximation = this . temp [ 2 ] ;
var scanDecoder = default ( ScanDecoder ) ;
var scanDecoder = default ( PdfJs ScanDecoder) ;
scanDecoder . DecodeScan (
this . Frame ,
@ -808,7 +808,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// </summary>
/// <param name="component">The component</param>
/// <param name="frameComponent">The frame component</param>
private void QuantizeAndInverseComponentData ( Component component , FrameComponent frameComponent )
private void QuantizeAndInverseComponentData ( PdfJs Component component , PdfJs FrameComponent frameComponent )
{
int blocksPerLine = component . BlocksPerLine ;
int blocksPerColumn = component . BlocksPerColumn ;
@ -834,7 +834,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
for ( int blockCol = 0 ; blockCol < blocksPerLine ; blockCol + + )
{
int offset = GetBlockBufferOffset ( ref component , blockRow , blockCol ) ;
IDCT . QuantizeAndInverse ( frameComponent , offset , ref computationBufferSpan , ref quantizationTable ) ;
PdfJs IDCT. QuantizeAndInverse ( frameComponent , offset , ref computationBufferSpan , ref quantizationTable ) ;
}
}
}
@ -849,9 +849,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
/// <param name="index">The table index</param>
/// <param name="codeLengths">The codelengths</param>
/// <param name="values">The values</param>
private void BuildHuffmanTable ( HuffmanTables tables , int index , byte [ ] codeLengths , byte [ ] values )
private void BuildHuffmanTable ( PdfJs HuffmanTables tables , int index , byte [ ] codeLengths , byte [ ] values )
{
tables [ index ] = new HuffmanTable ( codeLengths , values ) ;
tables [ index ] = new PdfJs HuffmanTable( codeLengths , values ) ;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -887,7 +887,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
ref byte cb = ref areaRowSpan [ o + 1 ] ;
ref byte cr = ref areaRowSpan [ o + 2 ] ;
ref TPixel pixel = ref imageRowSpan [ x ] ;
YCbCrToRgbTables . PackYCbCr ( ref pixel , yy , cb , cr ) ;
PdfJs YCbCrToRgbTables. PackYCbCr ( ref pixel , yy , cb , cr ) ;
}
}
}
@ -908,7 +908,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort
ref byte k = ref areaRowSpan [ o + 3 ] ;
ref TPixel pixel = ref imageRowSpan [ x ] ;
YCbCrToRgbTables . PackYccK ( ref pixel , yy , cb , cr , k ) ;
PdfJs YCbCrToRgbTables. PackYccK ( ref pixel , yy , cb , cr , k ) ;
}
}
}