287 lines
13 KiB
HTML
287 lines
13 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
|
<title>VISION Documentation (LDV): Recommendations</title>
|
|
</head>
|
|
|
|
<body background="images/conc2.gif" bgcolor="#FFFFFF">
|
|
<div align="center"><center>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr>
|
|
<td align="center" width="17%"><a href="kitdev.htm"><img
|
|
src="images/cprev.jpg" alt="Previous Chapter "
|
|
border="0" hspace="2" width="46" height="26"></a><a
|
|
href="index.htm"><img src="images/csom.jpg"
|
|
alt="Back to content " border="0" hspace="2" width="26"
|
|
height="26"></a><a href="preambule.htm"><img
|
|
src="images/csuiv.jpg" alt="Next Chapter " border="0"
|
|
hspace="2" width="43" height="26"></a></td>
|
|
<td align="center" valign="top" rowspan="2" width="8%"><p
|
|
align="center"><img src="images/icoprinc.gif" width="59"
|
|
height="71"></p>
|
|
</td>
|
|
<td width="33%"><p align="center"><font color="#0000FF"
|
|
size="5"><strong><em>VISION </em>Documentation
|
|
<em>(LDV)</strong></em></font></p>
|
|
</td>
|
|
<td align="center" valign="top" rowspan="2" width="8%"><p
|
|
align="center"><img src="images/icointro.gif" width="59"
|
|
height="71"></p>
|
|
</td>
|
|
<td valign="top" width="17%"><p align="left">Last update:
|
|
<!--webbot bot="Timestamp" startspan
|
|
s-type="EDITED" s-format="%d/%m/%y" -->17/09/00<!--webbot
|
|
bot="Timestamp" i-checksum="12363" endspan --></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="17%"><p align="center"><a
|
|
href="..\..\download/dvldv.zip">Download documentation</a></p>
|
|
</td>
|
|
<td width="33%"><p align="center"><font size="4"><strong>7.
|
|
R E C O M M E N D A T I O N S</strong></font></p>
|
|
</td>
|
|
<td align="center" width="17%"> <!--webbot
|
|
bot="HTMLMarkup" startspan --><A HREF="http://www.estat.com/getstats?serial=1390118421">
|
|
<IMG SRC="http://perso.estat.com/cgi-bin/perso/1390118421?page=DocVisionLDV"
|
|
BORDER=0></A>
|
|
<!--webbot
|
|
bot="HTMLMarkup" endspan --></td>
|
|
</tr>
|
|
</table>
|
|
</center></div>
|
|
|
|
<hr>
|
|
|
|
<p>Even if managing and programming LDVs is simple, it must respect some
|
|
common sense rules, one cannot simply do whatever he wants!
|
|
Here are some rules and clarification on some points which might be
|
|
troubling when one programs his first LDVs:</p>
|
|
<div align="center"><center>
|
|
|
|
<table border="2" width="100%">
|
|
<tr>
|
|
<td align="center" width="5%"><strong>#</strong></td>
|
|
<td align="center" width="95%"><strong>Recommendations /
|
|
Advises</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>1</strong></td>
|
|
<td width="95%">If you write an LDV, send it to me!
|
|
I would like <em><strong>VISION</strong></em> site to centralise
|
|
all the LDVs created. Verify also that your LDV is not compiled
|
|
with debug information!
|
|
It would be to no use, except reduce the performances!</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>2</strong></td>
|
|
<td width="95%">It would be nice and useful for everyone to give
|
|
the sources of the LDV with the LDV itself... This could give some
|
|
good ideas to some people...</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>3</strong></td>
|
|
<td width="95%">Do not forget that, by the means of the functions
|
|
called by <em><strong>VISION</strong></em>, you have
|
|
a direct access to <em><strong>VISION</strong></em> internal
|
|
memory. Thus, if you act a little randomly with the pointers
|
|
provided, <em><strong>VISION</strong></em> will most likely crash
|
|
sooner or later...</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>4</strong></td>
|
|
<td width="95%">If you use <a href="vapi/index.htm">VAPI</a>
|
|
(recommended!), the same remark applies, the global Vapi variable
|
|
of the LDV points directly on <em><strong>VISION</strong></em>
|
|
memory. If you write into this structure, your LDV might crash!
|
|
I let you imagine the consequences if you modify the address of
|
|
the function <a href="vapi/pr.htm#PrSetProg">PrSetProg</a>
|
|
and then try and call it!</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>5</strong></td>
|
|
<td width="95%">The ERROR to avoid in the function
|
|
<a href="descrip.htm#run">Run</a> is to allocate yourself the
|
|
memory for the image passed in the out parameter. Why? Doing this,
|
|
first, you overwrite the pointer <em><strong>VISION</strong></em>
|
|
has already allocated to that. Furthermore, as soon as <em><strong>VISION</strong></em>
|
|
will try to use it, it will crash. If fact, your LDV is more or
|
|
less "a PRG" launched by
|
|
<em><strong>VISION</strong></em> and terminated when
|
|
<em><strong>VISION</strong></em> (more excactly the LDG manager)
|
|
decides it. At this moment, the compiler or the system will free
|
|
the memory allocated by this module, even if you do not do it
|
|
explicitely. That is why that is always
|
|
<em><strong>VISION</strong></em>, using the function
|
|
<a href="descrip.htm#prerun">PreRun</a> that will allocate the
|
|
memory for the LDV, since it will use it after that. The function
|
|
<a href="descrip.htm#prerun">PreRun</a> is really essential!</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>6</strong></td>
|
|
<td width="95%">If you use the function <a
|
|
href="vapi/pr.htm#PrSetProg">PrSetProg</a> from <a
|
|
href="vapi/index.htm">VAPI</a> (really WARMLY recommended, unless
|
|
your LDV is fast as light!), try not to call it too often, for
|
|
instance inside a loop, it has no use (it may happen that the
|
|
percentage has not even changed!) and this will slow unecesseraly
|
|
your LDV. Before your call, put a test such as <strong>if ( ( iter & 0x0F )
|
|
== x0F )</strong>, it will call the progress function only one out
|
|
of sixteen times, this should be largely enough.</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><strong>7</strong></td>
|
|
<td>The function <a href="vapi/pr.htm#PrSetProg">PrSetProg</a>
|
|
from <a href="vapi/index.htm">VAPI</a>, gives control temporarily
|
|
to the AES. This will allow to move windows at that moment. That
|
|
is also one of the reasons why this function must be called a
|
|
little... but not too much!</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>8</strong></td>
|
|
<td width="95%">If your LDV has parameters (at most 4 parameters),
|
|
you must use an <a
|
|
href="descrip.htm#fichier ini">associated INI file</a>.
|
|
I recommend to associate systematically an INI file to your LDV.
|
|
It's really handy for translations, and not difficult at all!</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>9</strong></td>
|
|
<td width="95%">If you use an
|
|
<a
|
|
href="descrip.htm#fichier ini">INI file</a>, your LDV must control
|
|
the validity of passed parameters, and not crash stupidely if one
|
|
of them is out of bounds... In such a case, just return the
|
|
<a href="defines.htm#ELDV">ELDV_INVALIDPARAMETER</a> error code.
|
|
Do not forget that the<a href="descrip.htm#fichier ini">
|
|
INI file</a> is a text file, which can be easily modified by a
|
|
user...</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>10</strong></td>
|
|
<td width="95%">Floating numbers, while forecasted for a future
|
|
exxtension, are not necessary for LDV parameters. Let's say you
|
|
must enter a value between 0.0 and 1.0. All you have to do is to
|
|
indicate a range of [0;1000] in the <a
|
|
href="descrip.htm#fichier ini">INI file</a> (which still gives you
|
|
more precision that what can be entered in the GUI), to convert
|
|
the parameter given by <em><strong>VISION</strong></em> to float,
|
|
and then to divide it by 1000. There must exist weird cases where
|
|
floats are necessary, but one should do without them in 99% of
|
|
the cases!</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>11</strong></td>
|
|
<td width="95%">I advise, for memory performances reasons, to
|
|
allways use <a href="defines.htm#LDVF">LDVF_OPINPLACE</a> and <a
|
|
href="defines.htm#LDVF">LDVF_SPECFORMAT</a> flags. Allocate the
|
|
memory you want in the LDV (if you can...) and free it after its
|
|
execution.</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>12</strong></td>
|
|
<td width="95%">If you work only on lines and columns, use the
|
|
<a href="defines.htm#LDVF">LDVF_SPECFORMAT</a> flag.
|
|
|
|
The VDI function vr_cpyfm is made for that purpose. Using the
|
|
<a href="defines.htm#LDVF">LDVF_ATARIFORMAT</a>
|
|
or <a href="defines.htm#LDVF">LDVF_STDFORMAT</a> flags would
|
|
oblige
|
|
<em><strong>VISION</strong></em> to allocate memory unecessarily
|
|
(furthermore, the VDI functions ALWAYS work on the machine
|
|
specific format: <a href="defines.htm#LDVF">LDVF_SPECFORMAT</a>!)</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>13</strong></td>
|
|
<td width="95%">If you have to handle TOS and/or VDI indexes:<ul>
|
|
<li>You can work by lines or packets of n lines:<br>
|
|
Use the format <a href="defines.htm#LDVF">LDVF_SPECFORMAT</a>,
|
|
and the functions of the <a href="vapi/ra.htm">
|
|
Raster interface</a>. This will minimise the memory to
|
|
allocate</li>
|
|
<li>You are obliged to have access to any index at any time:<br>
|
|
Use the format <a href="defines.htm#LDVF">LDVF_ATARIFORMAT</a>,
|
|
and the functions of the <a href="vapi/ra.htm">
|
|
Raster interface</a>. <em><strong>VISION</strong></em>
|
|
will convert the image from the specific format to the
|
|
ATARI bitplan format before calling <a
|
|
href="descrip.htm#prerun">PreRun</a> or <a
|
|
href="descrip.htm#run">Run</a>.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>14</strong></td>
|
|
<td width="95%">Even if the user has selected a block as an area
|
|
to apply the LDV on the image, you are not limited to the area
|
|
defined by this block. You have access to the whole image, even
|
|
more if you decide to enlarge its size (fields out->fd_w and
|
|
out->fd_h of the function <a
|
|
But do not forget to update the fields x1, x2, y1 and
|
|
y2 of the structure <a href="struct.htm#LDV_PARAMS">LDV_PARAMS</a>
|
|
given by the function <a href="descrip.htm#prerun">PreRun</a>,
|
|
and also to UNDO buffer, to be able to go back.</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>15</strong></td>
|
|
<td width="95%"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="5%"><strong>16</strong></td>
|
|
<td width="95%"> </td>
|
|
</tr>
|
|
</table>
|
|
</center></div>
|
|
|
|
<p> </p>
|
|
|
|
<p> </p>
|
|
|
|
<hr>
|
|
<div align="center"><center>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr>
|
|
<td align="center" width="17%"><a href="kitdev.htm"><img
|
|
src="images/cprev.jpg" alt="Previous chapter "
|
|
border="0" hspace="2" width="46" height="26"></a><a
|
|
href="index.htm"><img src="images/csom.jpg"
|
|
alt="Back to content " border="0" hspace="2" width="26"
|
|
height="26"></a><a href="preambule.htm"><img
|
|
src="images/csuiv.jpg" alt="Next Chapter " border="0"
|
|
hspace="2" width="43" height="26"></a></td>
|
|
<td align="center" valign="top" rowspan="2" width="8%"><p
|
|
align="center"><img src="images/icoprinc.gif" width="59"
|
|
height="71"></p>
|
|
</td>
|
|
<td width="33%"><p align="center"><font color="#0000FF"
|
|
size="5"><strong><em>VISION </em>Documentation
|
|
<em>(LDV)</strong></em></font></p>
|
|
</td>
|
|
<td align="center" valign="top" rowspan="2" width="8%"><p
|
|
align="center"><img src="images/icointro.gif" width="59"
|
|
height="71"></p>
|
|
</td>
|
|
<td valign="top" width="17%"><p align="left">Last update:
|
|
<!--webbot bot="Timestamp" startspan
|
|
s-type="EDITED" s-format="%d/%m/%y" -->17/09/00<!--webbot
|
|
bot="Timestamp" i-checksum="12363" endspan --></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="17%"><p align="center"><a
|
|
href="..\..\download/dvldv.zip">Download documentation</a></p>
|
|
</td>
|
|
<td width="33%"><p align="center"><font size="4"><strong>7.
|
|
R E C O M M E N D A T I O N S</strong></font></p>
|
|
</td>
|
|
<td valign="top" width="17%"> </td>
|
|
</tr>
|
|
</table>
|
|
</center></div>
|
|
</body>
|
|
</html>
|