// If the filename property changed, reload the map
char *resource = mlt_properties_get( properties, "luma" );
+ char temp[ 512 ];
+
+ if ( resource != NULL && strchr( resource, '%' ) )
+ {
+ sprintf( temp, "%s/lumas/%s/%s", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ), strchr( resource, '%' ) + 1 );
+ resource = temp;
+ }
+
if ( resource != NULL && ( luma_bitmap == NULL || luma_width != width || luma_height != height ) )
{
uint16_t *orig_bitmap = mlt_properties_get_data( properties, "_luma.orig_bitmap", NULL );
mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
- if ( mlt_properties_get( properties, "distort" ) == NULL && mlt_properties_get( b_props, "distort" ) == NULL && geometry->item.distort == 0 )
+ if ( mlt_properties_get_int( properties, "distort" ) == 0 && mlt_properties_get_int( b_props, "distort" ) == 0 && geometry->item.distort == 0 )
{
// Adjust b_frame pixel aspect
int normalised_width = geometry->item.w;
scaled_height = normalised_height;
}
- // Now apply the fill
- // TODO: Should combine fill/distort in one property
- if ( mlt_properties_get( properties, "fill" ) != NULL )
+ if ( mlt_properties_get_int( properties, "fill" ) )
{
- scaled_width = ( geometry->item.w / scaled_width ) * scaled_width;
- scaled_height = ( geometry->item.h / scaled_height ) * scaled_height;
+ if ( scaled_height < normalised_height && scaled_width * normalised_height / scaled_height < normalised_width )
+ {
+ scaled_width = scaled_width * normalised_height / scaled_height;
+ scaled_height = normalised_height;
+ }
+ else if ( scaled_width < normalised_width && scaled_height * normalised_width / scaled_width < normalised_height )
+ {
+ scaled_height = scaled_height * normalised_width / scaled_width;
+ scaled_width = normalised_width;
+ }
}
// Save the new scaled dimensions
}
// We want to ensure that we bypass resize now...
- mlt_properties_set( b_props, "distort", "true" );
+ mlt_properties_set_int( b_props, "distort", 1 );
// Take into consideration alignment for optimisation
if ( !mlt_properties_get_int( properties, "titles" ) )
x = 0;
}
- // Copy the region of the image
- p = image + y * ss + x * 2;
-
- while ( h -- )
+ if ( w > 0 && h > 0 )
{
- inline_memcpy( dest, p, w * 2 );
- dest += ds;
- p += ss;
+ // Copy the region of the image
+ p = image + y * ss + x * 2;
+
+ while ( h -- )
+ {
+ inline_memcpy( dest, p, w * 2 );
+ dest += ds;
+ p += ss;
+ }
}
// Assign this position to the b frame
mlt_frame_set_position( b_frame, frame_position );
- mlt_properties_set( b_props, "distort", "true" );
+ mlt_properties_set_int( b_props, "distort", 1 );
// Return the frame
return b_frame;
{
if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL )
mlt_properties_set( b_props, "rescale.interp", "hyper" );
- mlt_properties_set( properties, "fill", NULL );
width_b = mlt_properties_get_int( a_props, "dest_width" );
height_b = mlt_properties_get_int( a_props, "dest_height" );
}