summaryrefslogtreecommitdiffstats
path: root/plug-ins/file-jpeg/jpeg.h
blob: 0bf9af0cf3bbfc09d5ef8c69082700fb41ffb9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef __JPEG_H__
#define __JPEG_H__

#define LOAD_PROC       "file-jpeg-load"
#define LOAD_THUMB_PROC "file-jpeg-load-thumb"
#define SAVE_PROC       "file-jpeg-save"
#define PLUG_IN_BINARY  "file-jpeg"
#define PLUG_IN_ROLE    "gimp-file-jpeg"

/* headers used in some APPn markers */
#define JPEG_APP_HEADER_EXIF "Exif\0\0"
#define JPEG_APP_HEADER_XMP  "http://ns.adobe.com/xap/1.0/"

typedef struct my_error_mgr
{
  struct jpeg_error_mgr pub;            /* "public" fields */

#ifdef __ia64__
  /* Ugh, the jmp_buf field needs to be 16-byte aligned on ia64 and some
   * glibc/icc combinations don't guarantee this. So we pad. See bug #138357
   * for details.
   */
  long double           dummy;
#endif

  jmp_buf               setjmp_buffer;  /* for return to caller */
} *my_error_ptr;

typedef enum
{
  JPEG_SUBSAMPLING_2x2_1x1_1x1 = 0,  /* smallest file */
  JPEG_SUBSAMPLING_2x1_1x1_1x1 = 1,  /* 4:2:2         */
  JPEG_SUBSAMPLING_1x1_1x1_1x1 = 2,
  JPEG_SUBSAMPLING_1x2_1x1_1x1 = 3
} JpegSubsampling;

extern gint32 volatile  preview_image_ID;
extern gint32           preview_layer_ID;
extern gboolean         undo_touched;
extern gboolean         load_interactive;
extern gint32           display_ID;
extern gchar           *image_comment;
extern gint             orig_quality;
extern JpegSubsampling  orig_subsmp;
extern gint             num_quant_tables;


void      destroy_preview               (void);

void      my_error_exit                 (j_common_ptr   cinfo);
void      my_emit_message               (j_common_ptr   cinfo,
                                         int            msg_level);
void      my_output_message             (j_common_ptr   cinfo);


#endif /* __JPEG_H__ */