00001 #ifndef EXPORT_H_HEADER_INCLUDED
00002 #define EXPORT_H_HEADER_INCLUDED
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #define EXPORT_GRAYSCALE (0x01<<0)
00043 #define EXPORT_ALPHA (0x01<<1)
00044 #define EXPORT_APPEND (0x01<<3)
00045 #define EXPORT_ANIMATION_REPEATS (0x01<<4)
00046
00047
00048
00049
00050
00051
00052
00053 typedef struct
00054 {
00055 ASImageFileTypes type;
00056 ASFlagType flags ;
00057 int dither ;
00058 int opaque_threshold ;
00059 int max_colors ;
00060 }ASXpmExportParams ;
00061
00062
00063
00064
00065
00066
00067 typedef struct
00068 {
00069 ASImageFileTypes type;
00070 ASFlagType flags ;
00071 int compression ;
00072 }ASPngExportParams ;
00073
00074
00075
00076
00077
00078
00079 typedef struct
00080 {
00081 ASImageFileTypes type;
00082 ASFlagType flags ;
00083 int quality ;
00084 }ASJpegExportParams ;
00085
00086
00087
00088
00089
00090
00091 typedef struct
00092 {
00093 ASImageFileTypes type;
00094 ASFlagType flags ;
00095 int dither ;
00096 int opaque_threshold ;
00097 unsigned short animate_delay ;
00098 unsigned short animate_repeats ;
00099 }ASGifExportParams ;
00100
00101
00102
00103
00104
00105
00106 typedef struct
00107 {
00108 ASImageFileTypes type;
00109 ASFlagType flags ;
00110 CARD32 rows_per_strip ;
00111
00112
00113 #define TIFF_COMPRESSION_NONE 1
00114 #define TIFF_COMPRESSION_OJPEG 6
00115 #define TIFF_COMPRESSION_JPEG 7
00116 #define TIFF_COMPRESSION_PACKBITS 32773
00117 #define TIFF_COMPRESSION_DEFLATE 32946
00118
00119 CARD32 compression_type ;
00120 int jpeg_quality ;
00121
00122 int opaque_threshold ;
00123 }ASTiffExportParams ;
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 typedef union ASImageExportParams
00136 {
00137 ASImageFileTypes type;
00138 ASXpmExportParams xpm;
00139 ASPngExportParams png;
00140 ASJpegExportParams jpeg;
00141 ASGifExportParams gif;
00142 ASTiffExportParams tiff;
00143 }ASImageExportParams;
00144
00145
00146 typedef Bool (*as_image_writer_func)( ASImage *im, const char *path,
00147 ASImageExportParams *params );
00148 extern as_image_writer_func as_image_file_writers[ASIT_Unknown];
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 Bool
00183 ASImage2file( ASImage *im, const char *dir, const char *file,
00184 ASImageFileTypes type, ASImageExportParams *params );
00185
00186
00187 Bool
00188 ASImage2PNGBuff( ASImage *im, CARD8 **buffer, int *size, ASImageExportParams *params );
00189 Bool
00190 ASImage2xpmRawBuff( ASImage *im, CARD8 **buffer, int *size, ASImageExportParams *params );
00191
00192
00193 Bool ASImage2xpm ( ASImage *im, const char *path, ASImageExportParams *params );
00194 Bool ASImage2png ( ASImage *im, const char *path, ASImageExportParams *params );
00195 Bool ASImage2jpeg( ASImage *im, const char *path, ASImageExportParams *params );
00196 Bool ASImage2xcf ( ASImage *im, const char *path, ASImageExportParams *params );
00197 Bool ASImage2ppm ( ASImage *im, const char *path, ASImageExportParams *params );
00198 Bool ASImage2bmp ( ASImage *im, const char *path, ASImageExportParams *params );
00199 Bool ASImage2ico ( ASImage *im, const char *path, ASImageExportParams *params );
00200 Bool ASImage2gif ( ASImage *im, const char *path, ASImageExportParams *params );
00201 Bool ASImage2tiff( ASImage *im, const char *path, ASImageExportParams *params );
00202
00203 #ifdef __cplusplus
00204 }
00205 #endif
00206
00207
00208 #endif