sjpeg.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 1994 Aladdin Enterprises. All rights reserved.
  2. This file is part of AFPL Ghostscript.
  3. AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  4. distributor accepts any responsibility for the consequences of using it, or
  5. for whether it serves any particular purpose or works at all, unless he or
  6. she says so in writing. Refer to the Aladdin Free Public License (the
  7. "License") for full details.
  8. Every copy of AFPL Ghostscript must include a copy of the License, normally
  9. in a plain ASCII text file named PUBLIC. The License grants you the right
  10. to copy, modify and redistribute AFPL Ghostscript, but only under certain
  11. conditions described in the License. Among other things, the License
  12. requires that the copyright notice and this notice be preserved on all
  13. copies.
  14. */
  15. /*$Id: sjpeg.h,v 1.2 2000/09/19 19:00:50 lpd Exp $ */
  16. /* IJG entry point wrappers */
  17. /* Requires sdct.h, jpeg/jpeglib.h */
  18. #ifndef sjpeg_INCLUDED
  19. # define sjpeg_INCLUDED
  20. /*
  21. * Each routine gs_jpeg_xxx is equivalent to the IJG entry point jpeg_xxx,
  22. * except that
  23. * (a) it takes a pointer to stream_DCT_state instead of just the IJG
  24. * jpeg_(de)compress_data struct;
  25. * (b) it catches any error exit from the IJG code and converts it into
  26. * an error return value per Ghostscript custom. A negative return
  27. * value is an error code, except for gs_jpeg_alloc_xxx which return
  28. * NULL (indicating e_VMerror).
  29. */
  30. /* Common to encode/decode */
  31. void gs_jpeg_error_setup(P1(stream_DCT_state * st));
  32. int gs_jpeg_log_error(P1(stream_DCT_state * st));
  33. JQUANT_TBL *gs_jpeg_alloc_quant_table(P1(stream_DCT_state * st));
  34. JHUFF_TBL *gs_jpeg_alloc_huff_table(P1(stream_DCT_state * st));
  35. int gs_jpeg_destroy(P1(stream_DCT_state * st));
  36. /* Encode */
  37. int gs_jpeg_create_compress(P1(stream_DCT_state * st));
  38. int gs_jpeg_set_defaults(P1(stream_DCT_state * st));
  39. int gs_jpeg_set_colorspace(P2(stream_DCT_state * st,
  40. J_COLOR_SPACE colorspace));
  41. int gs_jpeg_set_linear_quality(P3(stream_DCT_state * st,
  42. int scale_factor,
  43. boolean force_baseline));
  44. int gs_jpeg_set_quality(P3(stream_DCT_state * st,
  45. int quality,
  46. boolean force_baseline));
  47. int gs_jpeg_start_compress(P2(stream_DCT_state * st,
  48. boolean write_all_tables));
  49. int gs_jpeg_write_scanlines(P3(stream_DCT_state * st,
  50. JSAMPARRAY scanlines,
  51. int num_lines));
  52. int gs_jpeg_finish_compress(P1(stream_DCT_state * st));
  53. /* Decode */
  54. int gs_jpeg_create_decompress(P1(stream_DCT_state * st));
  55. int gs_jpeg_read_header(P2(stream_DCT_state * st,
  56. boolean require_image));
  57. int gs_jpeg_start_decompress(P1(stream_DCT_state * st));
  58. int gs_jpeg_read_scanlines(P3(stream_DCT_state * st,
  59. JSAMPARRAY scanlines,
  60. int max_lines));
  61. int gs_jpeg_finish_decompress(P1(stream_DCT_state * st));
  62. #endif /* sjpeg_INCLUDED */