Skip to content

craigk5n/ilib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ilib

Copyright (C) 2001-2016 Craig Knudsen, craig@k5n.us http://www.k5n.us/Ilib.php

Ilib is a library (and some tools and examples) written in C that can read, create, manipulate and save images. It is capable of using X11 BDF fonts for drawing text. That means you get lots (208, to be exact) of fonts to use. You can even create your own if you know how to create an X11 BDF font. It can read and write PPM, XPM, GIF, PNG and JPG image format. It can read (but not yet write) BMP.

Note: This code was originally developed in the late 1990s so some the C source code was written for "classic" C before ANSI C was standard everywhere. So functions are defined differently (not ANSI-style).

API Documentation

The API documentation is generated from the source code and can be found in Ilib.html. You can view it online here. Note that the API is modeled after a subset of the X11 API drawing functions.

Perl Module

The Ilib perl module is now included with the distribution. It is not compiled or installed by default. This perl module builds like all other perl modules. AFTER installing the rest of Ilib (see instructions below), do the following:

  cd perl
  perl Makefile.PL
  make
  make install

(Normally, you will need to be root to install.)

Extras

Compiling (Mac):

Install giflib, libjpeg and libpng if you want to be able to read or write images in those formats. The easiest way to do this is with brew:

brew install giflib
brew install libjpeg
brew install libpng

Edit Makefile and change DYNAMIC to NO. Then...

make makefiles
make -i all

You'll get errors on not being able to find the shared libraries since the makefiles are still somewhat broken for Mac. But this will build the static libIlib.a file. You can compile some of the sample client code using make static in each example client's directory.

Compiling (Linux, Unix):

In order to make use of GIF, PNG or JPEG, you need to obtain the add-on libraries mentioned above. (First, check your system. If you have a Linux distribution, it's likely to have some of these installed.)

To do so on ubuntu:

yum install libjpeg-devel libpng-devel libgif-devel giflib-devel

Edit the definitions of LIBS, DEFINES, INCLUDES to indicate which libraries are installed. Change PREFIX if you don't want to install in /usr/local.

Also, edit the values of CC and RANLIB if needed.

Then, just type "make makefiles; make all" to build everthing. Both a shared and static library will be buily in the "lib" directory. Type "make install" to install everything (defaults to /usr/local).

Look at the programs in "examples" and "clients" as examples how to use Ilib. The example program "iconvert" shows a handy tool for converting images between different formats and "isample" shows how to draw text, lines, etc.

Compiling (Win32):

You should be able to use the Cygnus Win32 package to build Ilib using the provided makefiles. I have not tested this since Ilib v1.0.

Ilib-1.1.0 was built on Win95 with MS Visual Developer (Visual C++). GIFLIB was also built with MS Visual Developer. Sorry, I'm not going to try and provide makefiles or project files for this.

TODO

  • Automake support, obviously...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published