"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/How-it-works.xml" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

How-it-works.xml  (vips-8.10.6):How-it-works.xml  (vips-8.11.0)
skipping to change at line 100 skipping to change at line 100
<para> <para>
VIPS operations read input images and write output images, performing some tra nsformation on the pixels. When an operation writes to an image the action it ta kes depends upon the image type. For example, if the image is a file on disc the n VIPS will start a data sink to stream pixels to the file, or if the image is a partial one then it will just attach start / generate / stop functions. VIPS operations read input images and write output images, performing some tra nsformation on the pixels. When an operation writes to an image the action it ta kes depends upon the image type. For example, if the image is a file on disc the n VIPS will start a data sink to stream pixels to the file, or if the image is a partial one then it will just attach start / generate / stop functions.
</para> </para>
<para> <para>
Like most threaded image processing systems, all VIPS operations have to be fr ee of side-effects. In other words, operations cannot modify images, they can on ly create new images. This could result in a lot of copying if an operation is o nly making a small change to a large image so VIPS has a set of mechanisms to co py image areas by just adjusting pointers. Most of the time no actual copying is necessary and you can perform operations on large images at low cost. Like most threaded image processing systems, all VIPS operations have to be fr ee of side-effects. In other words, operations cannot modify images, they can on ly create new images. This could result in a lot of copying if an operation is o nly making a small change to a large image so VIPS has a set of mechanisms to co py image areas by just adjusting pointers. Most of the time no actual copying is necessary and you can perform operations on large images at low cost.
</para> </para>
<para> <para>
<emphasis role="strong">Run-time code generation</emphasis> <emphasis role="strong">Run-time code generation</emphasis>
</para> </para>
<para> <para>
VIPS uses <link xlink:href="http://code.entropywave.com/orc/">Orc</link>, a ru n-time compiler, to generate code for some operations. For example, to compute a convolution on an 8-bit image, VIPS will examine the convolution matrix and the source image and generate a tiny program to calculate the convolution. This pro gram is then <quote>compiled</quote> to the vector instruction set for your CPU, for example SSE3 on most x86 processors. VIPS uses <ulink url="https://gstreamer.freedesktop.org/modules/orc.html">Orc< /ulink>, a run-time compiler, to generate code for some operations. For example, to compute a convolution on an 8-bit image, VIPS will examine the convolution m atrix and the source image and generate a tiny program to calculate the convolut ion. This program is then <quote>compiled</quote> to the vector instruction set for your CPU, for example SSE3 on most x86 processors.
</para> </para>
<para> <para>
Run-time vector code generation typically speeds operations up by a factor of three or four. Run-time vector code generation typically speeds operations up by a factor of three or four.
</para> </para>
<para> <para>
<emphasis role="strong">Joining operations together</emphasis> <emphasis role="strong">Joining operations together</emphasis>
</para> </para>
<para> <para>
The region create / prepare / prepare / free calls you use to get pixels from an image are an exact parallel to the start / generate / generate / stop calls t hat images use to create pixels. In fact, they are the same: a region on a parti al image holds the state created by that image for the generate function that wi ll fill the region with pixels. The region create / prepare / prepare / free calls you use to get pixels from an image are an exact parallel to the start / generate / generate / stop calls t hat images use to create pixels. In fact, they are the same: a region on a parti al image holds the state created by that image for the generate function that wi ll fill the region with pixels.
</para> </para>
skipping to change at line 138 skipping to change at line 138
</imageobject> </imageobject>
</inlinemediaobject> </inlinemediaobject>
</para> </para>
<para> <para>
Because the intermediate image is just a small region in memory, a pipeline of operations running together needs very little RAM. In fact, intermediates are s mall enough that they can fit in L2 cache on most machines, so an entire pipelin e can run without touching main memory. And finally, because each thread runs a very cheap copy of just the writeable state of the entire pipeline, threads can run with few locks. VIPS needs just four lock operations per output tile, regard less of the pipeline length or complexity. Because the intermediate image is just a small region in memory, a pipeline of operations running together needs very little RAM. In fact, intermediates are s mall enough that they can fit in L2 cache on most machines, so an entire pipelin e can run without touching main memory. And finally, because each thread runs a very cheap copy of just the writeable state of the entire pipeline, threads can run with few locks. VIPS needs just four lock operations per output tile, regard less of the pipeline length or complexity.
</para> </para>
<para> <para>
<emphasis role="strong">Data sources</emphasis> <emphasis role="strong">Data sources</emphasis>
</para> </para>
<para> <para>
VIPS has data sources which can supply pixels for processing from a variety of VIPS has data sources which can supply pixels for processing from a variety of
sources. VIPS can stream images from files in VIPS native format, from tiled TI sources. VIPS can stream images from files in VIPS native format, from tiled TI
FF files, from binary PPM/PGM/PBM/PFM, from Radiance (HDR) files, from FITS imag FF files, from binary PPM/PGM/PBM/PFM, from Radiance (HDR) files, from FITS imag
es and from tiled OpenEXR images. VIPS will automatically unpack other formats t es and from tiled OpenEXR images. VIPS will automatically unpack other formats t
o temporary disc files for you but this can obviously generate a lot of disc tra o temporary disc files for you but this can obviously generate a lot of disc tra
ffic. It also has a special sequential mode for streaming operations on non-rand ffic. It also has a special sequential mode for streaming operations on non-rand
om-access formats. Another refsect3 in these docs explains <link xlink:href="How om-access formats. Another refsect3 in these docs explains <ulink url="How-it-op
-it-opens-files.md.html">how libvips opens a file</link>. One of the sources use ens-files.md.html">how libvips opens a file</ulink>. One of the sources uses the
s the <link xlink:href="http://www.imagemagick.org">ImageMagick</link> (or optio <ulink
nally <link xlink:href="http://www.graphicsmagick.org">GraphicsMagick</link> lib url="http://www.imagemagick.org">ImageMagick</ulink> (or optionally <ulink
rary, so VIPS can read any image format that these libraries can read. url="http://www.graphicsmagick.org">GraphicsMagick</ulink> library, so VIPS ca
n read any image format that these libraries can read.
</para> </para>
<para> <para>
VIPS images are held on disc as a 64-byte header containing basic image inform ation like width, height, bands and format, then the image data as a single larg e block of pixels, left-to-right and top-to-bottom, then an XML extension block holding all the image metadata, such as ICC profiles and EXIF blocks. VIPS images are held on disc as a 64-byte header containing basic image inform ation like width, height, bands and format, then the image data as a single larg e block of pixels, left-to-right and top-to-bottom, then an XML extension block holding all the image metadata, such as ICC profiles and EXIF blocks.
</para> </para>
<para> <para>
When reading from a large VIPS image (or any other format with the same struct ure on disc, such as binary PPM), VIPS keeps a set of small rolling windows into the file, some small number of scanlines in size. As pixels are demanded by dif ferent threads VIPS will move these windows up and down the file. As a result, V IPS can process images much larger than RAM, even on 32-bit machines. When reading from a large VIPS image (or any other format with the same struct ure on disc, such as binary PPM), VIPS keeps a set of small rolling windows into the file, some small number of scanlines in size. As pixels are demanded by dif ferent threads VIPS will move these windows up and down the file. As a result, V IPS can process images much larger than RAM, even on 32-bit machines.
</para> </para>
<para> <para>
<emphasis role="strong">Data sinks</emphasis> <emphasis role="strong">Data sinks</emphasis>
</para> </para>
skipping to change at line 203 skipping to change at line 205
<para> <para>
(* Some vips operations DO have side effects, for example, <literal>vips_draw_ circle()</literal> will draw a circle on an image. These operations emit an <quo te>invalidate</quote> signal on the image they are called on and this signal mak es all downstream operations and caches drop their contents.) (* Some vips operations DO have side effects, for example, <literal>vips_draw_ circle()</literal> will draw a circle on an image. These operations emit an <quo te>invalidate</quote> signal on the image they are called on and this signal mak es all downstream operations and caches drop their contents.)
</para> </para>
<para> <para>
<emphasis role="strong">Operation database and APIs</emphasis> <emphasis role="strong">Operation database and APIs</emphasis>
</para> </para>
<para> <para>
VIPS has around 300 image processing operations written in this style. Each op eration is a GObject class. You can use the standard GObject calls to walk the c lass hierarchy and discover operations, and libvips adds a small amount of extra introspection metadata to handle things like optional arguments. VIPS has around 300 image processing operations written in this style. Each op eration is a GObject class. You can use the standard GObject calls to walk the c lass hierarchy and discover operations, and libvips adds a small amount of extra introspection metadata to handle things like optional arguments.
</para> </para>
<para> <para>
The <link xlink:href="using-from-c.html">C API</link> is a set of simple wrapp ers which create class instances for you. The <link xlink:href="using-from-cpp.h tml">C++ API</link> is a little fancier and adds things like automatic object li fetime management. The <link xlink:href="using-cli.html">command-line interface< /link> uses introspection to run any vips operation in the class hierarchy. The <ulink url="using-from-c.html">C API</ulink> is a set of simple wrappers w hich create class instances for you. The <ulink url="using-from-cpp.html">C++ AP I</ulink> is a little fancier and adds things like automatic object lifetime man agement. The <ulink url="using-cli.html"> command-line interface</ulink> uses in trospection to run any vips operation in the class hierarchy.
</para> </para>
<para> <para>
There are bindings for <link xlink:href="https://libvips.github.io/libvips/">m any other languages</link> on many platforms. Most of these bindings use the int rospection system to generate the binding at run-time. There are bindings for <ulink url="https://libvips.github.io/libvips">many oth er languages</ulink> on many platforms. Most of these bindings use the introspec tion system to generate the binding at run-time.
</para> </para>
<para> <para>
<emphasis role="strong">Snip</emphasis> <emphasis role="strong">Snip</emphasis>
</para> </para>
<para> <para>
The VIPS GUI, nip2, has its own scripting language called Snip. Snip is a lazy , higher-order, purely functional, object oriented language. Almost all of nip2’ s menus are implemented in it, and nip2 workspaces are Snip programs. The VIPS GUI, nip2, has its own scripting language called Snip. Snip is a lazy , higher-order, purely functional, object oriented language. Almost all of nip2’ s menus are implemented in it, and nip2 workspaces are Snip programs.
</para> </para>
<para> <para>
VIPS operations listed in the operation database appear as Snip functions. For example, <literal>abs</literal> can be used from Snip as: VIPS operations listed in the operation database appear as Snip functions. For example, <literal>abs</literal> can be used from Snip as:
</para> </para>
 End of changes. 4 change blocks. 
14 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)