#include <string.h>
-typedef struct
-{
- uint8_t r, g, b, a;
-} rgba_color;
-
static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index );
static void producer_close( mlt_producer parent );
return NULL;
}
-rgba_color parse_color( char *color, unsigned int color_int )
-{
- rgba_color result = { 0xff, 0xff, 0xff, 0xff };
-
- if ( !strcmp( color, "red" ) )
- {
- result.r = 0xff;
- result.g = 0x00;
- result.b = 0x00;
- }
- else if ( !strcmp( color, "green" ) )
- {
- result.r = 0x00;
- result.g = 0xff;
- result.b = 0x00;
- }
- else if ( !strcmp( color, "blue" ) )
- {
- result.r = 0x00;
- result.g = 0x00;
- result.b = 0xff;
- }
- else if ( !strcmp( color, "black" ) )
- {
- result.r = 0x00;
- result.g = 0x00;
- result.b = 0x00;
- }
- else if ( strcmp( color, "white" ) )
- {
- result.r = ( color_int >> 24 ) & 0xff;
- result.g = ( color_int >> 16 ) & 0xff;
- result.b = ( color_int >> 8 ) & 0xff;
- result.a = ( color_int ) & 0xff;
- }
-
- return result;
-}
-
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
// Obtain properties of frame
free( now );
now = mlt_properties_get( producer_props, "resource" );
}
- rgba_color color = parse_color( now, mlt_properties_get_int( producer_props, "resource" ) );
+ mlt_color color = mlt_properties_get_color( producer_props, "resource" );
// Choose suitable out values if nothing specific requested
if ( *format == mlt_image_none )