IM: old_im.h Source File

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  * $Id: old_im.h,v 1.1 2005/04/02 22:07:00 scuri Exp $
00006  */
00007 
00008 #ifndef __IM_OLD_H
00009 #define __IM_OLD_H
00010 
00011 #if defined(__cplusplus)
00012 extern "C" {
00013 #endif
00014 
00015 enum {IM_BMP, IM_PCX, IM_GIF, IM_TIF, IM_RAS, IM_SGI, IM_JPG, IM_LED, IM_TGA};
00016 enum {IM_NONE = 0x0000, IM_DEFAULT = 0x0100, IM_COMPRESSED = 0x0200};                        
00017 
00018 #define IM_ERR_READ IM_ERR_ACCESS
00019 #define IM_ERR_WRITE IM_ERR_ACCESS
00020 #define IM_ERR_TYPE IM_ERR_DATA
00021 #define IM_ERR_COMP IM_ERR_COMPRESS
00022 
00023 long imEncodeColor(unsigned char red, unsigned char green, unsigned char blue);
00024 void imDecodeColor(unsigned char* red, unsigned char* green, unsigned char* blue, long palette);
00025 int imFileFormat(char *filename, int* format);
00026 int imImageInfo(char *filename, int *width, int *height, int *type, int *palette_count);
00027 int imLoadRGB(char *filename, unsigned char *red, unsigned char *green, unsigned char *blue);
00028 int imSaveRGB(int width, int height, int format, unsigned char *red, unsigned char *green, unsigned char *blue, char *filename);
00029 int imLoadMap(char *filename, unsigned char *map, long *palette);
00030 int imSaveMap(int width, int height, int format, unsigned char *map, int palette_count, long *palette, char *filename);
00031 void imRGB2Map(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, int palette_count, long *palette);
00032 void imMap2RGB(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *red, unsigned char *green, unsigned char *blue);
00033 void imRGB2Gray(int width, int height, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *map, long *grays);
00034 void imMap2Gray(int width, int height, unsigned char *map, int palette_count, long *colors, unsigned char *grey_map, long *grays);
00035 void imResize(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map);
00036 void imStretch(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map);
00037 typedef int (*imCallback)(char *filename);
00038 int imRegisterCallback(imCallback cb, int cb_id, int format);
00039 
00040 #define IM_INTERRUPTED -1
00041 #define IM_ALL -1
00042 #define IM_COUNTER_CB   0
00043 typedef int (*imFileCounterCallback)(char *filename, int percent, int io);
00044 
00045 #define IM_RESOLUTION_CB   1
00046 typedef int (*imResolutionCallback)(char *filename, double* xres, double* yres, int* res_unit);
00047 
00048 enum {IM_RES_NONE, IM_RES_DPI, IM_RES_DPC};
00049 
00050 #define IM_GIF_TRANSPARENT_COLOR_CB 0
00051 typedef int (*imGifTranspIndex)(char *filename, unsigned char *transp_index);
00052 
00053 #define IM_TIF_IMAGE_DESCRIPTION_CB 0
00054 typedef int (*imTiffImageDesc)(char *filename, char* img_desc);
00055 
00056 #if defined(__cplusplus)
00057 }
00058 #endif
00059 
00060 #endif