jbig2_text.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_TEXT_H
  16. #define _JBIG2_TEXT_H
  17. /**
  18. * Headers for Text region handling
  19. **/
  20. typedef enum {
  21. JBIG2_CORNER_BOTTOMLEFT = 0,
  22. JBIG2_CORNER_TOPLEFT = 1,
  23. JBIG2_CORNER_BOTTOMRIGHT = 2,
  24. JBIG2_CORNER_TOPRIGHT = 3
  25. } Jbig2RefCorner;
  26. typedef struct {
  27. bool SBHUFF;
  28. bool SBREFINE;
  29. bool SBDEFPIXEL;
  30. Jbig2ComposeOp SBCOMBOP;
  31. bool TRANSPOSED;
  32. Jbig2RefCorner REFCORNER;
  33. int SBDSOFFSET;
  34. /* int SBW; */
  35. /* int SBH; */
  36. uint32_t SBNUMINSTANCES;
  37. int LOGSBSTRIPS;
  38. int SBSTRIPS;
  39. /* int SBNUMSYMS; */
  40. /* SBSYMCODES */
  41. /* SBSYMCODELEN */
  42. /* SBSYMS */
  43. Jbig2HuffmanTable *SBHUFFFS;
  44. Jbig2HuffmanTable *SBHUFFDS;
  45. Jbig2HuffmanTable *SBHUFFDT;
  46. Jbig2HuffmanTable *SBHUFFRDW;
  47. Jbig2HuffmanTable *SBHUFFRDH;
  48. Jbig2HuffmanTable *SBHUFFRDX;
  49. Jbig2HuffmanTable *SBHUFFRDY;
  50. Jbig2HuffmanTable *SBHUFFRSIZE;
  51. Jbig2ArithIntCtx *IADT;
  52. Jbig2ArithIntCtx *IAFS;
  53. Jbig2ArithIntCtx *IADS;
  54. Jbig2ArithIntCtx *IAIT;
  55. Jbig2ArithIaidCtx *IAID;
  56. Jbig2ArithIntCtx *IARI;
  57. Jbig2ArithIntCtx *IARDW;
  58. Jbig2ArithIntCtx *IARDH;
  59. Jbig2ArithIntCtx *IARDX;
  60. Jbig2ArithIntCtx *IARDY;
  61. bool SBRTEMPLATE;
  62. int8_t sbrat[4];
  63. } Jbig2TextRegionParams;
  64. int
  65. jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
  66. const Jbig2TextRegionParams *params,
  67. const Jbig2SymbolDict *const *dicts, const uint32_t n_dicts,
  68. Jbig2Image *image, const byte *data, const size_t size, Jbig2ArithCx *GR_stats, Jbig2ArithState *as, Jbig2WordStream *ws);
  69. int jbig2_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
  70. #endif /* _JBIG2_TEXT_H */