jpegcommon.h 529 Bytes
Newer Older
1
2
3
4
5
6
#pragma once

// clang-format off
#include <cstdio>
#include <cstddef>
// clang-format on
7
8

#if JPEG_FOUND
9
10
11
12
13
14
15
16
17
18
19
#include <jpeglib.h>
#include <setjmp.h>
#include <string>

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

#endif