www.fgks.org   »   [go: up one dir, main page]

Skip to content

rahra/cairo_xpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

cairo_xpm

This is an implementation of the XPM 3 (color gradients only) format to export a Cairo surface to XPM. It uses the same function prototypes as Cairo's PNG support.

The implementation is done on top of the Cairo API. It does not access Cairo-internal functions.

The functions with the following prototypes are implemented:

cairo_status_t cairo_image_surface_write_to_xpm_mem(cairo_surface_t *sfc, unsigned char **data, size_t *len);
cairo_status_t cairo_image_surface_write_to_xpm_stream(cairo_surface_t *sfc, cairo_write_func_t write_func, void *closure);
cairo_status_t cairo_image_surface_write_to_xpm(cairo_surface_t *sfc, const char *filename);

To compile as an object file to link against your code use the following statement:

gcc -Wall -g `pkg-config --cflags --libs cairo` -c cairo_xpm.c 

To compile as standalone tool including the main() function compile as follows:

gcc -Wall -g `pkg-config --cflags --libs cairo` -DCAIRO_XPM_MAIN -o cairo_xpm cairo_xpm.c

Please have a look at the comments within the source files for further details. Don't hesitate to contact me at bf@abenteuerland.at.

About

Create XPM data from a Cairo surface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages