Mariano Alvarez Fernandez wrote:
> GrSaveContextToJpeg is a new function, the old SaveContextToJpeg lived in the addon subdir, and I
> didn't know if we can change it, so I had write a new one and his pair: GrLoadContextToJpeg. Can
> you add it to grx.pas?
OK.
To check I have also written a demo program which is the exact translation to pascal of
jpgtest.c
In doing this I have noticed a problem in the translation of passing GrContext parameters
to procedures/functions. In C they are passed as pointers. In Pascal the best solution is
usually to pass them as "var" parametrers, and this had been done previously.
However there is a trick in grx that when passing a NULL pointer instead of a
GrContext pointer, an internal GrContext is created and/or used. This trick is
very frequently used for the current context, and is done several times in the
demo program. But I know no way in Pascal to pass a nil pointer as a var parameter.
So either one discards this possibility or pass the parameters as pointers
GrContextPtr like in C. This is not a natural way of doing in pascal but it works.
I have thus corrected grx.pas this way, corrected makefiles and readme to include
the new demo program, and also corrected vir_test.pas for the new syntax.
I have checked that everything works on djgpp.
All is contained in the attached grxdiff.zip
Maurice
--
Maurice Lombardi
Laboratoire de Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 63 54 95
mailto:Maurice.Lombardi@ujf-grenoble.fr