Commit bff8e883 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Function added to GradientWidget to recover the list of stops.

parent 20b6103f
......@@ -494,3 +494,22 @@ void GradientWidget::leaveEvent( QEvent *evt )
update();
}
}
void GradientWidget::getStops( QVector<float> &values, QVector<QColor> &colors ) const
{
values.clear();
colors.clear();
if( m_Stops.isEmpty() )
return;
values.reserve( m_Stops.size() );
colors.reserve( m_Stops.size() );
for( auto &s : m_Stops )
{
values.push_back( s.value() );
colors.push_back( s.color() );
}
}
......@@ -72,6 +72,7 @@ public:
void addStop( const QColor& color, float value );
void setStops( const QList<QColor>& colors, const QList<float>& values );
inline QColor getColor( float v ) const { return getColor( getInterval(v), v ); }
void getStops( QVector<float> &values, QVector<QColor> &colors ) const;
QString getShaderFunctionGLSL( const QString& funcName ) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment