|
shun-iwasawa |
82a8f5 |
/*
|
|
shun-iwasawa |
82a8f5 |
* jdsample.h
|
|
shun-iwasawa |
82a8f5 |
*
|
|
shun-iwasawa |
82a8f5 |
* This file was part of the Independent JPEG Group's software:
|
|
shun-iwasawa |
82a8f5 |
* Copyright (C) 1991-1996, Thomas G. Lane.
|
|
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 |
|
|
shun-iwasawa |
82a8f5 |
/* Pointer to routine to upsample a single component */
|
|
shun-iwasawa |
82a8f5 |
typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
|
|
shun-iwasawa |
82a8f5 |
jpeg_component_info *compptr,
|
|
shun-iwasawa |
82a8f5 |
JSAMPARRAY input_data,
|
|
shun-iwasawa |
82a8f5 |
JSAMPARRAY *output_data_ptr);
|
|
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 |
/* Color conversion buffer. When using separate upsampling and color
|
|
shun-iwasawa |
82a8f5 |
* conversion steps, this buffer holds one upsampled row group until it
|
|
shun-iwasawa |
82a8f5 |
* has been color converted and output.
|
|
shun-iwasawa |
82a8f5 |
* Note: we do not allocate any storage for component(s) which are full-size,
|
|
shun-iwasawa |
82a8f5 |
* ie do not need rescaling. The corresponding entry of color_buf[] is
|
|
shun-iwasawa |
82a8f5 |
* simply set to point to the input data array, thereby avoiding copying.
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
JSAMPARRAY color_buf[MAX_COMPONENTS];
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* Per-component upsampling method pointers */
|
|
shun-iwasawa |
82a8f5 |
upsample1_ptr methods[MAX_COMPONENTS];
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
int next_row_out; /* counts rows emitted from color_buf */
|
|
shun-iwasawa |
82a8f5 |
JDIMENSION rows_to_go; /* counts rows remaining in image */
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* Height of an input row group for each component. */
|
|
shun-iwasawa |
82a8f5 |
int rowgroup_height[MAX_COMPONENTS];
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
/* These arrays save pixel expansion factors so that int_expand need not
|
|
shun-iwasawa |
82a8f5 |
* recompute them each time. They are unused for other upsampling methods.
|
|
shun-iwasawa |
82a8f5 |
*/
|
|
shun-iwasawa |
82a8f5 |
UINT8 h_expand[MAX_COMPONENTS];
|
|
shun-iwasawa |
82a8f5 |
UINT8 v_expand[MAX_COMPONENTS];
|
|
shun-iwasawa |
82a8f5 |
} my_upsampler;
|
|
shun-iwasawa |
82a8f5 |
|
|
shun-iwasawa |
82a8f5 |
typedef my_upsampler *my_upsample_ptr;
|