Bitmap/Bézier curves/Cubic: Difference between revisions

Line 58:
{{trans|Ada}}
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Standard - '''pragmat''' '''read''' is an extension}}
{{works with|ALGOL 68|Revision 1 - one minor extension to language used - PRAGMA READ, similar to C's #include directive.}}
 
{{works with|ALGOL 68G|Any - tested with release mk15[http://sourceforge.net/projects/algol68/files/algol68g/algol68g-02.8b6 algol68g-2.fc96].i386}}
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d] - due to extensive use of '''pragmatformat'''[ted] ''transput'read''' is not part of algol68rs.}}
'''File: prelude/Bitmap/Bezier_curves/Cubic.a68'''<lang algol68># -*- coding: utf-8 -*- #
<lang algol68>PRAGMAT READ "Bresenhams_line_algorithm.a68" PRAGMAT;
 
cubic bezier OF class image :=
Line 87:
END # cubic bezier #;
 
SKIP</lang>'''File: test/Bitmap/Bezier_curves/Cubic.a68'''<lang algol68>#!/usr/bin/a68g --script #
#
# -*- coding: utf-8 -*- #
The following test
#
PR READ "prelude/Bitmap.a68" PR; # c.f. [[rc:Bitmap]] #
IF test THEN
PR READ "prelude/Bitmap/Bresenhams_line_algorithm.a68" PR; # c.f. [[rc:Bitmap/Bresenhams_line_algorithm]] #
PR READ "prelude/Bitmap/Bezier_curves/Cubic.a68" PR;
 
# The following test #
test:(
REF IMAGE x = INIT LOC[16,16]PIXEL;
(fill OF class image)(x, (white OF class image));
(cubic bezier OF class image)(x, (16, 1), (1, 4), (3, 16), (15, 11), (black OF class image), EMPTY);
(print OF class image) (x)
FI)</lang>'''Output:'''
Output:
<pre>
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff