next up previous contents
Next: 1.3 What's new in Up: 1. Introduction Previous: 1.1 Why use VIPS?   Contents

1.2 I/O styles

The I/O system supports three styles of input-output.

Whole-image I/O (WIO)
This style is a largely a left-over from VIPS 6.x. WIO image-processing operations have all of the input image given to them in a large memory array. They can read any of the input pels at will with simple pointer arithmetic.

Partial-image I/O (PIO)
In this style operations only have a small part of the input image available to them at any time. When PIO operations are joined together into a pipeline, images flow through them in small pieces, with all the operations in a pipeline executing at the same time.

In-place
The third style allows pels to be read and written anywhere in the image at any time, and is used by the VIPS in-place operations, such as im_fastline(). You should only use it for operations which would just be impossibly inefficient to write with either of the other two styles.

WIO operations are easy to program, but slow and inflexible when images become large. PIO operations are harder to program, but scale well as images become larger, and are automatically parallelized by the VIPS I/O system.

If you can face it, and if your algorithm can be expressed in this way, you should write your operations using PIO. Whichever you choose, applications which call your operation will see no difference, except in execution speed.

If your image processing operation performs no coordinate transformations, that is, if your output image is the same size as your input image or images, and if each output pixel depends only upon the pixel at the corresponding position in the input images, then you can use the im_wrapone() and im_wrapmany() operations. These take a simple buffer-processing operation supplied by you and wrap it up as a full-blown PIO operation. See §3.1.


next up previous contents
Next: 1.3 What's new in Up: 1. Introduction Previous: 1.1 Why use VIPS?   Contents
John Cupitt 2004-11-02