JpegSegments
Reads the JPEG segments both decoders understand the same way: tables, the frame header and the application segments that say how the samples are to be shown.
Eigenschaften
public static ReadOnlySpan<byte> ProfileSignature { get; }
value = JpegSegments.ProfileSignature
What an APP2 segment that holds a part of an ICC profile starts with; the number of the part and the number of parts follow, a byte each.
Methoden
public static void EnsureEnoughData(int width, int height, int remaining)
JpegSegments.EnsureEnoughData(width, height, remaining)
Refuses a file too short to hold the picture it declares, before buffers are allocated for it.
- width
- Width of the picture.
- height
- Height of the picture.
- remaining
- Bytes of the file that follow the header being read.
public static bool IsJfif(ReadOnlySpan<byte> segment)
result = JpegSegments.IsJfif(segment)
Whether an APP0 segment is the JFIF header.
public static JpegComponent[] ReadFrame(ReadOnlySpan<byte> segment, int width, int height)
result = JpegSegments.ReadFrame(segment, width, height)
Reads a frame header: the size of the picture and its components with their block grids.
public static void ReadHuffmanTables(ReadOnlySpan<byte> segment, JpegHuffmanTable[] dc, JpegHuffmanTable[] ac)
JpegSegments.ReadHuffmanTables(segment, dc, ac)
Reads the Huffman tables of a DHT segment.
public static int ReadOrientation(ReadOnlySpan<byte> data)
result = JpegSegments.ReadOrientation(data)
Reads the Exif orientation of a JPEG.
Rückgabe: A value from 1 to 8; 1 - the picture is stored the way it is shown - if the file says nothing readable.
public static byte[] ReadProfile(ReadOnlySpan<byte> data)
result = JpegSegments.ReadProfile(data)
Reads the ICC profile of a JPEG: the parts its APP2 segments hold, put together.
Rückgabe: The profile if it is one that can go into a re-encoded picture (see Byte})); otherwise - and if the file has none, or its parts do not make a whole - empty.
public static void ReadQuantizationTables(ReadOnlySpan<byte> segment, int[][] tables)
JpegSegments.ReadQuantizationTables(segment, tables)
Reads the quantization tables of a DQT segment, each into natural order.
public static bool TryReadAdobeTransform(ReadOnlySpan<byte> segment, int transform)
result = JpegSegments.TryReadAdobeTransform(segment, transform)
Reads the color transform flag of an APP14 segment.
Rückgabe: if the segment is not Adobe's.