jdmerge.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * jdmerge.h
  3. *
  4. * This file was part of the Independent JPEG Group's software:
  5. * Copyright (C) 1994-1996, Thomas G. Lane.
  6. * libjpeg-turbo Modifications:
  7. * Copyright (C) 2020, D. R. Commander.
  8. * For conditions of distribution and use, see the accompanying README.ijg
  9. * file.
  10. */
  11. #define JPEG_INTERNALS
  12. #include "jpeglib.h"
  13. #ifdef UPSAMPLE_MERGING_SUPPORTED
  14. /* Private subobject */
  15. typedef struct {
  16. struct jpeg_upsampler pub; /* public fields */
  17. /* Pointer to routine to do actual upsampling/conversion of one row group */
  18. void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
  19. JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);
  20. /* Private state for YCC->RGB conversion */
  21. int *Cr_r_tab; /* => table for Cr to R conversion */
  22. int *Cb_b_tab; /* => table for Cb to B conversion */
  23. JLONG *Cr_g_tab; /* => table for Cr to G conversion */
  24. JLONG *Cb_g_tab; /* => table for Cb to G conversion */
  25. /* For 2:1 vertical sampling, we produce two output rows at a time.
  26. * We need a "spare" row buffer to hold the second output row if the
  27. * application provides just a one-row buffer; we also use the spare
  28. * to discard the dummy last row if the image height is odd.
  29. */
  30. JSAMPROW spare_row;
  31. boolean spare_full; /* T if spare buffer is occupied */
  32. JDIMENSION out_row_width; /* samples per output row */
  33. JDIMENSION rows_to_go; /* counts rows remaining in image */
  34. } my_merged_upsampler;
  35. typedef my_merged_upsampler *my_merged_upsample_ptr;
  36. #endif /* UPSAMPLE_MERGING_SUPPORTED */