From 5d25c00e4b613b9cdf2c04fa3a68dffa03834a68 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 14 Mar 2004 22:34:33 +0000 Subject: gst-indent Original commit message from CVS: gst-indent --- gst/smpte/barboxwipes.c | 1186 +++++++++++++++++++++++------------------------ gst/smpte/gstmask.c | 20 +- gst/smpte/gstmask.h | 50 +- gst/smpte/gstsmpte.c | 292 ++++++------ gst/smpte/gstsmpte.h | 32 +- gst/smpte/paint.c | 162 +++---- gst/smpte/paint.h | 31 +- 7 files changed, 876 insertions(+), 897 deletions(-) (limited to 'gst/smpte') diff --git a/gst/smpte/barboxwipes.c b/gst/smpte/barboxwipes.c index a490f632..2508adf4 100644 --- a/gst/smpte/barboxwipes.c +++ b/gst/smpte/barboxwipes.c @@ -26,544 +26,533 @@ enum { - BOX_VERTICAL = 1, - BOX_HORIZONTAL = 2, - BOX_CLOCK = 3, - TRIGANLE_LINEAR = 4, + BOX_VERTICAL = 1, + BOX_HORIZONTAL = 2, + BOX_CLOCK = 3, + TRIGANLE_LINEAR = 4, }; -static gint boxes_1b[][7] = -{ +static gint boxes_1b[][7] = { #define WIPE_B1_1 0 - { BOX_VERTICAL, 0, 0, 0, 1, 1, 1 }, + {BOX_VERTICAL, 0, 0, 0, 1, 1, 1}, #define WIPE_B1_2 1 - { BOX_HORIZONTAL, 0, 0, 0, 1, 1, 1 } + {BOX_HORIZONTAL, 0, 0, 0, 1, 1, 1} }; -static gint boxes_2b[][7*2] = -{ +static gint boxes_2b[][7 * 2] = { #define WIPE_B2_21 0 - { BOX_VERTICAL, 0, 0, 1, 1, 2, 0, - BOX_VERTICAL, 1, 0, 0, 2, 2, 1 }, + {BOX_VERTICAL, 0, 0, 1, 1, 2, 0, + BOX_VERTICAL, 1, 0, 0, 2, 2, 1}, #define WIPE_B2_22 1 - { BOX_HORIZONTAL, 0, 0, 1, 2, 1, 0, - BOX_HORIZONTAL, 0, 1, 0, 2, 2, 1 }, + {BOX_HORIZONTAL, 0, 0, 1, 2, 1, 0, + BOX_HORIZONTAL, 0, 1, 0, 2, 2, 1}, }; -static gint box_clock_1b[][1*10] = -{ +static gint box_clock_1b[][1 * 10] = { #define WIPE_B1_241 0 - { BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 1, 1 }, + {BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 1, 1}, #define WIPE_B1_242 1 - { BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1 }, + {BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1}, #define WIPE_B1_243 2 - { BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1 }, + {BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B1_244 3 - { BOX_CLOCK, 1, 0, 0, 0, 0, 0, 1, 1, 1 }, + {BOX_CLOCK, 1, 0, 0, 0, 0, 0, 1, 1, 1}, }; #define WIPE_B2_221 0 -static gint box_clock_2b[][2*10] = -{ +static gint box_clock_2b[][2 * 10] = { #define WIPE_B2_221 0 - { BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 2, 1, - BOX_CLOCK, 1, 0, 0, 1, 2, 1, 0, 0, 2 }, + {BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 2, 1, + BOX_CLOCK, 1, 0, 0, 1, 2, 1, 0, 0, 2}, #define WIPE_B2_222 1 - { BOX_CLOCK, 2, 1, 0, 2, 2, 0, 0, 1, 1, - BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 0, 2 }, + {BOX_CLOCK, 2, 1, 0, 2, 2, 0, 0, 1, 1, + BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 0, 2}, #define WIPE_B2_223 2 - { BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2 }, + {BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1, + BOX_CLOCK, 1, 2, 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, 0, 1, 0, 0, 0, 2, 1}, #define WIPE_B2_234 9 - { BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 0, 1, - BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 2, 1 }, + {BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 0, 1, + BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 2, 1}, #define WIPE_B2_251 10 - { BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 2, 1, - BOX_CLOCK, 2, 0, 0, 1, 0, 0, 2, 2, 1 }, + {BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 2, 1, + BOX_CLOCK, 2, 0, 0, 1, 0, 0, 2, 2, 1}, #define WIPE_B2_252 11 - { BOX_CLOCK, 0, 0, 0, 0, 1, 0, 2, 0, 1, - BOX_CLOCK, 0, 2, 0, 0, 1, 0, 2, 2, 1 }, + {BOX_CLOCK, 0, 0, 0, 0, 1, 0, 2, 0, 1, + BOX_CLOCK, 0, 2, 0, 0, 1, 0, 2, 2, 1}, #define WIPE_B2_253 12 - { BOX_CLOCK, 0, 2, 0, 1, 2, 0, 0, 0, 1, - BOX_CLOCK, 2, 2, 0, 1, 2, 0, 2, 0, 1 }, + {BOX_CLOCK, 0, 2, 0, 1, 2, 0, 0, 0, 1, + BOX_CLOCK, 2, 2, 0, 1, 2, 0, 2, 0, 1}, #define WIPE_B2_254 13 - { BOX_CLOCK, 2, 0, 0, 2, 1, 0, 0, 0, 1, - BOX_CLOCK, 2, 2, 0, 2, 1, 0, 0, 2, 1 }, + {BOX_CLOCK, 2, 0, 0, 2, 1, 0, 0, 0, 1, + BOX_CLOCK, 2, 2, 0, 2, 1, 0, 0, 2, 1}, }; -static gint box_clock_4b[][4*10] = -{ +static gint box_clock_4b[][4 * 10] = { #define WIPE_B4_201 0 - { BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK,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, #define WIPE_B4_235 13 - { BOX_CLOCK, 1, 0, 0, 1, 1, 0, 0, 0, 1, - BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1, - BOX_CLOCK, 1, 2, 0, 1, 1, 0, 0, 2, 1 }, + {BOX_CLOCK, 1, 0, 0, 1, 1, 0, 0, 0, 1, + BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1, + BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1, + BOX_CLOCK, 1, 2, 0, 1, 1, 0, 0, 2, 1}, #define WIPE_B4_236 14 - { BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1, - BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1, - BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1, - BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 2, 1 }, + {BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1, + BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1, + BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1, + BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 2, 1}, }; -static gint box_clock_8b[][8*10] = -{ +static gint box_clock_8b[][8 * 10] = { #define WIPE_B8_261 0 - { BOX_CLOCK, 2, 1, 0, 2, 2, 0, 4, 1, 1, - BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 0, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 2, 0, 1, 3, - BOX_CLOCK, 2, 1, 0, 0, 1, 3, 2, 2, 4, - BOX_CLOCK, 2, 3, 0, 2, 2, 0, 4, 3, 1, - BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 4, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 2, 0, 3, 3, - BOX_CLOCK, 2, 3, 0, 0, 3, 3, 2, 2, 4 }, + {BOX_CLOCK,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 0, 3, 0, 1, + BOX_CLOCK, 3, 2, 0, 3, 0, 1, 2, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1, + BOX_CLOCK, 3, 2, 0, 3, 4, 1, 2, 2, 2}, }; -static gint triangles_2t[][2*9] = -{ +static gint triangles_2t[][2 * 9] = { /* 3 -> 6 */ #define WIPE_T2_3 0 - { 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 0, 1, 0, 0, 0, 1, 1, 1 }, + {0, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 0, 1, 0, 0, 0, 1, 1, 1}, #define WIPE_T2_4 WIPE_T2_3+1 - { 0, 0, 1, 1, 0, 0, 0, 1, 1, - 1, 0, 0, 0, 1, 1, 1, 1, 1 }, + {0, 0, 1, 1, 0, 0, 0, 1, 1, + 1, 0, 0, 0, 1, 1, 1, 1, 1}, #define WIPE_T2_5 WIPE_T2_4+1 - { 0, 0, 1, 0, 1, 1, 1, 1, 0, - 1, 0, 1, 0, 0, 1, 1, 1, 0 }, + {0, 0, 1, 0, 1, 1, 1, 1, 0, + 1, 0, 1, 0, 0, 1, 1, 1, 0}, #define WIPE_T2_6 WIPE_T2_5+1 - { 0, 0, 1, 1, 0, 1, 0, 1, 0, - 1, 0, 1, 0, 1, 0, 1, 1, 1 }, + {0, 0, 1, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 1, 1}, #define WIPE_T2_41 WIPE_T2_6+1 - { 0, 0, 0, 1, 0, 1, 0, 1, 1, - 1, 0, 1, 0, 1, 1, 1, 1, 2 }, + {0, 0, 0, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 0, 1, 1, 1, 1, 2}, #define WIPE_T2_42 WIPE_T2_41+1 - { 0, 0, 1, 1, 0, 0, 1, 1, 1, - 0, 0, 1, 0, 1, 2, 1, 1, 1 }, + {0, 0, 1, 1, 0, 0, 1, 1, 1, + 0, 0, 1, 0, 1, 2, 1, 1, 1}, #define WIPE_T2_45 WIPE_T2_42+1 - { 0, 0, 1, 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 1, 1, 1 }, + {0, 0, 1, 1, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1}, #define WIPE_T2_46 WIPE_T2_45+1 - { 0, 0, 0, 1, 0, 1, 1, 1, 0, - 0, 0, 0, 0, 1, 1, 1, 1, 0 }, + {0, 0, 0, 1, 0, 1, 1, 1, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 0}, #define WIPE_T2_245 WIPE_T2_46+1 - { 0, 0, 0, 2, 0, 0, 2, 2, 1, - 2, 2, 0, 0, 2, 0, 0, 0, 1 }, + {0, 0, 0, 2, 0, 0, 2, 2, 1, + 2, 2, 0, 0, 2, 0, 0, 0, 1}, #define WIPE_T2_246 WIPE_T2_245+1 - { 0, 2, 0, 0, 0, 0, 2, 0, 1, - 2, 0, 0, 2, 2, 0, 0, 2, 1 }, + {0, 2, 0, 0, 0, 0, 2, 0, 1, + 2, 0, 0, 2, 2, 0, 0, 2, 1}, }; -static gint triangles_3t[][3*9] = -{ +static gint triangles_3t[][3 * 9] = { /* 23 -> 26 */ #define WIPE_T3_23 0 - { 0, 0, 1, 1, 0, 0, 0, 2, 1, - 1, 0, 0, 0, 2, 1, 2, 2, 1, - 1, 0, 0, 2, 0, 1, 2, 2, 1 }, + {0, 0, 1, 1, 0, 0, 0, 2, 1, + 1, 0, 0, 0, 2, 1, 2, 2, 1, + 1, 0, 0, 2, 0, 1, 2, 2, 1}, #define WIPE_T3_24 1 - { 0, 0, 1, 2, 0, 1, 2, 1, 0, - 0, 0, 1, 2, 1, 0, 0, 2, 1, - 2, 1, 0, 0, 2, 1, 2, 2, 1 }, + {0, 0, 1, 2, 0, 1, 2, 1, 0, + 0, 0, 1, 2, 1, 0, 0, 2, 1, + 2, 1, 0, 0, 2, 1, 2, 2, 1}, #define WIPE_T3_25 2 - { 0, 0, 1, 0, 2, 1, 1, 2, 0, - 0, 0, 1, 2, 0, 1, 1, 2, 0, - 2, 0, 1, 1, 2, 0, 2, 2, 1 }, + {0, 0, 1, 0, 2, 1, 1, 2, 0, + 0, 0, 1, 2, 0, 1, 1, 2, 0, + 2, 0, 1, 1, 2, 0, 2, 2, 1}, #define WIPE_T3_26 3 - { 0, 0, 1, 2, 0, 1, 0, 1, 0, - 2, 0, 1, 0, 1, 0, 2, 2, 1, - 0, 1, 0, 0, 2, 1, 2, 2, 1 }, + {0, 0, 1, 2, 0, 1, 0, 1, 0, + 2, 0, 1, 0, 1, 0, 2, 2, 1, + 0, 1, 0, 0, 2, 1, 2, 2, 1}, }; -static gint triangles_4t[][4*9] = -{ +static gint triangles_4t[][4 * 9] = { #define WIPE_T4_61 0 - { 0, 0, 1, 1, 0, 0, 1, 2, 1, - 0, 0, 1, 0, 2, 2, 1, 2, 1, - 1, 0, 0, 2, 0, 1, 1, 2, 1, - 2, 0, 1, 1, 2, 1, 2, 2, 2 }, + {0, 0, 1, 1, 0, 0, 1, 2, 1, + 0, 0, 1, 0, 2, 2, 1, 2, 1, + 1, 0, 0, 2, 0, 1, 1, 2, 1, + 2, 0, 1, 1, 2, 1, 2, 2, 2}, #define WIPE_T4_62 1 - { 0, 0, 2, 2, 0, 1, 0, 1, 1, - 2, 0, 1, 0, 1, 1, 2, 1, 0, - 0, 1, 1, 2, 1, 0, 2, 2, 1, - 0, 1, 1, 0, 2, 2, 2, 2, 1 }, + {0, 0, 2, 2, 0, 1, 0, 1, 1, + 2, 0, 1, 0, 1, 1, 2, 1, 0, + 0, 1, 1, 2, 1, 0, 2, 2, 1, + 0, 1, 1, 0, 2, 2, 2, 2, 1}, #define WIPE_T4_63 2 - { 0, 0, 2, 1, 0, 1, 0, 2, 1, - 1, 0, 1, 0, 2, 1, 1, 2, 0, - 1, 0, 1, 1, 2, 0, 2, 2, 1, - 1, 0, 1, 2, 0, 2, 2, 2, 1 }, + {0, 0, 2, 1, 0, 1, 0, 2, 1, + 1, 0, 1, 0, 2, 1, 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2, 2, 0}, #define WIPE_T4_68 7 - { 0, 0, 0, 2, 0, 1, 2, 1, 0, - 0, 0, 0, 0, 1, 1, 2, 1, 0, - 0, 1, 1, 2, 1, 0, 0, 2, 0, - 2, 1, 0, 0, 2, 0, 2, 2, 1 }, + {0, 0, 0, 2, 0, 1, 2, 1, 0, + 0, 0, 0, 0, 1, 1, 2, 1, 0, + 0, 1, 1, 2, 1, 0, 0, 2, 0, + 2, 1, 0, 0, 2, 0, 2, 2, 1}, #define WIPE_T4_101 8 - { 0, 0, 1, 2, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, 2, 1, - 1, 1, 0, 0, 2, 1, 2, 2, 1, - 2, 0, 1, 1, 1, 0, 2, 2, 1 }, + {0, 0, 1, 2, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 0, 0, 2, 1, + 1, 1, 0, 0, 2, 1, 2, 2, 1, + 2, 0, 1, 1, 1, 0, 2, 2, 1}, }; -static gint triangles_8t[][8*9] = -{ +static gint triangles_8t[][8 * 9] = { /* 7 */ #define WIPE_T8_7 0 - { 0, 0, 0, 1, 0, 1, 1, 1, 1, - 1, 0, 1, 2, 0, 0, 1, 1, 1, - 2, 0, 0, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 2, 1, 1, 2, 2, 0, - 1, 1, 1, 1, 2, 1, 2, 2, 0, - 1, 1, 1, 0, 2, 0, 1, 2, 1, - 0, 1, 1, 1, 1, 1, 0, 2, 0, - 0, 0, 0, 0, 1, 1, 1, 1, 1 }, + {0, 0, 0, 1, 0, 1, 1, 1, 1, + 1, 0, 1, 2, 0, 0, 1, 1, 1, + 2, 0, 0, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 2, 1, 1, 2, 2, 0, + 1, 1, 1, 1, 2, 1, 2, 2, 0, + 1, 1, 1, 0, 2, 0, 1, 2, 1, + 0, 1, 1, 1, 1, 1, 0, 2, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 1}, #define WIPE_T8_43 1 - {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, 0, - 4, 0, 1, 3, 1, 0, 4, 2, 1, - 3, 1, 0, 2, 2, 1, 4, 2, 1, - 2, 0, 1, 3, 1, 0, 2, 2, 1, - 0, 2, 1, 2, 2, 1, 1, 3, 0, - 2, 2, 1, 1, 3, 0, 2, 4, 1, - 1, 3, 0, 0, 4, 1, 2, 4, 1, - 0, 2, 1, 1, 3, 0, 0, 4, 1, - 2, 2, 1, 4, 2, 1, 3, 3, 0, - 4, 2, 1, 3, 3, 0, 4, 4, 1, - 3, 3, 0, 2, 4, 1, 4, 4, 1, - 2, 2, 1, 3, 3, 0, 2, 4, 1 } + {0, 0, 1, 2, 0, 1, 1, 1, 0, + 2, 0, 1, 1, 1, 0, 2, 2, 1, + 1, 1, 0, 0, 2, 1, 2, 2, 1, + 0, 0, 1, 1, 1, 0, 0, 2, 1, + 2, 0, 1, 4, 0, 1, 3, 1, 0, + 4, 0, 1, 3, 1, 0, 4, 2, 1, + 3, 1, 0, 2, 2, 1, 4, 2, 1, + 2, 0, 1, 3, 1, 0, 2, 2, 1, + 0, 2, 1, 2, 2, 1, 1, 3, 0, + 2, 2, 1, 1, 3, 0, 2, 4, 1, + 1, 3, 0, 0, 4, 1, 2, 4, 1, + 0, 2, 1, 1, 3, 0, 0, 4, 1, + 2, 2, 1, 4, 2, 1, 3, 3, 0, + 4, 2, 1, 3, 3, 0, 4, 4, 1, + 3, 3, 0, 2, 4, 1, 4, 4, 1, + 2, 2, 1, 3, 3, 0, 2, 4, 1} }; typedef struct _GstWipeConfig GstWipeConfig; -struct _GstWipeConfig { - gint *objects; - gint nobjects; - gint xscale; - gint yscale; - gint cscale; +struct _GstWipeConfig +{ + gint *objects; + gint nobjects; + gint xscale; + gint yscale; + gint cscale; }; -static GstWipeConfig wipe_config[] = -{ +static GstWipeConfig wipe_config[] = { #define WIPE_CONFIG_1 0 - { boxes_1b[WIPE_B1_1], 1, 0, 0, 0 }, /* 1 */ + {boxes_1b[WIPE_B1_1], 1, 0, 0, 0}, /* 1 */ #define WIPE_CONFIG_2 WIPE_CONFIG_1+1 - { boxes_1b[WIPE_B1_2], 1, 0, 0, 0 }, /* 2 */ + {boxes_1b[WIPE_B1_2], 1, 0, 0, 0}, /* 2 */ #define WIPE_CONFIG_3 WIPE_CONFIG_2+1 - { triangles_2t[WIPE_T2_3], 2, 0, 0, 0 }, /* 3 */ + {triangles_2t[WIPE_T2_3], 2, 0, 0, 0}, /* 3 */ #define WIPE_CONFIG_4 WIPE_CONFIG_3+1 - { triangles_2t[WIPE_T2_4], 2, 0, 0, 0 }, /* 4 */ + {triangles_2t[WIPE_T2_4], 2, 0, 0, 0}, /* 4 */ #define WIPE_CONFIG_5 WIPE_CONFIG_4+1 - { triangles_2t[WIPE_T2_5], 2, 0, 0, 0 }, /* 5 */ + {triangles_2t[WIPE_T2_5], 2, 0, 0, 0}, /* 5 */ #define WIPE_CONFIG_6 WIPE_CONFIG_5+1 - { triangles_2t[WIPE_T2_6], 2, 0, 0, 0 }, /* 6 */ + {triangles_2t[WIPE_T2_6], 2, 0, 0, 0}, /* 6 */ #define WIPE_CONFIG_7 WIPE_CONFIG_6+1 - { triangles_8t[WIPE_T8_7], 8, 1, 1, 0 }, /* 7 */ + {triangles_8t[WIPE_T8_7], 8, 1, 1, 0}, /* 7 */ #define WIPE_CONFIG_8 WIPE_CONFIG_7+1 - { triangles_16t[WIPE_T16_8], 16, 2, 2, 0 }, /* 8 */ + {triangles_16t[WIPE_T16_8], 16, 2, 2, 0}, /* 8 */ #define WIPE_CONFIG_21 WIPE_CONFIG_8+1 - { boxes_2b[WIPE_B2_21], 2, 1, 1, 0 }, /* 21 */ + {boxes_2b[WIPE_B2_21], 2, 1, 1, 0}, /* 21 */ #define WIPE_CONFIG_22 WIPE_CONFIG_21+1 - { boxes_2b[WIPE_B2_22], 2, 1, 1, 0 }, /* 22 */ + {boxes_2b[WIPE_B2_22], 2, 1, 1, 0}, /* 22 */ #define WIPE_CONFIG_23 WIPE_CONFIG_22+1 - { triangles_3t[WIPE_T3_23], 3, 1, 1, 0 }, /* 23 */ + {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 23 */ #define WIPE_CONFIG_24 WIPE_CONFIG_23+1 - { triangles_3t[WIPE_T3_24], 3, 1, 1, 0 }, /* 24 */ + {triangles_3t[WIPE_T3_24], 3, 1, 1, 0}, /* 24 */ #define WIPE_CONFIG_25 WIPE_CONFIG_24+1 - { triangles_3t[WIPE_T3_23], 3, 1, 1, 0 }, /* 25 */ + {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 25 */ #define WIPE_CONFIG_26 WIPE_CONFIG_25+1 - { triangles_3t[WIPE_T3_26], 3, 1, 1, 0 }, /* 26 */ + {triangles_3t[WIPE_T3_26], 3, 1, 1, 0}, /* 26 */ #define WIPE_CONFIG_41 WIPE_CONFIG_26+1 - { triangles_2t[WIPE_T2_41], 2, 0, 0, 1 }, /* 41 */ + {triangles_2t[WIPE_T2_41], 2, 0, 0, 1}, /* 41 */ #define WIPE_CONFIG_42 WIPE_CONFIG_41+1 - { triangles_2t[WIPE_T2_42], 2, 0, 0, 1 }, /* 42 */ + {triangles_2t[WIPE_T2_42], 2, 0, 0, 1}, /* 42 */ #define WIPE_CONFIG_43 WIPE_CONFIG_42+1 - { triangles_8t[WIPE_T8_43], 8, 1, 1, 1 }, /* 43 */ + {triangles_8t[WIPE_T8_43], 8, 1, 1, 1}, /* 43 */ #define WIPE_CONFIG_44 WIPE_CONFIG_43+1 - { triangles_8t[WIPE_T8_44], 8, 1, 1, 1 }, /* 44 */ + {triangles_8t[WIPE_T8_44], 8, 1, 1, 1}, /* 44 */ #define WIPE_CONFIG_45 WIPE_CONFIG_44+1 - { triangles_2t[WIPE_T2_45], 2, 0, 0, 0 }, /* 45 */ + {triangles_2t[WIPE_T2_45], 2, 0, 0, 0}, /* 45 */ #define WIPE_CONFIG_46 WIPE_CONFIG_45+1 - { triangles_2t[WIPE_T2_46], 2, 0, 0, 0 }, /* 46 */ + {triangles_2t[WIPE_T2_46], 2, 0, 0, 0}, /* 46 */ #define WIPE_CONFIG_47 WIPE_CONFIG_46+1 - { triangles_8t[WIPE_T8_47], 8, 1, 1, 0 }, /* 47 */ + {triangles_8t[WIPE_T8_47], 8, 1, 1, 0}, /* 47 */ #define WIPE_CONFIG_48 WIPE_CONFIG_47+1 - { triangles_8t[WIPE_T8_48], 8, 1, 1, 0 }, /* 48 */ + {triangles_8t[WIPE_T8_48], 8, 1, 1, 0}, /* 48 */ #define WIPE_CONFIG_61 WIPE_CONFIG_48+1 - { triangles_4t[WIPE_T4_61], 4, 1, 1, 1 }, /* 61 */ + {triangles_4t[WIPE_T4_61], 4, 1, 1, 1}, /* 61 */ #define WIPE_CONFIG_62 WIPE_CONFIG_61+1 - { triangles_4t[WIPE_T4_62], 4, 1, 1, 1 }, /* 62 */ + {triangles_4t[WIPE_T4_62], 4, 1, 1, 1}, /* 62 */ #define WIPE_CONFIG_63 WIPE_CONFIG_62+1 - { triangles_4t[WIPE_T4_63], 4, 1, 1, 1 }, /* 63 */ + {triangles_4t[WIPE_T4_63], 4, 1, 1, 1}, /* 63 */ #define WIPE_CONFIG_64 WIPE_CONFIG_63+1 - { triangles_4t[WIPE_T4_64], 4, 1, 1, 1 }, /* 64 */ + {triangles_4t[WIPE_T4_64], 4, 1, 1, 1}, /* 64 */ #define WIPE_CONFIG_65 WIPE_CONFIG_64+1 - { triangles_4t[WIPE_T4_65], 4, 1, 1, 0 }, /* 65 */ + {triangles_4t[WIPE_T4_65], 4, 1, 1, 0}, /* 65 */ #define WIPE_CONFIG_66 WIPE_CONFIG_65+1 - { triangles_4t[WIPE_T4_66], 4, 1, 1, 0 }, /* 66 */ + {triangles_4t[WIPE_T4_66], 4, 1, 1, 0}, /* 66 */ #define WIPE_CONFIG_67 WIPE_CONFIG_66+1 - { triangles_4t[WIPE_T4_67], 4, 1, 1, 0 }, /* 67 */ + {triangles_4t[WIPE_T4_67], 4, 1, 1, 0}, /* 67 */ #define WIPE_CONFIG_68 WIPE_CONFIG_67+1 - { triangles_4t[WIPE_T4_68], 4, 1, 1, 0 }, /* 68 */ + {triangles_4t[WIPE_T4_68], 4, 1, 1, 0}, /* 68 */ #define WIPE_CONFIG_101 WIPE_CONFIG_68+1 - { triangles_4t[WIPE_T4_101], 4, 1, 1, 0 }, /* 101 */ + {triangles_4t[WIPE_T4_101], 4, 1, 1, 0}, /* 101 */ #define WIPE_CONFIG_201 WIPE_CONFIG_101+1 - { box_clock_4b[WIPE_B4_201], 4, 1, 1, 2 }, /* 201 */ + {box_clock_4b[WIPE_B4_201], 4, 1, 1, 2}, /* 201 */ #define WIPE_CONFIG_202 WIPE_CONFIG_201+1 - { box_clock_4b[WIPE_B4_202], 4, 1, 1, 2 }, /* 202 */ + {box_clock_4b[WIPE_B4_202], 4, 1, 1, 2}, /* 202 */ #define WIPE_CONFIG_203 WIPE_CONFIG_202+1 - { box_clock_4b[WIPE_B4_203], 4, 1, 1, 2 }, /* 203 */ + {box_clock_4b[WIPE_B4_203], 4, 1, 1, 2}, /* 203 */ #define WIPE_CONFIG_204 WIPE_CONFIG_203+1 - { box_clock_4b[WIPE_B4_204], 4, 1, 1, 2 }, /* 204 */ + {box_clock_4b[WIPE_B4_204], 4, 1, 1, 2}, /* 204 */ #define WIPE_CONFIG_205 WIPE_CONFIG_204+1 - { box_clock_4b[WIPE_B4_205], 4, 1, 1, 1 }, /* 205 */ + {box_clock_4b[WIPE_B4_205], 4, 1, 1, 1}, /* 205 */ #define WIPE_CONFIG_206 WIPE_CONFIG_205+1 - { box_clock_4b[WIPE_B4_206], 4, 1, 1, 1 }, /* 206 */ + {box_clock_4b[WIPE_B4_206], 4, 1, 1, 1}, /* 206 */ #define WIPE_CONFIG_207 WIPE_CONFIG_206+1 - { box_clock_4b[WIPE_B4_207], 4, 1, 1, 0 }, /* 207 */ + {box_clock_4b[WIPE_B4_207], 4, 1, 1, 0}, /* 207 */ #define WIPE_CONFIG_211 WIPE_CONFIG_207+1 - { box_clock_4b[WIPE_B4_211], 4, 1, 1, 1 }, /* 211 */ + {box_clock_4b[WIPE_B4_211], 4, 1, 1, 1}, /* 211 */ #define WIPE_CONFIG_212 WIPE_CONFIG_211+1 - { box_clock_4b[WIPE_B4_212], 4, 1, 1, 1 }, /* 212 */ + {box_clock_4b[WIPE_B4_212], 4, 1, 1, 1}, /* 212 */ #define WIPE_CONFIG_213 WIPE_CONFIG_212+1 - { box_clock_4b[WIPE_B4_213], 4, 1, 1, 0 }, /* 213 */ + {box_clock_4b[WIPE_B4_213], 4, 1, 1, 0}, /* 213 */ #define WIPE_CONFIG_214 WIPE_CONFIG_213+1 - { box_clock_4b[WIPE_B4_214], 4, 1, 1, 0 }, /* 214 */ + {box_clock_4b[WIPE_B4_214], 4, 1, 1, 0}, /* 214 */ #define WIPE_CONFIG_221 WIPE_CONFIG_214+1 - { box_clock_2b[WIPE_B2_221], 2, 1, 1, 1 }, /* 221 */ + {box_clock_2b[WIPE_B2_221], 2, 1, 1, 1}, /* 221 */ #define WIPE_CONFIG_222 WIPE_CONFIG_221+1 - { box_clock_2b[WIPE_B2_222], 2, 1, 1, 1 }, /* 222 */ + {box_clock_2b[WIPE_B2_222], 2, 1, 1, 1}, /* 222 */ #define WIPE_CONFIG_223 WIPE_CONFIG_222+1 - { box_clock_2b[WIPE_B2_223], 2, 1, 1, 1 }, /* 223 */ + {box_clock_2b[WIPE_B2_223], 2, 1, 1, 1}, /* 223 */ #define WIPE_CONFIG_224 WIPE_CONFIG_223+1 - { box_clock_2b[WIPE_B2_224], 2, 1, 1, 1 }, /* 224 */ + {box_clock_2b[WIPE_B2_224], 2, 1, 1, 1}, /* 224 */ #define WIPE_CONFIG_225 WIPE_CONFIG_224+1 - { box_clock_2b[WIPE_B2_225], 2, 1, 1, 0 }, /* 225 */ + {box_clock_2b[WIPE_B2_225], 2, 1, 1, 0}, /* 225 */ #define WIPE_CONFIG_226 WIPE_CONFIG_225+1 - { box_clock_2b[WIPE_B2_226], 2, 1, 1, 0 }, /* 226 */ + {box_clock_2b[WIPE_B2_226], 2, 1, 1, 0}, /* 226 */ #define WIPE_CONFIG_227 WIPE_CONFIG_226+1 - { box_clock_4b[WIPE_B4_227], 4, 1, 1, 1 }, /* 227 */ + {box_clock_4b[WIPE_B4_227], 4, 1, 1, 1}, /* 227 */ #define WIPE_CONFIG_228 WIPE_CONFIG_227+1 - { box_clock_4b[WIPE_B4_228], 4, 1, 1, 1 }, /* 228 */ + {box_clock_4b[WIPE_B4_228], 4, 1, 1, 1}, /* 228 */ #define WIPE_CONFIG_231 WIPE_CONFIG_228+1 - { box_clock_2b[WIPE_B2_231], 2, 1, 1, 0 }, /* 231 */ + {box_clock_2b[WIPE_B2_231], 2, 1, 1, 0}, /* 231 */ #define WIPE_CONFIG_232 WIPE_CONFIG_231+1 - { box_clock_2b[WIPE_B2_232], 2, 1, 1, 0 }, /* 232 */ + {box_clock_2b[WIPE_B2_232], 2, 1, 1, 0}, /* 232 */ #define WIPE_CONFIG_233 WIPE_CONFIG_232+1 - { box_clock_2b[WIPE_B2_233], 2, 1, 1, 0 }, /* 233 */ + {box_clock_2b[WIPE_B2_233], 2, 1, 1, 0}, /* 233 */ #define WIPE_CONFIG_234 WIPE_CONFIG_233+1 - { box_clock_2b[WIPE_B2_234], 2, 1, 1, 0 }, /* 234 */ + {box_clock_2b[WIPE_B2_234], 2, 1, 1, 0}, /* 234 */ #define WIPE_CONFIG_235 WIPE_CONFIG_234+1 - { box_clock_4b[WIPE_B4_235], 4, 1, 1, 0 }, /* 235 */ + {box_clock_4b[WIPE_B4_235], 4, 1, 1, 0}, /* 235 */ #define WIPE_CONFIG_236 WIPE_CONFIG_235+1 - { box_clock_4b[WIPE_B4_236], 4, 1, 1, 0 }, /* 236 */ + {box_clock_4b[WIPE_B4_236], 4, 1, 1, 0}, /* 236 */ #define WIPE_CONFIG_241 WIPE_CONFIG_236+1 - { box_clock_1b[WIPE_B1_241], 1, 0, 0, 0 }, /* 241 */ + {box_clock_1b[WIPE_B1_241], 1, 0, 0, 0}, /* 241 */ #define WIPE_CONFIG_242 WIPE_CONFIG_241+1 - { box_clock_1b[WIPE_B1_242], 1, 0, 0, 0 }, /* 242 */ + {box_clock_1b[WIPE_B1_242], 1, 0, 0, 0}, /* 242 */ #define WIPE_CONFIG_243 WIPE_CONFIG_242+1 - { box_clock_1b[WIPE_B1_243], 1, 0, 0, 0 }, /* 243 */ + {box_clock_1b[WIPE_B1_243], 1, 0, 0, 0}, /* 243 */ #define WIPE_CONFIG_244 WIPE_CONFIG_243+1 - { box_clock_1b[WIPE_B1_244], 1, 0, 0, 0 }, /* 244 */ + {box_clock_1b[WIPE_B1_244], 1, 0, 0, 0}, /* 244 */ #define WIPE_CONFIG_245 WIPE_CONFIG_244+1 - { triangles_2t[WIPE_T2_245], 2, 1, 1, 0 }, /* 245 */ + {triangles_2t[WIPE_T2_245], 2, 1, 1, 0}, /* 245 */ #define WIPE_CONFIG_246 WIPE_CONFIG_245+1 - { triangles_2t[WIPE_T2_246], 2, 1, 1, 0 }, /* 246 */ + {triangles_2t[WIPE_T2_246], 2, 1, 1, 0}, /* 246 */ #define WIPE_CONFIG_251 WIPE_CONFIG_246+1 - { box_clock_2b[WIPE_B2_251], 2, 1, 1, 0 }, /* 251 */ + {box_clock_2b[WIPE_B2_251], 2, 1, 1, 0}, /* 251 */ #define WIPE_CONFIG_252 WIPE_CONFIG_251+1 - { box_clock_2b[WIPE_B2_252], 2, 1, 1, 0 }, /* 252 */ + {box_clock_2b[WIPE_B2_252], 2, 1, 1, 0}, /* 252 */ #define WIPE_CONFIG_253 WIPE_CONFIG_252+1 - { box_clock_2b[WIPE_B2_253], 2, 1, 1, 0 }, /* 253 */ + {box_clock_2b[WIPE_B2_253], 2, 1, 1, 0}, /* 253 */ #define WIPE_CONFIG_254 WIPE_CONFIG_253+1 - { box_clock_2b[WIPE_B2_254], 2, 1, 1, 0 }, /* 254 */ + {box_clock_2b[WIPE_B2_254], 2, 1, 1, 0}, /* 254 */ #define WIPE_CONFIG_261 WIPE_CONFIG_254+1 - { box_clock_8b[WIPE_B8_261], 8, 2, 2, 2 }, /* 261 */ + {box_clock_8b[WIPE_B8_261], 8, 2, 2, 2}, /* 261 */ #define WIPE_CONFIG_262 WIPE_CONFIG_261+1 - { box_clock_8b[WIPE_B8_262], 8, 2, 2, 2 }, /* 262 */ + {box_clock_8b[WIPE_B8_262], 8, 2, 2, 2}, /* 262 */ #define WIPE_CONFIG_263 WIPE_CONFIG_262+1 - { box_clock_8b[WIPE_B8_263], 8, 2, 2, 1 }, /* 263 */ + {box_clock_8b[WIPE_B8_263], 8, 2, 2, 1}, /* 263 */ #define WIPE_CONFIG_264 WIPE_CONFIG_263+1 - { box_clock_8b[WIPE_B8_264], 8, 2, 2, 1 }, /* 264 */ + {box_clock_8b[WIPE_B8_264], 8, 2, 2, 1}, /* 264 */ }; static void -gst_wipe_boxes_draw (GstMask *mask) +gst_wipe_boxes_draw (GstMask * mask) { GstWipeConfig *config = mask->user_data; gint *impacts = config->objects; @@ -576,30 +565,30 @@ gst_wipe_boxes_draw (GstMask *mask) for (i = 0; i < config->nobjects; i++) { switch (impacts[0]) { case BOX_VERTICAL: - gst_smpte_paint_vbox (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth); + gst_smpte_paint_vbox (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth); impacts += 7; - break; + break; case BOX_HORIZONTAL: - gst_smpte_paint_hbox (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth); + gst_smpte_paint_hbox (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth); impacts += 7; case BOX_CLOCK: - gst_smpte_paint_box_clock (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth, - impacts[7] * width, impacts[8] * height, impacts[9] * depth); + gst_smpte_paint_box_clock (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth, + impacts[7] * width, impacts[8] * height, impacts[9] * depth); impacts += 10; default: - break; + break; } } } static void -gst_wipe_triangles_clock_draw (GstMask *mask) +gst_wipe_triangles_clock_draw (GstMask * mask) { GstWipeConfig *config = mask->user_data; gint *impacts = config->objects; @@ -610,15 +599,15 @@ gst_wipe_triangles_clock_draw (GstMask *mask) for (i = 0; i < config->nobjects; i++) { gst_smpte_paint_triangle_clock (mask->data, mask->width, - impacts[0] * width, impacts[1] * height, impacts[2] * depth, - impacts[3] * width, impacts[4] * height, impacts[5] * depth, - impacts[6] * width, impacts[7] * height, impacts[8] * depth); + impacts[0] * width, impacts[1] * height, impacts[2] * depth, + impacts[3] * width, impacts[4] * height, impacts[5] * depth, + impacts[6] * width, impacts[7] * height, impacts[8] * depth); impacts += 9; } } static void -gst_wipe_triangles_draw (GstMask *mask) +gst_wipe_triangles_draw (GstMask * mask) { GstWipeConfig *config = mask->user_data; gint *impacts = config->objects; @@ -630,295 +619,295 @@ gst_wipe_triangles_draw (GstMask *mask) for (i = 0; i < config->nobjects; i++) { gst_smpte_paint_triangle_linear (mask->data, mask->width, - impacts[0] * width, impacts[1] * height, impacts[2] * depth, - impacts[3] * width, impacts[4] * height, impacts[5] * depth, - impacts[6] * width, impacts[7] * height, impacts[8] * depth); + impacts[0] * width, impacts[1] * height, impacts[2] * depth, + impacts[3] * width, impacts[4] * height, impacts[5] * depth, + impacts[6] * width, impacts[7] * height, impacts[8] * depth); impacts += 9; } } -static GstMaskDefinition definitions[] = { - { 1, "bar_wipe_lr", - "A bar moves from left to right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_1] }, - { 2, "bar_wipe_tb", - "A bar moves from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_2] }, - { 3, "box_wipe_tl", - "A box expands from the upper-left corner to the lower-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_3] }, - { 4, "box_wipe_tr", - "A box expands from the upper-right corner to the lower-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_4] }, - { 5, "box_wipe_br", - "A box expands from the lower-right corner to the upper-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_5] }, - { 6, "box_wipe_bl", - "A box expands from the lower-left corner to the upper-right corner", +static GstMaskDefinition definitions[] = { + {1, "bar_wipe_lr", + "A bar moves from left to right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_1]}, + {2, "bar_wipe_tb", + "A bar moves from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_2]}, + {3, "box_wipe_tl", + "A box expands from the upper-left corner to the lower-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_3]}, + {4, "box_wipe_tr", + "A box expands from the upper-right corner to the lower-left corner", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_6] }, - { 7 , "four_box_wipe_ci", - "A box shape expands from each of the four corners toward the center", + &wipe_config[WIPE_CONFIG_4]}, + {5, "box_wipe_br", + "A box expands from the lower-right corner to the upper-left corner", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_7] }, - { 8 , "four_box_wipe_co", - "A box shape expands from the center of each quadrant toward the corners of each quadrant", + &wipe_config[WIPE_CONFIG_5]}, + {6, "box_wipe_bl", + "A box expands from the lower-left corner to the upper-right corner", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_8] }, - { 21, "barndoor_v", - "A central, vertical line splits and expands toward the left and right edges", - gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_21] }, - { 22, "barndoor_h", - "A central, horizontal line splits and expands toward the top and bottom edges", - gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_22] }, - { 23, "box_wipe_tc", - "A box expands from the top edge's midpoint to the bottom corners", + &wipe_config[WIPE_CONFIG_6]}, + {7, "four_box_wipe_ci", + "A box shape expands from each of the four corners toward the center", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_23] }, - { 24, "box_wipe_rc", - "A box expands from the right edge's midpoint to the left corners", + &wipe_config[WIPE_CONFIG_7]}, + {8, "four_box_wipe_co", + "A box shape expands from the center of each quadrant toward the corners of each quadrant", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_24] }, - { 25, "box_wipe_bc", - "A box expands from the bottom edge's midpoint to the top corners", + &wipe_config[WIPE_CONFIG_8]}, + {21, "barndoor_v", + "A central, vertical line splits and expands toward the left and right edges", + gst_wipe_boxes_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_21]}, + {22, "barndoor_h", + "A central, horizontal line splits and expands toward the top and bottom edges", + gst_wipe_boxes_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_22]}, + {23, "box_wipe_tc", + "A box expands from the top edge's midpoint to the bottom corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_23]}, + {24, "box_wipe_rc", + "A box expands from the right edge's midpoint to the left corners", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_25] }, - { 26, "box_wipe_lc", - "A box expands from the left edge's midpoint to the right corners", + &wipe_config[WIPE_CONFIG_24]}, + {25, "box_wipe_bc", + "A box expands from the bottom edge's midpoint to the top corners", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_26] }, - { 41, "diagonal_tl", - "A diagonal line moves from the upper-left corner to the lower-right corner", + &wipe_config[WIPE_CONFIG_25]}, + {26, "box_wipe_lc", + "A box expands from the left edge's midpoint to the right corners", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_41] }, - { 42, "diagonal_tr", - "A diagonal line moves from the upper right corner to the lower-left corner", + &wipe_config[WIPE_CONFIG_26]}, + {41, "diagonal_tl", + "A diagonal line moves from the upper-left corner to the lower-right corner", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_42] }, - { 43, "bowtie_v", - "Two wedge shapes slide in from the top and bottom edges toward the center", + &wipe_config[WIPE_CONFIG_41]}, + {42, "diagonal_tr", + "A diagonal line moves from the upper right corner to the lower-left corner", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_43] }, - { 44, "bowtie_h", - "Two wedge shapes slide in from the left and right edges toward the center", + &wipe_config[WIPE_CONFIG_42]}, + {43, "bowtie_v", + "Two wedge shapes slide in from the top and bottom edges toward the center", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_44] }, - { 45, "barndoor_dbl", - "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners", + &wipe_config[WIPE_CONFIG_43]}, + {44, "bowtie_h", + "Two wedge shapes slide in from the left and right edges toward the center", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_45] }, - { 46, "barndoor_dtl", - "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners", + &wipe_config[WIPE_CONFIG_44]}, + {45, "barndoor_dbl", + "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_46] }, - { 47, "misc_diagonal_dbd", - "Four wedge shapes split from the center and retract toward the four edges", + &wipe_config[WIPE_CONFIG_45]}, + {46, "barndoor_dtl", + "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_47] }, - { 48, "misc_diagonal_dd", - "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges", + &wipe_config[WIPE_CONFIG_46]}, + {47, "misc_diagonal_dbd", + "Four wedge shapes split from the center and retract toward the four edges", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_48] }, - { 61, "vee_d", - "A wedge shape moves from top to bottom", + &wipe_config[WIPE_CONFIG_47]}, + {48, "misc_diagonal_dd", + "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_61] }, - { 62, "vee_l", - "A wedge shape moves from right to left", + &wipe_config[WIPE_CONFIG_48]}, + {61, "vee_d", + "A wedge shape moves from top to bottom", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_62] }, - { 63, "vee_u", - "A wedge shape moves from bottom to top", + &wipe_config[WIPE_CONFIG_61]}, + {62, "vee_l", + "A wedge shape moves from right to left", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_63] }, - { 64, "vee_r", - "A wedge shape moves from left to right", + &wipe_config[WIPE_CONFIG_62]}, + {63, "vee_u", + "A wedge shape moves from bottom to top", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_64] }, - { 65, "barnvee_d", - "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + &wipe_config[WIPE_CONFIG_63]}, + {64, "vee_r", + "A wedge shape moves from left to right", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_65] }, - { 66, "barnvee_l", - "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + &wipe_config[WIPE_CONFIG_64]}, + {65, "barnvee_d", + "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_66] }, - { 67, "barnvee_u", - "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + &wipe_config[WIPE_CONFIG_65]}, + {66, "barnvee_l", + "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_67] }, - { 68, "barnvee_r", - "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + &wipe_config[WIPE_CONFIG_66]}, + {67, "barnvee_u", + "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_68] }, - { 101, "iris_rect", - "A rectangle expands from the center.", + &wipe_config[WIPE_CONFIG_67]}, + {68, "barnvee_r", + "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", gst_wipe_triangles_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_101] }, - { 201, "clock_cw12", - "A radial hand sweeps clockwise from the twelve o'clock position", + &wipe_config[WIPE_CONFIG_68]}, + {101, "iris_rect", + "A rectangle expands from the center.", + gst_wipe_triangles_draw, _gst_mask_default_destroy, + &wipe_config[WIPE_CONFIG_101]}, + {201, "clock_cw12", + "A radial hand sweeps clockwise from the twelve o'clock position", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_201] }, - { 202, "clock_cw3", - "A radial hand sweeps clockwise from the three o'clock position", + &wipe_config[WIPE_CONFIG_201]}, + {202, "clock_cw3", + "A radial hand sweeps clockwise from the three o'clock position", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_202] }, - { 203, "clock_cw6", - "A radial hand sweeps clockwise from the six o'clock position", + &wipe_config[WIPE_CONFIG_202]}, + {203, "clock_cw6", + "A radial hand sweeps clockwise from the six o'clock position", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_203] }, - { 204, "clock_cw9", - "A radial hand sweeps clockwise from the nine o'clock position", + &wipe_config[WIPE_CONFIG_203]}, + {204, "clock_cw9", + "A radial hand sweeps clockwise from the nine o'clock position", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_204] }, - { 205, "pinwheel_tbv", - "Two radial hands sweep clockwise from the twelve and six o'clock positions", + &wipe_config[WIPE_CONFIG_204]}, + {205, "pinwheel_tbv", + "Two radial hands sweep clockwise from the twelve and six o'clock positions", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_205] }, - { 206, "pinwheel_tbh", - "Two radial hands sweep clockwise from the nine and three o'clock positions", + &wipe_config[WIPE_CONFIG_205]}, + {206, "pinwheel_tbh", + "Two radial hands sweep clockwise from the nine and three o'clock positions", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_206] }, - { 207, "pinwheel_fb", - "Four radial hands sweep clockwise", + &wipe_config[WIPE_CONFIG_206]}, + {207, "pinwheel_fb", + "Four radial hands sweep clockwise", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_207] }, - { 211, "fan_ct", - "A fan unfolds from the top edge, the fan axis at the center", + &wipe_config[WIPE_CONFIG_207]}, + {211, "fan_ct", + "A fan unfolds from the top edge, the fan axis at the center", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_211] }, - { 212, "fan_cr", - "A fan unfolds from the right edge, the fan axis at the center", + &wipe_config[WIPE_CONFIG_211]}, + {212, "fan_cr", + "A fan unfolds from the right edge, the fan axis at the center", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_212] }, - { 213, "doublefan_fov", - "Two fans, their axes at the center, unfold from the top and bottom", + &wipe_config[WIPE_CONFIG_212]}, + {213, "doublefan_fov", + "Two fans, their axes at the center, unfold from the top and bottom", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_213] }, - { 214, "doublefan_foh", - "Two fans, their axes at the center, unfold from the left and right", + &wipe_config[WIPE_CONFIG_213]}, + {214, "doublefan_foh", + "Two fans, their axes at the center, unfold from the left and right", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_214] }, - { 221, "singlesweep_cwt", - "A radial hand sweeps clockwise from the top edge's midpoint", + &wipe_config[WIPE_CONFIG_214]}, + {221, "singlesweep_cwt", + "A radial hand sweeps clockwise from the top edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_221] }, - { 222, "singlesweep_cwr", - "A radial hand sweeps clockwise from the right edge's midpoint", + &wipe_config[WIPE_CONFIG_221]}, + {222, "singlesweep_cwr", + "A radial hand sweeps clockwise from the right edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_222] }, - { 223, "singlesweep_cwb", - "A radial hand sweeps clockwise from the bottom edge's midpoint", + &wipe_config[WIPE_CONFIG_222]}, + {223, "singlesweep_cwb", + "A radial hand sweeps clockwise from the bottom edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_223] }, - { 224, "singlesweep_cwl", - "A radial hand sweeps clockwise from the left edge's midpoint", + &wipe_config[WIPE_CONFIG_223]}, + {224, "singlesweep_cwl", + "A radial hand sweeps clockwise from the left edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_224] }, - { 225, "doublesweep_pv", - "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints", + &wipe_config[WIPE_CONFIG_224]}, + {225, "doublesweep_pv", + "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_225] }, - { 226, "doublesweep_pd", - "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints", + &wipe_config[WIPE_CONFIG_225]}, + {226, "doublesweep_pd", + "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_226] }, - { 227, "doublesweep_ov", - "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left", + &wipe_config[WIPE_CONFIG_226]}, + {227, "doublesweep_ov", + "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_227] }, - { 228, "doublesweep_oh", - "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom", + &wipe_config[WIPE_CONFIG_227]}, + {228, "doublesweep_oh", + "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_228] }, - { 231, "fan_t", - "A fan unfolds from the bottom, the fan axis at the top edge's midpoint", + &wipe_config[WIPE_CONFIG_228]}, + {231, "fan_t", + "A fan unfolds from the bottom, the fan axis at the top edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_231] }, - { 232, "fan_r", - "A fan unfolds from the left, the fan axis at the right edge's midpoint", + &wipe_config[WIPE_CONFIG_231]}, + {232, "fan_r", + "A fan unfolds from the left, the fan axis at the right edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_232] }, - { 233, "fan_b", - "A fan unfolds from the top, the fan axis at the bottom edge's midpoint", + &wipe_config[WIPE_CONFIG_232]}, + {233, "fan_b", + "A fan unfolds from the top, the fan axis at the bottom edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_233] }, - { 234, "fan_l", - "A fan unfolds from the right, the fan axis at the left edge's midpoint", + &wipe_config[WIPE_CONFIG_233]}, + {234, "fan_l", + "A fan unfolds from the right, the fan axis at the left edge's midpoint", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_234] }, - { 235, "doublefan_fiv", - "Two fans, their axes at the top and bottom, unfold from the center", + &wipe_config[WIPE_CONFIG_234]}, + {235, "doublefan_fiv", + "Two fans, their axes at the top and bottom, unfold from the center", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_235] }, - { 236, "doublefan_fih", - "Two fans, their axes at the left and right, unfold from the center", + &wipe_config[WIPE_CONFIG_235]}, + {236, "doublefan_fih", + "Two fans, their axes at the left and right, unfold from the center", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_236] }, - { 241, "singlesweep_cwtl", - "A radial hand sweeps clockwise from the upper-left corner", + &wipe_config[WIPE_CONFIG_236]}, + {241, "singlesweep_cwtl", + "A radial hand sweeps clockwise from the upper-left corner", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_241] }, - { 242, "singlesweep_cwbl", - "A radial hand sweeps counter-clockwise from the lower-left corner.", + &wipe_config[WIPE_CONFIG_241]}, + {242, "singlesweep_cwbl", + "A radial hand sweeps counter-clockwise from the lower-left corner.", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_242] }, - { 243, "singlesweep_cwbr", - "A radial hand sweeps clockwise from the lower-right corner", + &wipe_config[WIPE_CONFIG_242]}, + {243, "singlesweep_cwbr", + "A radial hand sweeps clockwise from the lower-right corner", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_243] }, - { 244, "singlesweep_cwtr", - "A radial hand sweeps counter-clockwise from the upper-right corner", + &wipe_config[WIPE_CONFIG_243]}, + {244, "singlesweep_cwtr", + "A radial hand sweeps counter-clockwise from the upper-right corner", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_244] }, - { 245, "doublesweep_pdtl", - "Two radial hands attached at the upper-left and lower-right corners sweep down and up", + &wipe_config[WIPE_CONFIG_244]}, + {245, "doublesweep_pdtl", + "Two radial hands attached at the upper-left and lower-right corners sweep down and up", gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_245] }, - { 246, "doublesweep_pdbl", - "Two radial hands attached at the lower-left and upper-right corners sweep down and up", + &wipe_config[WIPE_CONFIG_245]}, + {246, "doublesweep_pdbl", + "Two radial hands attached at the lower-left and upper-right corners sweep down and up", gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_246] }, - { 251, "saloondoor_t", - "Two radial hands attached at the upper-left and upper-right corners sweep down", + &wipe_config[WIPE_CONFIG_246]}, + {251, "saloondoor_t", + "Two radial hands attached at the upper-left and upper-right corners sweep down", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_251] }, - { 252, "saloondoor_l", - "Two radial hands attached at the upper-left and lower-left corners sweep to the right", + &wipe_config[WIPE_CONFIG_251]}, + {252, "saloondoor_l", + "Two radial hands attached at the upper-left and lower-left corners sweep to the right", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_252] }, - { 253, "saloondoor_b", - "Two radial hands attached at the lower-left and lower-right corners sweep up", + &wipe_config[WIPE_CONFIG_252]}, + {253, "saloondoor_b", + "Two radial hands attached at the lower-left and lower-right corners sweep up", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_253] }, - { 254, "saloondoor_r", - "Two radial hands attached at the upper-right and lower-right corners sweep to the left", + &wipe_config[WIPE_CONFIG_253]}, + {254, "saloondoor_r", + "Two radial hands attached at the upper-right and lower-right corners sweep to the left", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_254] }, - { 261, "windshield_r", - "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left", + &wipe_config[WIPE_CONFIG_254]}, + {261, "windshield_r", + "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_261] }, - { 262, "windshield_u", - "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom", + &wipe_config[WIPE_CONFIG_261]}, + {262, "windshield_u", + "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_262] }, - { 263, "windshield_v", - "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top", + &wipe_config[WIPE_CONFIG_262]}, + {263, "windshield_v", + "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_263] }, - { 264, "windshield_h", - "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left", + &wipe_config[WIPE_CONFIG_263]}, + {264, "windshield_h", + "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left", gst_wipe_boxes_draw, _gst_mask_default_destroy, - &wipe_config[WIPE_CONFIG_264] }, - { 0, NULL, NULL, NULL } + &wipe_config[WIPE_CONFIG_264]}, + {0, NULL, NULL, NULL} }; void @@ -931,4 +920,3 @@ _gst_barboxwipes_register (void) i++; } } - diff --git a/gst/smpte/gstmask.c b/gst/smpte/gstmask.c index 13c79b34..0e2cf01f 100644 --- a/gst/smpte/gstmask.c +++ b/gst/smpte/gstmask.c @@ -35,25 +35,25 @@ _gst_mask_init (void) } static gint -gst_mask_compare (GstMaskDefinition *def1, - GstMaskDefinition *def2) +gst_mask_compare (GstMaskDefinition * def1, GstMaskDefinition * def2) { return (def1->type - def2->type); } void -_gst_mask_register (GstMaskDefinition *definition) +_gst_mask_register (GstMaskDefinition * definition) { - masks = g_list_insert_sorted (masks, definition, (GCompareFunc) gst_mask_compare); + masks = + g_list_insert_sorted (masks, definition, (GCompareFunc) gst_mask_compare); } -const GList* +const GList * gst_mask_get_definitions (void) { return masks; } -static GstMaskDefinition* +static GstMaskDefinition * gst_mask_find_definition (gint type) { GList *walk = masks; @@ -63,13 +63,13 @@ gst_mask_find_definition (gint type) if (def->type == type) return def; - + walk = g_list_next (walk); } return NULL; } -GstMask* +GstMask * gst_mask_factory_new (gint type, gint bpp, gint width, gint height) { GstMaskDefinition *definition; @@ -95,14 +95,14 @@ gst_mask_factory_new (gint type, gint bpp, gint width, gint height) } void -_gst_mask_default_destroy (GstMask *mask) +_gst_mask_default_destroy (GstMask * mask) { g_free (mask->data); g_free (mask); } void -gst_mask_destroy (GstMask *mask) +gst_mask_destroy (GstMask * mask) { if (mask->destroy_func) mask->destroy_func (mask); diff --git a/gst/smpte/gstmask.h b/gst/smpte/gstmask.h index 6131c624..6f82078f 100644 --- a/gst/smpte/gstmask.h +++ b/gst/smpte/gstmask.h @@ -27,37 +27,39 @@ typedef struct _GstMask GstMask; typedef struct _GstMaskDefinition GstMaskDefinition; -typedef void (*GstMaskDrawFunc) (GstMask *mask); -typedef void (*GstMaskDestroyFunc) (GstMask *mask); - -struct _GstMaskDefinition { - gint type; - gchar *short_name; - gchar *long_name; - GstMaskDrawFunc draw_func; - GstMaskDestroyFunc destroy_func; - gpointer user_data; +typedef void (*GstMaskDrawFunc) (GstMask * mask); +typedef void (*GstMaskDestroyFunc) (GstMask * mask); + +struct _GstMaskDefinition +{ + gint type; + gchar *short_name; + gchar *long_name; + GstMaskDrawFunc draw_func; + GstMaskDestroyFunc destroy_func; + gpointer user_data; }; -struct _GstMask { - gint type; - guint32 *data; - gpointer user_data; +struct _GstMask +{ + gint type; + guint32 *data; + gpointer user_data; - gint width; - gint height; - gint bpp; + gint width; + gint height; + gint bpp; - GstMaskDestroyFunc destroy_func; + GstMaskDestroyFunc destroy_func; }; -void _gst_mask_init (void); -void _gst_mask_register (GstMaskDefinition *definition); +void _gst_mask_init (void); +void _gst_mask_register (GstMaskDefinition * definition); -void _gst_mask_default_destroy (GstMask *mask); +void _gst_mask_default_destroy (GstMask * mask); -const GList* gst_mask_get_definitions (void); -GstMask* gst_mask_factory_new (gint type, gint bpp, gint width, gint height); -void gst_mask_destroy (GstMask *mask); +const GList *gst_mask_get_definitions (void); +GstMask *gst_mask_factory_new (gint type, gint bpp, gint width, gint height); +void gst_mask_destroy (GstMask * mask); #endif /* __GST_MASK_H__ */ diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c index 5899a9a1..91b91d9d 100644 --- a/gst/smpte/gstsmpte.c +++ b/gst/smpte/gstsmpte.c @@ -34,43 +34,39 @@ static GstElementDetails smpte_details = { }; static GstStaticPadTemplate gst_smpte_src_template = -GST_STATIC_PAD_TEMPLATE ( - "src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - GST_VIDEO_CAPS_YUV("I420") - ) -); +GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420") + ) + ); static GstStaticPadTemplate gst_smpte_sink1_template = -GST_STATIC_PAD_TEMPLATE ( - "sink1", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - GST_VIDEO_CAPS_YUV("I420") - ) -); +GST_STATIC_PAD_TEMPLATE ("sink1", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420") + ) + ); static GstStaticPadTemplate gst_smpte_sink2_template = -GST_STATIC_PAD_TEMPLATE ( - "sink2", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - GST_VIDEO_CAPS_YUV("I420") - ) -); +GST_STATIC_PAD_TEMPLATE ("sink2", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420") + ) + ); /* SMPTE signals and args */ -enum { +enum +{ /* FILL ME */ LAST_SIGNAL }; -enum { +enum +{ ARG_0, ARG_TYPE, ARG_BORDER, @@ -80,48 +76,51 @@ enum { #define GST_TYPE_SMPTE_TRANSITION_TYPE (gst_smpte_transition_type_get_type()) static GType -gst_smpte_transition_type_get_type (void) +gst_smpte_transition_type_get_type (void) { static GType smpte_transition_type = 0; GEnumValue *smpte_transitions; if (!smpte_transition_type) { const GList *definitions; - gint i=0; + gint i = 0; definitions = gst_mask_get_definitions (); - smpte_transitions = g_new0 (GEnumValue, g_list_length ((GList *)definitions)+1); + smpte_transitions = + g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1); while (definitions) { GstMaskDefinition *definition = (GstMaskDefinition *) definitions->data; + definitions = g_list_next (definitions); smpte_transitions[i].value = definition->type; smpte_transitions[i].value_name = definition->short_name; smpte_transitions[i].value_nick = definition->long_name; - + i++; } - smpte_transition_type = - g_enum_register_static ("GstSMPTETransitionType", smpte_transitions); + smpte_transition_type = + g_enum_register_static ("GstSMPTETransitionType", smpte_transitions); } return smpte_transition_type; -} +} -static void gst_smpte_class_init (GstSMPTEClass *klass); -static void gst_smpte_base_init (GstSMPTEClass *klass); -static void gst_smpte_init (GstSMPTE *smpte); +static void gst_smpte_class_init (GstSMPTEClass * klass); +static void gst_smpte_base_init (GstSMPTEClass * klass); +static void gst_smpte_init (GstSMPTE * smpte); -static void gst_smpte_loop (GstElement *element); +static void gst_smpte_loop (GstElement * element); -static void gst_smpte_set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec); -static void gst_smpte_get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec); +static void gst_smpte_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_smpte_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); static GstElementClass *parent_class = NULL; + /*static guint gst_smpte_signals[LAST_SIGNAL] = { 0 }; */ static GType @@ -131,45 +130,46 @@ gst_smpte_get_type (void) if (!smpte_type) { static const GTypeInfo smpte_info = { - sizeof(GstSMPTEClass), - (GBaseInitFunc)gst_smpte_base_init, + sizeof (GstSMPTEClass), + (GBaseInitFunc) gst_smpte_base_init, NULL, - (GClassInitFunc)gst_smpte_class_init, + (GClassInitFunc) gst_smpte_class_init, NULL, NULL, - sizeof(GstSMPTE), + sizeof (GstSMPTE), 0, - (GInstanceInitFunc)gst_smpte_init, + (GInstanceInitFunc) gst_smpte_init, }; - smpte_type = g_type_register_static(GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0); + smpte_type = + g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0); } return smpte_type; } static void -gst_smpte_base_init (GstSMPTEClass *klass) +gst_smpte_base_init (GstSMPTEClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get(&gst_smpte_sink1_template)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get(&gst_smpte_sink2_template)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get(&gst_smpte_src_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_smpte_sink1_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_smpte_sink2_template)); + gst_element_class_add_pad_template (element_class, + gst_static_pad_template_get (&gst_smpte_src_template)); gst_element_class_set_details (element_class, &smpte_details); } static void -gst_smpte_class_init (GstSMPTEClass *klass) +gst_smpte_class_init (GstSMPTEClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; - gobject_class = (GObjectClass*)klass; - gstelement_class = (GstElementClass*)klass; + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_ref(GST_TYPE_ELEMENT); + parent_class = g_type_class_ref (GST_TYPE_ELEMENT); gobject_class->set_property = gst_smpte_set_property; gobject_class->get_property = gst_smpte_get_property; @@ -177,39 +177,42 @@ gst_smpte_class_init (GstSMPTEClass *klass) _gst_mask_init (); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE, - g_param_spec_enum ("type", "Type", "The type of transition to use", - GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE)); + g_param_spec_enum ("type", "Type", "The type of transition to use", + GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FPS, - g_param_spec_float ("fps", "FPS", "Frames per second if no input files are given", - 0., G_MAXFLOAT, 25., G_PARAM_READWRITE)); + g_param_spec_float ("fps", "FPS", + "Frames per second if no input files are given", 0., G_MAXFLOAT, 25., + G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BORDER, - g_param_spec_int ("border", "Border", "The border width of the transition", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + g_param_spec_int ("border", "Border", + "The border width of the transition", 0, G_MAXINT, 0, + G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEPTH, - g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", - 1, 24, 16, G_PARAM_READWRITE)); + g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", 1, 24, + 16, G_PARAM_READWRITE)); } /* wht yel cya grn mag red blu blk -I Q */ -static int y_colors[] = { 255, 226, 179, 150, 105, 76, 29, 16, 16, 0 }; -static int u_colors[] = { 128, 0, 170, 46, 212, 85, 255, 128, 0, 128 }; -static int v_colors[] = { 128, 155, 0, 21, 235, 255, 107, 128, 128, 255 }; +static int y_colors[] = { 255, 226, 179, 150, 105, 76, 29, 16, 16, 0 }; +static int u_colors[] = { 128, 0, 170, 46, 212, 85, 255, 128, 0, 128 }; +static int v_colors[] = { 128, 155, 0, 21, 235, 255, 107, 128, 128, 255 }; static void -fill_i420 (guint8 *data, gint width, gint height, gint color) +fill_i420 (guint8 * data, gint width, gint height, gint color) { gint size = width * height, size4 = size >> 2; guint8 *yp = data; guint8 *up = data + size; guint8 *vp = data + size + size4; - + memset (yp, y_colors[color], size); memset (up, u_colors[color], size4); memset (vp, v_colors[color], size4); } static gboolean -gst_smpte_update_mask (GstSMPTE *smpte, gint type, gint depth, gint width, gint height) +gst_smpte_update_mask (GstSMPTE * smpte, gint type, gint depth, gint width, + gint height) { GstMask *newmask; @@ -230,7 +233,7 @@ gst_smpte_update_mask (GstSMPTE *smpte, gint type, gint depth, gint width, gint } static gboolean -gst_smpte_sinkconnect (GstPad *pad, const GstCaps *caps) +gst_smpte_sinkconnect (GstPad * pad, const GstCaps * caps) { GstSMPTE *smpte; GstStructure *structure; @@ -243,29 +246,34 @@ gst_smpte_sinkconnect (GstPad *pad, const GstCaps *caps) ret = gst_structure_get_int (structure, "width", &smpte->width); ret &= gst_structure_get_int (structure, "height", &smpte->height); ret &= gst_structure_get_double (structure, "framerate", &smpte->fps); - if (!ret) return GST_PAD_LINK_REFUSED; + if (!ret) + return GST_PAD_LINK_REFUSED; - gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width, smpte->height); + gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width, + smpte->height); /* forward to the next plugin */ - return gst_pad_try_set_caps(smpte->srcpad, caps); + return gst_pad_try_set_caps (smpte->srcpad, caps); } -static void -gst_smpte_init (GstSMPTE *smpte) +static void +gst_smpte_init (GstSMPTE * smpte) { - smpte->sinkpad1 = gst_pad_new_from_template ( - gst_static_pad_template_get(&gst_smpte_sink1_template), "sink1"); + smpte->sinkpad1 = + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_smpte_sink1_template), "sink1"); gst_pad_set_link_function (smpte->sinkpad1, gst_smpte_sinkconnect); gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad1); - smpte->sinkpad2 = gst_pad_new_from_template ( - gst_static_pad_template_get(&gst_smpte_sink2_template), "sink2"); + smpte->sinkpad2 = + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_smpte_sink2_template), "sink2"); gst_pad_set_link_function (smpte->sinkpad2, gst_smpte_sinkconnect); gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad2); - smpte->srcpad = gst_pad_new_from_template ( - gst_static_pad_template_get(&gst_smpte_src_template), "src"); + smpte->srcpad = + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_smpte_src_template), "src"); gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad); gst_element_set_loop_function (GST_ELEMENT (smpte), gst_smpte_loop); @@ -278,48 +286,53 @@ gst_smpte_init (GstSMPTE *smpte) smpte->type = 1; smpte->border = 0; smpte->depth = 16; - gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width, smpte->height); + gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width, + smpte->height); } static void -gst_smpte_blend_i420 (guint8 *in1, guint8 *in2, guint8 *out, GstMask *mask, - gint width, gint height, gint border, gint pos) +gst_smpte_blend_i420 (guint8 * in1, guint8 * in2, guint8 * out, GstMask * mask, + gint width, gint height, gint border, gint pos) { guint32 *maskp; gint value; gint i, j; gint min, max; - guint8 *in1u, *in1v, *in2u, *in2v, *outu, *outv; + guint8 *in1u, *in1v, *in2u, *in2v, *outu, *outv; gint lumsize = width * height; gint chromsize = lumsize >> 2; - if (border == 0) border++; + if (border == 0) + border++; - min = pos - border; + min = pos - border; max = pos; - in1u = in1 + lumsize; in1v = in1u + chromsize; - in2u = in2 + lumsize; in2v = in2u + chromsize; - outu = out + lumsize; outv = outu + chromsize; - + in1u = in1 + lumsize; + in1v = in1u + chromsize; + in2u = in2 + lumsize; + in2v = in2u + chromsize; + outu = out + lumsize; + outv = outu + chromsize; + maskp = mask->data; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { value = *maskp++; value = ((CLAMP (value, min, max) - min) << 8) / border; - + *out++ = ((*in1++ * value) + (*in2++ * (256 - value))) >> 8; if (!(i & 1) && !(j & 1)) { - *outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8; - *outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8; + *outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8; + *outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8; } } } } static void -gst_smpte_loop (GstElement *element) +gst_smpte_loop (GstElement * element) { GstSMPTE *smpte; GstBuffer *outbuf; @@ -335,8 +348,7 @@ gst_smpte_loop (GstElement *element) if (GST_IS_EVENT (in1)) { gst_pad_push (smpte->srcpad, GST_DATA (in1)); in1 = NULL; - } - else + } else ts = GST_BUFFER_TIMESTAMP (in1); } if (GST_PAD_IS_USABLE (smpte->sinkpad2) && in2 == NULL) { @@ -344,8 +356,7 @@ gst_smpte_loop (GstElement *element) if (GST_IS_EVENT (in2)) { gst_pad_push (smpte->srcpad, GST_DATA (in2)); in2 = NULL; - } - else + } else ts = GST_BUFFER_TIMESTAMP (in2); } @@ -358,33 +369,33 @@ gst_smpte_loop (GstElement *element) fill_i420 (GST_BUFFER_DATA (in2), smpte->width, smpte->height, 0); } - if (smpte->position < smpte->duration) { + if (smpte->position < smpte->duration) { outbuf = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3); if (!GST_PAD_CAPS (smpte->srcpad)) { GstCaps *caps; - caps = gst_caps_copy (gst_static_caps_get ( - &gst_smpte_src_template.static_caps)); - gst_caps_set_simple (caps, - "width", G_TYPE_INT, smpte->width, - "height", G_TYPE_INT, smpte->height, - "framerate", G_TYPE_DOUBLE, smpte->fps, NULL); + + caps = + gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template. + static_caps)); + gst_caps_set_simple (caps, "width", G_TYPE_INT, smpte->width, "height", + G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps, + NULL); if (!gst_pad_try_set_caps (smpte->srcpad, caps)) { - GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), (NULL)); - return; + GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), (NULL)); + return; } } - gst_smpte_blend_i420 (GST_BUFFER_DATA (in1), - GST_BUFFER_DATA (in2), - GST_BUFFER_DATA (outbuf), - smpte->mask, smpte->width, smpte->height, - smpte->border, - ((1 << smpte->depth) + smpte->border) * - smpte->position / smpte->duration); - } - else { + gst_smpte_blend_i420 (GST_BUFFER_DATA (in1), + GST_BUFFER_DATA (in2), + GST_BUFFER_DATA (outbuf), + smpte->mask, smpte->width, smpte->height, + smpte->border, + ((1 << smpte->depth) + smpte->border) * + smpte->position / smpte->duration); + } else { outbuf = in2; gst_buffer_ref (in2); } @@ -401,20 +412,20 @@ gst_smpte_loop (GstElement *element) } static void -gst_smpte_set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) +gst_smpte_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) { GstSMPTE *smpte; - smpte = GST_SMPTE(object); + smpte = GST_SMPTE (object); switch (prop_id) { case ARG_TYPE: { gint type = g_value_get_enum (value); - gst_smpte_update_mask (smpte, type, smpte->depth, - smpte->width, smpte->height); + gst_smpte_update_mask (smpte, type, smpte->depth, + smpte->width, smpte->height); break; } case ARG_BORDER: @@ -427,8 +438,8 @@ gst_smpte_set_property (GObject *object, guint prop_id, { gint depth = g_value_get_int (value); - gst_smpte_update_mask (smpte, smpte->type, depth, - smpte->width, smpte->height); + gst_smpte_update_mask (smpte, smpte->type, depth, + smpte->width, smpte->height); break; } default: @@ -438,12 +449,12 @@ gst_smpte_set_property (GObject *object, guint prop_id, } static void -gst_smpte_get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) +gst_smpte_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) { GstSMPTE *smpte; - smpte = GST_SMPTE(object); + smpte = GST_SMPTE (object); switch (prop_id) { case ARG_TYPE: @@ -468,20 +479,13 @@ gst_smpte_get_property (GObject *object, guint prop_id, static gboolean -plugin_init (GstPlugin *plugin) +plugin_init (GstPlugin * plugin) { - return gst_element_register(plugin, "smpte", - GST_RANK_NONE, GST_TYPE_SMPTE); + return gst_element_register (plugin, "smpte", GST_RANK_NONE, GST_TYPE_SMPTE); } -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "smpte", - "Apply the standard SMPTE transitions on video images", - plugin_init, - VERSION, - "LGPL", - GST_PACKAGE, - GST_ORIGIN -) +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "smpte", + "Apply the standard SMPTE transitions on video images", + plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN) diff --git a/gst/smpte/gstsmpte.h b/gst/smpte/gstsmpte.h index 40844209..762eebf8 100644 --- a/gst/smpte/gstsmpte.h +++ b/gst/smpte/gstsmpte.h @@ -38,28 +38,28 @@ typedef struct _GstSMPTE GstSMPTE; typedef struct _GstSMPTEClass GstSMPTEClass; -struct _GstSMPTE { - GstElement element; +struct _GstSMPTE +{ + GstElement element; - gint format; - gint width; - gint height; - gdouble fps; + gint format; + gint width; + gint height; + gdouble fps; - gint duration; - gint position; + gint duration; + gint position; - GstPad *srcpad, - *sinkpad1, - *sinkpad2; + GstPad *srcpad, *sinkpad1, *sinkpad2; - gint type; - gint border; - gint depth; - GstMask *mask; + gint type; + gint border; + gint depth; + GstMask *mask; }; -struct _GstSMPTEClass { +struct _GstSMPTEClass +{ GstElementClass parent_class; }; diff --git a/gst/smpte/paint.c b/gst/smpte/paint.c index dae3c6f1..fdff77e5 100644 --- a/gst/smpte/paint.c +++ b/gst/smpte/paint.c @@ -26,21 +26,20 @@ #include "paint.h" void -gst_smpte_paint_vbox (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1) +gst_smpte_paint_vbox (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, gint x1, gint y1, gint c1) { gint i, j; gint width, height; width = x1 - x0; height = y1 - y0; - + g_assert (width > 0); g_assert (height > 0); dest = dest + y0 * stride + x0; - + for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { dest[j] = (c1 * j + c0 * (width - j)) / width; @@ -50,16 +49,15 @@ gst_smpte_paint_vbox (guint32 *dest, gint stride, } void -gst_smpte_paint_hbox (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1) +gst_smpte_paint_hbox (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, gint x1, gint y1, gint c1) { gint i, j; gint width, height; width = x1 - x0; height = y1 - y0; - + g_assert (width > 0); g_assert (height > 0); @@ -68,7 +66,8 @@ gst_smpte_paint_hbox (guint32 *dest, gint stride, dest = dest + y0 * stride + x0; for (i = 0; i < height; i++) { - guint32 value = (c1 * i + c0 * (height - i)) / height; + guint32 value = (c1 * i + c0 * (height - i)) / height; + for (j = 0; j < width; j++) { dest[j] = value; } @@ -148,29 +147,35 @@ G_STMT_START { \ } G_STMT_END void -gst_smpte_paint_triangle_linear (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, gint x2, gint y2, gint c2) +gst_smpte_paint_triangle_linear (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, gint x2, gint y2, gint c2) { gint sdxl, sdyl, sdcl, dxlabs, dylabs, dclabs, xrl, yrl, crl, pxl, pyl, pcl; gint sdxr, sdyr, sdcr, dxrabs, dyrabs, dcrabs, xrr, yrr, crr, pxr, pyr, pcr; gint i, j, k, seg_start, seg_end; - if (y0 > y1) { SWAP_INT (x0, x1); SWAP_INT (y0, y1); SWAP_INT (c0, c1); } - if (y0 > y2) { SWAP_INT (x0, x2); SWAP_INT (y0, y2); SWAP_INT (c0, c2); } - if (y1 > y2) { SWAP_INT (x1, x2); SWAP_INT (y1, y2); SWAP_INT (c1, c2); } - - PREPARE_3D_LINE (x0,y0,c0,x2,y2,c2, - dxlabs,dylabs,dclabs, - sdxl, sdyl,sdcl, - xrl,yrl,crl, - pxl,pyl,pcl); - - PREPARE_3D_LINE (x0,y0,c0,x1,y1,c1, - dxrabs,dyrabs,dcrabs, - sdxr, sdyr,sdcr, - xrr,yrr,crr, - pxr,pyr,pcr); + if (y0 > y1) { + SWAP_INT (x0, x1); + SWAP_INT (y0, y1); + SWAP_INT (c0, c1); + } + if (y0 > y2) { + SWAP_INT (x0, x2); + SWAP_INT (y0, y2); + SWAP_INT (c0, c2); + } + if (y1 > y2) { + SWAP_INT (x1, x2); + SWAP_INT (y1, y2); + SWAP_INT (c1, c2); + } + + PREPARE_3D_LINE (x0, y0, c0, x2, y2, c2, + dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, xrl, yrl, crl, pxl, pyl, pcl); + + PREPARE_3D_LINE (x0, y0, c0, x1, y1, c1, + dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr); dest = dest + stride * y0; seg_start = y0; @@ -183,37 +188,32 @@ gst_smpte_paint_triangle_linear (guint32 *dest, gint stride, gint sign = SIGN (e - s); e += sign; - for (j = s; j != e; j+=sign) { - dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s); + for (j = s; j != e; j += sign) { + dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s); } while (pyr == i) { - STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, - xrr, yrr, crr, pxr, pyr, pcr); + STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, + xrr, yrr, crr, pxr, pyr, pcr); } while (pyl == i) { - STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, - xrl, yrl, crl, pxl, pyl, pcl); + STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, + xrl, yrl, crl, pxl, pyl, pcl); } dest += stride; } - PREPARE_3D_LINE (x1,y1,c1,x2,y2,c2, - dxrabs,dyrabs,dcrabs, - sdxr, sdyr,sdcr, - xrr,yrr,crr, - pxr,pyr,pcr); + PREPARE_3D_LINE (x1, y1, c1, x2, y2, c2, + dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr); seg_start = y1; seg_end = y2; } } -static void -draw_bresenham_line (guint32 *dest, gint stride, - gint x0, gint y0, - gint x1, gint y1, - guint32 col) +static void +draw_bresenham_line (guint32 * dest, gint stride, + gint x0, gint y0, gint x1, gint y1, guint32 col) { gint dx = abs (x1 - x0); gint dy = abs (y1 - y0); @@ -224,13 +224,12 @@ draw_bresenham_line (guint32 *dest, gint stride, x_incr = SIGN (x1 - x0); y_incr = SIGN (y1 - y0) * stride; - - if (dx >= dy) { + + if (dx >= dy) { dpr = dy << 1; i = dx; indep = x_incr; - } - else { + } else { dpr = dx << 1; i = dy; indep = y_incr; @@ -242,7 +241,7 @@ draw_bresenham_line (guint32 *dest, gint stride, for (; i >= 0; i--) { *dest = col; - if (P > 0) { + if (P > 0) { dest += x_incr; dest += y_incr; P += dpru; @@ -254,10 +253,9 @@ draw_bresenham_line (guint32 *dest, gint stride, } void -gst_smpte_paint_triangle_clock (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, - gint x2, gint y2, gint c2) +gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, gint x2, gint y2, gint c2) { gint i; gint sign; @@ -265,11 +263,11 @@ gst_smpte_paint_triangle_clock (guint32 *dest, gint stride, gfloat len1; angle_s = 0.0; - angle_e = acos (((x1-x0) * (x2-x0) + (y1-y0) * (y2-y0))/ - (sqrt ((x1-x0) * (x1-x0) + (y1-y0) * (y1-y0)) * - sqrt ((x2-x0) * (x2-x0) + (y2-y0) * (y2-y0)))); + angle_e = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (y2 - y0)) / + (sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) * + sqrt ((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0)))); - len1 = sqrt ((x1-x0) * (x1-x0) + (y1-y0) * (y1-y0)); + len1 = sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); if (x1 == x2) { sign = SIGN (y2 - y1); @@ -278,65 +276,57 @@ gst_smpte_paint_triangle_clock (guint32 *dest, gint stride, if (y1 == i) angle = 0; else - angle = acos (((x1-x0) * (x2-x0) + (y1-y0) * (i-y0)) / - (len1 * sqrt ((x1-x0) * (x1-x0) + (i-y0) * (i-y0)))) / angle_e; + angle = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (i - y0)) / + (len1 * sqrt ((x1 - x0) * (x1 - x0) + (i - y0) * (i - + y0)))) / angle_e; draw_bresenham_line (dest, stride, - x0, y0, x1, i, - (c2 * angle + c1 * (1.0-angle))); + x0, y0, x1, i, (c2 * angle + c1 * (1.0 - angle))); } - } - else if (y1 == y2) { + } else if (y1 == y2) { sign = SIGN (x2 - x1); for (i = x1; i != (x2 + sign); i += sign) { if (x1 == i) angle = 0; else - angle = acos (((x1-x0) * (i-x0) + (y1-y0) * (y2-y0)) / - (len1 * sqrt ((i-x0) * (i-x0) + (y2-y0) * (y2-y0)))) / angle_e; + angle = acos (((x1 - x0) * (i - x0) + (y1 - y0) * (y2 - y0)) / + (len1 * sqrt ((i - x0) * (i - x0) + (y2 - y0) * (y2 - + y0)))) / angle_e; draw_bresenham_line (dest, stride, - x0, y0, i, y1, - (c2 * angle + c1 * (1.0-angle))); + x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle))); } } } void -gst_smpte_paint_box_clock (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, - gint x2, gint y2, gint c2) +gst_smpte_paint_box_clock (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, gint x2, gint y2, gint c2) { gfloat angle_m, col_m; gint xv, yv; - if (x1 == x0) { + if (x1 == x0) { xv = x2; yv = y1; } else if (y1 == y0) { xv = x1; yv = y2; - } - else { + } else { g_warning ("paint box clock: not supported"); return; } - angle_m = 2 * acos (((x1-x0) * (xv-x0) + (y1-y0) * (yv-y0))/ - (sqrt ((x1-x0) * (x1-x0) + (y1-y0) * (y1-y0)) * - sqrt ((xv-x0) * (xv-x0) + (yv-y0) * (yv-y0)))) / M_PI; - - col_m = c2 * angle_m + c1 * (1.0-angle_m); + angle_m = 2 * acos (((x1 - x0) * (xv - x0) + (y1 - y0) * (yv - y0)) / + (sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) * + sqrt ((xv - x0) * (xv - x0) + (yv - y0) * (yv - y0)))) / M_PI; + + col_m = c2 * angle_m + c1 * (1.0 - angle_m); gst_smpte_paint_triangle_clock (dest, stride, - x0, y0, c0, - x1, y1, c1, - xv, yv, col_m); + x0, y0, c0, x1, y1, c1, xv, yv, col_m); gst_smpte_paint_triangle_clock (dest, stride, - x0, y0, c0, - xv, yv, col_m, - x2, y2, c2); + x0, y0, c0, xv, yv, col_m, x2, y2, c2); } - diff --git a/gst/smpte/paint.h b/gst/smpte/paint.h index 4c34cf92..aa9fd425 100644 --- a/gst/smpte/paint.h +++ b/gst/smpte/paint.h @@ -22,26 +22,21 @@ #include -void gst_smpte_paint_vbox (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1); -void gst_smpte_paint_hbox (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1); +void gst_smpte_paint_vbox (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, gint x1, gint y1, gint c1); +void gst_smpte_paint_hbox (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, gint x1, gint y1, gint c1); -void gst_smpte_paint_triangle_linear (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, - gint x2, gint y2, gint c2); +void gst_smpte_paint_triangle_linear (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, gint x2, gint y2, gint c2); -void gst_smpte_paint_triangle_clock (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, - gint x2, gint y2, gint c2); +void gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, gint x2, gint y2, gint c2); -void gst_smpte_paint_box_clock (guint32 *dest, gint stride, - gint x0, gint y0, gint c0, - gint x1, gint y1, gint c1, - gint x2, gint y2, gint c2); +void gst_smpte_paint_box_clock (guint32 * dest, gint stride, + gint x0, gint y0, gint c0, + gint x1, gint y1, gint c1, gint x2, gint y2, gint c2); #endif /* __GST_SMPTE_PAINT_H__ */ -- cgit