]> git.sesse.net Git - mlt/commitdiff
filter_chroma.c: update to use new property-based color value
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 20 Feb 2009 23:45:54 +0000 (23:45 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 20 Feb 2009 23:45:54 +0000 (23:45 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1367 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/vmfx/filter_chroma.c
src/modules/vmfx/filter_chroma_hold.c

index 7616856c12ad2ac4f154ad0c97e1544d7e7a095f..f13838ba7aea8eb17f436aa96c1d57201547c25f 100644 (file)
@@ -45,12 +45,11 @@ static inline uint8_t alpha_value( uint8_t a, uint8_t *p, uint8_t u, uint8_t v,
 static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
 {
        mlt_filter this = mlt_frame_pop_service( frame );
-       char *key = mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "key" );
        int variance = 200 * mlt_properties_get_double( MLT_FILTER_PROPERTIES( this ), "variance" );
-       int32_t key_val = strtol( key, &key, 0 );
-       uint8_t b = key_val & 0xff;
-       uint8_t g = ( key_val >> 8 ) & 0xff;
-       uint8_t r = ( key_val >> 16 ) & 0xff;
+       int32_t key_val = mlt_properties_get_int( MLT_FILTER_PROPERTIES( this ), "key" );
+       uint8_t r = ( key_val >> 24 ) & 0xff;
+       uint8_t g = ( key_val >> 16 ) & 0xff;
+       uint8_t b = ( key_val >>  8 ) & 0xff;
        uint8_t y, u, v;
 
        RGB2YUV( r, g, b, y, u, v );
@@ -91,7 +90,7 @@ mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
        {
-               mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "key", arg == NULL ? "0x0000ff" : arg );
+               mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "key", arg == NULL ? "0x0000ff00" : arg );
                mlt_properties_set_double( MLT_FILTER_PROPERTIES( this ), "variance", 0.15 );
                this->process = filter_process;
        }
index 2046f925f99a70709123a37a61a6ba6fea26473f..07ca4a800e25b218d87bdfbba9c881fd71af4006 100644 (file)
@@ -91,7 +91,7 @@ mlt_filter filter_chroma_hold_init( mlt_profile profile, mlt_service_type type,
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )
        {
-               mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "key", arg == NULL ? "0xc00000" : arg );
+               mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "key", arg == NULL ? "0xc0000000" : arg );
                mlt_properties_set_double( MLT_FILTER_PROPERTIES( this ), "variance", 0.15 );
                this->process = filter_process;
        }