File: imagetypes.h

package info (click to toggle)
xloadimage 4.1-25
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 4,820 kB
  • sloc: ansic: 36,084; asm: 284; makefile: 282; sh: 280
file content (129 lines) | stat: -rw-r--r-- 3,674 bytes parent folder | download | duplicates (5)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* imagetypes.h:
 *
 * supported image types and the imagetypes array declaration.  when you
 * add a new image type, only the makefile and this header need to be
 * changed.
 *
 * jim frost 10.15.89
 */

#ifndef __IMAGETYPES_H__
#define __IMAGETYPES_H__

Image *niffLoad();
Image *facesLoad();
Image *pbmLoad();
Image *sunRasterLoad();
Image *gifLoad();
Image *rleLoad();
Image *xwdLoad();
Image *vffLoad();
Image *xbitmapLoad();
Image *xpixmapLoad();
Image *fbmLoad();
Image *pcxLoad();
Image *imgLoad();
Image *macLoad();
Image *cmuwmLoad();
Image *mcidasLoad();
#if 0
Image *pdsLoad();
#else
Image *vicarLoad();
#endif
#ifdef HAVE_LIBJPEG
Image *jpegLoad();
#endif
#ifdef HAVE_LIBTIFF
Image *tiffLoad();
#endif
#ifdef HAVE_LIBPNG
Image *pngLoad();
#endif

int niffIdent();
int facesIdent();
int pbmIdent();
int sunRasterIdent();
int gifIdent();
int rleIdent();
int xwdIdent();
int vffIdent();
int xbitmapIdent();
int xpixmapIdent();
int fbmIdent();
int pcxIdent();
int imgIdent();
int macIdent();
int cmuwmIdent();
int mcidasIdent();
#if 0
int pdsIdent();
#else
int vicarIdent();
#endif
#ifdef HAVE_LIBJPEG
int jpegIdent();
#endif
#ifdef HAVE_LIBTIFF
int tiffIdent();
#endif
#ifdef HAVE_LIBPNG
int pngIdent();
#endif

void niffDump();
#ifdef HAVE_LIBJPEG
void jpegDump();
#endif
#ifdef HAVE_LIBTIFF
void tiffDump();
#endif
void pbmDump();

/* some of these are order-dependent
 */

struct {
  int    (*identifier)(); /* print out image info if this kind of image */
  Image *(*loader)();     /* load image if this kind of image */
  void   (*dumper)();     /* dump image of this kind */
  char  *type;            /* image type name */
  char  *name;            /* name of this image format */
} ImageTypes[] = {
  {niffIdent,      niffLoad,      niffDump,    "niff",      "Native Image File Format (NIFF)"},
  {sunRasterIdent, sunRasterLoad, NULL,        "sunraster", "Sun Rasterfile"},
  {gifIdent,       gifLoad,       NULL,        "gif",       "GIF Image"},
#ifdef HAVE_LIBJPEG
  {jpegIdent,      jpegLoad,      jpegDump,    "jpeg",      "JFIF-style JPEG Image"},
#endif
#ifdef HAVE_LIBTIFF
  {tiffIdent,      tiffLoad,      tiffDump,    "tiff",      "TIFF image"},
#endif
#ifdef HAVE_LIBPNG
  {pngIdent,       pngLoad,       NULL,        "png",       "PNG image"},
#endif
  {fbmIdent,       fbmLoad,       NULL,        "fbm",       "FBM Image"},
  {cmuwmIdent,     cmuwmLoad,     NULL,        "cmuraster", "CMU WM Raster"},
  {pbmIdent,       pbmLoad,       pbmDump,     "pbm",       "Portable Bit Map (PBM, PGM, PPM)"},
  {facesIdent,     facesLoad,     NULL,        "faces",     "Faces Project"},
  {rleIdent,       rleLoad,       NULL,        "rle",       "Utah RLE Image"},
  {xwdIdent,       xwdLoad,       NULL,        "xwd",       "X Window Dump"},
  {vffIdent,       vffLoad,       NULL,        "vff",       "Sun Visualization File Format"},
  {mcidasIdent,    mcidasLoad,    NULL,        "mcidas",    "McIDAS areafile"},
#if 0
  {pdsIdent,       pdsLoad,       NULL,        "pds",       "PDS/VICAR Image"},
#else
  {vicarIdent,     vicarLoad,     NULL,        "vicar",     "VICAR Image"},
#endif
  {pcxIdent,       pcxLoad,       NULL,        "pcx",       "PC Paintbrush Image"},
  {imgIdent,       imgLoad,       NULL,        "gem",       "GEM Bit Image"},
  {macIdent,       macLoad,       NULL,        "macpaint",  "MacPaint Image"},
  {xpixmapIdent,   xpixmapLoad,   NULL,        "xpm",       "X Pixmap"},
  {xbitmapIdent,   xbitmapLoad,   NULL,        "xbm",       "X Bitmap"},
  {NULL,           NULL,          NULL,         NULL,        NULL}
};

void dumpImage (Image *image, char *type, char *filename, int verbose);

#endif /* __IMAGETYPES_H__ */