jbig2_page.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_PAGE_H
  16. #define _JBIG2_PAGE_H
  17. /* the page structure handles decoded page
  18. results. it's allocated by a 'page info'
  19. segment and marked complete by an 'end of page'
  20. segment.
  21. */
  22. typedef enum {
  23. JBIG2_PAGE_FREE,
  24. JBIG2_PAGE_NEW,
  25. JBIG2_PAGE_COMPLETE,
  26. JBIG2_PAGE_RETURNED,
  27. JBIG2_PAGE_RELEASED
  28. } Jbig2PageState;
  29. struct _Jbig2Page {
  30. Jbig2PageState state;
  31. uint32_t number;
  32. uint32_t height, width; /* in pixels */
  33. uint32_t x_resolution, y_resolution; /* in pixels per meter */
  34. uint16_t stripe_size;
  35. bool striped;
  36. uint32_t end_row;
  37. uint8_t flags;
  38. Jbig2Image *image;
  39. };
  40. int jbig2_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
  41. int jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
  42. int jbig2_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
  43. int jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *src, uint32_t x, uint32_t y, Jbig2ComposeOp op);
  44. #endif /* _JBIG2_PAGE_H */