export(3x)

export3x

Functionality for writing images into files libafterimage/export.h

Usage

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

NAMEexport

- Image output into different file formats.

Nameexport_grayscale

- save image as grayscale. EXPORT_ALPHA - save alpha channel if format permits EXPORT_APPEND - if format allows multiple images - image will be appended

Function

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

Source

#define EXPORT_GRAYSCALE (0x01<<0) #define EXPORT_ALPHA (0x01<<1) #define EXPORT_APPEND (0x01<<3) /* adds subimage */ #define EXPORT_ANIMATION_REPEATS (0x01<<4) /* number of loops to repeat GIF animation */ /*****/

libAfterImage/ASPngExportParams

NAMEASPngExportParams

- parameters for export into PNG file.

Source

typedef struct {
ASImageFileTypes type;
ASFlagType flags ;
int compression ; }ASPngExportParams ;

libAfterImage/ASJpegExportParams

NAMEASJpegExportParams

- parameters for export into JPEG file.

Source

typedef struct {
ASImageFileTypes type;
ASFlagType flags ;
int quality ; }ASJpegExportParams ;

libAfterImage/ASGifExportParams

NAMEASGifExportParams

- parameters for export into GIF file.

Source

typedef struct {
ASImageFileTypes type;
ASFlagType flags ;
int dither ;
int opaque_threshold ;
unsigned short animate_delay ;
unsigned short animate_repeats ; }ASGifExportParams ;

libAfterImage/ASTiffExportParams

NAMEASTiffExportParams

- parameters for export into TIFF file.

Source

typedef struct {
ASImageFileTypes type;
ASFlagType flags ;
CARD32 rows_per_strip ;

/* these are suitable compressions : */ #define TIFF_COMPRESSION_NONE 1 #define TIFF_COMPRESSION_OJPEG 6 /* !6.0 JPEG */ #define TIFF_COMPRESSION_JPEG 7 #define TIFF_COMPRESSION_PACKBITS 32773 /* Macintosh RLE */ #define TIFF_COMPRESSION_DEFLATE 32946 /* Deflate compression */
/* you should be able to use other values from tiff.h as well */
CARD32 compression_type ;
int jpeg_quality ;

int opaque_threshold ; }ASTiffExportParams ;

libAfterImage/ASImageExportParams

NAMEASImageExportParams

- union of structures holding parameters for export into different file formats.

Overview

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

Source

typedef union ASImageExportParams {
ASImageFileTypes type;
ASXpmExportParams xpm;
ASPngExportParams png;
ASJpegExportParams jpeg;
ASGifExportParams gif;
ASTiffExportParams tiff; }ASImageExportParams;

libAfterImage/export/ASImage2file()

NAMEASImage2file()

Inputs

im

- Image to write out.

dir

- directory name to write file into (optional, could be NULL)

file

- file name with or without directory name.

type

- output file format. ( see ASImageFileTypes )

params

- pointer to ASImageExportParams union's member for the above type, with additional export parameters, such as quality, compression, etc. If NULL then all defaults will be used.

Return value

True on success. False - failure.

Overview

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

Notes

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

Examples

asmerge.c: ASMerge.3

Releases

11 releases since Debian 3.1 (Sarge); the text changed 10 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10
  9. 11
  10. 12
  11. 13

Author

Sasha Vasko <sasha at aftercode dot net> libAfterImage/ExportFlags

From libafterimage-dev 2.2.12-18 in Debian 13 (Trixie). Parsed by carta from the page's man source.