author Emilio Cobos Álvarez <>
Tue, 28 Mar 2023 08:20:09 +0000
changeset 658112 702d4a62e5d03a2b36b3a17645718208a30ddb08
parent 302664 4e6dd91cd5823834a7da0394367609a1640dfb11
permissions -rw-r--r--
Bug 1824304 - Fix PiP window type hint after bug 1823350. r=stransky Differential Revision:

 * jdsample.h
 * This file was part of the Independent JPEG Group's software:
 * Copyright (C) 1991-1996, Thomas G. Lane.
 * For conditions of distribution and use, see the accompanying README.ijg
 * file.

#include "jpeglib.h"

/* Pointer to routine to upsample a single component */
typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
                               jpeg_component_info *compptr,
                               JSAMPARRAY input_data,
                               JSAMPARRAY *output_data_ptr);

/* Private subobject */

typedef struct {
  struct jpeg_upsampler pub;    /* public fields */

  /* Color conversion buffer.  When using separate upsampling and color
   * conversion steps, this buffer holds one upsampled row group until it
   * has been color converted and output.
   * Note: we do not allocate any storage for component(s) which are full-size,
   * ie do not need rescaling.  The corresponding entry of color_buf[] is
   * simply set to point to the input data array, thereby avoiding copying.

  /* Per-component upsampling method pointers */
  upsample1_ptr methods[MAX_COMPONENTS];

  int next_row_out;             /* counts rows emitted from color_buf */
  JDIMENSION rows_to_go;        /* counts rows remaining in image */

  /* Height of an input row group for each component. */
  int rowgroup_height[MAX_COMPONENTS];

  /* These arrays save pixel expansion factors so that int_expand need not
   * recompute them each time.  They are unused for other upsampling methods.
} my_upsampler;

typedef my_upsampler *my_upsample_ptr;