tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

jdsample.h (1825B)


      1 /*
      2 * jdsample.h
      3 *
      4 * This file was part of the Independent JPEG Group's software:
      5 * Copyright (C) 1991-1996, Thomas G. Lane.
      6 * libjpeg-turbo Modifications:
      7 * Copyright (C) 2022, D. R. Commander.
      8 * For conditions of distribution and use, see the accompanying README.ijg
      9 * file.
     10 */
     11 
     12 #define JPEG_INTERNALS
     13 #include "jpeglib.h"
     14 #include "jsamplecomp.h"
     15 
     16 
     17 /* Pointer to routine to upsample a single component */
     18 typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
     19                               jpeg_component_info *compptr,
     20                               _JSAMPARRAY input_data,
     21                               _JSAMPARRAY *output_data_ptr);
     22 
     23 /* Private subobject */
     24 
     25 typedef struct {
     26  struct jpeg_upsampler pub;    /* public fields */
     27 
     28  /* Color conversion buffer.  When using separate upsampling and color
     29   * conversion steps, this buffer holds one upsampled row group until it
     30   * has been color converted and output.
     31   * Note: we do not allocate any storage for component(s) which are full-size,
     32   * ie do not need rescaling.  The corresponding entry of color_buf[] is
     33   * simply set to point to the input data array, thereby avoiding copying.
     34   */
     35  _JSAMPARRAY color_buf[MAX_COMPONENTS];
     36 
     37  /* Per-component upsampling method pointers */
     38  upsample1_ptr methods[MAX_COMPONENTS];
     39 
     40  int next_row_out;             /* counts rows emitted from color_buf */
     41  JDIMENSION rows_to_go;        /* counts rows remaining in image */
     42 
     43  /* Height of an input row group for each component. */
     44  int rowgroup_height[MAX_COMPONENTS];
     45 
     46  /* These arrays save pixel expansion factors so that int_expand need not
     47   * recompute them each time.  They are unused for other upsampling methods.
     48   */
     49  UINT8 h_expand[MAX_COMPONENTS];
     50  UINT8 v_expand[MAX_COMPONENTS];
     51 } my_upsampler;
     52 
     53 typedef my_upsampler *my_upsample_ptr;