mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
Anti-aliasing is now an option.
Original commit message from CVS: Anti-aliasing is now an option.
This commit is contained in:
parent
6777b92462
commit
a6fdf5997a
2 changed files with 26 additions and 2 deletions
|
@ -46,6 +46,7 @@ enum {
|
|||
ARG_SCREEN_WIDTH,
|
||||
ARG_SCREEN_HEIGHT,
|
||||
ARG_DITHER,
|
||||
ARG_ANTIALIASING
|
||||
};
|
||||
|
||||
static GstStaticPadTemplate sink_template =
|
||||
|
@ -178,8 +179,11 @@ gst_cacasink_class_init (GstCACASinkClass *klass)
|
|||
g_param_spec_int("screen_height","screen_height","screen_height",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READABLE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DITHER,
|
||||
g_param_spec_enum("dither","dither","dither",
|
||||
g_param_spec_enum("dither","Dither Type","Set type of Dither",
|
||||
GST_TYPE_CACADITHER, 0, G_PARAM_READWRITE));
|
||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ANTIALIASING,
|
||||
g_param_spec_boolean ("anti_aliasing", "Anti-Aliasing",
|
||||
"Enables Anti-Aliasing", TRUE, G_PARAM_READWRITE));
|
||||
|
||||
gobject_class->set_property = gst_cacasink_set_property;
|
||||
gobject_class->get_property = gst_cacasink_get_property;
|
||||
|
@ -302,7 +306,11 @@ gst_cacasink_init (GstCACASink *cacasink)
|
|||
|
||||
cacasink->screen_width = caca_get_width ();
|
||||
cacasink->screen_height = caca_get_height ();
|
||||
|
||||
cacasink->antialiasing = TRUE;
|
||||
caca_set_feature (CACA_ANTIALIASING_MAX);
|
||||
cacasink->dither = 0;
|
||||
caca_set_dithering (CACA_DITHERING_NONE);
|
||||
|
||||
GST_FLAG_SET(cacasink, GST_ELEMENT_THREAD_SUGGESTED);
|
||||
}
|
||||
|
||||
|
@ -380,6 +388,17 @@ gst_cacasink_set_property (GObject *object, guint prop_id, const GValue *value,
|
|||
caca_set_dithering (cacasink->dither + CACA_DITHERING_NONE);
|
||||
break;
|
||||
}
|
||||
case ARG_ANTIALIASING: {
|
||||
cacasink->antialiasing = g_value_get_boolean (value);
|
||||
if (cacasink->antialiasing) {
|
||||
caca_set_feature (CACA_ANTIALIASING_MAX);
|
||||
}
|
||||
|
||||
else {
|
||||
caca_set_feature (CACA_ANTIALIASING_MIN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -406,6 +425,10 @@ gst_cacasink_get_property (GObject *object, guint prop_id, GValue *value, GParam
|
|||
g_value_set_enum (value, cacasink->dither);
|
||||
break;
|
||||
}
|
||||
case ARG_ANTIALIASING: {
|
||||
g_value_set_boolean (value, cacasink->antialiasing);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
|
|
@ -71,6 +71,7 @@ struct _GstCACASink {
|
|||
gint screen_width, screen_height;
|
||||
guint bpp;
|
||||
guint dither;
|
||||
gboolean antialiasing;
|
||||
guint red_mask, green_mask, blue_mask;
|
||||
|
||||
gint64 correction;
|
||||
|
|
Loading…
Reference in a new issue