summaryrefslogtreecommitdiff
path: root/graphics/sam2p/in_jai.hpp
blob: 4b351056883e2cb9cc722b8f92f05d5e8161181c (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
/* in_jai.hpp -- Tue Jun 11 19:05:04 CEST 2002
 */

#ifdef __GNUC__
#ifndef __clang__
#pragma interface
#endif
#endif

#ifndef IN_JAI_HPP
#define IN_JAI_HPP 1

#include "config2.h"

#if USE_IN_JAI

#include "gensio.hpp"

struct jai_gfxinfo {
  /** 0 for baseline JPEG, 1..15 for other JPEG compression */
  unsigned char SOF_type;
  unsigned char colorspace;
  unsigned char bad, bpc, cpp, had_jfif, colortransform, id_rgb;
  /** (Horiz<<4+Vert) sampling factor for the first color component. Usually
   * 0x11, but TIFF defaults to 0x22.
   */
  unsigned char hvs;
  /*Image::Sampled::dimen_t*/slen_t height, width;
  /** Offset of byte just _after_ the first SOF marker (FF C0 or alike)
   * from the beginning of the file.
   */
  slen_t SOF_offs;
};

extern char const*jai_errors[];
#if 0
  extern void jai_parse_jpeg(struct gfxinfo *result, Filter::FlatR *f);
  extern void jai_parse_jpeg(struct gfxinfo *result, FILE *f);
#else
  extern void jai_parse_jpeg(struct jai_gfxinfo *result, DecoderTeller *fp, bool must_be_baseline=true);
  /** Doesn't treat `-' as a special filename. @return 0, 1, or -1 on I/O error */
  extern int jai_is_baseline_jpeg(char const* filename);
  extern int jai_is_baseline_jpeg(/*DecoderTeller*/ Filter::UngetFILED *fp);
#endif

#endif

#endif /* in_jai.hpp */