[vlmc-devel] EffectSettingValue: Don't use QColor to save color

Yikai Lu git at videolan.org
Tue Apr 12 15:51:31 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Apr 12 20:42:45 2016 +0900| [3872c82d5cf749d6784aeaaa96303201c86e3ffe] | committer: Hugo Beauzée-Luyssen

EffectSettingValue: Don't use QColor to save color

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/3872c82d5cf749d6784aeaaa96303201c86e3ffe
---

 src/EffectsEngine/EffectSettingValue.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/EffectsEngine/EffectSettingValue.cpp b/src/EffectsEngine/EffectSettingValue.cpp
index e2b0f5c..9862a05 100644
--- a/src/EffectsEngine/EffectSettingValue.cpp
+++ b/src/EffectsEngine/EffectSettingValue.cpp
@@ -20,7 +20,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <QColor>
 #include <QPoint>
 
 #include "EffectsEngine/Effect.h"
@@ -78,8 +77,8 @@ EffectSettingValue::set( const QVariant &val )
         }
     case Color:
         {
-            QColor  color = val.value<QColor>();
-            qreal   rgb[3] = { color.redF(), color.greenF(), color.blueF() };
+            QVariantList l = val.toList();
+            qreal   rgb[3] = { l[0].toFloat(), l[1].toFloat(), l[2].toFloat() };
             copyToFrei0rBuff( rgb, 3 * sizeof(float) );
             break ;
         }
@@ -139,7 +138,9 @@ EffectSettingValue::get()
             f0r_param_color_t   tmp;
             m_effectInstance->effect()->m_f0r_get_param_value( m_effectInstance->m_instance,
                                                                &tmp, m_index );
-            m_val.setValue( QColor::fromRgbF( tmp.r, tmp.g, tmp.b ) );
+            QVariantList l;
+            l << tmp.r << tmp.g << tmp.b;
+            m_val.setValue( l );
             break ;
         }
     case Position:



More information about the Vlmc-devel mailing list