IM: old_im.h Source File
From IM - An Imaging Tool
old_im.h
Go to the documentation of this file.00001 /** \file 00002 * \brief Old API 00003 * 00004 * See Copyright Notice in im_lib.h 00005 */ 00006 00007 #ifndef __IM_OLD_H 00008 #define __IM_OLD_H 00009 00010 #if defined(__cplusplus) 00011 extern "C" { 00012 #endif 00013 00014 enum {IM_BMP, IM_PCX, IM_GIF, IM_TIF, IM_RAS, IM_SGI, IM_JPG, IM_LED, IM_TGA}; 00015 enum {IM_NONE = 0x0000, IM_DEFAULT = 0x0100, IM_COMPRESSED = 0x0200}; 00016 00017 #define IM_ERR_READ IM_ERR_ACCESS 00018 #define IM_ERR_WRITE IM_ERR_ACCESS 00019 #define IM_ERR_TYPE IM_ERR_DATA 00020 #define IM_ERR_COMP IM_ERR_COMPRESS 00021 00022 long imEncodeColor(unsigned char red, unsigned char green, unsigned char blue); 00023 void imDecodeColor(unsigned char* red, unsigned char* green, unsigned char* blue, long palette); 00024 int imFileFormat(char *filename, int* format); 00025 int imImageInfo(char *filename, int *width, int *height, int *type, int *palette_count); 00026 int imLoadRGB(char *filename, unsigned char *red, unsigned char *green, unsigned char *blue); 00027 int imSaveRGB(int width, int height, int format, unsigned char *red, unsigned char *green, unsigned char *blue, char *filename); 00028 int imLoadMap(char *filename, unsigned char *map, long *palette); 00029 int imSaveMap(int width, int height, int format, unsigned char *map, int palette_count, long *palette, char *filename); 00030 void imRGB2Map(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, int palette_count, long *palette); 00031 void imMap2RGB(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *red, unsigned char *green, unsigned char *blue); 00032 void imRGB2Gray(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, long *grays); 00033 void imMap2Gray(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *grey_map, long *grays); 00034 void imResize(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map); 00035 void imStretch(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map); 00036 typedef int (*imCallback)(char *filename); 00037 int imRegisterCallback(imCallback cb, int cb_id, int format); 00038 00039 #define IM_INTERRUPTED -1 00040 #define IM_ALL -1 00041 #define IM_COUNTER_CB 0 00042 typedef int (*imFileCounterCallback)(char *filename, int percent, int io); 00043 00044 #define IM_RESOLUTION_CB 1 00045 typedef int (*imResolutionCallback)(char *filename, double* xres, double* yres, int* res_unit); 00046 00047 enum {IM_RES_NONE, IM_RES_DPI, IM_RES_DPC}; 00048 00049 #define IM_GIF_TRANSPARENT_COLOR_CB 0 00050 typedef int (*imGifTranspIndex)(char *filename, unsigned char *transp_index); 00051 00052 #define IM_TIF_IMAGE_DESCRIPTION_CB 0 00053 typedef int (*imTiffImageDesc)(char *filename, char* img_desc); 00054 00055 #if defined(__cplusplus) 00056 } 00057 #endif 00058 00059 #endif