common_jpeg.h 577 Bytes
Newer Older
1
2
#pragma once

3
#if JPEG_FOUND
4
5
#include <stdio.h>

6
7
8
#include <jpeglib.h>
#include <setjmp.h>

9
10
11
12
namespace vision {
namespace image {
namespace detail {

13
14
15
16
17
18
19
static const JOCTET EOI_BUFFER[1] = {JPEG_EOI};
struct torch_jpeg_error_mgr {
  struct jpeg_error_mgr pub; /* "public" fields */
  char jpegLastErrorMsg[JMSG_LENGTH_MAX]; /* error messages */
  jmp_buf setjmp_buffer; /* for return to caller */
};

20
using torch_jpeg_error_ptr = struct torch_jpeg_error_mgr*;
21
void torch_jpeg_error_exit(j_common_ptr cinfo);
22

23
24
25
26
} // namespace detail
} // namespace image
} // namespace vision

27
#endif