2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
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.
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.
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.
27 extern void _gst_barboxwipes_register (void);
29 static GList *masks = NULL;
34 _gst_barboxwipes_register ();
38 gst_mask_compare (GstMaskDefinition * def1, GstMaskDefinition * def2)
40 return (def1->type - def2->type);
44 _gst_mask_register (GstMaskDefinition * definition)
47 g_list_insert_sorted (masks, definition, (GCompareFunc) gst_mask_compare);
51 gst_mask_get_definitions (void)
56 static GstMaskDefinition *
57 gst_mask_find_definition (gint type)
62 GstMaskDefinition *def = (GstMaskDefinition *) walk->data;
64 if (def->type == type)
67 walk = g_list_next (walk);
73 gst_mask_factory_new (gint type, gint bpp, gint width, gint height)
75 GstMaskDefinition *definition;
78 definition = gst_mask_find_definition (type);
80 mask = g_new0 (GstMask, 1);
82 mask->type = definition->type;
85 mask->height = height;
86 mask->destroy_func = definition->destroy_func;
87 mask->user_data = definition->user_data;
88 mask->data = g_malloc (width * height * sizeof (guint32));
90 if (definition->draw_func)
91 definition->draw_func (mask);
98 _gst_mask_default_destroy (GstMask * mask)
105 gst_mask_destroy (GstMask * mask)
107 if (mask->destroy_func)
108 mask->destroy_func (mask);