File: bezier.lisp

package info (click to toggle)
clisp 1%3A2.44.1-4.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 40,080 kB
  • ctags: 12,945
  • sloc: lisp: 77,546; ansic: 32,166; xml: 25,161; sh: 11,568; fortran: 7,094; cpp: 2,636; makefile: 1,234; perl: 164
file content (39 lines) | stat: -rw-r--r-- 1,294 bytes parent folder | download | duplicates (34)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;;; -*- Mode:Lisp; Package:XLIB; Syntax:COMMON-LISP; Base:10; Lowercase:T -*-

;;; CLX interface for Bezier Spline Extension.

;;;
;;;			 TEXAS INSTRUMENTS INCORPORATED
;;;				  P.O. BOX 2909
;;;			       AUSTIN, TEXAS 78769
;;;
;;; Copyright (C) 1987 Texas Instruments Incorporated.
;;;
;;; Permission is granted to any individual or institution to use, copy, modify,
;;; and distribute this software, provided that this complete copyright and
;;; permission notice is maintained, intact, in all copies and supporting
;;; documentation.
;;;
;;; Texas Instruments Incorporated provides this software "as is" without
;;; express or implied warranty.
;;;

(in-package :xlib)

(export 'draw-curves)

(define-extension "bezier")

(defun draw-curves (drawable gcontext points)
  ;; Draw Bezier splines on drawable using gcontext.
  ;; Points are a list of (x0 y0 x1 y1 x2 y2 x3 y3)
  (declare (type drawable drawable)
	   (type gcontext gcontext)
	   (type sequence points))
  (let* ((display (drawable-display drawable))
	 (opcode (extension-opcode display "bezier")))
    (with-buffer-request (display opcode :gc-force gcontext)
      ((data card8) 1) ;; X_PolyBezier - The minor_opcode for PolyBezier
      (drawable drawable)
      (gcontext gcontext)
      ((sequence :format int16) points))))