A Survey of Gaussian Convolution Algorithms
imageio.h
Go to the documentation of this file.
1 
20 #ifndef _IMAGEIO_H_
21 #define _IMAGEIO_H_
22 
23 #include <stdio.h>
24 #include "basic.h"
25 
27 #define MAX_IMAGE_SIZE 10000
28 
29 
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 
32 /* Build string macros listing the supported formats */
33 #ifdef USE_LIBJPEG
34 #define SUPPORTEDSTRING_JPEG "/JPEG"
35 #else
36 #define SUPPORTEDSTRING_JPEG ""
37 #endif
38 #ifdef USE_LIBPNG
39 #define SUPPORTEDSTRING_PNG "/PNG"
40 #else
41 #define SUPPORTEDSTRING_PNG ""
42 #endif
43 #ifdef USE_LIBTIFF
44 #define SUPPORTEDSTRING_TIFF "/TIFF"
45 #else
46 #define SUPPORTEDSTRING_TIFF ""
47 #endif
48 
49 /* Definitions for specifying image formats */
50 #define IMAGEIO_U8 0x0000
51 #define IMAGEIO_SINGLE 0x0001
52 #define IMAGEIO_FLOAT IMAGEIO_SINGLE
53 #define IMAGEIO_DOUBLE 0x0002
54 #define IMAGEIO_STRIP_ALPHA 0x0010
55 #define IMAGEIO_BGRFLIP 0x0020
56 #define IMAGEIO_AFLIP 0x0040
57 #define IMAGEIO_GRAYSCALE 0x0080
58 #define IMAGEIO_GRAY IMAGEIO_GRAYSCALE
59 #define IMAGEIO_PLANAR 0x0100
60 #define IMAGEIO_COLUMNMAJOR 0x0200
61 #define IMAGEIO_RGB (IMAGEIO_STRIP_ALPHA)
62 #define IMAGEIO_BGR (IMAGEIO_STRIP_ALPHA | IMAGEIO_BGRFLIP)
63 #define IMAGEIO_RGBA 0x0000
64 #define IMAGEIO_BGRA (IMAGEIO_BGRFLIP)
65 #define IMAGEIO_ARGB (IMAGEIO_AFLIP)
66 #define IMAGEIO_ABGR (IMAGEIO_BGRFLIP | IMAGEIO_AFLIP)
67 
68 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
69 
70 
79 #define READIMAGE_FORMATS_SUPPORTED \
80  "BMP" SUPPORTEDSTRING_JPEG SUPPORTEDSTRING_PNG SUPPORTEDSTRING_TIFF
81 
83 #define WRITEIMAGE_FORMATS_SUPPORTED \
84  "BMP" SUPPORTEDSTRING_JPEG SUPPORTEDSTRING_PNG SUPPORTEDSTRING_TIFF
85 
86 #ifndef _CRT_SECURE_NO_WARNINGS
87 
88 #define _CRT_SECURE_NO_WARNINGS
89 #endif
90 
91 int identify_image_type(char *type, const char *filename);
92 
93 void *read_image(int *width, int *height,
94  const char *filename, unsigned format);
95 
96 int write_image(void *image, int width, int height,
97  const char *filename, unsigned format, int quality);
98 
99 #endif /* _IMAGEIO_H_ */