Tizen 2.0 Release
[framework/multimedia/gst-plugins-good0.10.git] / gst / smpte / barboxwipes.c
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include "paint.h"
25 #include "gstmask.h"
26
27 enum
28 {
29   BOX_VERTICAL = 1,
30   BOX_HORIZONTAL = 2,
31   BOX_CLOCK = 3,
32   TRIGANLE_LINEAR = 4
33 };
34
35 static const gint boxes_1b[][7] = {
36 #define WIPE_B1_1       0
37   {BOX_VERTICAL, 0, 0, 0, 1, 1, 1},
38 #define WIPE_B1_2       1
39   {BOX_HORIZONTAL, 0, 0, 0, 1, 1, 1}
40 };
41
42 static const gint boxes_2b[][7 * 2] = {
43 #define WIPE_B2_21      0
44   {BOX_VERTICAL, 0, 0, 1, 1, 2, 0,
45       BOX_VERTICAL, 1, 0, 0, 2, 2, 1},
46 #define WIPE_B2_22      1
47   {BOX_HORIZONTAL, 0, 0, 1, 2, 1, 0,
48       BOX_HORIZONTAL, 0, 1, 0, 2, 2, 1},
49 };
50
51 static const gint box_clock_1b[][1 * 10] = {
52 #define WIPE_B1_241     0
53   {BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 1, 1},
54 #define WIPE_B1_242     1
55   {BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1},
56 #define WIPE_B1_243     2
57   {BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1},
58 #define WIPE_B1_244     3
59   {BOX_CLOCK, 1, 0, 0, 0, 0, 0, 1, 1, 1},
60 };
61
62 #define WIPE_B2_221     0
63 static const gint box_clock_2b[][2 * 10] = {
64 #define WIPE_B2_221     0
65   {BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 2, 1,
66       BOX_CLOCK, 1, 0, 0, 1, 2, 1, 0, 0, 2},
67 #define WIPE_B2_222     1
68   {BOX_CLOCK, 2, 1, 0, 2, 2, 0, 0, 1, 1,
69       BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 0, 2},
70 #define WIPE_B2_223     2
71   {BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1,
72       BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2},
73 #define WIPE_B2_224     3
74   {BOX_CLOCK, 0, 1, 0, 0, 0, 0, 2, 1, 1,
75       BOX_CLOCK, 0, 1, 0, 2, 1, 1, 0, 2, 2},
76 #define WIPE_B2_225     4
77   {BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 2, 1,
78       BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1},
79 #define WIPE_B2_226     5
80   {BOX_CLOCK, 0, 1, 0, 0, 0, 0, 2, 1, 1,
81       BOX_CLOCK, 2, 1, 0, 2, 2, 0, 0, 1, 1},
82 #define WIPE_B2_231     6
83   {BOX_CLOCK, 1, 0, 0, 1, 2, 0, 2, 0, 1,
84       BOX_CLOCK, 1, 0, 0, 1, 2, 0, 0, 0, 1},
85 #define WIPE_B2_232     7
86   {BOX_CLOCK, 2, 1, 0, 0, 1, 0, 2, 0, 1,
87       BOX_CLOCK, 2, 1, 0, 0, 1, 0, 2, 2, 1},
88 #define WIPE_B2_233     8
89   {BOX_CLOCK, 1, 2, 0, 1, 0, 0, 2, 2, 1,
90       BOX_CLOCK, 1, 2, 0, 1, 0, 0, 0, 2, 1},
91 #define WIPE_B2_234     9
92   {BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 0, 1,
93       BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 2, 1},
94 #define WIPE_B2_251     10
95   {BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 2, 1,
96       BOX_CLOCK, 2, 0, 0, 1, 0, 0, 2, 2, 1},
97 #define WIPE_B2_252     11
98   {BOX_CLOCK, 0, 0, 0, 0, 1, 0, 2, 0, 1,
99       BOX_CLOCK, 0, 2, 0, 0, 1, 0, 2, 2, 1},
100 #define WIPE_B2_253     12
101   {BOX_CLOCK, 0, 2, 0, 1, 2, 0, 0, 0, 1,
102       BOX_CLOCK, 2, 2, 0, 1, 2, 0, 2, 0, 1},
103 #define WIPE_B2_254     13
104   {BOX_CLOCK, 2, 0, 0, 2, 1, 0, 0, 0, 1,
105       BOX_CLOCK, 2, 2, 0, 2, 1, 0, 0, 2, 1},
106 };
107
108 static const gint box_clock_4b[][4 * 10] = {
109 #define WIPE_B4_201     0
110   {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1,
111         BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2,
112         BOX_CLOCK, 1, 1, 0, 1, 2, 2, 0, 1, 3,
113       BOX_CLOCK, 1, 1, 0, 0, 1, 3, 1, 0, 4},
114 #define WIPE_B4_202     1
115   {BOX_CLOCK, 1, 1, 0, 1, 0, 3, 2, 1, 4,
116         BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1,
117         BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2,
118       BOX_CLOCK, 1, 1, 0, 0, 1, 2, 1, 0, 3},
119 #define WIPE_B4_203     2
120   {BOX_CLOCK, 1, 1, 0, 1, 0, 2, 2, 1, 3,
121         BOX_CLOCK, 1, 1, 0, 2, 1, 3, 1, 2, 4,
122         BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1,
123       BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 0, 2},
124 #define WIPE_B4_204     3
125   {BOX_CLOCK, 1, 1, 0, 1, 0, 1, 2, 1, 2,
126         BOX_CLOCK, 1, 1, 0, 2, 1, 2, 1, 2, 3,
127         BOX_CLOCK, 1, 1, 0, 1, 2, 3, 0, 1, 4,
128       BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1},
129 #define WIPE_B4_205     4
130   {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1,
131         BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2,
132         BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1,
133       BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 0, 2},
134 #define WIPE_B4_206     5
135   {BOX_CLOCK, 1, 1, 0, 1, 0, 1, 2, 1, 2,
136         BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1,
137         BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2,
138       BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1},
139 #define WIPE_B4_207     6
140   {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1,
141         BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1,
142         BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1,
143       BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1},
144 #define WIPE_B4_211     7
145   {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1,
146         BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2,
147         BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1,
148       BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 2, 2},
149 #define WIPE_B4_212     8
150   {BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 0, 1,
151         BOX_CLOCK, 1, 1, 0, 1, 0, 1, 0, 1, 2,
152         BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1,
153       BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2},
154 #define WIPE_B4_213     9
155   {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1,
156         BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1,
157         BOX_CLOCK, 1, 1, 0, 1, 2, 0, 2, 1, 1,
158       BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1},
159 #define WIPE_B4_214     10
160   {BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 0, 1,
161         BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1,
162         BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1,
163       BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 2, 1},
164 #define WIPE_B4_227     11
165   {BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 1, 1,
166         BOX_CLOCK, 1, 0, 0, 1, 1, 1, 0, 0, 2,
167         BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 1, 1,
168       BOX_CLOCK, 1, 2, 0, 1, 1, 1, 0, 2, 2},
169 #define WIPE_B4_228     12
170   {BOX_CLOCK, 0, 1, 0, 0, 0, 0, 1, 1, 1,
171         BOX_CLOCK, 0, 1, 0, 1, 1, 1, 0, 2, 2,
172         BOX_CLOCK, 2, 1, 0, 2, 0, 0, 1, 1, 1,
173       BOX_CLOCK, 2, 1, 0, 1, 1, 1, 2, 2, 2},
174 #define WIPE_B4_235     13
175   {BOX_CLOCK, 1, 0, 0, 1, 1, 0, 0, 0, 1,
176         BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1,
177         BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1,
178       BOX_CLOCK, 1, 2, 0, 1, 1, 0, 0, 2, 1},
179 #define WIPE_B4_236     14
180   {BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1,
181         BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1,
182         BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1,
183       BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 2, 1},
184 };
185
186 static const gint box_clock_8b[][8 * 10] = {
187 #define WIPE_B8_261     0
188   {BOX_CLOCK, 2, 1, 0, 2, 2, 0, 4, 1, 1,
189         BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 0, 2,
190         BOX_CLOCK, 2, 1, 0, 2, 0, 2, 0, 1, 3,
191         BOX_CLOCK, 2, 1, 0, 0, 1, 3, 2, 2, 4,
192         BOX_CLOCK, 2, 3, 0, 2, 2, 0, 4, 3, 1,
193         BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 4, 2,
194         BOX_CLOCK, 2, 3, 0, 2, 4, 2, 0, 3, 3,
195       BOX_CLOCK, 2, 3, 0, 0, 3, 3, 2, 2, 4},
196 #define WIPE_B8_262     1
197   {BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 0, 1,
198         BOX_CLOCK, 1, 2, 0, 1, 0, 1, 0, 2, 2,
199         BOX_CLOCK, 1, 2, 0, 0, 2, 2, 1, 4, 3,
200         BOX_CLOCK, 1, 2, 0, 1, 4, 3, 2, 2, 4,
201         BOX_CLOCK, 3, 2, 0, 2, 2, 0, 3, 0, 1,
202         BOX_CLOCK, 3, 2, 0, 3, 0, 1, 4, 2, 2,
203         BOX_CLOCK, 3, 2, 0, 4, 2, 2, 3, 4, 3,
204       BOX_CLOCK, 3, 2, 0, 3, 4, 3, 2, 2, 4},
205 #define WIPE_B8_263     2
206   {BOX_CLOCK, 2, 1, 0, 2, 0, 0, 4, 1, 1,
207         BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 2, 2,
208         BOX_CLOCK, 2, 1, 0, 2, 0, 0, 0, 1, 1,
209         BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 2, 2,
210         BOX_CLOCK, 2, 3, 0, 2, 4, 0, 4, 3, 1,
211         BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 2, 2,
212         BOX_CLOCK, 2, 3, 0, 2, 4, 0, 0, 3, 1,
213       BOX_CLOCK, 2, 3, 0, 0, 3, 1, 2, 2, 2},
214 #define WIPE_B8_264     3
215   {BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1,
216         BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2,
217         BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 4, 1,
218         BOX_CLOCK, 1, 2, 0, 1, 4, 1, 2, 2, 2,
219         BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 0, 1,
220         BOX_CLOCK, 3, 2, 0, 3, 0, 1, 2, 2, 2,
221         BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1,
222       BOX_CLOCK, 3, 2, 0, 3, 4, 1, 2, 2, 2},
223 };
224
225 static const gint triangles_2t[][2 * 9] = {
226   /* 3 -> 6 */
227 #define WIPE_T2_3       0
228   {0, 0, 0, 0, 1, 1, 1, 1, 1,
229       1, 0, 1, 0, 0, 0, 1, 1, 1},
230 #define WIPE_T2_4       WIPE_T2_3+1
231   {0, 0, 1, 1, 0, 0, 0, 1, 1,
232       1, 0, 0, 0, 1, 1, 1, 1, 1},
233 #define WIPE_T2_5       WIPE_T2_4+1
234   {0, 0, 1, 0, 1, 1, 1, 1, 0,
235       1, 0, 1, 0, 0, 1, 1, 1, 0},
236 #define WIPE_T2_6       WIPE_T2_5+1
237   {0, 0, 1, 1, 0, 1, 0, 1, 0,
238       1, 0, 1, 0, 1, 0, 1, 1, 1},
239 #define WIPE_T2_41      WIPE_T2_6+1
240   {0, 0, 0, 1, 0, 1, 0, 1, 1,
241       1, 0, 1, 0, 1, 1, 1, 1, 2},
242 #define WIPE_T2_42      WIPE_T2_41+1
243   {0, 0, 1, 1, 0, 0, 1, 1, 1,
244       0, 0, 1, 0, 1, 2, 1, 1, 1},
245 #define WIPE_T2_45      WIPE_T2_42+1
246   {0, 0, 1, 1, 0, 0, 0, 1, 0,
247       1, 0, 0, 0, 1, 0, 1, 1, 1},
248 #define WIPE_T2_46      WIPE_T2_45+1
249   {0, 0, 0, 1, 0, 1, 1, 1, 0,
250       0, 0, 0, 0, 1, 1, 1, 1, 0},
251 #define WIPE_T2_245     WIPE_T2_46+1
252   {0, 0, 0, 2, 0, 0, 2, 2, 1,
253       2, 2, 0, 0, 2, 0, 0, 0, 1},
254 #define WIPE_T2_246     WIPE_T2_245+1
255   {0, 2, 0, 0, 0, 0, 2, 0, 1,
256       2, 0, 0, 2, 2, 0, 0, 2, 1},
257 };
258
259 static const gint triangles_3t[][3 * 9] = {
260   /* 23 -> 26 */
261 #define WIPE_T3_23      0
262   {0, 0, 1, 1, 0, 0, 0, 2, 1,
263         1, 0, 0, 0, 2, 1, 2, 2, 1,
264       1, 0, 0, 2, 0, 1, 2, 2, 1},
265 #define WIPE_T3_24      1
266   {0, 0, 1, 2, 0, 1, 2, 1, 0,
267         0, 0, 1, 2, 1, 0, 0, 2, 1,
268       2, 1, 0, 0, 2, 1, 2, 2, 1},
269 #define WIPE_T3_25      2
270   {0, 0, 1, 0, 2, 1, 1, 2, 0,
271         0, 0, 1, 2, 0, 1, 1, 2, 0,
272       2, 0, 1, 1, 2, 0, 2, 2, 1},
273 #define WIPE_T3_26      3
274   {0, 0, 1, 2, 0, 1, 0, 1, 0,
275         2, 0, 1, 0, 1, 0, 2, 2, 1,
276       0, 1, 0, 0, 2, 1, 2, 2, 1},
277 };
278
279 static const gint triangles_4t[][4 * 9] = {
280 #define WIPE_T4_61      0
281   {0, 0, 1, 1, 0, 0, 1, 2, 1,
282         0, 0, 1, 0, 2, 2, 1, 2, 1,
283         1, 0, 0, 2, 0, 1, 1, 2, 1,
284       2, 0, 1, 1, 2, 1, 2, 2, 2},
285 #define WIPE_T4_62      1
286   {0, 0, 2, 2, 0, 1, 0, 1, 1,
287         2, 0, 1, 0, 1, 1, 2, 1, 0,
288         0, 1, 1, 2, 1, 0, 2, 2, 1,
289       0, 1, 1, 0, 2, 2, 2, 2, 1},
290 #define WIPE_T4_63      2
291   {0, 0, 2, 1, 0, 1, 0, 2, 1,
292         1, 0, 1, 0, 2, 1, 1, 2, 0,
293         1, 0, 1, 1, 2, 0, 2, 2, 1,
294       1, 0, 1, 2, 0, 2, 2, 2, 1},
295 #define WIPE_T4_64      3
296   {0, 0, 1, 2, 0, 2, 2, 1, 1,
297         0, 0, 1, 0, 1, 0, 2, 1, 1,
298         0, 1, 0, 2, 1, 1, 0, 2, 1,
299       2, 1, 1, 0, 2, 1, 2, 2, 2},
300 #define WIPE_T4_65      4
301   {0, 0, 0, 1, 0, 1, 1, 2, 0,
302         0, 0, 0, 0, 2, 1, 1, 2, 0,
303         1, 0, 1, 2, 0, 0, 1, 2, 0,
304       2, 0, 0, 1, 2, 0, 2, 2, 1},
305 #define WIPE_T4_66      5
306   {0, 0, 1, 2, 0, 0, 0, 1, 0,
307         2, 0, 0, 0, 1, 0, 2, 1, 1,
308         0, 1, 0, 2, 1, 1, 2, 2, 0,
309       0, 1, 0, 0, 2, 1, 2, 2, 0},
310 #define WIPE_T4_67      6
311   {0, 0, 1, 1, 0, 0, 0, 2, 0,
312         1, 0, 0, 0, 2, 0, 1, 2, 1,
313         1, 0, 0, 1, 2, 1, 2, 2, 0,
314       1, 0, 0, 2, 0, 1, 2, 2, 0},
315 #define WIPE_T4_68      7
316   {0, 0, 0, 2, 0, 1, 2, 1, 0,
317         0, 0, 0, 0, 1, 1, 2, 1, 0,
318         0, 1, 1, 2, 1, 0, 0, 2, 0,
319       2, 1, 0, 0, 2, 0, 2, 2, 1},
320 #define WIPE_T4_101     8
321   {0, 0, 1, 2, 0, 1, 1, 1, 0,
322         0, 0, 1, 1, 1, 0, 0, 2, 1,
323         1, 1, 0, 0, 2, 1, 2, 2, 1,
324       2, 0, 1, 1, 1, 0, 2, 2, 1},
325 };
326
327 static const gint triangles_8t[][8 * 9] = {
328   /* 7 */
329 #define WIPE_T8_7       0
330   {0, 0, 0, 1, 0, 1, 1, 1, 1,
331         1, 0, 1, 2, 0, 0, 1, 1, 1,
332         2, 0, 0, 1, 1, 1, 2, 1, 1,
333         1, 1, 1, 2, 1, 1, 2, 2, 0,
334         1, 1, 1, 1, 2, 1, 2, 2, 0,
335         1, 1, 1, 0, 2, 0, 1, 2, 1,
336         0, 1, 1, 1, 1, 1, 0, 2, 0,
337       0, 0, 0, 0, 1, 1, 1, 1, 1},
338 #define WIPE_T8_43      1
339   {0, 0, 1, 1, 0, 0, 1, 1, 1,
340         1, 0, 0, 2, 0, 1, 1, 1, 1,
341         2, 0, 1, 1, 1, 1, 2, 1, 2,
342         1, 1, 1, 2, 1, 2, 2, 2, 1,
343         1, 1, 1, 1, 2, 0, 2, 2, 1,
344         1, 1, 1, 0, 2, 1, 1, 2, 0,
345         0, 1, 2, 1, 1, 1, 0, 2, 1,
346       0, 0, 1, 0, 1, 2, 1, 1, 1},
347 #define WIPE_T8_44      2
348   {0, 0, 1, 1, 0, 2, 1, 1, 1,
349         1, 0, 2, 2, 0, 1, 1, 1, 1,
350         2, 0, 1, 1, 1, 1, 2, 1, 0,
351         1, 1, 1, 2, 1, 0, 2, 2, 1,
352         1, 1, 1, 1, 2, 2, 2, 2, 1,
353         1, 1, 1, 0, 2, 1, 1, 2, 2,
354         0, 1, 0, 1, 1, 1, 0, 2, 1,
355       0, 0, 1, 0, 1, 0, 1, 1, 1},
356 #define WIPE_T8_47      3
357   {0, 0, 0, 1, 0, 1, 1, 1, 0,
358         1, 0, 1, 2, 0, 0, 1, 1, 0,
359         2, 0, 0, 1, 1, 0, 2, 1, 1,
360         1, 1, 0, 2, 1, 1, 2, 2, 0,
361         1, 1, 0, 1, 2, 1, 2, 2, 0,
362         1, 1, 0, 0, 2, 0, 1, 2, 1,
363         0, 1, 1, 1, 1, 0, 0, 2, 0,
364       0, 0, 0, 0, 1, 1, 1, 1, 0},
365 #define WIPE_T8_48      4
366   {0, 0, 1, 1, 0, 0, 0, 1, 0,
367         1, 0, 0, 0, 1, 0, 1, 1, 1,
368         1, 0, 0, 2, 0, 1, 2, 1, 0,
369         1, 0, 0, 1, 1, 1, 2, 1, 0,
370         0, 1, 0, 1, 1, 1, 1, 2, 0,
371         0, 1, 0, 0, 2, 1, 1, 2, 0,
372         1, 1, 1, 2, 1, 0, 1, 2, 0,
373       2, 1, 0, 1, 2, 0, 2, 2, 1},
374 };
375
376 static const gint triangles_16t[][16 * 9] = {
377   /* 8 */
378 #define WIPE_T16_8      0
379   {0, 0, 1, 2, 0, 1, 1, 1, 0,
380         2, 0, 1, 1, 1, 0, 2, 2, 1,
381         1, 1, 0, 0, 2, 1, 2, 2, 1,
382         0, 0, 1, 1, 1, 0, 0, 2, 1,
383         2, 0, 1, 4, 0, 1, 3, 1, 0,
384         4, 0, 1, 3, 1, 0, 4, 2, 1,
385         3, 1, 0, 2, 2, 1, 4, 2, 1,
386         2, 0, 1, 3, 1, 0, 2, 2, 1,
387         0, 2, 1, 2, 2, 1, 1, 3, 0,
388         2, 2, 1, 1, 3, 0, 2, 4, 1,
389         1, 3, 0, 0, 4, 1, 2, 4, 1,
390         0, 2, 1, 1, 3, 0, 0, 4, 1,
391         2, 2, 1, 4, 2, 1, 3, 3, 0,
392         4, 2, 1, 3, 3, 0, 4, 4, 1,
393         3, 3, 0, 2, 4, 1, 4, 4, 1,
394       2, 2, 1, 3, 3, 0, 2, 4, 1}
395 };
396
397 typedef struct _GstWipeConfig GstWipeConfig;
398
399 struct _GstWipeConfig
400 {
401   const gint *objects;
402   gint nobjects;
403   gint xscale;
404   gint yscale;
405   gint cscale;
406 };
407
408 static const GstWipeConfig wipe_config[] = {
409 #define WIPE_CONFIG_1   0
410   {boxes_1b[WIPE_B1_1], 1, 0, 0, 0},    /* 1 */
411 #define WIPE_CONFIG_2   WIPE_CONFIG_1+1
412   {boxes_1b[WIPE_B1_2], 1, 0, 0, 0},    /* 2 */
413 #define WIPE_CONFIG_3   WIPE_CONFIG_2+1
414   {triangles_2t[WIPE_T2_3], 2, 0, 0, 0},        /* 3 */
415 #define WIPE_CONFIG_4   WIPE_CONFIG_3+1
416   {triangles_2t[WIPE_T2_4], 2, 0, 0, 0},        /* 4 */
417 #define WIPE_CONFIG_5   WIPE_CONFIG_4+1
418   {triangles_2t[WIPE_T2_5], 2, 0, 0, 0},        /* 5 */
419 #define WIPE_CONFIG_6   WIPE_CONFIG_5+1
420   {triangles_2t[WIPE_T2_6], 2, 0, 0, 0},        /* 6 */
421 #define WIPE_CONFIG_7   WIPE_CONFIG_6+1
422   {triangles_8t[WIPE_T8_7], 8, 1, 1, 0},        /* 7 */
423 #define WIPE_CONFIG_8   WIPE_CONFIG_7+1
424   {triangles_16t[WIPE_T16_8], 16, 2, 2, 0},     /* 8 */
425
426 #define WIPE_CONFIG_21  WIPE_CONFIG_8+1
427   {boxes_2b[WIPE_B2_21], 2, 1, 1, 0},   /* 21 */
428 #define WIPE_CONFIG_22  WIPE_CONFIG_21+1
429   {boxes_2b[WIPE_B2_22], 2, 1, 1, 0},   /* 22 */
430
431 #define WIPE_CONFIG_23  WIPE_CONFIG_22+1
432   {triangles_3t[WIPE_T3_23], 3, 1, 1, 0},       /* 23 */
433 #define WIPE_CONFIG_24  WIPE_CONFIG_23+1
434   {triangles_3t[WIPE_T3_24], 3, 1, 1, 0},       /* 24 */
435 #define WIPE_CONFIG_25  WIPE_CONFIG_24+1
436   {triangles_3t[WIPE_T3_25], 3, 1, 1, 0},       /* 25 */
437 #define WIPE_CONFIG_26  WIPE_CONFIG_25+1
438   {triangles_3t[WIPE_T3_26], 3, 1, 1, 0},       /* 26 */
439 #define WIPE_CONFIG_41  WIPE_CONFIG_26+1
440   {triangles_2t[WIPE_T2_41], 2, 0, 0, 1},       /* 41 */
441 #define WIPE_CONFIG_42  WIPE_CONFIG_41+1
442   {triangles_2t[WIPE_T2_42], 2, 0, 0, 1},       /* 42 */
443 #define WIPE_CONFIG_43  WIPE_CONFIG_42+1
444   {triangles_8t[WIPE_T8_43], 8, 1, 1, 1},       /* 43 */
445 #define WIPE_CONFIG_44  WIPE_CONFIG_43+1
446   {triangles_8t[WIPE_T8_44], 8, 1, 1, 1},       /* 44 */
447 #define WIPE_CONFIG_45  WIPE_CONFIG_44+1
448   {triangles_2t[WIPE_T2_45], 2, 0, 0, 0},       /* 45 */
449 #define WIPE_CONFIG_46  WIPE_CONFIG_45+1
450   {triangles_2t[WIPE_T2_46], 2, 0, 0, 0},       /* 46 */
451 #define WIPE_CONFIG_47  WIPE_CONFIG_46+1
452   {triangles_8t[WIPE_T8_47], 8, 1, 1, 0},       /* 47 */
453 #define WIPE_CONFIG_48  WIPE_CONFIG_47+1
454   {triangles_8t[WIPE_T8_48], 8, 1, 1, 0},       /* 48 */
455 #define WIPE_CONFIG_61  WIPE_CONFIG_48+1
456   {triangles_4t[WIPE_T4_61], 4, 1, 1, 1},       /* 61 */
457 #define WIPE_CONFIG_62  WIPE_CONFIG_61+1
458   {triangles_4t[WIPE_T4_62], 4, 1, 1, 1},       /* 62 */
459 #define WIPE_CONFIG_63  WIPE_CONFIG_62+1
460   {triangles_4t[WIPE_T4_63], 4, 1, 1, 1},       /* 63 */
461 #define WIPE_CONFIG_64  WIPE_CONFIG_63+1
462   {triangles_4t[WIPE_T4_64], 4, 1, 1, 1},       /* 64 */
463 #define WIPE_CONFIG_65  WIPE_CONFIG_64+1
464   {triangles_4t[WIPE_T4_65], 4, 1, 1, 0},       /* 65 */
465 #define WIPE_CONFIG_66  WIPE_CONFIG_65+1
466   {triangles_4t[WIPE_T4_66], 4, 1, 1, 0},       /* 66 */
467 #define WIPE_CONFIG_67  WIPE_CONFIG_66+1
468   {triangles_4t[WIPE_T4_67], 4, 1, 1, 0},       /* 67 */
469 #define WIPE_CONFIG_68  WIPE_CONFIG_67+1
470   {triangles_4t[WIPE_T4_68], 4, 1, 1, 0},       /* 68 */
471 #define WIPE_CONFIG_101 WIPE_CONFIG_68+1
472   {triangles_4t[WIPE_T4_101], 4, 1, 1, 0},      /* 101 */
473 #define WIPE_CONFIG_201 WIPE_CONFIG_101+1
474   {box_clock_4b[WIPE_B4_201], 4, 1, 1, 2},      /* 201 */
475 #define WIPE_CONFIG_202 WIPE_CONFIG_201+1
476   {box_clock_4b[WIPE_B4_202], 4, 1, 1, 2},      /* 202 */
477 #define WIPE_CONFIG_203 WIPE_CONFIG_202+1
478   {box_clock_4b[WIPE_B4_203], 4, 1, 1, 2},      /* 203 */
479 #define WIPE_CONFIG_204 WIPE_CONFIG_203+1
480   {box_clock_4b[WIPE_B4_204], 4, 1, 1, 2},      /* 204 */
481 #define WIPE_CONFIG_205 WIPE_CONFIG_204+1
482   {box_clock_4b[WIPE_B4_205], 4, 1, 1, 1},      /* 205 */
483 #define WIPE_CONFIG_206 WIPE_CONFIG_205+1
484   {box_clock_4b[WIPE_B4_206], 4, 1, 1, 1},      /* 206 */
485 #define WIPE_CONFIG_207 WIPE_CONFIG_206+1
486   {box_clock_4b[WIPE_B4_207], 4, 1, 1, 0},      /* 207 */
487 #define WIPE_CONFIG_211 WIPE_CONFIG_207+1
488   {box_clock_4b[WIPE_B4_211], 4, 1, 1, 1},      /* 211 */
489 #define WIPE_CONFIG_212 WIPE_CONFIG_211+1
490   {box_clock_4b[WIPE_B4_212], 4, 1, 1, 1},      /* 212 */
491 #define WIPE_CONFIG_213 WIPE_CONFIG_212+1
492   {box_clock_4b[WIPE_B4_213], 4, 1, 1, 0},      /* 213 */
493 #define WIPE_CONFIG_214 WIPE_CONFIG_213+1
494   {box_clock_4b[WIPE_B4_214], 4, 1, 1, 0},      /* 214 */
495 #define WIPE_CONFIG_221 WIPE_CONFIG_214+1
496   {box_clock_2b[WIPE_B2_221], 2, 1, 1, 1},      /* 221 */
497 #define WIPE_CONFIG_222 WIPE_CONFIG_221+1
498   {box_clock_2b[WIPE_B2_222], 2, 1, 1, 1},      /* 222 */
499 #define WIPE_CONFIG_223 WIPE_CONFIG_222+1
500   {box_clock_2b[WIPE_B2_223], 2, 1, 1, 1},      /* 223 */
501 #define WIPE_CONFIG_224 WIPE_CONFIG_223+1
502   {box_clock_2b[WIPE_B2_224], 2, 1, 1, 1},      /* 224 */
503 #define WIPE_CONFIG_225 WIPE_CONFIG_224+1
504   {box_clock_2b[WIPE_B2_225], 2, 1, 1, 0},      /* 225 */
505 #define WIPE_CONFIG_226 WIPE_CONFIG_225+1
506   {box_clock_2b[WIPE_B2_226], 2, 1, 1, 0},      /* 226 */
507 #define WIPE_CONFIG_227 WIPE_CONFIG_226+1
508   {box_clock_4b[WIPE_B4_227], 4, 1, 1, 1},      /* 227 */
509 #define WIPE_CONFIG_228 WIPE_CONFIG_227+1
510   {box_clock_4b[WIPE_B4_228], 4, 1, 1, 1},      /* 228 */
511 #define WIPE_CONFIG_231 WIPE_CONFIG_228+1
512   {box_clock_2b[WIPE_B2_231], 2, 1, 1, 0},      /* 231 */
513 #define WIPE_CONFIG_232 WIPE_CONFIG_231+1
514   {box_clock_2b[WIPE_B2_232], 2, 1, 1, 0},      /* 232 */
515 #define WIPE_CONFIG_233 WIPE_CONFIG_232+1
516   {box_clock_2b[WIPE_B2_233], 2, 1, 1, 0},      /* 233 */
517 #define WIPE_CONFIG_234 WIPE_CONFIG_233+1
518   {box_clock_2b[WIPE_B2_234], 2, 1, 1, 0},      /* 234 */
519 #define WIPE_CONFIG_235 WIPE_CONFIG_234+1
520   {box_clock_4b[WIPE_B4_235], 4, 1, 1, 0},      /* 235 */
521 #define WIPE_CONFIG_236 WIPE_CONFIG_235+1
522   {box_clock_4b[WIPE_B4_236], 4, 1, 1, 0},      /* 236 */
523 #define WIPE_CONFIG_241 WIPE_CONFIG_236+1
524   {box_clock_1b[WIPE_B1_241], 1, 0, 0, 0},      /* 241 */
525 #define WIPE_CONFIG_242 WIPE_CONFIG_241+1
526   {box_clock_1b[WIPE_B1_242], 1, 0, 0, 0},      /* 242 */
527 #define WIPE_CONFIG_243 WIPE_CONFIG_242+1
528   {box_clock_1b[WIPE_B1_243], 1, 0, 0, 0},      /* 243 */
529 #define WIPE_CONFIG_244 WIPE_CONFIG_243+1
530   {box_clock_1b[WIPE_B1_244], 1, 0, 0, 0},      /* 244 */
531 #define WIPE_CONFIG_245 WIPE_CONFIG_244+1
532   {triangles_2t[WIPE_T2_245], 2, 1, 1, 0},      /* 245 */
533 #define WIPE_CONFIG_246 WIPE_CONFIG_245+1
534   {triangles_2t[WIPE_T2_246], 2, 1, 1, 0},      /* 246 */
535 #define WIPE_CONFIG_251 WIPE_CONFIG_246+1
536   {box_clock_2b[WIPE_B2_251], 2, 1, 1, 0},      /* 251 */
537 #define WIPE_CONFIG_252 WIPE_CONFIG_251+1
538   {box_clock_2b[WIPE_B2_252], 2, 1, 1, 0},      /* 252 */
539 #define WIPE_CONFIG_253 WIPE_CONFIG_252+1
540   {box_clock_2b[WIPE_B2_253], 2, 1, 1, 0},      /* 253 */
541 #define WIPE_CONFIG_254 WIPE_CONFIG_253+1
542   {box_clock_2b[WIPE_B2_254], 2, 1, 1, 0},      /* 254 */
543
544 #define WIPE_CONFIG_261 WIPE_CONFIG_254+1
545   {box_clock_8b[WIPE_B8_261], 8, 2, 2, 2},      /* 261 */
546 #define WIPE_CONFIG_262 WIPE_CONFIG_261+1
547   {box_clock_8b[WIPE_B8_262], 8, 2, 2, 2},      /* 262 */
548 #define WIPE_CONFIG_263 WIPE_CONFIG_262+1
549   {box_clock_8b[WIPE_B8_263], 8, 2, 2, 1},      /* 263 */
550 #define WIPE_CONFIG_264 WIPE_CONFIG_263+1
551   {box_clock_8b[WIPE_B8_264], 8, 2, 2, 1},      /* 264 */
552 };
553
554 static void
555 gst_wipe_boxes_draw (GstMask * mask)
556 {
557   const GstWipeConfig *config = mask->user_data;
558   const gint *impacts = config->objects;
559   gint width = (mask->width >> config->xscale);
560   gint height = (mask->height >> config->yscale);
561   gint depth = (1 << mask->bpp) >> config->cscale;
562
563   gint i;
564
565   for (i = 0; i < config->nobjects; i++) {
566     switch (impacts[0]) {
567       case BOX_VERTICAL:
568         /* vbox does not draw last pixels */
569         gst_smpte_paint_vbox (mask->data, mask->width,
570             impacts[1] * width, impacts[2] * height, impacts[3] * depth,
571             impacts[4] * width, impacts[5] * height, impacts[6] * depth);
572         impacts += 7;
573         break;
574       case BOX_HORIZONTAL:
575         /* hbox does not draw last pixels */
576         gst_smpte_paint_hbox (mask->data, mask->width,
577             impacts[1] * width, impacts[2] * height, impacts[3] * depth,
578             impacts[4] * width, impacts[5] * height, impacts[6] * depth);
579         impacts += 7;
580         break;
581       case BOX_CLOCK:
582       {
583         gint x0, y0, x1, y1, x2, y2;
584
585         /* make sure not to draw outside the area */
586         x0 = MIN (impacts[1] * width, mask->width - 1);
587         y0 = MIN (impacts[2] * height, mask->height - 1);
588         x1 = MIN (impacts[4] * width, mask->width - 1);
589         y1 = MIN (impacts[5] * height, mask->height - 1);
590         x2 = MIN (impacts[7] * width, mask->width - 1);
591         y2 = MIN (impacts[8] * height, mask->height - 1);
592
593         gst_smpte_paint_box_clock (mask->data, mask->width,
594             x0, y0, impacts[3] * depth, x1, y1, impacts[6] * depth,
595             x2, y2, impacts[9] * depth);
596         impacts += 10;
597       }
598       default:
599         break;
600     }
601   }
602 }
603
604 static void
605 gst_wipe_triangles_clock_draw (GstMask * mask)
606 {
607   const GstWipeConfig *config = mask->user_data;
608   const gint *impacts = config->objects;
609   gint width = (mask->width >> config->xscale);
610   gint height = (mask->height >> config->yscale);
611   gint depth = (1 << mask->bpp) >> config->cscale;
612   gint i;
613
614   for (i = 0; i < config->nobjects; i++) {
615     gint x0, y0, x1, y1, x2, y2;
616
617     /* make sure not to draw outside the area */
618     x0 = MIN (impacts[0] * width, mask->width - 1);
619     y0 = MIN (impacts[1] * height, mask->height - 1);
620     x1 = MIN (impacts[3] * width, mask->width - 1);
621     y1 = MIN (impacts[4] * height, mask->height - 1);
622     x2 = MIN (impacts[6] * width, mask->width - 1);
623     y2 = MIN (impacts[7] * height, mask->height - 1);
624
625     gst_smpte_paint_triangle_clock (mask->data, mask->width,
626         x0, y0, impacts[2] * depth, x1, y1, impacts[5] * depth,
627         x2, y2, impacts[8] * depth);
628     impacts += 9;
629   }
630 }
631
632 static void
633 gst_wipe_triangles_draw (GstMask * mask)
634 {
635   const GstWipeConfig *config = mask->user_data;
636   const gint *impacts = config->objects;
637   gint width = (mask->width >> config->xscale);
638   gint height = (mask->height >> config->yscale);
639   gint depth = (1 << mask->bpp) >> config->cscale;
640
641   gint i;
642
643   for (i = 0; i < config->nobjects; i++) {
644     gint x0, y0, x1, y1, x2, y2;
645
646     /* make sure not to draw outside the area */
647     x0 = MIN (impacts[0] * width, mask->width - 1);
648     y0 = MIN (impacts[1] * height, mask->height - 1);
649     x1 = MIN (impacts[3] * width, mask->width - 1);
650     y1 = MIN (impacts[4] * height, mask->height - 1);
651     x2 = MIN (impacts[6] * width, mask->width - 1);
652     y2 = MIN (impacts[7] * height, mask->height - 1);
653
654     gst_smpte_paint_triangle_linear (mask->data, mask->width,
655         x0, y0, impacts[2] * depth, x1, y1, impacts[5] * depth,
656         x2, y2, impacts[8] * depth);
657     impacts += 9;
658   }
659 }
660
661 /* see also:
662  * http://www.w3c.rl.ac.uk/pasttalks/slidemaker/XML_Multimedia/htmls/transitions.html
663  */
664 static const GstMaskDefinition definitions[] = {
665   {1, "bar-wipe-lr",
666         "A bar moves from left to right",
667         gst_wipe_boxes_draw, _gst_mask_default_destroy,
668       &wipe_config[WIPE_CONFIG_1]},
669   {2, "bar-wipe-tb",
670         "A bar moves from top to bottom",
671         gst_wipe_boxes_draw, _gst_mask_default_destroy,
672       &wipe_config[WIPE_CONFIG_2]},
673   {3, "box-wipe-tl",
674         "A box expands from the upper-left corner to the lower-right corner",
675         gst_wipe_triangles_draw, _gst_mask_default_destroy,
676       &wipe_config[WIPE_CONFIG_3]},
677   {4, "box-wipe-tr",
678         "A box expands from the upper-right corner to the lower-left corner",
679         gst_wipe_triangles_draw, _gst_mask_default_destroy,
680       &wipe_config[WIPE_CONFIG_4]},
681   {5, "box-wipe-br",
682         "A box expands from the lower-right corner to the upper-left corner",
683         gst_wipe_triangles_draw, _gst_mask_default_destroy,
684       &wipe_config[WIPE_CONFIG_5]},
685   {6, "box-wipe-bl",
686         "A box expands from the lower-left corner to the upper-right corner",
687         gst_wipe_triangles_draw, _gst_mask_default_destroy,
688       &wipe_config[WIPE_CONFIG_6]},
689   {7, "four-box-wipe-ci",
690         "A box shape expands from each of the four corners toward the center",
691         gst_wipe_triangles_draw, _gst_mask_default_destroy,
692       &wipe_config[WIPE_CONFIG_7]},
693   {8, "four-box-wipe-co",
694         "A box shape expands from the center of each quadrant toward the corners of each quadrant",
695         gst_wipe_triangles_draw, _gst_mask_default_destroy,
696       &wipe_config[WIPE_CONFIG_8]},
697   {21, "barndoor-v",
698         "A central, vertical line splits and expands toward the left and right edges",
699         gst_wipe_boxes_draw, _gst_mask_default_destroy,
700       &wipe_config[WIPE_CONFIG_21]},
701   {22, "barndoor-h",
702         "A central, horizontal line splits and expands toward the top and bottom edges",
703         gst_wipe_boxes_draw, _gst_mask_default_destroy,
704       &wipe_config[WIPE_CONFIG_22]},
705   {23, "box-wipe-tc",
706         "A box expands from the top edge's midpoint to the bottom corners",
707         gst_wipe_triangles_draw, _gst_mask_default_destroy,
708       &wipe_config[WIPE_CONFIG_23]},
709   {24, "box-wipe-rc",
710         "A box expands from the right edge's midpoint to the left corners",
711         gst_wipe_triangles_draw, _gst_mask_default_destroy,
712       &wipe_config[WIPE_CONFIG_24]},
713   {25, "box-wipe-bc",
714         "A box expands from the bottom edge's midpoint to the top corners",
715         gst_wipe_triangles_draw, _gst_mask_default_destroy,
716       &wipe_config[WIPE_CONFIG_25]},
717   {26, "box-wipe-lc",
718         "A box expands from the left edge's midpoint to the right corners",
719         gst_wipe_triangles_draw, _gst_mask_default_destroy,
720       &wipe_config[WIPE_CONFIG_26]},
721   {41, "diagonal-tl",
722         "A diagonal line moves from the upper-left corner to the lower-right corner",
723         gst_wipe_triangles_draw, _gst_mask_default_destroy,
724       &wipe_config[WIPE_CONFIG_41]},
725   {42, "diagonal-tr",
726         "A diagonal line moves from the upper right corner to the lower-left corner",
727         gst_wipe_triangles_draw, _gst_mask_default_destroy,
728       &wipe_config[WIPE_CONFIG_42]},
729   {43, "bowtie-v",
730         "Two wedge shapes slide in from the top and bottom edges toward the center",
731         gst_wipe_triangles_draw, _gst_mask_default_destroy,
732       &wipe_config[WIPE_CONFIG_43]},
733   {44, "bowtie-h",
734         "Two wedge shapes slide in from the left and right edges toward the center",
735         gst_wipe_triangles_draw, _gst_mask_default_destroy,
736       &wipe_config[WIPE_CONFIG_44]},
737   {45, "barndoor-dbl",
738         "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners",
739         gst_wipe_triangles_draw, _gst_mask_default_destroy,
740       &wipe_config[WIPE_CONFIG_45]},
741   {46, "barndoor-dtl",
742         "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners",
743         gst_wipe_triangles_draw, _gst_mask_default_destroy,
744       &wipe_config[WIPE_CONFIG_46]},
745   {47, "misc-diagonal-dbd",
746         "Four wedge shapes split from the center and retract toward the four edges",
747         gst_wipe_triangles_draw, _gst_mask_default_destroy,
748       &wipe_config[WIPE_CONFIG_47]},
749   {48, "misc-diagonal-dd",
750         "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges",
751         gst_wipe_triangles_draw, _gst_mask_default_destroy,
752       &wipe_config[WIPE_CONFIG_48]},
753   {61, "vee-d",
754         "A wedge shape moves from top to bottom",
755         gst_wipe_triangles_draw, _gst_mask_default_destroy,
756       &wipe_config[WIPE_CONFIG_61]},
757   {62, "vee-l",
758         "A wedge shape moves from right to left",
759         gst_wipe_triangles_draw, _gst_mask_default_destroy,
760       &wipe_config[WIPE_CONFIG_62]},
761   {63, "vee-u",
762         "A wedge shape moves from bottom to top",
763         gst_wipe_triangles_draw, _gst_mask_default_destroy,
764       &wipe_config[WIPE_CONFIG_63]},
765   {64, "vee-r",
766         "A wedge shape moves from left to right",
767         gst_wipe_triangles_draw, _gst_mask_default_destroy,
768       &wipe_config[WIPE_CONFIG_64]},
769   {65, "barnvee-d",
770         "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
771         gst_wipe_triangles_draw, _gst_mask_default_destroy,
772       &wipe_config[WIPE_CONFIG_65]},
773   {66, "barnvee-l",
774         "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
775         gst_wipe_triangles_draw, _gst_mask_default_destroy,
776       &wipe_config[WIPE_CONFIG_66]},
777   {67, "barnvee-u",
778         "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
779         gst_wipe_triangles_draw, _gst_mask_default_destroy,
780       &wipe_config[WIPE_CONFIG_67]},
781   {68, "barnvee-r",
782         "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
783         gst_wipe_triangles_draw, _gst_mask_default_destroy,
784       &wipe_config[WIPE_CONFIG_68]},
785   {101, "iris-rect",
786         "A rectangle expands from the center.",
787         gst_wipe_triangles_draw, _gst_mask_default_destroy,
788       &wipe_config[WIPE_CONFIG_101]},
789   {201, "clock-cw12",
790         "A radial hand sweeps clockwise from the twelve o'clock position",
791         gst_wipe_boxes_draw, _gst_mask_default_destroy,
792       &wipe_config[WIPE_CONFIG_201]},
793   {202, "clock-cw3",
794         "A radial hand sweeps clockwise from the three o'clock position",
795         gst_wipe_boxes_draw, _gst_mask_default_destroy,
796       &wipe_config[WIPE_CONFIG_202]},
797   {203, "clock-cw6",
798         "A radial hand sweeps clockwise from the six o'clock position",
799         gst_wipe_boxes_draw, _gst_mask_default_destroy,
800       &wipe_config[WIPE_CONFIG_203]},
801   {204, "clock-cw9",
802         "A radial hand sweeps clockwise from the nine o'clock position",
803         gst_wipe_boxes_draw, _gst_mask_default_destroy,
804       &wipe_config[WIPE_CONFIG_204]},
805   {205, "pinwheel-tbv",
806         "Two radial hands sweep clockwise from the twelve and six o'clock positions",
807         gst_wipe_boxes_draw, _gst_mask_default_destroy,
808       &wipe_config[WIPE_CONFIG_205]},
809   {206, "pinwheel-tbh",
810         "Two radial hands sweep clockwise from the nine and three o'clock positions",
811         gst_wipe_boxes_draw, _gst_mask_default_destroy,
812       &wipe_config[WIPE_CONFIG_206]},
813   {207, "pinwheel-fb",
814         "Four radial hands sweep clockwise",
815         gst_wipe_boxes_draw, _gst_mask_default_destroy,
816       &wipe_config[WIPE_CONFIG_207]},
817   {211, "fan-ct",
818         "A fan unfolds from the top edge, the fan axis at the center",
819         gst_wipe_boxes_draw, _gst_mask_default_destroy,
820       &wipe_config[WIPE_CONFIG_211]},
821   {212, "fan-cr",
822         "A fan unfolds from the right edge, the fan axis at the center",
823         gst_wipe_boxes_draw, _gst_mask_default_destroy,
824       &wipe_config[WIPE_CONFIG_212]},
825   {213, "doublefan-fov",
826         "Two fans, their axes at the center, unfold from the top and bottom",
827         gst_wipe_boxes_draw, _gst_mask_default_destroy,
828       &wipe_config[WIPE_CONFIG_213]},
829   {214, "doublefan-foh",
830         "Two fans, their axes at the center, unfold from the left and right",
831         gst_wipe_boxes_draw, _gst_mask_default_destroy,
832       &wipe_config[WIPE_CONFIG_214]},
833   {221, "singlesweep-cwt",
834         "A radial hand sweeps clockwise from the top edge's midpoint",
835         gst_wipe_boxes_draw, _gst_mask_default_destroy,
836       &wipe_config[WIPE_CONFIG_221]},
837   {222, "singlesweep-cwr",
838         "A radial hand sweeps clockwise from the right edge's midpoint",
839         gst_wipe_boxes_draw, _gst_mask_default_destroy,
840       &wipe_config[WIPE_CONFIG_222]},
841   {223, "singlesweep-cwb",
842         "A radial hand sweeps clockwise from the bottom edge's midpoint",
843         gst_wipe_boxes_draw, _gst_mask_default_destroy,
844       &wipe_config[WIPE_CONFIG_223]},
845   {224, "singlesweep-cwl",
846         "A radial hand sweeps clockwise from the left edge's midpoint",
847         gst_wipe_boxes_draw, _gst_mask_default_destroy,
848       &wipe_config[WIPE_CONFIG_224]},
849   {225, "doublesweep-pv",
850         "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints",
851         gst_wipe_boxes_draw, _gst_mask_default_destroy,
852       &wipe_config[WIPE_CONFIG_225]},
853   {226, "doublesweep-pd",
854         "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints",
855         gst_wipe_boxes_draw, _gst_mask_default_destroy,
856       &wipe_config[WIPE_CONFIG_226]},
857   {227, "doublesweep-ov",
858         "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left",
859         gst_wipe_boxes_draw, _gst_mask_default_destroy,
860       &wipe_config[WIPE_CONFIG_227]},
861   {228, "doublesweep-oh",
862         "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom",
863         gst_wipe_boxes_draw, _gst_mask_default_destroy,
864       &wipe_config[WIPE_CONFIG_228]},
865   {231, "fan-t",
866         "A fan unfolds from the bottom, the fan axis at the top edge's midpoint",
867         gst_wipe_boxes_draw, _gst_mask_default_destroy,
868       &wipe_config[WIPE_CONFIG_231]},
869   {232, "fan-r",
870         "A fan unfolds from the left, the fan axis at the right edge's midpoint",
871         gst_wipe_boxes_draw, _gst_mask_default_destroy,
872       &wipe_config[WIPE_CONFIG_232]},
873   {233, "fan-b",
874         "A fan unfolds from the top, the fan axis at the bottom edge's midpoint",
875         gst_wipe_boxes_draw, _gst_mask_default_destroy,
876       &wipe_config[WIPE_CONFIG_233]},
877   {234, "fan-l",
878         "A fan unfolds from the right, the fan axis at the left edge's midpoint",
879         gst_wipe_boxes_draw, _gst_mask_default_destroy,
880       &wipe_config[WIPE_CONFIG_234]},
881   {235, "doublefan-fiv",
882         "Two fans, their axes at the top and bottom, unfold from the center",
883         gst_wipe_boxes_draw, _gst_mask_default_destroy,
884       &wipe_config[WIPE_CONFIG_235]},
885   {236, "doublefan-fih",
886         "Two fans, their axes at the left and right, unfold from the center",
887         gst_wipe_boxes_draw, _gst_mask_default_destroy,
888       &wipe_config[WIPE_CONFIG_236]},
889   {241, "singlesweep-cwtl",
890         "A radial hand sweeps clockwise from the upper-left corner",
891         gst_wipe_boxes_draw, _gst_mask_default_destroy,
892       &wipe_config[WIPE_CONFIG_241]},
893   {242, "singlesweep-cwbl",
894         "A radial hand sweeps counter-clockwise from the lower-left corner.",
895         gst_wipe_boxes_draw, _gst_mask_default_destroy,
896       &wipe_config[WIPE_CONFIG_242]},
897   {243, "singlesweep-cwbr",
898         "A radial hand sweeps clockwise from the lower-right corner",
899         gst_wipe_boxes_draw, _gst_mask_default_destroy,
900       &wipe_config[WIPE_CONFIG_243]},
901   {244, "singlesweep-cwtr",
902         "A radial hand sweeps counter-clockwise from the upper-right corner",
903         gst_wipe_boxes_draw, _gst_mask_default_destroy,
904       &wipe_config[WIPE_CONFIG_244]},
905   {245, "doublesweep-pdtl",
906         "Two radial hands attached at the upper-left and lower-right corners sweep down and up",
907         gst_wipe_triangles_clock_draw, _gst_mask_default_destroy,
908       &wipe_config[WIPE_CONFIG_245]},
909   {246, "doublesweep-pdbl",
910         "Two radial hands attached at the lower-left and upper-right corners sweep down and up",
911         gst_wipe_triangles_clock_draw, _gst_mask_default_destroy,
912       &wipe_config[WIPE_CONFIG_246]},
913   {251, "saloondoor-t",
914         "Two radial hands attached at the upper-left and upper-right corners sweep down",
915         gst_wipe_boxes_draw, _gst_mask_default_destroy,
916       &wipe_config[WIPE_CONFIG_251]},
917   {252, "saloondoor-l",
918         "Two radial hands attached at the upper-left and lower-left corners sweep to the right",
919         gst_wipe_boxes_draw, _gst_mask_default_destroy,
920       &wipe_config[WIPE_CONFIG_252]},
921   {253, "saloondoor-b",
922         "Two radial hands attached at the lower-left and lower-right corners sweep up",
923         gst_wipe_boxes_draw, _gst_mask_default_destroy,
924       &wipe_config[WIPE_CONFIG_253]},
925   {254, "saloondoor-r",
926         "Two radial hands attached at the upper-right and lower-right corners sweep to the left",
927         gst_wipe_boxes_draw, _gst_mask_default_destroy,
928       &wipe_config[WIPE_CONFIG_254]},
929   {261, "windshield-r",
930         "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left",
931         gst_wipe_boxes_draw, _gst_mask_default_destroy,
932       &wipe_config[WIPE_CONFIG_261]},
933   {262, "windshield-u",
934         "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom",
935         gst_wipe_boxes_draw, _gst_mask_default_destroy,
936       &wipe_config[WIPE_CONFIG_262]},
937   {263, "windshield-v",
938         "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top",
939         gst_wipe_boxes_draw, _gst_mask_default_destroy,
940       &wipe_config[WIPE_CONFIG_263]},
941   {264, "windshield-h",
942         "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left",
943         gst_wipe_boxes_draw, _gst_mask_default_destroy,
944       &wipe_config[WIPE_CONFIG_264]},
945   {0, NULL, NULL, NULL}
946 };
947
948 void
949 _gst_barboxwipes_register (void)
950 {
951   gint i = 0;
952
953   while (definitions[i].short_name) {
954     _gst_mask_register (&definitions[i]);
955     i++;
956   }
957 }