| 1 | |
| 2 | <refentry id="imagesize"> |
| 3 | <indexterm id="IndexImagesize"><primary>imagesize</primary></indexterm> |
| 4 | <refentryinfo><title>Image Processing Opcodes</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>imagesize</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>imagesize</refname> |
| 11 | <refpurpose> |
| 12 | Return the width and height of a previously opened or created 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>Return the width and height of a previously opened or created image. An image can be loaded with <link linkend="imageload"><citetitle>imageload</citetitle></link>. An empty image can be created with <link linkend="imagecreate"><citetitle>imagecreate</citetitle></link>. |
| 21 | </para> |
| 22 | </refsect1> |
| 23 | |
| 24 | <refsect1> |
| 25 | <title>Syntax</title> |
| 26 | <synopsis>iwidth, iheight <command>imagesize</command> iimagenum</synopsis> |
| 27 | </refsect1> |
| 28 | |
| 29 | <refsect1> |
| 30 | <title>Initialization</title> |
| 31 | <para> |
| 32 | <emphasis>iimagenum</emphasis> -- the reference of the image.. It should be a value returned by <link linkend="imageload"><citetitle>imageload</citetitle></link> or <link linkend="imagecreate"><citetitle>imagecreate</citetitle></link>. |
| 33 | </para> |
| 34 | <para> |
| 35 | <emphasis>iwidth</emphasis> -- image width. |
| 36 | </para> |
| 37 | <para> |
| 38 | <emphasis>iheight</emphasis> -- image height. |
| 39 | </para> |
| 40 | </refsect1> |
| 41 | |
| 42 | <refsect1> |
| 43 | <title>Examples</title> |
| 44 | <para> |
| 45 | Here is an example of the imagesize 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>. |
| 46 | <example> |
| 47 | <title>Example of the imagesize opcode.</title> |
| 48 | <xi:include href="examples-xml/imageopcodes.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 49 | </example> |
| 50 | Its output should include a line like this: |
| 51 | <screen> |
| 52 | width = 512 pixels, heigth = 512 pixels |
| 53 | </screen> |
| 54 | </para> |
| 55 | </refsect1> |
| 56 | |
| 57 | <refsect1> |
| 58 | <title>See also</title> |
| 59 | <para><link linkend="ImageopcodesTop"><citetitle>Image processing opcodes</citetitle></link></para> |
| 60 | </refsect1> |
| 61 | |
| 62 | <refsect1> |
| 63 | <title>Credits</title> |
| 64 | <para> |
| 65 | <simplelist> |
| 66 | <member>Author: Cesare Marilungo</member> |
| 67 | </simplelist> |
| 68 | </para> |
| 69 | <para>New in version 5.08</para> |
| 70 | </refsect1> |
| 71 | </refentry> |