jdsample.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * For conditions of distribution and use, see the accompanying README.ijg
  7. * file.
  8. */
  9. #define JPEG_INTERNALS
  10. #include "jpeglib.h"
  11. /* Pointer to routine to upsample a single component */
  12. typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
  13. jpeg_component_info *compptr,
  14. JSAMPARRAY input_data,
  15. JSAMPARRAY *output_data_ptr);
  16. /* Private subobject */
  17. typedef struct {
  18. struct jpeg_upsampler pub; /* public fields */
  19. /* Color conversion buffer. When using separate upsampling and color
  20. * conversion steps, this buffer holds one upsampled row group until it
  21. * has been color converted and output.
  22. * Note: we do not allocate any storage for component(s) which are full-size,
  23. * ie do not need rescaling. The corresponding entry of color_buf[] is
  24. * simply set to point to the input data array, thereby avoiding copying.
  25. */
  26. JSAMPARRAY color_buf[MAX_COMPONENTS];
  27. /* Per-component upsampling method pointers */
  28. upsample1_ptr methods[MAX_COMPONENTS];
  29. int next_row_out; /* counts rows emitted from color_buf */
  30. JDIMENSION rows_to_go; /* counts rows remaining in image */
  31. /* Height of an input row group for each component. */
  32. int rowgroup_height[MAX_COMPONENTS];
  33. /* These arrays save pixel expansion factors so that int_expand need not
  34. * recompute them each time. They are unused for other upsampling methods.
  35. */
  36. UINT8 h_expand[MAX_COMPONENTS];
  37. UINT8 v_expand[MAX_COMPONENTS];
  38. } my_upsampler;
  39. typedef my_upsampler *my_upsample_ptr;