mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 21:12:26 +00:00
[173/906] add lumaxpro (desaturate + cross process) effect. nothing too impressive but I like it.
This commit is contained in:
parent
15a1f7a203
commit
5db4fa5f1e
5 changed files with 30 additions and 6 deletions
|
@ -105,3 +105,20 @@ gst_gl_effects_sepia (GstGLEffects *effects) {
|
|||
gst_gl_filter_render_to_target (filter, effects->intexture, effects->outtexture,
|
||||
gst_gl_effects_sepia_callback, effects);
|
||||
}
|
||||
|
||||
static void gst_gl_effects_luma_xpro_callback (gint width, gint height, guint texture, gpointer data)
|
||||
{
|
||||
GstGLEffects* effects = GST_GL_EFFECTS (data);
|
||||
|
||||
gst_gl_effects_luma_to_curve (effects, luma_xpro_curve, GST_GL_EFFECTS_CURVE_LUMA_XPRO,
|
||||
width, height, texture);
|
||||
}
|
||||
|
||||
void
|
||||
gst_gl_effects_luma_xpro (GstGLEffects *effects) {
|
||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||
|
||||
gst_gl_filter_render_to_target (filter, effects->intexture, effects->outtexture,
|
||||
gst_gl_effects_luma_xpro_callback, effects);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ static const GstGLEffectsCurve xpro_curve = {
|
|||
"\377\367\377\377\367\377\377\370",
|
||||
};
|
||||
|
||||
static const GstGLEffectsCurve blue_curve = {
|
||||
static const GstGLEffectsCurve luma_xpro_curve = {
|
||||
256, 1, 3,
|
||||
"\0\0\1\0\1\1\0\1\2\0\1\2\0\1\2\0\1\2\0\1\3\0\2\3\0\2\4\0\2\4\0\2\5\0\2\6"
|
||||
"\0\3\6\0\3\6\0\3\7\0\3\10\0\4\10\0\4\11\0\4\12\0\4\12\1\4\13\1\5\14\1\5\15"
|
||||
|
@ -94,7 +94,6 @@ static const GstGLEffectsCurve blue_curve = {
|
|||
"\274\362\355\276\364\356\277\364\357\277\365\360\277\365\360\302\366\361"
|
||||
"\302\367\361\304\370\363\304\370\363\307\370\364\307\371\364\311\371\366"
|
||||
"\312\372\367\312\372\367\314\372\367\316\373\370\316\373\370\320\373\371"
|
||||
|
||||
"\320\374\371\321\374\372\323\374\372\324\375\372\325\375\372\325\375\373"
|
||||
"\327\375\373\330\375\374\332\375\374\333\375\375\334\376\375\334\376\375"
|
||||
"\335\376\375\337\376\375\337\376\375\340\376\376\342\376\376\344\376\376"
|
||||
|
|
|
@ -67,6 +67,7 @@ typedef enum {
|
|||
GST_GL_EFFECT_HEAT,
|
||||
GST_GL_EFFECT_SEPIA,
|
||||
GST_GL_EFFECT_XPRO,
|
||||
GST_GL_EFFECT_LUMA_XPRO,
|
||||
GST_GL_EFFECT_GLOW,
|
||||
GST_GL_N_EFFECTS
|
||||
} GstGLEffectsEffect;
|
||||
|
@ -89,6 +90,7 @@ gst_gl_effects_effect_get_type (void)
|
|||
{ GST_GL_EFFECT_HEAT, "Heat Signature Effect", "heat" },
|
||||
{ GST_GL_EFFECT_SEPIA, "Sepia Toning Effect", "sepia" },
|
||||
{ GST_GL_EFFECT_XPRO, "Cross Processing Effect", "xpro" },
|
||||
{ GST_GL_EFFECT_LUMA_XPRO, "Luma Cross Processing Effect", "lumaxpro" },
|
||||
{ GST_GL_EFFECT_GLOW, "Glow Lighting Effect", "glow" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
@ -140,6 +142,9 @@ gst_gl_effects_set_effect (GstGLEffects *effects, gint effect_type) {
|
|||
case GST_GL_EFFECT_XPRO:
|
||||
effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_xpro;
|
||||
break;
|
||||
case GST_GL_EFFECT_LUMA_XPRO:
|
||||
effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_luma_xpro;
|
||||
break;
|
||||
case GST_GL_EFFECT_GLOW:
|
||||
effects->effect = (GstGLEffectProcessFunc) gst_gl_effects_glow;
|
||||
break;
|
||||
|
|
|
@ -49,6 +49,7 @@ enum {
|
|||
GST_GL_EFFECTS_CURVE_HEAT,
|
||||
GST_GL_EFFECTS_CURVE_SEPIA,
|
||||
GST_GL_EFFECTS_CURVE_XPRO,
|
||||
GST_GL_EFFECTS_CURVE_LUMA_XPRO,
|
||||
GST_GL_EFFECTS_N_CURVES
|
||||
};
|
||||
|
||||
|
@ -96,6 +97,7 @@ void gst_gl_effects_square (GstGLEffects *effects);
|
|||
void gst_gl_effects_heat (GstGLEffects *effects);
|
||||
void gst_gl_effects_sepia (GstGLEffects *effects);
|
||||
void gst_gl_effects_xpro (GstGLEffects *effects);
|
||||
void gst_gl_effects_luma_xpro (GstGLEffects *effects);
|
||||
void gst_gl_effects_glow (GstGLEffects *effects);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -164,16 +164,17 @@ main (gint argc, gchar * argv[])
|
|||
combo = gtk_combo_box_new_text ();
|
||||
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "identity");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "mirror");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "squeeze");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "stretch");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "bulge");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "twirl");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "tunnel");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "fisheye");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "twirl");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "bulge");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "tunnel");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "square");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "mirror");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "heat");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "xpro");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "lumaxpro");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "sepia");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "glow");
|
||||
|
||||
|
|
Loading…
Reference in a new issue