/[cl-cairo2]/transformations.lisp
ViewVC logotype

Diff of /transformations.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by tpapp, Mon Aug 13 14:30:44 2007 UTC revision 12 by tpapp, Tue Aug 14 07:53:12 2007 UTC
# Line 5  Line 5 
5  ;;;;  cairo-matrix-init is not defined, as we have a structure in lisp  ;;;;  cairo-matrix-init is not defined, as we have a structure in lisp
6  ;;;;    with an appropriate constructor  ;;;;    with an appropriate constructor
7  ;;;;  ;;;;
8  ;;;;  cairo_identity_matrix is reset-matrix  ;;;;  cairo_identity_matrix is reset-trans-matrix
9  ;;;;  ;;;;
10  ;;;;  functions that manipulate transformation matrices have  ;;;;  functions that manipulate transformation matrices have
11  ;;;;    trans-matrix instead of matrix in their name  ;;;;    trans-matrix instead of matrix in their name
12  ;;;;  ;;;;
13  ;;;;  cairo_matrix_transform_distance and cairo_matrix_transform_point  ;;;;  cairo_matrix_transform_distance and cairo_matrix_transform_point
14  ;;;;    are simply transform-distance and transform-point  ;;;;    are simply transform-distance and transform-point
15    ;;;;
16    ;;;;  cairo_matrix_init is not defined, make-trans-matrix will give
17    ;;;;    you an identity matrix
18    
19  ;;;;  ;;;;
20  ;;;;  simple functions  ;;;;  simple functions
# Line 22  Line 25 
25    (scale sx sy)    (scale sx sy)
26    (rotate angle))    (rotate angle))
27    
28  (define-flexible (reset-matrix pointer)  (define-flexible (reset-trans-matrix pointer)
29    (cairo_identity_matrix pointer))    (cairo_identity_matrix pointer))
30    
31    
# Line 30  Line 33 
33  ;;;;  transition matrix structure and helper functions/macros  ;;;;  transition matrix structure and helper functions/macros
34  ;;;;  ;;;;
35    
36  (defstruct trans-matrix xx yx xy yy x0 y0)  (defstruct trans-matrix
37      (xx 1d0 :type double-float)
38      (yx 0d0 :type double-float)
39      (xy 0d0 :type double-float)
40      (yy 1d0 :type double-float)
41      (x0 0d0 :type double-float)
42      (y0 0d0 :type double-float))
43    
44  (defun trans-matrix-copy-in (pointer matrix)  (defun trans-matrix-copy-in (pointer matrix)
45    "Copy matrix to a memory location."    "Copy matrix to a memory location."
# Line 108  Line 117 
117    
118  (define-flexible (get-trans-matrix pointer)  (define-flexible (get-trans-matrix pointer)
119    (with-trans-matrix-out matrix-pointer    (with-trans-matrix-out matrix-pointer
120      (cairo_set_matrix pointer matrix-pointer)))      (cairo_get_matrix pointer matrix-pointer)))
121    
122  (define-with-x-y user-to-device)  (define-with-x-y user-to-device)
123  (define-with-x-y user-to-device-distance)  (define-with-x-y user-to-device-distance)
# Line 129  Line 138 
138            matrix-pointer            matrix-pointer
139            ,@args)))))            ,@args)))))
140    
 (define-matrix-init identity)  
141  (define-matrix-init translate tx ty)  (define-matrix-init translate tx ty)
142  (define-matrix-init scale sx sy)  (define-matrix-init scale sx sy)
143  (define-matrix-init rotate radians)  (define-matrix-init rotate radians)

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.5