ieC++ - Image Engine C++ library
C++ C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


ieC++ - Image Engine C++ library v2.2
Copyright 2015 by Markus Dimdal and FMJ-Software.


The ieC++ library is a C++ software development kit with the dual aim of serving as the basis for image viewing and image file format conversion applications with various optional image processing functionality. It is the core of, FMJ-Software’s Image Eye and Any image products.

The ieC++ library is made available for non-commercial use under GPL v3.

The source code is hosted here:

/ Markus / FMJ-Software /

File organization:

The files compromising the library are organized in directories as follows:

ReadMe.txt				This file.
gpl.txt					License terms (GPLv3).
ieC++.sln				Visual C++ 2015 workspace for the following sample apps:
EyeConv.*				Project & source for a simple PNG/GIF format converter.
EyeView.*				Project & source for a simple PNG/GIF image viewer.

Bin\					< Compiled binaries >

Src\					< Source code >

Src\Fmt\				< File format handlers >

Setting up the library files in your project

First add all the files from the Src folder to your project (a handful of the files are optional really, but don’t worry about that now). Next add those file format handlers that you want from the Src\Fmt folder. The file names should be enough to tell you what is what.

Note that the PNG handler (ief_png.cpp) will require that you also link with the zlib compression library and that if you want write support for JPEG (ief_jpeg.cpp) then you also need to link with the IJG’s jpegsr6b library. Several formats are dependent on text-meta data handlers, so also add ief_xmp.* and ief_iptc.*. For reading JPEG’s, you need all the files ief_jpeg_*.*.

Next, wherever you want to use ieC++ in your code, add an #include "ieC++.h"
Before reading any image files you need to register the file format handlers like e.g.: ieAddModule(png);

Both 32-bit (Win32) and 64-bit (x64) Windows are supported.
C++ exception handling is not required.

Several pieces of functionality is optional and can be disabled using project preprocessor definitions – c.f. ieC++.h for IE_NO_EXPORT, IE_NO_DRAW, IE_NO_DIRCACHE and IE_NO_IMAGECACHE.

Most functions return an error code of type ieResult. See ieErrors.h for possible values. Success or failure can be checked with the inline functions ieIsOk(code) and isFailed(code).

Class overview

There are a number of classes used to represent images, information about image files, mechanisms to read and write images, and to display images. For a detailed listing of member functions and parameters, please refer to the header files. Here is only given a short functional overview of the most important classes.

The image base class – ieImage

This class represents a bitmapped image. It is an abstract base class – in reality images will be instances as of one out of many derived classes, depending on the pixel format (see the enum iePixelFormat which defines the true-color pixel formats BGRA, wBGRA, fBGRA, the grayscale formats L, wL, fL and the palette indexed format CLUT) and whether they you want them to be possible to draw to screen or not.

Create an image using the static factory function ieImage::Create(pixel-format, with-height, …)
An image instance can be queried for an interface for raw pixel access, e.g. BGRA() returns an ieIImage_BGRA *.
Like many of the other classes, it is reference counted, so use Release() when you’re don with it.

An optional text meta data access interface is queried by Text() which returns an ieITextInfo interface which you can use to query for any of the text meta data types defined in the enum ieTextInfoType.

The image display class – ieImageDisp

This is a container for simplifying image display. It always holds an ‘original’ image – the image passed to the ieImageDisp constructor. Then there’s also a ‘display’ image, which is the one that is actually drawn to screen. The two can be one and the same. The display image, with any intermediary stages, is calculated as and when needed. This can include doing color adjustments, zooming, animation compositing (animated gif/apng) and conversion to a format that can be drawn (e.g. dithering of wBGRA to a draweable BGRA). All without modifying the original.

The image file manager class – ieFileManager

This class is intended as a global manager (one instance per process) for handling loading and saving images, including asynchronous functions for caching and preloading of images, enumeration of image files in a folder, and speculative decoding – techniques that significantly increase the subjective performance of an image viewer.

The image file reader class – ieIFileReader

Given an file on disk, the file manager can give you an instance of a subclass exposing the ieIFileReader interface. Think of it as an extended ‘file handle’. First call ReadMeta() to read in file meta data. This does not read in any bitmap data into memory. You can now query various information such as image dimensions, pixel format and text meta data. Next, you can create an image of appropriate dimensions and pixel format and pass it to ReadImage() to read in the bitmap. Alternatively you can use ieFileManager::ReadImage to do the whole procedure for you.

Writing files – ieFileManager

The file manager also exposes functions for writing to various file formats as well as enumerating the available formats and sub-formats. Most formats allows each pixel to be stored in different data formats – see ieClrFormat (use  IE_FORMAT_AUTO to auto-select the best data format). Some formats also accepts a compression param.