|
shun-iwasawa |
82a8f5 |
/*
|
|
shun-iwasawa |
82a8f5 |
* jdmerge.h
|
|
shun-iwasawa |
82a8f5 |
*
|
|
shun-iwasawa |
82a8f5 |
* This file was part of the Independent JPEG Group's software:
|
|
shun-iwasawa |
82a8f5 |
* Copyright (C) 1994-1996, Thomas G. Lane.
|
|
shun-iwasawa |
82a8f5 |
* libjpeg-turbo Modifications:
|
|
shun-iwasawa |
82a8f5 |
* Copyright (C) 2020, D. R. Commander.
|
|
shun-iwasawa |
82a8f5 |
* For conditions of distribution and use, see the accompanying README.ijg
|
|
shun-iwasawa |
82a8f5 |
* file.
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
#define JPEG_INTERNALS
|
|
shun-iwasawa |
82a8f5 |
#include "jpeglib.h"
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* Private subobject */
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
typedef struct {
|
|
shun-iwasawa |
82a8f5 |
struct jpeg_upsampler pub; /* public fields */
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* Pointer to routine to do actual upsampling/conversion of one row group */
|
|
shun-iwasawa |
82a8f5 |
void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
|
shun-iwasawa |
82a8f5 |
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* Private state for YCC->RGB conversion */
|
|
shun-iwasawa |
82a8f5 |
int *Cr_r_tab; /* => table for Cr to R conversion */
|
|
shun-iwasawa |
82a8f5 |
int *Cb_b_tab; /* => table for Cb to B conversion */
|
|
shun-iwasawa |
82a8f5 |
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
|
shun-iwasawa |
82a8f5 |
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* For 2:1 vertical sampling, we produce two output rows at a time.
|
|
shun-iwasawa |
82a8f5 |
* We need a "spare" row buffer to hold the second output row if the
|
|
shun-iwasawa |
82a8f5 |
* application provides just a one-row buffer; we also use the spare
|
|
shun-iwasawa |
82a8f5 |
* to discard the dummy last row if the image height is odd.
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
JSAMPROW spare_row;
|
|
shun-iwasawa |
82a8f5 |
boolean spare_full; /* T if spare buffer is occupied */
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
JDIMENSION out_row_width; /* samples per output row */
|
|
shun-iwasawa |
82a8f5 |
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
|
shun-iwasawa |
82a8f5 |
} my_merged_upsampler;
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
typedef my_merged_upsampler *my_merged_upsample_ptr;
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
#endif /* UPSAMPLE_MERGING_SUPPORTED */
|