| 1 | |
| 2 | <refentry id="imageload"> |
| 3 | <indexterm id="IndexImageload"><primary>imageload</primary></indexterm> |
| 4 | <refentryinfo><title>Image Processing Opcodes</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>imageload</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>imageload</refname> |
| 11 | <refpurpose> |
| 12 | Load an image. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para>Plugin opcode in image. This opcode is part of the plugin repository and has to be installed separately. |
| 19 | The plugin repository can be found here: <ulink url="https://github.com/csound/plugins"><citetitle>https://github.com/csound/plugins</citetitle></ulink></para> |
| 20 | <para> |
| 21 | Load an image and return a reference to it. Individual pixel values can then be accessed with <link linkend="imagegetpixel"><citetitle>imagegetpixel</citetitle></link>. |
| 22 | </para> |
| 23 | <note><simpara>The image processing opcodes can only load png images</simpara></note> |
| 24 | </refsect1> |
| 25 | |
| 26 | <refsect1> |
| 27 | <title>Syntax</title> |
| 28 | <synopsis>iimagenum <command>imageload</command> filename</synopsis> |
| 29 | </refsect1> |
| 30 | |
| 31 | <refsect1> |
| 32 | <title>Initialization</title> |
| 33 | <para> |
| 34 | <emphasis>iimagenum</emphasis> -- number assigned to the loaded image. |
| 35 | </para> |
| 36 | <para> |
| 37 | <emphasis>filename</emphasis> -- The filename of the image to load (should be a valid PNG image file). |
| 38 | </para> |
| 39 | </refsect1> |
| 40 | |
| 41 | <refsect1> |
| 42 | <title>Examples</title> |
| 43 | <para> |
| 44 | Here is an example of the imageload opcode. It uses the file <ulink url="examples/imageopcodes.csd"><citetitle>imageopcodes.csd</citetitle></ulink> and <ulink url="examples/imageOpcode01.png"><citetitle>imageOpcode01.png</citetitle></ulink>. |
| 45 | <example> |
| 46 | <title>Example of the imageload opcode.</title> |
| 47 | <xi:include href="examples-xml/imageopcodes.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 48 | </example> |
| 49 | <para> |
| 50 | This is what the image <citetitle>imageOpcode01.png</citetitle> looks like: |
| 51 | </para> |
| 52 | <imageobject> |
| 53 | <imagedata fileref="images/imageOpcode01small.png" format="PNG"/> |
| 54 | </imageobject> |
| 55 | </para> |
| 56 | </refsect1> |
| 57 | |
| 58 | <refsect1> |
| 59 | <title>See also</title> |
| 60 | <para><link linkend="ImageopcodesTop"><citetitle>Image processing opcodes</citetitle></link></para> |
| 61 | </refsect1> |
| 62 | |
| 63 | <refsect1> |
| 64 | <title>Credits</title> |
| 65 | <para> |
| 66 | <simplelist> |
| 67 | <member>Author: Cesare Marilungo</member> |
| 68 | </simplelist> |
| 69 | </para> |
| 70 | |
| 71 | <para>New in version 5.08</para> |
| 72 | </refsect1> |
| 73 | </refentry> |