The I/O system supports three styles of input-output.
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.