[Verse-dev] img_img 0.1 release

Robin Rowe rower at MovieEditor.com
Sun Oct 24 04:26:34 CEST 2004


This is the first 0.1 release of img_img, a new image format library to
enable programmers to read and write image file formats easily.

http://sourceforge.net/project/shownotes.php?release_id=277425

This version of img_img has only been built using Microsoft VC++ 6, but is
designed to port easily and will eventually be available on all major
platforms. This is an experimental early adopter release for programmers.
There will be evolutionary changes.

The img_img library uses plug-ins to read/write images to a flat RGB buffer
in memory. img_img includes a command-line tool that will be useful for
doing image format conversions, a bit like ImageMagick's 'convert' tool.
This first release only includes a plug-in for the PPM format (8 and
16-bit), but many more formats are to follow. OpenEXR and JPEG2000 are
expected next.

The fundamental img_img structure that holds images is called ImgData.

struct ImgData
{    void* raster;
     unsigned width;
     unsigned height;
     unsigned channels;
     unsigned byte_depth;
     CHANNEL_TYPE channel_type;
};

The img_img library moves images between files and this structure. The type
of raster depends on the file being manipulated. img_img can handle 8-bit,
16-bit, and 32-bit rasters.

This release of img_img supports compiled-in use of the library. A future
version will include img_server, a wrapper daemon that will provide rasters
in shared memory and have a socket-based control protocol. Using img_server
will make it possible for multiple applications to manipulate images in
memory. CinePaint and Blender's Verse project intend to use img_img in the
future.

Below is a simple C++ code example of using img_img. For more details see
the source of main.cpp, part of the img_img command-line tool.

Robin
-------------------------------------------------------------------
Robin.Rowe at MovieEditor.com   Beverly Hills, California
www.CinePaint.org - Open source digital motion picture software

// initialization:
 ImgImg img_img;
 ImgPluginData plugin_data;
 memset(&plugin_data,0,sizeof(plugin_data));// Important to zero first!
// specify file to read and plug-in to use:
 plugin_data.filename = "test8.ppm";
 plugin_data.libname = "img_ppm";
// read the file into an RGB buffer:
 bool ok = img_img.Read(plugin_data);
// expose the raw RGB buffer:
 ImgData& img_data=img_img.GetImgData();
 ... do whatever you want to the flat RGB raster in memory ...
// write this 8-bit raster as a 16-bit ppm:
 plugin_data.filename = "test16.ppm";
 plugin_data.write_options = "bits=16";
 ok = img_img.Write(plugin_data);


###



More information about the Verse-dev mailing list