@@ -122,7 +122,10 @@ static int filter_get_audio(mlt_frame frame,
122122 return 0 ;
123123}
124124
125- static void setup_pen (QPainter &p, QRect &rect, mlt_properties filter_properties)
125+ static void setup_pen (QPainter &p,
126+ QRect &rect,
127+ mlt_properties filter_properties,
128+ mlt_properties frame_properties)
126129{
127130 QVector<QColor> colors;
128131 bool color_found = true ;
@@ -133,6 +136,8 @@ static void setup_pen(QPainter &p, QRect &rect, mlt_properties filter_properties
133136 if (mlt_properties_exists (filter_properties, prop_name.toUtf8 ().constData ())) {
134137 mlt_color mcolor = mlt_properties_get_color (filter_properties,
135138 prop_name.toUtf8 ().constData ());
139+ mcolor = mlt_color_convert_trc (mcolor,
140+ mlt_properties_get (frame_properties, " color_trc" ));
136141 colors.append (QColor (mcolor.r , mcolor.g , mcolor.b , mcolor.a ));
137142 } else {
138143 color_found = false ;
@@ -177,14 +182,18 @@ static void setup_pen(QPainter &p, QRect &rect, mlt_properties filter_properties
177182 p.setPen (QColor (0 , 0 , 0 , 0 )); // Clear pen
178183}
179184
180- static void draw_light (mlt_properties filter_properties, QImage *qimg, mlt_rect *rect, double mag)
185+ static void draw_light (mlt_properties filter_properties,
186+ mlt_properties frame_properties,
187+ QImage *qimg,
188+ mlt_rect *rect,
189+ double mag)
181190{
182191 QPainter p (qimg);
183192 QRect r (rect->x , rect->y , rect->w , rect->h );
184193 p.setRenderHint (QPainter::Antialiasing);
185194 // Output transparency = input transparency
186195 p.setCompositionMode (QPainter::CompositionMode_SourceAtop);
187- setup_pen (p, r, filter_properties);
196+ setup_pen (p, r, filter_properties, frame_properties );
188197 p.setOpacity (mag);
189198 p.drawRect (r);
190199 p.end ();
@@ -235,7 +244,7 @@ static int filter_get_image(mlt_frame frame,
235244 if (!error) {
236245 QImage qimg (*width, *height, QImage::Format_ARGB32);
237246 convert_mlt_to_qimage (*image, &qimg, *width, *height, *format);
238- draw_light (filter_properties, &qimg, &rect, mag);
247+ draw_light (filter_properties, frame_properties, &qimg, &rect, mag);
239248 convert_qimage_to_mlt (&qimg, *image, *width, *height);
240249 }
241250 } else {
0 commit comments