1 /* in_jai.hpp -- Tue Jun 11 19:05:04 CEST 2002
2  */
3 
4 #ifdef __GNUC__
5 #ifndef __clang__
6 #pragma interface
7 #endif
8 #endif
9 
10 #ifndef IN_JAI_HPP
11 #define IN_JAI_HPP 1
12 
13 #include "config2.h"
14 
15 #if USE_IN_JAI
16 
17 #include "gensio.hpp"
18 
19 struct jai_gfxinfo {
20   /** 0 for baseline JPEG, 1..15 for other JPEG compression */
21   unsigned char SOF_type;
22   unsigned char colorspace;
23   unsigned char bad, bpc, cpp, had_jfif, colortransform, id_rgb;
24   /** (Horiz<<4+Vert) sampling factor for the first color component. Usually
25    * 0x11, but TIFF defaults to 0x22.
26    */
27   unsigned char hvs;
28   /*Image::Sampled::dimen_t*/slen_t height, width;
29   /** Offset of byte just _after_ the first SOF marker (FF C0 or alike)
30    * from the beginning of the file.
31    */
32   slen_t SOF_offs;
33 };
34 
35 extern char const*jai_errors[];
36 #if 0
37   extern void jai_parse_jpeg(struct gfxinfo *result, Filter::FlatR *f);
38   extern void jai_parse_jpeg(struct gfxinfo *result, FILE *f);
39 #else
40   extern void jai_parse_jpeg(struct jai_gfxinfo *result, DecoderTeller *fp, bool must_be_baseline=true);
41   /** Doesn't treat `-' as a special filename. @return 0, 1, or -1 on I/O error */
42   extern int jai_is_baseline_jpeg(char const* filename);
43   extern int jai_is_baseline_jpeg(/*DecoderTeller*/ Filter::UngetFILED *fp);
44 #endif
45 
46 #endif
47 
48 #endif /* in_jai.hpp */
49