#include <libmtpixel.h>
This program is compiled and run by using:
gcc hello.c -lmtpixel -o hello
libmtpixel can handle the following file formats:
File types PNG, JPEG, JPEG2000, TIFF, XPM, and GIF are handled by external libraries: libpng,
libjpeg, libopenjpeg, libtiff, libXpm, and libungif/giflib. As a result of this, the efficiency of
these file operations will depend on the version of these libraries installed
on your system.
For example, libtiff is unable to read certain old JPEG compressed TIFF files.
For more information on these libraries, consult their respective websites:
int main()
{
char *txt = "Hello World", *font_filename = "/usr/X11R6/lib/fonts/truetype/arial.ttf";
}
mtpaint_init();
mtpaint_new_image(320, 240, 256, 0, 3);
mtpaint_col_a(7);
mtpaint_text(txt, strlen(txt), font_filename, "ASCII", 50, 0, 11, MT_TEXT_SHRINK);
mtpaint_paste(0, 0);
mtpaint_file_save("test.png", FT_PNG, 5);
mtpaint_quit();
return 0;
./hello
A.2 Supported File Types
Format
Load
Save
BMP
All.
Indexed palette. 24 bit RGB including alpha channel.
GIF
All single images.
Indexed palette including transparency index. Animations via Gifsicle.
JPEG
All.
24 bit RGB.
JPEG2000
All.
24 bit RGB.
LSS16 (*.lss)
All.
Indexed palette (16 colours), 18 bits per colour (6 per RGB channel).
PNG
All.
Indexed palette. 24 bit RGB. Including transparency index,
alpha/selection/mask channels.
TGA
All.
Indexed palette. 24 bit RGB including alpha channel.
TIFF
All.
Indexed palette. 24 bit RGB. Including alpha channel.
XBM
All.
2 colour indexed palette including hotspot.
XPM
All.
Indexed palette. 24 bit RGB. Including transparency index and hotspot.
libpng
http://www.libpng.org/pub/png/libpng.html
libjpeg
http://www.ijg.org/
libopenjpeg
http://www.openjpeg.org/
libtiff
http://www.libtiff.org/
libXpm
http://www.inria.fr/koala/lehors/xpm.html or
http://www.x.org/ or
http://www.xfree86.org/
libungif / giflib
http://libungif.sourceforge.net/doc/