forked from dmitryvk/cl-gtk2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgdk.pixbufs.lisp
202 lines (168 loc) · 5.67 KB
/
gdk.pixbufs.lisp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
(in-package :gdk)
(defcfun (pixbuf-render-threshold-alpha "gdk_pixbuf_render_threshold_alpha") :void
(pixbuf (g-object pixbuf))
(bitmap (g-object bitmap))
(src-x :int)
(src-y :int)
(dest-x :int)
(dest-y :int)
(width :int)
(height :int)
(alpha-threshold :int))
(export 'pixbuf-render-threshold-alpha)
(defcfun (pixbuf-render-to-drawable "gdk_pixbuf_render_to_drawable") :void
(pixbuf (g-object pixbuf))
(drawable (g-object drawable))
(gc (g-object graphics-context))
(src-x :int)
(src-y :int)
(dest-x :int)
(dest-y :int)
(width :int)
(height :int)
(dither rgb-dither)
(x-dither :int)
(y-dither :int))
(export 'pixbuf-render-to-drawable)
(defcfun (pixbuf-render-to-drawable-alpha "gdk_pixbuf_render_to_drawable_alpha") :void
(pixbuf (g-object pixbuf))
(drawable (g-object drawable))
(src-x :int)
(src-y :int)
(dest-x :int)
(dest-y :int)
(width :int)
(height :int)
(alpha-mode pixbuf-alpha-mode)
(alpha-threshold :int)
(dither rgb-dither)
(x-dither :int)
(y-dither :int))
(export 'pixbuf-render-to-drawable-alpha)
(defcfun gdk-pixbuf-render-pixmap-and-mask :void
(pixbuf (g-object pixbuf))
(pixmap-return :pointer)
(mask-return :pointer)
(alpha-threshold :int))
(defun pixbuf-render-pixmap-and-mask (pixbuf alpha-threshold)
(with-foreign-objects ((pixmap-return :pointer) (mask-return :pointer))
(gdk-pixbuf-render-pixmap-and-mask pixbuf pixmap-return mask-return alpha-threshold)
(values (convert-from-foreign (mem-ref pixmap-return :pointer) '(g-object pixmap :already-referenced))
(convert-from-foreign (mem-ref mask-return :pointer) '(g-object pixmap :already-referenced)))))
(export 'pixbuf-render-pixmap-and-mask)
(defcfun gdk-pixbuf-render-pixmap-and-mask-for-colormap :void
(pixbuf (g-object pixbuf))
(colormap (g-object colormap))
(pixmap-return :pointer)
(mask-return :pointer)
(alpha-threshold :int))
(defun pixbuf-render-pixmap-and-mask-for-colormap (pixbuf colormap alpha-threshold)
(with-foreign-objects ((pixmap-return :pointer) (mask-return :pointer))
(gdk-pixbuf-render-pixmap-and-mask-for-colormap pixbuf colormap pixmap-return mask-return alpha-threshold)
(values (convert-from-foreign (mem-ref pixmap-return :pointer) '(g-object pixmap :already-referenced))
(convert-from-foreign (mem-ref mask-return :pointer) '(g-object pixmap :already-referenced)))))
(export 'pixbuf-render-pixmap-and-mask-for-colormap)
(defcfun gdk-pixbuf-get-from-drawable (g-object pixbuf :already-referenced)
(dest (g-object pixbuf))
(src (g-object drawable))
(colormap :pointer)
(src-x :int)
(src-y :int)
(dest-x :int)
(dest-y :int)
(width :int)
(height :int))
(defun pixbuf-get-from-drawable (pixbuf drawable &key (src-x 0) (src-y 0) (dest-x 0) (dest-y 0) (width -1) (height -1))
(gdk-pixbuf-get-from-drawable pixbuf drawable (null-pointer) src-x src-y dest-x dest-y width height))
(export 'pixbuf-get-from-drawable)
(defcfun gdk-pixbuf-get-from-image (g-object pixbuf :already-referenced)
(dest (g-object pixbuf))
(src (g-object gdk-image))
(colormap :pointer)
(src-x :int)
(src-y :int)
(dest-x :int)
(dest-y :int)
(width :int)
(height :int))
(defun pixbuf-get-from-image (pixbuf image &key (src-x 0) (src-y 0) (dest-x 0) (dest-y 0) (width -1) (height -1))
(gdk-pixbuf-get-from-image pixbuf image (null-pointer) src-x src-y dest-x dest-y width height))
(export 'pixbuf-get-from-image)
(defcfun gdk-pixbuf-new (g-object pixbuf :already-referenced)
(colorspace colorspace)
(has-alpha :boolean)
(bits-per-sample :int)
(width :int)
(height :int))
(defcfun gdk-pixbuf-scale-simple (g-object pixbuf :already-referenced)
(src (g-object pixbuf))
(dest-width :int)
(dest-height :int)
(interp-type gdk-interp-type))
(defun pixbuf-scale-simple (pixbuf dest-width dest-height &key (interp-type :bilinear))
(gdk-pixbuf-scale-simple pixbuf dest-width dest-height interp-type))
(export 'pixbuf-scale-simple)
(defcfun (pixbuf-scale "gdk_pixbuf_scale") :void
(src (g-object pixbuf))
(dest (g-object pixbuf))
(dest-x :int)
(dest-y :int)
(dest-width :int)
(dest-height :int)
(offset-x :double)
(offset-y :double)
(scale-x :double)
(scale-y :double)
(interp-type gdk-interp-type))
(export 'pixbuf-scale)
(defcfun (pixbuf-composite-color-simple "gdk_pixbuf_composite_color_simple") (g-object pixbuf :already-referenced)
(src (g-object pixbuf))
(dest-width :int)
(dest-height :int)
(interp-type gdk-interp-type)
(overall-alpha :int)
(check-size :int)
(color-1 :uint32)
(color-2 :uint32))
(export 'pixbuf-composite-color-simple)
(defcfun (pixbuf-composite "gdk_pixbuf_composite") :void
(src (g-object pixbuf))
(dest (g-object pixbuf))
(dest-x :int)
(dest-y :int)
(dest-width :int)
(dest-height :int)
(offset-x :double)
(offset-y :double)
(scale-x :double)
(scale-y :double)
(interp-type gdk-interp-type)
(overall-alpha :int))
(export 'pixbuf-composite)
(defcfun (pixbuf-composite-color "gdk_pixbuf_composite_color") :void
(src (g-object pixbuf))
(dest (g-object pixbuf))
(dest-x :int)
(dest-y :int)
(dest-width :int)
(dest-height :int)
(offset-x :double)
(offset-y :double)
(scale-x :double)
(scale-y :double)
(interp-type gdk-interp-type)
(overall-alpha :int)
(check-x :int)
(check-y :int)
(check-size :int)
(color-1 :uint32)
(color-2 :uint32))
(export 'pixbuf-composite-color)
(defcfun (pixbuf-rotate-simple "gdk_pixbuf_rotate_simple") (g-object pixbuf :already-referenced)
(src (g-object pixbuf))
(angle gdk-pixbuf-rotation))
(export 'pixbuf-rotate-simple)
(defcfun (pixbuf-flip "gdk_pixbuf_flip") (g-object pixbuf :already-referenced)
(src (g-object pixbuf))
(horizontal :boolean))
(export 'pixbuf-flip)