1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __JPEG_H__
19 #define __JPEG_H__
20 
21 #define LOAD_PROC       "file-jpeg-load"
22 #define LOAD_THUMB_PROC "file-jpeg-load-thumb"
23 #define SAVE_PROC       "file-jpeg-save"
24 #define PLUG_IN_BINARY  "file-jpeg"
25 #define PLUG_IN_ROLE    "gimp-file-jpeg"
26 
27 /* headers used in some APPn markers */
28 #define JPEG_APP_HEADER_EXIF "Exif\0\0"
29 #define JPEG_APP_HEADER_XMP  "http://ns.adobe.com/xap/1.0/"
30 
31 typedef struct my_error_mgr
32 {
33   struct jpeg_error_mgr pub;            /* "public" fields */
34 
35 #ifdef __ia64__
36   /* Ugh, the jmp_buf field needs to be 16-byte aligned on ia64 and some
37    * glibc/icc combinations don't guarantee this. So we pad. See bug #138357
38    * for details.
39    */
40   long double           dummy;
41 #endif
42 
43   jmp_buf               setjmp_buffer;  /* for return to caller */
44 } *my_error_ptr;
45 
46 typedef enum
47 {
48   JPEG_SUBSAMPLING_2x2_1x1_1x1 = 0,  /* smallest file */
49   JPEG_SUBSAMPLING_2x1_1x1_1x1 = 1,  /* 4:2:2         */
50   JPEG_SUBSAMPLING_1x1_1x1_1x1 = 2,
51   JPEG_SUBSAMPLING_1x2_1x1_1x1 = 3
52 } JpegSubsampling;
53 
54 extern gint32 volatile  preview_image_ID;
55 extern gint32           preview_layer_ID;
56 extern gboolean         undo_touched;
57 extern gboolean         load_interactive;
58 extern gint32           display_ID;
59 extern gchar           *image_comment;
60 extern gint             orig_quality;
61 extern JpegSubsampling  orig_subsmp;
62 extern gint             num_quant_tables;
63 
64 
65 void      destroy_preview               (void);
66 
67 void      my_error_exit                 (j_common_ptr   cinfo);
68 void      my_emit_message               (j_common_ptr   cinfo,
69                                          int            msg_level);
70 void      my_output_message             (j_common_ptr   cinfo);
71 
72 
73 #endif /* __JPEG_H__ */
74