Linear Methods for Image Interpolation
|
00001 00016 #ifndef _IMAGEIO_H_ 00017 #define _IMAGEIO_H_ 00018 00019 #include <stdio.h> 00020 #include "basic.h" 00021 00023 #define MAX_IMAGE_SIZE 10000 00024 00025 00026 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00027 00028 /* Build string macros listing the supported formats */ 00029 #ifdef LIBJPEG_SUPPORT 00030 #define SUPPORTEDSTRING_JPEG "/JPEG" 00031 #else 00032 #define SUPPORTEDSTRING_JPEG "" 00033 #endif 00034 #ifdef LIBPNG_SUPPORT 00035 #define SUPPORTEDSTRING_PNG "/PNG" 00036 #else 00037 #define SUPPORTEDSTRING_PNG "" 00038 #endif 00039 #ifdef LIBTIFF_SUPPORT 00040 #define SUPPORTEDSTRING_TIFF "/TIFF" 00041 #else 00042 #define SUPPORTEDSTRING_TIFF "" 00043 #endif 00044 00045 /* Definitions for specifying image formats */ 00046 #define IMAGEIO_U8 0x0000 00047 #define IMAGEIO_SINGLE 0x0001 00048 #define IMAGEIO_FLOAT IMAGEIO_SINGLE 00049 #define IMAGEIO_DOUBLE 0x0002 00050 #define IMAGEIO_STRIP_ALPHA 0x0010 00051 #define IMAGEIO_BGRFLIP 0x0020 00052 #define IMAGEIO_AFLIP 0x0040 00053 #define IMAGEIO_GRAYSCALE 0x0080 00054 #define IMAGEIO_GRAY IMAGEIO_GRAYSCALE 00055 #define IMAGEIO_PLANAR 0x0100 00056 #define IMAGEIO_COLUMNMAJOR 0x0200 00057 #define IMAGEIO_RGB (IMAGEIO_STRIP_ALPHA) 00058 #define IMAGEIO_BGR (IMAGEIO_STRIP_ALPHA | IMAGEIO_BGRFLIP) 00059 #define IMAGEIO_RGBA 0x0000 00060 #define IMAGEIO_BGRA (IMAGEIO_BGRFLIP) 00061 #define IMAGEIO_ARGB (IMAGEIO_AFLIP) 00062 #define IMAGEIO_ABGR (IMAGEIO_BGRFLIP | IMAGEIO_AFLIP) 00063 00064 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00065 00066 00075 #define READIMAGE_FORMATS_SUPPORTED \ 00076 "BMP" SUPPORTEDSTRING_JPEG SUPPORTEDSTRING_PNG SUPPORTEDSTRING_TIFF 00077 00079 #define WRITEIMAGE_FORMATS_SUPPORTED \ 00080 "BMP" SUPPORTEDSTRING_JPEG SUPPORTEDSTRING_PNG SUPPORTEDSTRING_TIFF 00081 00082 #ifndef _CRT_SECURE_NO_WARNINGS 00083 00084 #define _CRT_SECURE_NO_WARNINGS 00085 #endif 00086 00087 int IdentifyImageType(char *Type, const char *FileName); 00088 00089 void *ReadImage(int *Width, int *Height, 00090 const char *FileName, unsigned Format); 00091 00092 int WriteImage(void *Image, int Width, int Height, 00093 const char *FileName, unsigned Format, int Quality); 00094 00095 #endif /* _IMAGEIO_H_ */