export - functionality for writing images into files libAfterImage/export.h
- Image output into different file formats.
Structures : ASXpmExportParams ASPngExportParams ASJpegExportParams ASGifExportParams ASImageExportParams Functions : ASImage2file() Other libAfterImage modules : ascmap.h asfont.h asimage.h asvisual.h blender.h export.h import.h transform.h ximage.h
Sasha Vasko <sasha at aftercode dot net> libAfterImage/ExportFlags
- save image as grayscale. EXPORT_ALPHA - save alpha channel if format permits EXPORT_APPEND - if format allows multiple images - image will be appended
Some common flags that could be used while writing images into different file formats.
#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
- parameters for export into PNG file.
typedef struct { ASImageFileTypes type; ASFlagType flags ; int compression ; }ASPngExportParams ; libAfterImage/ASJpegExportParams
- parameters for export into JPEG file.
typedef struct { ASImageFileTypes type; ASFlagType flags ; int quality ; }ASJpegExportParams ; libAfterImage/ASGifExportParams
- parameters for export into GIF file.
typedef struct { ASImageFileTypes type; ASFlagType flags ; int dither ; int opaque_threshold ; unsigned short animate_delay ; unsigned short animate_repeats ; }ASGifExportParams ; libAfterImage/ASTiffExportParams
- parameters for export into TIFF file.
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
- union of structures holding parameters for export into different file formats.
Treatment of this union depends on what type of export was requested.
ASImageFileTypes
typedef union ASImageExportParams { ASImageFileTypes type; ASXpmExportParams xpm; ASPngExportParams png; ASJpegExportParams jpeg; ASGifExportParams gif; ASTiffExportParams tiff; }ASImageExportParams; libAfterImage/export/ASImage2file()
Bool ASImage2file( ASImage *im, const char *dir, const char *file, ASImageFileTypes type, ASImageExportParams *params );
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.
True on success. False - failure.
ASImage2file will construct filename out of dir and file components and then will call specific filter to write out file in requested format.
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.
asmerge.c: ASMerge.3
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.