Class JpegFrameDecode
[Guid("8939F66E-C46A-4c21-A9D1-98B327CE1679")]
public class JpegFrameDecode : ComObject
- Inheritance
-
JpegFrameDecode
Constructors
JpegFrameDecode(nint)
public JpegFrameDecode(nint nativePtr)
Parameters
nativePtr
nint
Properties
FrameHeader
Retrieves header data from the entire frame. The result includes parameters from the Start Of Frame (SOF) marker for the scan as well as parameters derived from other metadata such as the color model of the compressed data.
public JpegFrameHeader FrameHeader { get; }
Property Value
Methods
ClearIndexing()
Removes the indexing from a JPEG that has been indexed using IWICJpegFrameDecode::SetIndexing.
public void ClearIndexing()
CopyMinimalStream(int, int, byte[], out int)
No documentation.
public void CopyMinimalStream(int streamOffset, int streamData, byte[] streamDataRef, out int streamDataActualRef)
Parameters
streamOffset
intNo documentation.
streamData
intNo documentation.
streamDataRef
byte[]No documentation.
streamDataActualRef
intNo documentation.
CopyScan(int, int, int, byte[], out int)
Retrieves a copy of the compressed JPEG scan directly from the WIC decoder frame's output stream.
public void CopyScan(int scanIndex, int scanOffset, int scanData, byte[] scanDataRef, out int scanDataActualRef)
Parameters
scanIndex
intThe zero-based index of the scan for which data is retrieved.
scanOffset
intThe byte position in the scan data to begin copying. Use 0 on the first call. If the output buffer size is insufficient to store the entire scan, this offset allows you to resume copying from the end of the previous copy operation.
scanData
intThe size, in bytes, of the pbScanData array.
scanDataRef
byte[]A reference that receives the table data. This parameter must not be
null
.scanDataActualRef
intA reference that receives the size of the scan data actually copied into pbScanData. The size returned may be smaller that the size of cbScanData. This parameter may be
null
.
DoesSupportIndexing(out RawBool)
Retrieves a value indicating whether this decoder supports indexing for efficient random access.
public void DoesSupportIndexing(out RawBool fIndexingSupportedRef)
Parameters
fIndexingSupportedRef
RawBoolTrue if indexing is supported; otherwise, false.
Remarks
Indexing is only supported for some JPEG types. Call this method
GetAcHuffmanTable(int, int, out JpegAcHuffmanTable)
Retrieves a copy of the AC Huffman table for the specified scan and table.
public void GetAcHuffmanTable(int scanIndex, int tableIndex, out JpegAcHuffmanTable acHuffmanTableRef)
Parameters
scanIndex
intThe zero-based index of the scan for which data is retrieved.
tableIndex
intThe index of the AC Huffman table to retrieve. Valid indices for a given scan can be determined by retrieving the scan header with IWICJpegFrameDecode::GetScanHeader.
acHuffmanTableRef
JpegAcHuffmanTableA reference that receives the table data. This parameter must not be
null
.
GetDcHuffmanTable(int, int, out JpegDeviceContextHuffmanTable)
Retrieves a copy of the DC Huffman table for the specified scan and table.
public void GetDcHuffmanTable(int scanIndex, int tableIndex, out JpegDeviceContextHuffmanTable dcHuffmanTableRef)
Parameters
scanIndex
intThe zero-based index of the scan for which data is retrieved.
tableIndex
intThe index of the DC Huffman table to retrieve. Valid indices for a given scan can be determined by retrieving the scan header with IWICJpegFrameDecode::GetScanHeader.
dcHuffmanTableRef
JpegDeviceContextHuffmanTableA reference that receives the table data. This parameter must not be
null
.
GetQuantizationTable(int, int, out JpegQuantizationTable)
Retrieves a copy of the quantization table.
public void GetQuantizationTable(int scanIndex, int tableIndex, out JpegQuantizationTable quantizationTableRef)
Parameters
scanIndex
intThe zero-based index of the scan for which data is retrieved.
tableIndex
intThe index of the quantization table to retrieve. Valid indices for a given scan can be determined by retrieving the scan header with IWICJpegFrameDecode::GetScanHeader.
quantizationTableRef
JpegQuantizationTableA reference that receives the table data. This parameter must not be
null
.
GetScanHeader(int, out JpegScanHeader)
Retrieves parameters from the Start Of Scan (SOS) marker for the scan with the specified index.
public void GetScanHeader(int scanIndex, out JpegScanHeader scanHeaderRef)
Parameters
scanIndex
intThe index of the scan for which header data is retrieved.
scanHeaderRef
JpegScanHeaderA reference that receives the frame header data.
SetIndexing(JpegIndexingOptions, int)
Enables indexing of the JPEG for efficient random access.
public void SetIndexing(JpegIndexingOptions options, int horizontalIntervalSize)
Parameters
options
JpegIndexingOptionsA value specifying whether indexes should be generated immediately or deferred until a future call to IWICBitmapSource::CopyPixels.
horizontalIntervalSize
intThe granularity of the indexing, in pixels.
Remarks
This method enables efficient random-access to the image pixels at the expense of memory usage. The amount of memory required for indexing depends on the requested index granularity. Unless SetIndexing is called, it is much more efficient to access a JPEG by progressing through its pixels top-down during calls to IWICBitmapSource::CopyPixels.
This method will fail if indexing is unsupported on the file. IWICJpegFrameDecode::DoesSupportIndexing should be called to first determine whether indexing is supported. If this method is called multiple times, the final call changes the index granularity to the requested size.
The provided interval size controls horizontal spacing of index entries. This value is internally rounded up according to the JPEG?s MCU (minimum coded unit) size, which is typically either 8 or 16 unscaled pixels. The vertical size of the index interval is always equal to one MCU size.
Indexes can be generated immediately, or during future calls to IWICBitmapSource::CopyPixels to reduce redundant decompression work.
Operators
explicit operator JpegFrameDecode(nint)
public static explicit operator JpegFrameDecode(nint nativePtr)
Parameters
nativePtr
nint