C# Class BitMiracle.LibJpeg.Classic.Internal.my_upsampler

Inheritance: jpeg_upsampler
Exibir arquivo Open project: prepare/HTML-Renderer

Public Methods

Method Description
my_upsampler ( jpeg_decompress_struct cinfo )
start_pass ( ) : void

Initialize for an upsampling pass.

upsample ( ComponentBuffer input_buf, int &in_row_group_ctr, int in_row_groups_avail, byte output_buf, int &out_row_ctr, int out_rows_avail ) : void

Control routine to do upsampling (and color conversion). In this version we upsample each component independently. We upsample one row group into the conversion buffer, then apply color conversion a row at a time.

Private Methods

Method Description
fullsize_upsample ( ComponentBuffer &input_data ) : void

For full-size components, we just make color_buf[ci] point at the input buffer, and thus avoid copying any data. Note that this is safe only because sep_upsample doesn't declare the input row group "consumed" until we are done color converting and emitting it.

h2v1_upsample ( ComponentBuffer &input_data ) : void

Fast processing for the common case of 2:1 horizontal and 1:1 vertical. It's still a box filter.

h2v2_upsample ( ComponentBuffer &input_data ) : void

Fast processing for the common case of 2:1 horizontal and 2:1 vertical. It's still a box filter.

int_upsample ( ComponentBuffer &input_data ) : void

This version handles any integral sampling ratios. This is not used for typical JPEG files, so it need not be fast. Nor, for that matter, is it particularly accurate: the algorithm is simple replication of the input pixel onto the corresponding output pixels. The hi-falutin sampling literature refers to this as a "box filter". A box filter tends to introduce visible artifacts, so if you are actually going to use 3:1 or 4:1 sampling ratios you would be well advised to improve this code.

noop_upsample ( ) : void

This is a no-op version used for "uninteresting" components. These components will not be referenced by color conversion.

upsampleComponent ( ComponentBuffer &input_data ) : void

Method Details

my_upsampler() public method

public my_upsampler ( jpeg_decompress_struct cinfo )
cinfo jpeg_decompress_struct

start_pass() public method

Initialize for an upsampling pass.
public start_pass ( ) : void
return void

upsample() public method

Control routine to do upsampling (and color conversion). In this version we upsample each component independently. We upsample one row group into the conversion buffer, then apply color conversion a row at a time.
public upsample ( ComponentBuffer input_buf, int &in_row_group_ctr, int in_row_groups_avail, byte output_buf, int &out_row_ctr, int out_rows_avail ) : void
input_buf ComponentBuffer
in_row_group_ctr int
in_row_groups_avail int
output_buf byte
out_row_ctr int
out_rows_avail int
return void