gxcllzw.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (C) 1997 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: gxcllzw.c,v 1.2 2000/09/19 19:00:34 lpd Exp $ */
  16. /* LZW filter initialization for RAM-based band lists */
  17. #include "std.h"
  18. #include "gstypes.h"
  19. #include "gsmemory.h"
  20. #include "gxclmem.h"
  21. #include "slzwx.h"
  22. private stream_LZW_state cl_LZWE_state;
  23. private stream_LZW_state cl_LZWD_state;
  24. /* Initialize the states to be copied. */
  25. void
  26. gs_cl_lzw_init(gs_memory_t * mem)
  27. {
  28. s_LZW_set_defaults((stream_state *) & cl_LZWE_state);
  29. cl_LZWE_state.template = &s_LZWE_template;
  30. s_LZW_set_defaults((stream_state *) & cl_LZWD_state);
  31. cl_LZWD_state.template = &s_LZWD_template;
  32. }
  33. /* Return the prototypes for compressing/decompressing the band list. */
  34. const stream_state *
  35. clist_compressor_state(void *client_data)
  36. {
  37. return (const stream_state *)&cl_LZWE_state;
  38. }
  39. const stream_state *
  40. clist_decompressor_state(void *client_data)
  41. {
  42. return (const stream_state *)&cl_LZWD_state;
  43. }