C# Class BitMiracle.LibJpeg.Classic.jpeg_decompress_struct

Inheritance: jpeg_common_struct
Datei anzeigen Open project: prepare/HTML-Renderer Class Usage Examples

Public Methods

Method Description
jpeg_abort_decompress ( ) : void

Aborts processing of a JPEG decompression operation.

jpeg_calc_output_dimensions ( ) : void

Pre-calculate output image dimensions and related values for current decompression parameters.

This is allowed for possible use by application. Hence it mustn't do anything that can't be done twice. Also note that it may be called before the master module is initialized!

jpeg_consume_input ( ) : ReadResult

Consume data in advance of what the decompressor requires.

This routine can be called at any time after initializing the JPEG object. It reads some additional data and returns when one of the indicated significant events occurs. If called after the EOI marker is reached, it will immediately return ReadResult.JPEG_REACHED_EOI without attempting to read more data.

jpeg_copy_critical_parameters ( jpeg_compress_struct dstinfo ) : void

Initializes the compression object with default parameters, then copy from the source object all parameters needed for lossless transcoding.

Parameters that can be varied without loss (such as scan script and Huffman optimization) are left in their default states.

jpeg_decompress_struct ( ) : System

Initializes a new instance of the jpeg_decompress_struct class.

jpeg_decompress_struct ( jpeg_error_mgr errorManager ) : System

Initializes a new instance of the jpeg_decompress_struct class.

jpeg_finish_decompress ( ) : bool

Finish JPEG decompression.

This will normally just verify the file trailer and release temp storage.

jpeg_finish_output ( ) : bool

Finish up after an output pass in buffered-image mode.

jpeg_has_multiple_scans ( ) : bool

Is there more than one scan?

If you are concerned about maximum performance on baseline JPEG files, you should use buffered-image mode only when the incoming file actually has multiple scans. This can be tested by calling this method.

jpeg_input_complete ( ) : bool

Indicates if we have finished reading the input file.

jpeg_read_coefficients ( ) : jvirt_array[]

Read or write the raw DCT coefficient arrays from a JPEG file (useful for lossless transcoding).

jpeg_read_header must be completed before calling this.
The entire image is read into a set of virtual coefficient-block arrays, one per component. The return value is an array of virtual-array descriptors.
An alternative usage is to simply obtain access to the coefficient arrays during a buffered-image mode decompression operation. This is allowed after any jpeg_finish_output call. The arrays can be accessed until jpeg_finish_decompress is called. Note that any call to the library may reposition the arrays, so don't rely on jvirt_array{T}.Access results to stay valid across library calls.

jpeg_read_header ( bool require_image ) : ReadResult

Decompression startup: this will read the source datastream header markers, up to the beginning of the compressed data proper.

Need only initialize JPEG object and supply a data source before calling.
On return, the image dimensions and other info have been stored in the JPEG object. The application may wish to consult this information before selecting decompression parameters.
This routine is now just a front end to jpeg_consume_input, with some extra error checking.

jpeg_read_raw_data ( byte data, int max_lines ) : int

Alternate entry point to read raw data.

Replaces jpeg_read_scanlines when reading raw downsampled data. Processes exactly one iMCU row per call, unless suspended.

jpeg_read_scanlines ( byte scanlines, int max_lines ) : int

Read some scanlines of data from the JPEG decompressor.

We warn about excess calls to jpeg_read_scanlines since this likely signals an application programmer error. However, an oversize buffer (max_lines > scanlines remaining) is not an error.

jpeg_save_markers ( int marker_code, int length_limit ) : void

Control saving of COM and APPn markers into Marker_list.

jpeg_set_marker_processor ( int marker_code, jpeg_marker_parser_method routine ) : void

Sets processor for special marker.

Allows you to supply your own routine to process COM and/or APPn markers on-the-fly as they are read.

jpeg_start_decompress ( ) : bool

Decompression initialization.

jpeg_read_header must be completed before calling this.
If a multipass operating mode was selected, this will do all but the last pass, and thus may take a great deal of time.

jpeg_start_output ( int scan_number ) : bool

Initialize for an output pass in buffered-image mode.

jpeg_stdio_src ( Stream infile ) : void

Sets input stream.

The caller must have already opened the stream, and is responsible for closing it after finishing decompression.

Private Methods

Method Description
default_decompress_parms ( ) : void

Set default decompression parameters.

initialize ( ) : void

Initialization of JPEG compression objects. The error manager must already be set up (in case memory manager fails).

jpeg_consume_input_inHeader ( ) : ReadResult
jpeg_consume_input_start ( ) : void
output_pass_setup ( ) : bool

Set up for an output pass, and perform any dummy pass(es) needed. Common subroutine for jpeg_start_decompress and jpeg_start_output. Entry: global_state = DSTATE_PRESCAN only if previously suspended. Exit: If done, returns true and sets global_state for proper output mode. If suspended, returns false and sets global_state = DSTATE_PRESCAN.

transdecode_master_selection ( ) : void

Master selection of decompression modules for transcoding (that is, reading raw DCT coefficient arrays from an input JPEG file.) This substitutes for initialization of the full decompressor.

use_merged_upsample ( ) : bool

Determine whether merged upsample/color conversion should be used. CRUCIAL: this must match the actual capabilities of merged upsampler!

Method Details

jpeg_abort_decompress() public method

Aborts processing of a JPEG decompression operation.
public jpeg_abort_decompress ( ) : void
return void

jpeg_calc_output_dimensions() public method

Pre-calculate output image dimensions and related values for current decompression parameters.
This is allowed for possible use by application. Hence it mustn't do anything that can't be done twice. Also note that it may be called before the master module is initialized!
public jpeg_calc_output_dimensions ( ) : void
return void

jpeg_consume_input() public method

Consume data in advance of what the decompressor requires.
This routine can be called at any time after initializing the JPEG object. It reads some additional data and returns when one of the indicated significant events occurs. If called after the EOI marker is reached, it will immediately return ReadResult.JPEG_REACHED_EOI without attempting to read more data.
public jpeg_consume_input ( ) : ReadResult
return ReadResult

jpeg_copy_critical_parameters() public method

Initializes the compression object with default parameters, then copy from the source object all parameters needed for lossless transcoding.
Parameters that can be varied without loss (such as scan script and Huffman optimization) are left in their default states.
public jpeg_copy_critical_parameters ( jpeg_compress_struct dstinfo ) : void
dstinfo jpeg_compress_struct Target JPEG compression object.
return void

jpeg_decompress_struct() public method

Initializes a new instance of the jpeg_decompress_struct class.
public jpeg_decompress_struct ( ) : System
return System

jpeg_decompress_struct() public method

Initializes a new instance of the jpeg_decompress_struct class.
public jpeg_decompress_struct ( jpeg_error_mgr errorManager ) : System
errorManager jpeg_error_mgr The error manager.
return System

jpeg_finish_decompress() public method

Finish JPEG decompression.
This will normally just verify the file trailer and release temp storage.
public jpeg_finish_decompress ( ) : bool
return bool

jpeg_finish_output() public method

Finish up after an output pass in buffered-image mode.
public jpeg_finish_output ( ) : bool
return bool

jpeg_has_multiple_scans() public method

Is there more than one scan?
If you are concerned about maximum performance on baseline JPEG files, you should use buffered-image mode only when the incoming file actually has multiple scans. This can be tested by calling this method.
public jpeg_has_multiple_scans ( ) : bool
return bool

jpeg_input_complete() public method

Indicates if we have finished reading the input file.
public jpeg_input_complete ( ) : bool
return bool

jpeg_read_coefficients() public method

Read or write the raw DCT coefficient arrays from a JPEG file (useful for lossless transcoding).
jpeg_read_header must be completed before calling this.
The entire image is read into a set of virtual coefficient-block arrays, one per component. The return value is an array of virtual-array descriptors.
An alternative usage is to simply obtain access to the coefficient arrays during a buffered-image mode decompression operation. This is allowed after any jpeg_finish_output call. The arrays can be accessed until jpeg_finish_decompress is called. Note that any call to the library may reposition the arrays, so don't rely on jvirt_array{T}.Access results to stay valid across library calls.
public jpeg_read_coefficients ( ) : jvirt_array[]
return jvirt_array[]

jpeg_read_header() public method

Decompression startup: this will read the source datastream header markers, up to the beginning of the compressed data proper.
Need only initialize JPEG object and supply a data source before calling.
On return, the image dimensions and other info have been stored in the JPEG object. The application may wish to consult this information before selecting decompression parameters.
This routine is now just a front end to jpeg_consume_input, with some extra error checking.
public jpeg_read_header ( bool require_image ) : ReadResult
require_image bool Read a description of Return Value.
return ReadResult

jpeg_read_raw_data() public method

Alternate entry point to read raw data.
Replaces jpeg_read_scanlines when reading raw downsampled data. Processes exactly one iMCU row per call, unless suspended.
public jpeg_read_raw_data ( byte data, int max_lines ) : int
data byte The raw data.
max_lines int The number of scanlines for reading.
return int

jpeg_read_scanlines() public method

Read some scanlines of data from the JPEG decompressor.
We warn about excess calls to jpeg_read_scanlines since this likely signals an application programmer error. However, an oversize buffer (max_lines > scanlines remaining) is not an error.
public jpeg_read_scanlines ( byte scanlines, int max_lines ) : int
scanlines byte Buffer for filling.
max_lines int Required number of lines.
return int

jpeg_save_markers() public method

Control saving of COM and APPn markers into Marker_list.
public jpeg_save_markers ( int marker_code, int length_limit ) : void
marker_code int The marker type to save (see JPEG_MARKER enumeration).
/// To arrange to save all the special marker types, you need to call this /// routine 17 times, for COM and APP0-APP15 markers.
length_limit int If the incoming marker is longer than length_limit data bytes, /// only length_limit bytes will be saved; this parameter allows you to avoid chewing up memory /// when you only need to see the first few bytes of a potentially large marker. If you want to save /// all the data, set length_limit to 0xFFFF; that is enough since marker lengths are only 16 bits. /// As a special case, setting length_limit to 0 prevents that marker type from being saved at all. /// (That is the default behavior, in fact.) ///
return void

jpeg_set_marker_processor() public method

Sets processor for special marker.
Allows you to supply your own routine to process COM and/or APPn markers on-the-fly as they are read.
public jpeg_set_marker_processor ( int marker_code, jpeg_marker_parser_method routine ) : void
marker_code int The marker code.
routine jpeg_marker_parser_method The processor.
return void

jpeg_start_decompress() public method

Decompression initialization.
jpeg_read_header must be completed before calling this.
If a multipass operating mode was selected, this will do all but the last pass, and thus may take a great deal of time.
public jpeg_start_decompress ( ) : bool
return bool

jpeg_start_output() public method

Initialize for an output pass in buffered-image mode.
public jpeg_start_output ( int scan_number ) : bool
scan_number int Indicates which scan of the input file is to be displayed; /// the scans are numbered starting at 1 for this purpose.
return bool

jpeg_stdio_src() public method

Sets input stream.
The caller must have already opened the stream, and is responsible for closing it after finishing decompression.
public jpeg_stdio_src ( Stream infile ) : void
infile Stream The input stream.
return void