common_jpeg.h 577 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #if JPEG_FOUND
  3. #include <stdio.h>
  4. #include <jpeglib.h>
  5. #include <setjmp.h>
  6. namespace vision {
  7. namespace image {
  8. namespace detail {
  9. static const JOCTET EOI_BUFFER[1] = {JPEG_EOI};
  10. struct torch_jpeg_error_mgr {
  11. struct jpeg_error_mgr pub; /* "public" fields */
  12. char jpegLastErrorMsg[JMSG_LENGTH_MAX]; /* error messages */
  13. jmp_buf setjmp_buffer; /* for return to caller */
  14. };
  15. using torch_jpeg_error_ptr = struct torch_jpeg_error_mgr*;
  16. void torch_jpeg_error_exit(j_common_ptr cinfo);
  17. } // namespace detail
  18. } // namespace image
  19. } // namespace vision
  20. #endif