Bitmap/Bézier curves/Cubic: Difference between revisions
Content added Content deleted
(→[[Bitmap/Bézier_curves/Cubic#ALGOL 68]]: updated layout) |
|||
Line 58: | Line 58: | ||
{{trans|Ada}} |
{{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 |
{{works with|ALGOL 68G|Any - tested with release [http://sourceforge.net/projects/algol68/files/algol68g/algol68g-2.6 algol68g-2.6].}} |
||
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release 1.8.8d.fc9.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 '''format'''[ted] ''transput''.}} |
||
'''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 := |
cubic bezier OF class image := |
||
Line 87: | Line 87: | ||
END # cubic bezier #; |
END # cubic bezier #; |
||
SKIP</lang>'''File: test/Bitmap/Bezier_curves/Cubic.a68'''<lang algol68>#!/usr/bin/a68g --script # |
|||
# |
|||
# -*- coding: utf-8 -*- # |
|||
⚫ | |||
# |
|||
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; |
|||
⚫ | |||
test:( |
|||
REF IMAGE x = INIT LOC[16,16]PIXEL; |
REF IMAGE x = INIT LOC[16,16]PIXEL; |
||
(fill OF class image)(x, (white OF class image)); |
(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); |
(cubic bezier OF class image)(x, (16, 1), (1, 4), (3, 16), (15, 11), (black OF class image), EMPTY); |
||
(print OF class image) (x) |
(print OF class image) (x) |
||
)</lang>'''Output:''' |
|||
Output: |
|||
<pre> |
<pre> |
||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff |
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff |