if [ "$MLT_CONSUMER" == "westley:" ]
then export WESTLEY_CONSUMER="westley:$demo.westley"
bash $demo -consumer $WESTLEY_CONSUMER
- inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=true
+ inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=1 composite.geometry=85%,5%:10%x10%
elif [ "$MLT_CONSUMER" == "westley" ]
then bash $demo -consumer $MLT_CONSUMER | less
else bash $demo -consumer $MLT_CONSUMER
clip2.dv out=1000 \
-track \
watermark1.png out=1000 \
--transition composite fill=1 in=0 out=1000 a_track=0 b_track=1 \
+-transition composite fill=1 in=0 out=1000 a_track=0 b_track=1 geometry=85%,5%:10%x10% \
$*
mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
mlt_producer_attach( result, filter );
mlt_filter_close( filter );
- filter = mlt_factory_filter( "data_show", "%obscure.properties" );
- mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
- mlt_producer_attach( result, filter );
- mlt_filter_close( filter );
- mlt_events_unblock( MLT_PRODUCER_PROPERTIES( result ), MLT_PRODUCER_PROPERTIES( result ) );
return result;
}
/** Load properties from a file.
*/
-mlt_properties mlt_properties_load( char *filename )
+mlt_properties mlt_properties_load( const char *filename )
{
// Construct a standalone properties object
mlt_properties this = mlt_properties_new( );
return this;
}
-static inline int generate_hash( char *name )
+static inline int generate_hash( const char *name )
{
int hash = 0;
int i = 1;
real producer.
*/
-static inline void mlt_properties_do_mirror( mlt_properties this, char *name )
+static inline void mlt_properties_do_mirror( mlt_properties this, const char *name )
{
property_list *list = this->local;
if ( list->mirror != NULL )
/** Pass all properties from 'that' that match the prefix to 'this' (excluding the prefix).
*/
-int mlt_properties_pass( mlt_properties this, mlt_properties that, char *prefix )
+int mlt_properties_pass( mlt_properties this, mlt_properties that, const char *prefix )
{
int count = mlt_properties_count( that );
int length = strlen( prefix );
/** Locate a property by name
*/
-static inline mlt_property mlt_properties_find( mlt_properties this, char *name )
+static inline mlt_property mlt_properties_find( mlt_properties this, const char *name )
{
property_list *list = this->local;
mlt_property value = NULL;
/** Add a new property.
*/
-static mlt_property mlt_properties_add( mlt_properties this, char *name )
+static mlt_property mlt_properties_add( mlt_properties this, const char *name )
{
property_list *list = this->local;
int key = generate_hash( name );
if ( list->count == list->size )
{
list->size += 50;
- list->name = realloc( list->name, list->size * sizeof( char * ) );
+ list->name = realloc( list->name, list->size * sizeof( const char * ) );
list->value = realloc( list->value, list->size * sizeof( mlt_property ) );
}
/** Fetch a property by name - this includes add if not found.
*/
-static mlt_property mlt_properties_fetch( mlt_properties this, char *name )
+static mlt_property mlt_properties_fetch( mlt_properties this, const char *name )
{
// Try to find an existing property first
mlt_property property = mlt_properties_find( this, name );
/** Set the property.
*/
-int mlt_properties_set( mlt_properties this, char *name, char *value )
+int mlt_properties_set( mlt_properties this, const char *name, const char *value )
{
int error = 1;
// Set it if not NULL
if ( property == NULL )
{
- fprintf( stderr, "Whoops\n" );
+ fprintf( stderr, "Whoops - %s not found (should never occur)\n", name );
}
else if ( value == NULL )
{
error = mlt_property_set_string( property, value );
mlt_properties_do_mirror( this, name );
}
- else if ( property != NULL && value[ 0 ] == '@' )
+ else if ( value[ 0 ] == '@' )
{
int total = 0;
int current = 0;
/** Set or default the property.
*/
-int mlt_properties_set_or_default( mlt_properties this, char *name, char *value, char *def )
+int mlt_properties_set_or_default( mlt_properties this, const char *name, const char *value, const char *def )
{
return mlt_properties_set( this, name, value == NULL ? def : value );
}
/** Get a string value by name.
*/
-char *mlt_properties_get( mlt_properties this, char *name )
+char *mlt_properties_get( mlt_properties this, const char *name )
{
mlt_property value = mlt_properties_find( this, name );
return value == NULL ? NULL : mlt_property_get_string( value );
/** Set a value by parsing a name=value string
*/
-int mlt_properties_parse( mlt_properties this, char *namevalue )
+int mlt_properties_parse( mlt_properties this, const char *namevalue )
{
char *name = strdup( namevalue );
char *value = NULL;
/** Get a value associated to the name.
*/
-int mlt_properties_get_int( mlt_properties this, char *name )
+int mlt_properties_get_int( mlt_properties this, const char *name )
{
mlt_property value = mlt_properties_find( this, name );
return value == NULL ? 0 : mlt_property_get_int( value );
/** Set a value associated to the name.
*/
-int mlt_properties_set_int( mlt_properties this, char *name, int value )
+int mlt_properties_set_int( mlt_properties this, const char *name, int value )
{
int error = 1;
/** Get a value associated to the name.
*/
-double mlt_properties_get_double( mlt_properties this, char *name )
+double mlt_properties_get_double( mlt_properties this, const char *name )
{
mlt_property value = mlt_properties_find( this, name );
return value == NULL ? 0 : mlt_property_get_double( value );
/** Set a value associated to the name.
*/
-int mlt_properties_set_double( mlt_properties this, char *name, double value )
+int mlt_properties_set_double( mlt_properties this, const char *name, double value )
{
int error = 1;
/** Get a value associated to the name.
*/
-mlt_position mlt_properties_get_position( mlt_properties this, char *name )
+mlt_position mlt_properties_get_position( mlt_properties this, const char *name )
{
mlt_property value = mlt_properties_find( this, name );
return value == NULL ? 0 : mlt_property_get_position( value );
/** Set a value associated to the name.
*/
-int mlt_properties_set_position( mlt_properties this, char *name, mlt_position value )
+int mlt_properties_set_position( mlt_properties this, const char *name, mlt_position value )
{
int error = 1;
/** Get a value associated to the name.
*/
-void *mlt_properties_get_data( mlt_properties this, char *name, int *length )
+void *mlt_properties_get_data( mlt_properties this, const char *name, int *length )
{
mlt_property value = mlt_properties_find( this, name );
return value == NULL ? NULL : mlt_property_get_data( value, length );
/** Set a value associated to the name.
*/
-int mlt_properties_set_data( mlt_properties this, char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise )
+int mlt_properties_set_data( mlt_properties this, const char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise )
{
int error = 1;
/** Rename a property.
*/
-int mlt_properties_rename( mlt_properties this, char *source, char *dest )
+int mlt_properties_rename( mlt_properties this, const char *source, const char *dest )
{
mlt_property value = mlt_properties_find( this, dest );
fprintf( output, "%s=%s\n", list->name[ i ], mlt_properties_get( this, list->name[ i ] ) );
}
-void mlt_properties_debug( mlt_properties this, char *title, FILE *output )
+void mlt_properties_debug( mlt_properties this, const char *title, FILE *output )
{
fprintf( output, "%s: ", title );
if ( this != NULL )
extern int mlt_properties_init( mlt_properties, void *child );
extern mlt_properties mlt_properties_new( );
-extern mlt_properties mlt_properties_load( char *file );
+extern mlt_properties mlt_properties_load( const char *file );
extern int mlt_properties_inc_ref( mlt_properties self );
extern int mlt_properties_dec_ref( mlt_properties self );
extern int mlt_properties_ref_count( mlt_properties self );
extern void mlt_properties_mirror( mlt_properties self, mlt_properties that );
extern int mlt_properties_inherit( mlt_properties self, mlt_properties that );
-extern int mlt_properties_pass( mlt_properties self, mlt_properties that, char *prefix );
-extern int mlt_properties_set( mlt_properties self, char *name, char *value );
-extern int mlt_properties_set_or_default( mlt_properties self, char *name, char *value, char *def );
-extern int mlt_properties_parse( mlt_properties self, char *namevalue );
-extern char *mlt_properties_get( mlt_properties self, char *name );
+extern int mlt_properties_pass( mlt_properties self, mlt_properties that, const char *prefix );
+extern int mlt_properties_set( mlt_properties self, const char *name, const char *value );
+extern int mlt_properties_set_or_default( mlt_properties self, const char *name, const char *value, const char *def );
+extern int mlt_properties_parse( mlt_properties self, const char *namevalue );
+extern char *mlt_properties_get( mlt_properties self, const char *name );
extern char *mlt_properties_get_name( mlt_properties self, int index );
extern char *mlt_properties_get_value( mlt_properties self, int index );
extern void *mlt_properties_get_data_at( mlt_properties self, int index, int *size );
-extern int mlt_properties_get_int( mlt_properties self, char *name );
-extern int mlt_properties_set_int( mlt_properties self, char *name, int value );
-extern double mlt_properties_get_double( mlt_properties self, char *name );
-extern int mlt_properties_set_double( mlt_properties self, char *name, double value );
-extern mlt_position mlt_properties_get_position( mlt_properties self, char *name );
-extern int mlt_properties_set_position( mlt_properties self, char *name, mlt_position value );
-extern int mlt_properties_set_data( mlt_properties self, char *name, void *value, int length, mlt_destructor, mlt_serialiser );
-extern void *mlt_properties_get_data( mlt_properties self, char *name, int *length );
-extern int mlt_properties_rename( mlt_properties self, char *source, char *dest );
+extern int mlt_properties_get_int( mlt_properties self, const char *name );
+extern int mlt_properties_set_int( mlt_properties self, const char *name, int value );
+extern double mlt_properties_get_double( mlt_properties self, const char *name );
+extern int mlt_properties_set_double( mlt_properties self, const char *name, double value );
+extern mlt_position mlt_properties_get_position( mlt_properties self, const char *name );
+extern int mlt_properties_set_position( mlt_properties self, const char *name, mlt_position value );
+extern int mlt_properties_set_data( mlt_properties self, const char *name, void *value, int length, mlt_destructor, mlt_serialiser );
+extern void *mlt_properties_get_data( mlt_properties self, const char *name, int *length );
+extern int mlt_properties_rename( mlt_properties self, const char *source, const char *dest );
extern int mlt_properties_count( mlt_properties self );
extern void mlt_properties_dump( mlt_properties self, FILE *output );
-extern void mlt_properties_debug( mlt_properties self, char *title, FILE *output );
+extern void mlt_properties_debug( mlt_properties self, const char *title, FILE *output );
extern void mlt_properties_close( mlt_properties self );
#endif
/** Set a string on this property.
*/
-int mlt_property_set_string( mlt_property this, char *value )
+int mlt_property_set_string( mlt_property this, const char *value )
{
if ( value != this->prop_string )
{
return 0;
}
+static inline int mlt_property_atoi( const char *value )
+{
+ if ( value == NULL )
+ return 0;
+ else if ( value[0] == '0' && value[1] == 'x' )
+ return strtol( value + 2, NULL, 16 );
+ else
+ return strtol( value, NULL, 10 );
+}
+
/** Get an int from this property.
*/
else if ( this->types & mlt_prop_int64 )
return ( int )this->prop_int64;
else if ( this->types & mlt_prop_string )
- return atoi( this->prop_string );
+ return mlt_property_atoi( this->prop_string );
return 0;
}
return 0;
}
+static inline int64_t mlt_property_atoll( const char *value )
+{
+ if ( value == NULL )
+ return 0;
+ else if ( value[0] == '0' && value[1] == 'x' )
+ return strtoll( value + 2, NULL, 16 );
+ else
+ return strtoll( value, NULL, 10 );
+}
+
/** Get an int64 from this property.
*/
else if ( this->types & mlt_prop_position )
return ( int64_t )this->prop_position;
else if ( this->types & mlt_prop_string )
- return ( int64_t )atol( this->prop_string );
+ return mlt_property_atoll( this->prop_string );
return 0;
}
extern int mlt_property_set_double( mlt_property self, double value );
extern int mlt_property_set_position( mlt_property self, mlt_position value );
extern int mlt_property_set_uint64( mlt_property self, uint64_t value );
-extern int mlt_property_set_string( mlt_property self, char *value );
+extern int mlt_property_set_string( mlt_property self, const char *value );
extern int mlt_property_set_data( mlt_property self, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser );
extern int mlt_property_get_int( mlt_property self );
extern double mlt_property_get_double( mlt_property self );
mlt_properties_set_data( frame_properties, label, temp, 0, ( mlt_destructor )mlt_frame_close, NULL );
// We want the first data_queue, but after that, all queues are appended
- if ( !done && mlt_properties_get_data( temp_properties, "data_queue", NULL ) != NULL &&
- mlt_deque_count( mlt_properties_get_data( temp_properties, "data_queue", NULL ) ) != 0 )
+ if ( !done && mlt_properties_get_data( temp_properties, "data_queue", NULL ) != NULL )
{
if ( data_queue == NULL )
{
{
if ( !strncmp( name + len, "length[", 7 ) )
{
- mlt_properties_set_position( properties, key, length / period );
+ mlt_properties_set_position( properties, key, ( length - period ) / period );
}
else
{
/** The averaging function...
*/
-void obscure_average( uint8_t *start, int width, int height, int stride )
+static inline void obscure_average( uint8_t *start, int width, int height, int stride )
{
- int y;
- int x;
+ register int y;
+ register int x;
register int Y = ( *start + *( start + 2 ) ) / 2;
register int U = *( start + 1 );
register int V = *( start + 3 );
register uint8_t *p;
+ register int components = width >> 1;
- for ( y = 0; y < height; y ++ )
+ y = height;
+ while( y -- )
{
- p = start + y * stride;
- for ( x = 0; x < width / 2; x ++ )
+ p = start;
+ x = components;
+ while( x -- )
{
- Y = ( Y + *p ++ ) / 2;
- U = ( U + *p ++ ) / 2;
- Y = ( Y + *p ++ ) / 2;
- V = ( V + *p ++ ) / 2;
+ Y = ( Y + *p ++ ) >> 1;
+ U = ( U + *p ++ ) >> 1;
+ Y = ( Y + *p ++ ) >> 1;
+ V = ( V + *p ++ ) >> 1;
}
+ start += stride;
}
- for ( y = 0; y < height; y ++ )
+ start -= height * stride;
+ y = height;
+ while( y -- )
{
- p = start + y * stride;
-
- for ( x = 0; x < width / 2; x ++ )
+ p = start;
+ x = components;
+ while( x -- )
{
*p ++ = Y;
*p ++ = U;
*p ++ = Y;
*p ++ = V;
}
+ start += stride;
}
}
aw = w + mw > area_w ? mw - ( w + mw - area_w ) : mw;
ah = h + mh > area_h ? mh - ( h + mh - area_h ) : mh;
if ( aw > 1 && ah > 1 )
- obscure_average( p + h * width * 2 + w * 2, aw, ah, width * 2 );
+ obscure_average( p + h * ( width << 1 ) + ( w << 1 ), aw, ah, width << 1 );
}
}
}
for ( j = 0; j < width_src; j ++ )
{
a = ( alpha == NULL ) ? 255 : *alpha ++;
- mix = ( luma == NULL ) ? weight : linearstep( luma[ j ], luma[ j ] + softness, weight );
- mix = ( mix * ( a + 1 ) ) >> 8;
+ mix = ( luma == NULL ) ? weight : smoothstep( luma[ j ], luma[ j ] + softness, weight + softness );
+ mix = ( mix * a ) >> 8;
*dest = ( *src++ * mix + *dest * ( ( 1 << 16 ) - mix ) ) >> 16;
dest++;
*dest = ( *src++ * mix + *dest * ( ( 1 << 16 ) - mix ) ) >> 16;
*/
static inline void
-scale_luma ( uint16_t *dest_buf, int dest_width, int dest_height, const uint16_t *src_buf, int src_width, int src_height )
+scale_luma ( uint16_t *dest_buf, int dest_width, int dest_height, const uint16_t *src_buf, int src_width, int src_height, int invert )
{
register int i, j;
register int x_step = ( src_width << 16 ) / dest_width;
for ( j = 0; j < dest_width; j++ )
{
- *dest_buf++ = src[ x >> 16 ];
+ *dest_buf++ = src[ x >> 16 ] ^ invert;
x += x_step;
}
y += y_step;
int luma_width = mlt_properties_get_int( properties, "_luma.width" );
int luma_height = mlt_properties_get_int( properties, "_luma.height" );
uint16_t *luma_bitmap = mlt_properties_get_data( properties, "_luma.bitmap", NULL );
+ int invert = mlt_properties_get_int( properties, "luma_invert" );
// If the filename property changed, reload the map
char *resource = mlt_properties_get( properties, "luma" );
}
// Scale luma map
luma_bitmap = mlt_pool_alloc( width * height * sizeof( uint16_t ) );
- scale_luma( luma_bitmap, width, height, orig_bitmap, luma_width, luma_height );
+ scale_luma( luma_bitmap, width, height, orig_bitmap, luma_width, luma_height, invert * ( ( 1 << 16 ) - 1 ) );
// Remember the scaled luma size to prevent unnecessary scaling
mlt_properties_set_int( properties, "_luma.width", width );
if ( mlt_properties_get_int( properties, "titles" ) )
{
- result.nw = result.item.w = *width;
- result.nh = result.item.h = *height;
+ result.item.w = *width * ( result.item.w / result.nw );
+ result.nw = result.item.w;
+ result.item.h = *height * ( result.item.h / result.nh );
+ result.nh = *height;
result.sw = width_b;
result.sh = height_b;
}
this->process = composite_process;
// Default starting motion and zoom
- mlt_properties_set( properties, "start", arg != NULL ? arg : "85%,5%:10%x10%" );
+ mlt_properties_set( properties, "start", arg != NULL ? arg : "0,0:100%x100%" );
// Default factory
mlt_properties_set( properties, "factory", "fezzik" );
alpha = p;
while ( size -- )
{
- *p ++ = *image ++;
+ *p ++ = ( int )( ( ( *image ++ - 16 ) * 299 ) / 255 );
image ++;
}
mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", alpha, region_width * region_height, mlt_pool_release, NULL );
mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
// We want to ensure that we don't get a wobble...
- mlt_properties_set_int( composite_properties, "distort", 1 );
+ //mlt_properties_set_int( composite_properties, "distort", 1 );
mlt_properties_set_int( composite_properties, "progressive", 1 );
// Pass all the composite. properties on the transition down
.filter[0]=watermark
.filter[0].resource=colour:0x000000
.filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40
-.filter[0].composite.titles=1
.filter[1]=watermark
.filter[1].resource=pango:
.filter[1].producer.markup=Shotcut
.filter[0]=watermark
.filter[0].resource=colour:0x000000
.filter[0].composite.geometry=0%,0%:100%x100%:0;5=0%,0%:100%x100%:40
-.filter[0].composite.titles=1
.filter[1]=watermark
.filter[1].resource=pango:
.filter[1].producer.markup=Shotcut
.filter[1].composite.geometry=0%,0%:100%x100%:0;8=0%,0%:100%x100%:100
-.filter[1].composite.halign=centre
.filter[1].composite.titles=1
#
.composite.geometry=0%,93%:100%x7%
.filter[0]=watermark
.filter[0].resource=colour:0x000000
-.filter[0].composite.geometry=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
.filter[1]=watermark
.filter[1].resource=pango:
.filter[1].producer.markup=Shotcut
.filter[1].producer.font=San 32
.filter[1].composite.titles=1
-#
-# ETV Location
-#
-
-location=region
-.description=Titles
-.properties.markup=filter[1].producer.markup
-.type.markup=text
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=0,80:230x30
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:0;25=0%,0%:100%x100%:100
-.filter[0].composite.luma=%luma01.pgm
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=0%,0%:100%x100%:0;24=0%,0%:100%x100%:0;49=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=right
-.filter[1].composite.valign=center
-
-courtesy=region
-.description=Titles
-.properties.markup=filter[1].producer.markup
-.type.markup=text
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=0,115:230x30
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=12=0%,0%:100%x100%:0;37=0%,0%:100%x100%:100
-.filter[0].composite.luma=%luma01.pgm
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=ETV Exclusive
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=0%,0%:100%x100%:0;37=0%,0%:100%x100%:0;61=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=right
-.filter[1].composite.valign=right
-
-exclusive=region
-.description=Exclusive
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=0,115:230x30
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:10;12=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=ETV Exclusive
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=0%,0%:100%x100%:10;12=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=right
-.filter[1].composite.valign=right
-
-file_shot=region
-.description=Titles
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=590,160:80x25
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=File Shot
-.filter[1].producer.font=San 20
-.filter[1].composite.geometry=0%,0%:100%x100%:15;25=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=centre
-.filter[1].composite.valign=centre
-
-special=region
-.description=Titles
-.period=2
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.composite.geometry=465,375:255x35
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=Special
-.filter[1].producer.font=San 24
-.filter[1].composite.geometry=100%,0%:100%x100%:0;49=100%,0%:100%x100%:0;74=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=centre
-.filter[1].composite.valign=centre
-
-ticker=region
-.description=Tickertape
-.properties.markup=filter[1].producer.markup
-.type.markup=text
-.properties.length[0]=filter[1].composite.out
-.composite.geometry=0,500:722x75
-.filter[0]=watermark
-.filter[0].resource=colour:0x6c010100
-.filter[0].composite.geometry=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=Ticker - provided for reference
-.filter[1].composite.geometry=0%,0%:100%x100%:100
-.filter[1].composite.titles=0
-.filter[1].producer.font=San 24
-.filter[1].composite.halign=centre
-.filter[1].composite.titles=1
-.filter[1].composite.valign=centre
-
-super=region
-.description=Transcription
-.properties.0=filter[1].producer.markup
-.properties.1=filter[2].producer.markup
-.properties.align=filter[1].composite.valign
-.properties.length[0]=filter[0].composite.out
-.properties.length[1]=filter[1].composite.out
-.properties.length[2]=filter[2].composite.out
-.period=2
-.composite.geometry=0,410:720x90
-.filter[0]=watermark
-.filter[0].resource=colour:0xbbbbbb00
-.filter[0].composite.geometry=0%,0%:100%x100%:10;25=0%,0%:100%x100%:100
-.filter[0].composite.titles=1
-.filter[0].composite.luma=%luma18.pgm
-.filter[0].composite.out=25
-.filter[1]=watermark
-.filter[1].resource=pango:
-.filter[1].producer.markup=
-.filter[1].producer.font=San 32
-.filter[1].producer.fgcolour=0x6c0101ff
-.filter[1].composite.geometry=0%,0%:100%x100%:0;25=0%,0%:100%x100%:100
-.filter[1].composite.titles=1
-.filter[1].composite.halign=centre
-.filter[1].composite.valign=top
-.filter[2]=watermark
-.filter[2].resource=pango:
-.filter[2].producer.markup=
-.filter[2].producer.font=San 32
-.filter[2].producer.fgcolour=0x6c0101ff
-.filter[2].composite.geometry=0%,0%:100%x100%:0;25=0%,0%:100%x100%:100
-.filter[2].composite.titles=1
-.filter[2].composite.halign=centre
-.filter[2].composite.valign=bottom
-
+greyscale=greyscale
+.description=greyscale
-# This properties file describes the fx available to the data_send and
+# This properties file describes the fx available to the data_feed and
# data_show filters
#
# Syntax is as follows:
# included as properties using the normal region filter syntax.
#
-obscure=region
-.description=Obscure
+obscure0=region
+.description=Primary Obscure
+.properties.geometry=composite.geometry
+.properties.resource=resource
+.properties.length[0]=composite.out
+.composite.geometry=
+.resource=rectangle
+.composite.refresh=1
+.filter[0]=obscure
+
+obscure1=region
+.description=Secondary Obscure
.properties.geometry=composite.geometry
.properties.resource=resource
.properties.length[0]=composite.out
.resource=rectangle
.composite.refresh=1
.filter[0]=obscure
-.filter[0].start=0,0:100%x100%:8x8
resizer=resize
resampler=resample,soxresample,avresample
data=data_feed:attr_check
+obscure=data_show:%obscure.properties
FT_Bitmap bitmap;
uint8_t *src = NULL;
uint8_t* dest = NULL;
+ uint8_t *d, *s, a;
int stride;
pango_ft2_font_map_set_resolution( fontmap, 72, 72 );
src = bitmap.buffer;
x = ( gdk_pixbuf_get_width( pixbuf ) - w - 2 * pad ) * align / 2 + pad;
dest = gdk_pixbuf_get_pixels( pixbuf ) + 4 * x + pad * stride;
- for ( j = 0; j < h; j++ )
+ j = h;
+
+ while( j -- )
{
- uint8_t *d = dest;
- for ( i = 0; i < w; i++ )
+ d = dest;
+ s = src;
+ i = w;
+ while( i -- )
{
- float a = ( float ) bitmap.buffer[ j * bitmap.pitch + i ] / 255.0;
- *d++ = ( int ) ( a * fg.r + ( 1 - a ) * bg.r );
- *d++ = ( int ) ( a * fg.g + ( 1 - a ) * bg.g );
- *d++ = ( int ) ( a * fg.b + ( 1 - a ) * bg.b );
- *d++ = ( int ) ( a * fg.a + ( 1 - a ) * bg.a );
+ a = *s ++;
+ *d++ = ( a * fg.r + ( 255 - a ) * bg.r ) >> 8;
+ *d++ = ( a * fg.g + ( 255 - a ) * bg.g ) >> 8;
+ *d++ = ( a * fg.b + ( 255 - a ) * bg.b ) >> 8;
+ *d++ = ( a * fg.a + ( 255 - a ) * bg.a ) >> 8;
}
dest += stride;
+ src += bitmap.pitch;
}
mlt_pool_release( bitmap.buffer );
g_object_unref( layout );