1export(1)                AfterStep X11 window manager                export(1)
2
3
4

NAME

6       export -  functionality  for  writing  images  into  files  libAfterIm‐
7       age/export.h
8

NAMEexport

10       - Image output into different file formats.
11
12

SEE ALSO

14       Structures :
15                ASXpmExportParams
16                ASPngExportParams
17                ASJpegExportParams
18                ASGifExportParams
19                ASImageExportParams
20
21       Functions :
22               ASImage2file()
23
24       Other libAfterImage modules :
25                ascmap.h asfont.h asimage.h asvisual.h blender.h export.h
26                import.h transform.h ximage.h
27

AUTHOR

29       Sasha Vasko <sasha at aftercode dot net>
30

NAMEEXPORT_GRAYSCALE

32       - save image as grayscale.  EXPORT_ALPHA - save alpha channel if format
33       permits  EXPORT_APPEND  - if format allows multiple images - image will
34       be appended
35
36

FUNCTION

38       Some common flags that could be used while writing images into
39       different file formats.
40

SOURCE

42       Source :
43       #define EXPORT_GRAYSCALE            (0x01<<0)
44       #define EXPORT_ALPHA                (0x01<<1)
45       #define EXPORT_APPEND               (0x01<<3)  /* adds subimage  */
46       #define EXPORT_ANIMATION_REPEATS    (0x01<<4)  /* number of loops to repeat GIF animation */
47       /*****/
48

NAMEASPngExportParams

50       - parameters for export into PNG file.
51
52

SOURCE

54       Source :
55       typedef struct
56       {
57           ASImageFileTypes type;
58           ASFlagType flags ;
59           int compression ;
60       }ASPngExportParams ;
61

NAMEASJpegExportParams

63       - parameters for export into JPEG file.
64
65

SOURCE

67       Source :
68       typedef struct
69       {
70           ASImageFileTypes type;
71           ASFlagType flags ;
72           int quality ;
73       }ASJpegExportParams ;
74

NAMEASGifExportParams

76       - parameters for export into GIF file.
77
78

SOURCE

80       Source :
81       typedef struct
82       {
83           ASImageFileTypes type;
84           ASFlagType flags ;
85           int dither ;
86           int opaque_threshold ;
87           unsigned short animate_delay ;
88           unsigned short animate_repeats ;
89       }ASGifExportParams ;
90

NAMEASTiffExportParams

92       - parameters for export into TIFF file.
93
94

SOURCE

96       Source :
97       typedef struct
98       {
99           ASImageFileTypes type;
100           ASFlagType flags ;
101           CARD32 rows_per_strip ;
102
103       /* these are suitable compressions : */
104       #define TIFF_COMPRESSION_NONE       1
105       #define TIFF_COMPRESSION_OJPEG      6   /* !6.0 JPEG */
106       #define TIFF_COMPRESSION_JPEG       7
107       #define TIFF_COMPRESSION_PACKBITS   32773   /* Macintosh RLE */
108       #define TIFF_COMPRESSION_DEFLATE    32946   /* Deflate compression */
109           /* you should be able to use other values from tiff.h as well */
110           CARD32 compression_type ;
111           int jpeg_quality ;
112
113           int opaque_threshold ;
114       }ASTiffExportParams ;
115

NAMEASImageExportParams

117       - union of structures holding parameters for export into different file
118       formats.
119
120

DESCRIPTION

122       Treatment of this union depends on what type of export was requested.
123

SEE ALSO

125       ASImageFileTypes
126

SOURCE

128       Source :
129       typedef union ASImageExportParams
130       {
131           ASImageFileTypes   type;
132           ASXpmExportParams  xpm;
133           ASPngExportParams  png;
134           ASJpegExportParams jpeg;
135           ASGifExportParams  gif;
136           ASTiffExportParams tiff;
137       }ASImageExportParams;
138

NAMEASImage2file()

SYNOPSIS

141       Bool ASImage2file( ASImage *im, const char *dir, const char *file,
142                     ASImageFileTypes type, ASImageExportParams *params );
143

INPUTS

145       im     - Image to write out.
146
147       dir    - directory name to write file into (optional, could be NULL)
148
149       file   - file name with or without directory name.
150
151       type   - output file format. ( see ASImageFileTypes )
152
153       params -  pointer  to  ASImageExportParams union's member for the above
154              type, with additional export parameters, such as  quality,  com‐
155              pression, etc. If NULL then all defaults will be used.
156
157

RETURN VALUE

159       True on success. False - failure.
160

DESCRIPTION

162       ASImage2file will construct filename out of dir and file components
163       and then will call specific filter to write out file in requested
164       format.
165

NOTES

167       Some formats support compression, others support lossy compression,
168       yet others allows you to limit number of colors and colordepth.
169       Each specific filter will try to interpret those parameters in its
170       own way.
171

EXAMPLE

173       asmerge.c: ASMerge.3
174
175
176
1773rd Berkeley Distribution      AfterStep v.2.2.6                     export(1)
Impressum