]> git.sesse.net Git - mlt/commitdiff
Fix image size, fix utf-8 characters in titles
authorj-b-m <jb@kdenlive.org>
Thu, 30 Jul 2009 21:20:13 +0000 (23:20 +0200)
committerj-b-m <jb@kdenlive.org>
Thu, 30 Jul 2009 21:20:13 +0000 (23:20 +0200)
modified:   kdenlivetitle_wrapper.cpp
modified:   producer_kdenlivetitle.c

src/modules/qimage/kdenlivetitle_wrapper.cpp
src/modules/qimage/producer_kdenlivetitle.c

index db5ca400eb59e1dd7184900056f206da5341ba26..08204bfcaa5f045ffc194eb1e56c92198385e4a1 100644 (file)
@@ -84,10 +84,10 @@ void drawKdenliveTitle( mlt_producer producer, uint8_t * buffer, int width, int
        g_mutex.unlock();
        
        //must be extracted from kdenlive title
-       QImage *img = new QImage( width,height,QImage::Format_ARGB32 );
-       img->fill( 0 );
+       QImage img( width, height, QImage::Format_ARGB32 );
+       img.fill( 0 );
        QPainter p1;
-       p1.begin( img );
+       p1.begin( &img );
        p1.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::HighQualityAntialiasing );
        //| QPainter::SmoothPixmapTransform );
        
@@ -105,7 +105,7 @@ void drawKdenliveTitle( mlt_producer producer, uint8_t * buffer, int width, int
            scene->render( &p1, r1, r2 );
        }
        p1.end();
-       uint8_t *pointer=img->bits();
+       uint8_t *pointer=img.bits();
        QRgb* src = ( QRgb* ) pointer;
        for ( int i = 0; i < width * height * 4; i += 4 )
        {
@@ -115,7 +115,6 @@ void drawKdenliveTitle( mlt_producer producer, uint8_t * buffer, int width, int
                *buffer++=qAlpha( *src );
                src++;
        }
-       delete img;
 }
 
 void loadFromXml( mlt_producer producer, QGraphicsScene *scene, const char *templateXml, const char *templateText )
@@ -128,8 +127,8 @@ void loadFromXml( mlt_producer producer, QGraphicsScene *scene, const char *temp
        scene->clear();
        mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
        QDomDocument doc;
-       QString data(templateXml);
-       QString replacementText(templateText);
+       QString data = QString::fromUtf8(templateXml);
+       QString replacementText = QString::fromUtf8(templateText);
        doc.setContent(data);
        QDomNodeList titles = doc.elementsByTagName( "kdenlivetitle" );
        int maxZValue = 0;
index 450d829dfe0b5acbccea08299304cbf89a02b35d..313ffae0dd10a9bba61eff07bdf7cd0d8fbbd6e3 100644 (file)
@@ -56,6 +56,9 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        /* Obtain properties of producer */
        mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
        
+       *width = mlt_properties_get_int( properties, "rescale_width" );
+       *height = mlt_properties_get_int( properties, "rescale_height" );
+       
        /* Allocate the image */
        int size = *width * ( *height ) * 4;
 
@@ -64,8 +67,6 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        mlt_properties_set_int( properties, "width", *width );
        mlt_properties_set_int( properties, "height", *height );
 
-
-
        /* cache later ?? */
 
        if ( 1 )