// Get the in and out position
mlt_position in = mlt_transition_get_in( this );
mlt_position out = mlt_transition_get_out( this );
+ int length = out - in + 1;
// Get the new style geometry string
char *property = mlt_properties_get( properties, "geometry" );
+ // Allow a geometry repeat cycle
+ if ( mlt_properties_get_int( properties, "cycle" ) )
+ length = mlt_properties_get_int( properties, "cycle" );
+
// Parse the geometry if we have one
- mlt_geometry_parse( geometry, property, out - in + 1, normalised_width, normalised_height );
+ mlt_geometry_parse( geometry, property, length, normalised_width, normalised_height );
// Check if we're using the old style geometry
if ( property == NULL )
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;
// field 1 = upper field and y should be even.
if ( ( field > -1 ) && ( y % 2 == field ) )
{
- //fprintf( stderr, "field %d y %d\n", field, y );
if ( ( field == 1 && y < height_dest - 1 ) || ( field == 0 && y == 0 ) )
p_dest += stride_dest;
else
*/
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 );
scaled_height = normalised_height;
}
+ // Honour the fill request - this will scale the image to fill width or height while maintaining a/r
+ // ????: Shouln't this be the default behaviour?
if ( mlt_properties_get_int( properties, "fill" ) )
{
if ( scaled_height < normalised_height && scaled_width * normalised_height / scaled_height < normalised_width )
else
{
int length = mlt_transition_get_out( this ) - mlt_transition_get_in( this ) + 1;
+ if ( mlt_properties_get_int( properties, "cycle" ) )
+ length = mlt_properties_get_int( properties, "cycle" );
mlt_geometry_refresh( start, mlt_properties_get( properties, "geometry" ), length, normalised_width, normalised_height );
}
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" );