geometrictransform: Descriptions and default values

Improve some properties and element descriptions and changes
some default properties values.
This commit is contained in:
Thiago Santos 2010-06-05 10:58:00 -03:00
parent adcb34378a
commit 964c71b7c6
8 changed files with 38 additions and 19 deletions

View file

@ -142,7 +142,7 @@ gst_circle_base_init (gpointer gclass)
gst_element_class_set_details_simple (element_class, gst_element_class_set_details_simple (element_class,
"circle", "circle",
"Transform/Effect/Video", "Transform/Effect/Video",
"Applies 'circle' geometric transform to the image", "Warps the picture into an arc shaped form",
"Thiago Santos<thiago.sousa.santos@collabora.co.uk>"); "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
} }
@ -190,17 +190,17 @@ gst_circle_class_init (GstCircleClass * klass)
g_object_class_install_property (gobject_class, PROP_ANGLE, g_object_class_install_property (gobject_class, PROP_ANGLE,
g_param_spec_double ("angle", "angle", g_param_spec_double ("angle", "angle",
"angle", "Angle at which the arc starts in radians",
-G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_ANGLE, -G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_ANGLE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_SPREAD_ANGLE, g_object_class_install_property (gobject_class, PROP_SPREAD_ANGLE,
g_param_spec_double ("spread-angle", "spread angle", g_param_spec_double ("spread-angle", "spread angle",
"spread angle", "Length of the arc in radians",
-G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_SPREAD_ANGLE, -G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_SPREAD_ANGLE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_HEIGHT, g_object_class_install_property (gobject_class, PROP_HEIGHT,
g_param_spec_int ("height", "height", g_param_spec_int ("height", "height",
"height", "Height of the arc",
0, G_MAXINT, DEFAULT_HEIGHT, 0, G_MAXINT, DEFAULT_HEIGHT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

View file

@ -50,13 +50,6 @@ enum
PROP_OFF_EDGE_PIXELS PROP_OFF_EDGE_PIXELS
}; };
enum
{
GST_GT_OFF_EDGES_PIXELS_IGNORE = 0,
GST_GT_OFF_EDGES_PIXELS_CLAMP,
GST_GT_OFF_EDGES_PIXELS_WRAP
};
#define GST_GT_OFF_EDGES_PIXELS_METHOD_TYPE ( \ #define GST_GT_OFF_EDGES_PIXELS_METHOD_TYPE ( \
gst_geometric_transform_off_edges_pixels_method_get_type()) gst_geometric_transform_off_edges_pixels_method_get_type())
static GType static GType
@ -308,12 +301,15 @@ gst_geometric_transform_class_init (gpointer klass, gpointer class_data)
g_param_spec_enum ("off-edge-pixels", "Off edge pixels", g_param_spec_enum ("off-edge-pixels", "Off edge pixels",
"What to do with off edge pixels", "What to do with off edge pixels",
GST_GT_OFF_EDGES_PIXELS_METHOD_TYPE, DEFAULT_OFF_EDGE_PIXELS, GST_GT_OFF_EDGES_PIXELS_METHOD_TYPE, DEFAULT_OFF_EDGE_PIXELS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
} }
static void static void
gst_geometric_transform_init (GTypeInstance * instance, gpointer g_class) gst_geometric_transform_init (GTypeInstance * instance, gpointer g_class)
{ {
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (instance);
gt->off_edge_pixels = DEFAULT_OFF_EDGE_PIXELS;
} }
GType GType

View file

@ -38,6 +38,13 @@ G_BEGIN_DECLS
#define GST_GEOMETRIC_TRANSFORM_GET_CLASS(obj) \ #define GST_GEOMETRIC_TRANSFORM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_GEOMETRIC_TRANSFORM,GstGeometricTransformClass)) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_GEOMETRIC_TRANSFORM,GstGeometricTransformClass))
enum
{
GST_GT_OFF_EDGES_PIXELS_IGNORE = 0,
GST_GT_OFF_EDGES_PIXELS_CLAMP,
GST_GT_OFF_EDGES_PIXELS_WRAP
};
typedef struct _GstGeometricTransform GstGeometricTransform; typedef struct _GstGeometricTransform GstGeometricTransform;
typedef struct _GstGeometricTransformClass GstGeometricTransformClass; typedef struct _GstGeometricTransformClass GstGeometricTransformClass;

View file

@ -207,8 +207,8 @@ gst_kaleidoscope_class_init (GstKaleidoscopeClass * klass)
-G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_ANGLE, -G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_ANGLE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_SIDES, g_object_class_install_property (gobject_class, PROP_SIDES,
g_param_spec_int ("sides", "sides", "number of sides", g_param_spec_int ("sides", "sides", "Number of sides of the kaleidoscope",
0, G_MAXINT, DEFAULT_SIDES, 2, G_MAXINT, DEFAULT_SIDES,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstgt_class->map_func = kaleidoscope_map; gstgt_class->map_func = kaleidoscope_map;
@ -217,6 +217,9 @@ gst_kaleidoscope_class_init (GstKaleidoscopeClass * klass)
static void static void
gst_kaleidoscope_init (GstKaleidoscope * filter, GstKaleidoscopeClass * gclass) gst_kaleidoscope_init (GstKaleidoscope * filter, GstKaleidoscopeClass * gclass)
{ {
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
filter->angle = DEFAULT_ANGLE; filter->angle = DEFAULT_ANGLE;
filter->angle2 = DEFAULT_ANGLE2; filter->angle2 = DEFAULT_ANGLE2;
filter->sides = DEFAULT_SIDES; filter->sides = DEFAULT_SIDES;

View file

@ -188,7 +188,7 @@ gst_pinch_class_init (GstPinchClass * klass)
g_object_class_install_property (gobject_class, PROP_INTENSITY, g_object_class_install_property (gobject_class, PROP_INTENSITY,
g_param_spec_double ("intensity", "intensity", g_param_spec_double ("intensity", "intensity",
"intensity of the pinch effect", "intensity of the pinch effect",
0.0, G_MAXDOUBLE, DEFAULT_INTENSITY, -1.0, 1.0, DEFAULT_INTENSITY,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstgt_class->map_func = pinch_map; gstgt_class->map_func = pinch_map;
@ -197,6 +197,9 @@ gst_pinch_class_init (GstPinchClass * klass)
static void static void
gst_pinch_init (GstPinch * filter, GstPinchClass * gclass) gst_pinch_init (GstPinch * filter, GstPinchClass * gclass)
{ {
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
filter->intensity = DEFAULT_INTENSITY; filter->intensity = DEFAULT_INTENSITY;
} }

View file

@ -208,6 +208,9 @@ gst_sphere_class_init (GstSphereClass * klass)
static void static void
gst_sphere_init (GstSphere * filter, GstSphereClass * gclass) gst_sphere_init (GstSphere * filter, GstSphereClass * gclass)
{ {
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
filter->refraction = DEFAULT_REFRACTION; filter->refraction = DEFAULT_REFRACTION;
} }

View file

@ -66,7 +66,7 @@ enum
PROP_ANGLE PROP_ANGLE
}; };
#define DEFAULT_ANGLE 0 #define DEFAULT_ANGLE (G_PI)
GST_BOILERPLATE (GstTwirl, gst_twirl, GstCircleGeometricTransform, GST_BOILERPLATE (GstTwirl, gst_twirl, GstCircleGeometricTransform,
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM); GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
@ -124,7 +124,7 @@ gst_twirl_base_init (gpointer gclass)
gst_element_class_set_details_simple (element_class, gst_element_class_set_details_simple (element_class,
"twirl", "twirl",
"Transform/Effect/Video", "Transform/Effect/Video",
"Applies 'twirl' geometric transform to the image", "Twists the image from the center out",
"Thiago Santos<thiago.sousa.santos@collabora.co.uk>"); "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
} }
@ -175,7 +175,8 @@ gst_twirl_class_init (GstTwirlClass * klass)
g_object_class_install_property (gobject_class, PROP_ANGLE, g_object_class_install_property (gobject_class, PROP_ANGLE,
g_param_spec_double ("angle", "angle", g_param_spec_double ("angle", "angle",
"angle in radians of the twirl effect", "This is the angle in radians by which pixels at the "
"nearest edge of the image will move",
-G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_ANGLE, -G_MAXDOUBLE, G_MAXDOUBLE, DEFAULT_ANGLE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
@ -185,6 +186,9 @@ gst_twirl_class_init (GstTwirlClass * klass)
static void static void
gst_twirl_init (GstTwirl * filter, GstTwirlClass * gclass) gst_twirl_init (GstTwirl * filter, GstTwirlClass * gclass)
{ {
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
filter->angle = DEFAULT_ANGLE; filter->angle = DEFAULT_ANGLE;
} }

View file

@ -140,7 +140,7 @@ gst_water_ripple_base_init (gpointer gclass)
gst_element_class_set_details_simple (element_class, gst_element_class_set_details_simple (element_class,
"waterripple", "waterripple",
"Transform/Effect/Video", "Transform/Effect/Video",
"Applies 'water_ripple' geometric transform to the image", "Creates a water ripple effect on the image",
"Thiago Santos<thiago.sousa.santos@collabora.co.uk>"); "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
} }
@ -216,6 +216,9 @@ gst_water_ripple_class_init (GstWaterRippleClass * klass)
static void static void
gst_water_ripple_init (GstWaterRipple * filter, GstWaterRippleClass * gclass) gst_water_ripple_init (GstWaterRipple * filter, GstWaterRippleClass * gclass)
{ {
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
filter->amplitude = DEFAULT_AMPLITUDE; filter->amplitude = DEFAULT_AMPLITUDE;
filter->phase = DEFAULT_PHASE; filter->phase = DEFAULT_PHASE;
filter->wavelength = DEFAULT_WAVELENGTH; filter->wavelength = DEFAULT_WAVELENGTH;