jbig2_symbol_dict.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Copyright (C) 2001-2023 Artifex Software, Inc.
  2. All Rights Reserved.
  3. This software is provided AS-IS with no warranty, either express or
  4. implied.
  5. This software is distributed under license and may not be copied,
  6. modified or distributed except as expressly authorized under the terms
  7. of the license contained in the file LICENSE in this distribution.
  8. Refer to licensing information at http://www.artifex.com or contact
  9. Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  10. CA 94129, USA, for further information.
  11. */
  12. /*
  13. jbig2dec
  14. */
  15. #ifndef _JBIG2_SYMBOL_DICT_H
  16. #define _JBIG2_SYMBOL_DICT_H
  17. /* symbol dictionary header */
  18. /* the results of decoding a symbol dictionary */
  19. typedef struct {
  20. uint32_t n_symbols;
  21. Jbig2Image **glyphs;
  22. } Jbig2SymbolDict;
  23. /* decode a symbol dictionary segment and store the results */
  24. int jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data);
  25. /* get a particular glyph by index */
  26. Jbig2Image *jbig2_sd_glyph(Jbig2SymbolDict *dict, unsigned int id);
  27. /* return a new empty symbol dict */
  28. Jbig2SymbolDict *jbig2_sd_new(Jbig2Ctx *ctx, uint32_t n_symbols);
  29. /* release the memory associated with a symbol dict */
  30. void jbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict);
  31. /* generate a new symbol dictionary by concatenating a list of
  32. existing dictionaries */
  33. Jbig2SymbolDict *jbig2_sd_cat(Jbig2Ctx *ctx, uint32_t n_dicts, Jbig2SymbolDict **dicts);
  34. /* count the number of dictionary segments referred
  35. to by the given segment */
  36. uint32_t jbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
  37. /* return an array of pointers to symbol dictionaries referred
  38. to by a segment */
  39. Jbig2SymbolDict **jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);
  40. #endif /* _JBIG2_SYMBOL_DICT_H */