]> git.sesse.net Git - mlt/commitdiff
frei0r_helper.c: cleanup color parser to use new code in mlt_property.c
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 20 Feb 2009 23:11:19 +0000 (23:11 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 20 Feb 2009 23:11:19 +0000 (23:11 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1363 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/frei0r/frei0r_helper.c

index d246edc2b867b240fc9552fd5b7360a16842c9bb..e42b06e301afa7c668357a62bac113d29b215e41 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
-
-static void parse_color( char *color, f0r_param_color_t *fcolor )
+static void parse_color( int color, f0r_param_color_t *fcolor )
 {
-       unsigned int temp = strtoul( color, &color, 0 );
-       if ( strlen( color ) > 6 )
-               temp >>= 8;
-       fcolor->r = ( temp >> 16 ) & 0xff;
+       fcolor->r = ( color >> 24 ) & 0xff;
        fcolor->r /= 255;
-       fcolor->g = ( temp >>  8 ) & 0xff;
+       fcolor->g = ( color >> 16 ) & 0xff;
        fcolor->g /= 255;
-       fcolor->b = ( temp >>  0 ) & 0xff;
+       fcolor->b = ( color >>  8 ) & 0xff;
        fcolor->b /= 255;
 }
 
-
- int process_frei0r_item( mlt_service_type type,  double position , mlt_properties prop , mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ){
+int process_frei0r_item( mlt_service_type type,  double position , mlt_properties prop , mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ){
 
        int i=0;
        f0r_instance_t ( *f0r_construct ) ( unsigned int , unsigned int ) =  mlt_properties_get_data(  prop , "f0r_construct" ,NULL);
@@ -94,11 +89,10 @@ static void parse_color( char *color, f0r_param_color_t *fcolor )
                                        case F0R_PARAM_COLOR:
                                        {
                                                f0r_param_color_t color;
-                                               parse_color(mlt_properties_get(prop , pinfo.name), &color);
+                                               parse_color(mlt_properties_get_int(prop , pinfo.name), &color);
                                                f0r_set_param_value(inst, &color, i);
                                                break;
                                        }
-
                                }
                        }