#include "glsl_manager.h"
#include <movit/deconvolution_sharpen_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ bool ok = effect->set_int( "matrix_size",
+ mlt_properties_anim_get_int( properties, "matrix_size", position, length ) );
+ ok |= effect->set_float( "cirlce_radius",
+ mlt_properties_anim_get_double( properties, "circle_radius", position, length ) );
+ ok |= effect->set_float( "gaussian_radius",
+ mlt_properties_anim_get_double( properties, "gaussian_radius", position, length ) );
+ ok |= effect->set_float( "correlation",
+ mlt_properties_anim_get_double( properties, "correlation", position, length ) );
+ ok |= effect->set_float( "noise",
+ mlt_properties_anim_get_double( properties, "noise", position, length ) );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect )
+ if ( !GlslManager::get_effect( filter, frame ) )
GlslManager::add_effect( filter, frame, new DeconvolutionSharpenEffect() );
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- bool ok = effect->set_int( "matrix_size", mlt_properties_get_int( filter_props, "matrix_size" ) );
- ok |= effect->set_float( "circle_radius", mlt_properties_get_double( filter_props, "circle_radius" ) );
- ok |= effect->set_float( "gaussian_radius", mlt_properties_get_double( filter_props, "gaussian_radius" ) );
- ok |= effect->set_float( "correlation", mlt_properties_get_double( filter_props, "correlation" ) );
- ok |= effect->set_float( "noise", mlt_properties_get_double( filter_props, "noise" ) );
- assert(ok);
- }
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
minimum: 0
maximum: 10
default: 5
+ mutable: yes
- identifier: circle_radius
title: Circle Radius
type: float
minimum: 0
default: 2
+ mutable: yes
- identifier: gaussian_radius
title: Gaussian Radius
type: float
minimum: 0
default: 0
+ mutable: yes
- identifier: correlation
title: Correlation
type: float
minimum: 0
default: 0.95
+ mutable: yes
- identifier: noise
title: Noise Level
type: float
minimum: 0
default: 0.01
-
+ mutable: yes
#include "glsl_manager.h"
#include <movit/lift_gamma_gain_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ RGBTriplet triplet(
+ mlt_properties_anim_get_double( properties, "lift_r", position, length ),
+ mlt_properties_anim_get_double( properties, "lift_g", position, length ),
+ mlt_properties_anim_get_double( properties, "lift_b", position, length )
+ );
+ bool ok = effect->set_vec3( "lift", (float*) &triplet );
+ triplet.r = mlt_properties_anim_get_double( properties, "gamma_r", position, length );
+ triplet.g = mlt_properties_anim_get_double( properties, "gamma_g", position, length );
+ triplet.b = mlt_properties_anim_get_double( properties, "gamma_b", position, length );
+ ok |= effect->set_vec3( "gamma", (float*) &triplet );
+ triplet.r = mlt_properties_anim_get_double( properties, "gain_r", position, length );
+ triplet.g = mlt_properties_anim_get_double( properties, "gain_g", position, length );
+ triplet.b = mlt_properties_anim_get_double( properties, "gain_b", position, length );
+ ok |= effect->set_vec3( "gain", (float*) &triplet );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect )
- effect = GlslManager::add_effect( filter, frame, new LiftGammaGainEffect );
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- RGBTriplet triplet(
- mlt_properties_get_double( filter_props, "lift_r" ),
- mlt_properties_get_double( filter_props, "lift_g" ),
- mlt_properties_get_double( filter_props, "lift_b" )
- );
- bool ok = effect->set_vec3( "lift", (float*) &triplet );
- triplet.r = mlt_properties_get_double( filter_props, "gamma_r" );
- triplet.g = mlt_properties_get_double( filter_props, "gamma_g" );
- triplet.b = mlt_properties_get_double( filter_props, "gamma_b" );
- ok |= effect->set_vec3( "gamma", (float*) &triplet );
- triplet.r = mlt_properties_get_double( filter_props, "gain_r" );
- triplet.g = mlt_properties_get_double( filter_props, "gain_g" );
- triplet.b = mlt_properties_get_double( filter_props, "gain_b" );
- ok |= effect->set_vec3( "gain", (float*) &triplet );
- assert(ok);
- }
+ if ( !GlslManager::get_effect( filter, frame ) )
+ GlslManager::add_effect( filter, frame, new LiftGammaGainEffect );
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
type: float
minimum: 0.0
default: 0.0
+ mutable: yes
- identifier: lift_g
title: Lift Green
type: float
minimum: 0.0
default: 0.0
+ mutable: yes
- identifier: lift_b
title: Lift Blue
type: float
minimum: 0.0
default: 0.0
+ mutable: yes
- identifier: gamma_r
title: Gamma Red
type: float
minimum: 0.0
default: 1.0
+ mutable: yes
- identifier: gamma_g
title: Gamma Green
type: float
minimum: 0.0
default: 1.0
+ mutable: yes
- identifier: gamma_b
title: Gamma Blue
type: float
minimum: 0.0
default: 1.0
+ mutable: yes
- identifier: gain_r
title: Gain Red
type: float
minimum: 0.0
default: 1.0
+ mutable: yes
- identifier: gain_g
title: Gain Green
type: float
minimum: 0.0
default: 1.0
+ mutable: yes
- identifier: gain_b
title: Gain Blue
type: float
minimum: 0.0
default: 1.0
+ mutable: yes
#include "glsl_manager.h"
#include <movit/diffusion_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ bool ok = effect->set_float( "radius",
+ mlt_properties_anim_get_double( properties, "radius", position, length ) );
+ ok |= effect->set_float( "blurred_mix_amount",
+ mlt_properties_anim_get_double( properties, "mix", position, length ) );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect )
- effect = GlslManager::add_effect( filter, frame, new DiffusionEffect() );
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- bool ok = effect->set_float( "radius", mlt_properties_get_double( filter_props, "radius" ) );
- ok |= effect->set_float( "blurred_mix_amount", mlt_properties_get_double( filter_props, "mix" ) );
- assert(ok);
- }
+ if ( !GlslManager::get_effect( filter, frame ) )
+ GlslManager::add_effect( filter, frame, new DiffusionEffect() );
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
type: float
minimum: 0.0
default: 3.0
+ mutable: yes
- identifier: mix
title: Blurriness
minimum: 0.0
maximum: 1.0
default: 0.3
+ mutable: yes
#include "glsl_manager.h"
#include <movit/glow_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ bool ok = effect->set_float( "radius",
+ mlt_properties_anim_get_double( properties, "radius", position, length ) );
+ ok |= effect->set_float( "blurred_mix_amount",
+ mlt_properties_anim_get_double( properties, "blur_mix", position, length ) );
+ ok |= effect->set_float( "highlight_cutoff",
+ mlt_properties_anim_get_double( properties, "highlight_cutoff", position, length ) );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect )
- effect = GlslManager::add_effect( filter, frame, new GlowEffect() );
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- bool ok = effect->set_float( "radius", mlt_properties_get_double( filter_props, "radius" ) );
- ok |= effect->set_float( "blurred_mix_amount", mlt_properties_get_double( filter_props, "blur_mix" ) );
- ok |= effect->set_float( "highlight_cutoff", mlt_properties_get_double( filter_props, "highlight_cutoff" ) );
- assert(ok);
- }
+ if ( !GlslManager::get_effect( filter, frame ) )
+ GlslManager::add_effect( filter, frame, new GlowEffect() );
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
type: float
minimum: 0.0
default: 20.0
+ mutable: yes
- identifier: blur_mix
title: Highlight Blurriness
minimum: 0.0
maximum: 1.0
default: 1.0
+ mutable: yes
- identifier: highlight_cutoff
title: Highlight Cutoff Threshold
minimum: 0.0
maximum: 1.0
default: 0.2
+ mutable: yes
GlslManager::get_instance()->lock_service( frame );
Effect* effect = GlslManager::get_effect( filter, frame );
if ( effect ) {
- bool ok = effect->set_float( "strength_first", mlt_properties_get_double( properties, "opacity" ) );
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ bool ok = effect->set_float( "strength_first",
+ mlt_properties_anim_get_double( properties, "opacity", position, length ) );
assert(ok);
}
GlslManager::get_instance()->unlock_service( frame );
minimum: 0
maximum: 1
default: 1
+ mutable: yes
#include "glsl_manager.h"
#include <movit/saturation_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ bool ok = effect->set_float( "saturation",
+ mlt_properties_anim_get_double( properties, "saturation", position, length ) );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect )
- effect = GlslManager::add_effect( filter, frame, new SaturationEffect() );
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- bool ok = effect->set_float( "saturation", mlt_properties_get_double( filter_props, "saturation" ) );
- assert(ok);
- }
+ if ( !GlslManager::get_effect( filter, frame ) )
+ GlslManager::add_effect( filter, frame, new SaturationEffect() );
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
type: float
minimum: 0
default: 1
+ mutable: yes
#include "glsl_manager.h"
#include <movit/vignette_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ bool ok = effect->set_float( "radius",
+ mlt_properties_anim_get_double( properties, "radius", position, length ) );
+ ok |= effect->set_float( "inner_radius",
+ mlt_properties_anim_get_double( properties, "inner_radius", position, length ) );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect ) {
- effect = GlslManager::add_effect( filter, frame, new VignetteEffect() );
- }
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- bool ok = effect->set_float( "radius", mlt_properties_get_double( filter_props, "radius" ) );
- ok |= effect->set_float( "inner_radius", mlt_properties_get_double( filter_props, "inner_radius" ) );
- assert(ok);
- }
+ if ( !GlslManager::get_effect( filter, frame ) )
+ GlslManager::add_effect( filter, frame, new VignetteEffect() );
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
minimum: 0.0
maximum: 1.0
default: 0.3
+ mutable: yes
- identifier: inner_radius
title: Inner Radius
minimum: 0.0
maximum: 1.0
default: 0.3
+ mutable: yes
#include "glsl_manager.h"
#include <movit/white_balance_effect.h>
+static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
+{
+ mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
+ mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ GlslManager::get_instance()->lock_service( frame );
+ Effect* effect = GlslManager::get_effect( filter, frame );
+ if ( effect ) {
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_position length = mlt_filter_get_length2( filter, frame );
+ int color_int = mlt_properties_anim_get_int( properties, "neutral_color", position, length );
+ RGBTriplet color(
+ float((color_int >> 24) & 0xff) / 255.0f,
+ float((color_int >> 16) & 0xff) / 255.0f,
+ float((color_int >> 8) & 0xff) / 255.0f
+ );
+ bool ok = effect->set_vec3( "neutral_color", (float*) &color );
+ ok |= effect->set_float( "output_color_temperature",
+ mlt_properties_anim_get_double( properties, "color_temperature", position, length ) );
+ assert(ok);
+ }
+ GlslManager::get_instance()->unlock_service( frame );
+ *format = mlt_image_glsl;
+ return mlt_frame_get_image( frame, image, format, width, height, writable );
+}
+
static mlt_frame process( mlt_filter filter, mlt_frame frame )
{
if ( !mlt_frame_is_test_card( frame ) ) {
- Effect* effect = GlslManager::get_effect( filter, frame );
- if ( !effect )
- effect = GlslManager::add_effect( filter, frame, new WhiteBalanceEffect );
- if ( effect ) {
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- int color_int = mlt_properties_get_int( filter_props, "neutral_color" );
- RGBTriplet color(
- float((color_int >> 24) & 0xff) / 255.0f,
- float((color_int >> 16) & 0xff) / 255.0f,
- float((color_int >> 8) & 0xff) / 255.0f
- );
- bool ok = effect->set_vec3( "neutral_color", (float*) &color );
- ok |= effect->set_float( "output_color_temperature", mlt_properties_get_double( filter_props, "color_temperature" ) );
- assert(ok);
- }
+ if ( !GlslManager::get_effect( filter, frame ) )
+ GlslManager::add_effect( filter, frame, new WhiteBalanceEffect );
}
+ mlt_frame_push_service( frame, filter );
+ mlt_frame_push_get_image( frame, get_image );
return frame;
}
type: string
widget: color
default: 0x7f7f7f00
+ mutable: yes
- identifier: color_temperature
title: Color Temperature
maximum: 15000.0
default: 6500.0
unit: Kelvin
+ mutable: yes
}
// Get the transition parameters
+ mlt_position position = mlt_transition_get_position( transition, a_frame );
+ mlt_position length = mlt_transition_get_length( transition );
int reverse = mlt_properties_get_int( properties, "reverse" );
double mix = mlt_properties_get( properties, "mix" ) ?
- mlt_properties_get_double( properties, "mix" ) :
+ mlt_properties_anim_get_double( properties, "mix", position, length ) :
mlt_transition_get_progress( transition, a_frame );
double inverse = 1.0 - mix;
type: float
minimum: 0
maximum: 1
+ mutable: yes
- identifier: mix
title: Mix Level
type: float
minimum: 0
maximum: 1
+ mutable: yes
- identifier: reverse
title: Reverse