JpegTransforms

Ecng.Drawing

The arithmetic both JPEG decoders share: the inverse DCT and the conversion of decoded components to RGBA.

Propiedades

ZigZag
public static ReadOnlySpan<byte> ZigZag { get; }
value = JpegTransforms.ZigZag

Position in a block of each coefficient, in the zigzag order coefficients are coded in.

Métodos

InverseDct
public static void InverseDct(ReadOnlySpan<int> block, byte[] samples, int stride, int left, int top)
JpegTransforms.InverseDct(block, samples, stride, left, top)

Turns the dequantized coefficients of one block into 8x8 samples.

block
64 coefficients in natural order.
samples
The plane the samples go to.
stride
Length of a row of the plane.
left
Column of the block in the plane.
top
Row of the block in the plane.
ResolveColorModel
public static JpegColorModels ResolveColorModel(JpegComponent[] components, bool hasJfif, int adobeTransform)
result = JpegTransforms.ResolveColorModel(components, hasJfif, adobeTransform)

Decides what the components of a frame stand for, the way libjpeg does.

components
The components of the frame.
hasJfif
Whether the file has a JFIF segment.
adobeTransform
The transform flag of the Adobe segment, or -1 if the file has none.
ToImage
public static RasterImage ToImage(int width, int height, JpegComponent[] components, JpegColorModels model)
result = JpegTransforms.ToImage(width, height, components, model)

Builds the picture out of the decoded sample planes.