Color values in MLT should always contain alpha (0xRRGGBBAA):

http://kdenlive.org/mantis/view.php?id=2644
parent c4aeddbf
......@@ -3,7 +3,7 @@
<name>Blue Screen</name>
<description>Make selected color transparent</description>
<author>Charles Yates</author>
<parameter type="color" name="key" default="0x0000FF">
<parameter type="color" name="key" default="0x0000ffff">
<name>Color key</name>
</parameter>
<parameter type="constant" name="variance" max="100" min="0" factor="100" default="15">
......
......@@ -3,7 +3,7 @@
<name>Chroma Hold</name>
<description>Make image greyscale except for chosen color</description>
<author>Charles Yates</author>
<parameter type="color" name="key" default="0x000000">
<parameter type="color" name="key" default="0x000000ff">
<name>Color key</name>
</parameter>
<parameter type="constant" name="variance" max="100" min="0" factor="100" default="15" >
......
......@@ -4,7 +4,7 @@
<name>White Balance</name>
<description>Adjust the white balance / color temperature</description>
<author>Dan Dennedy</author>
<parameter type="color" name="Neutral Color" default="0xFFFFFF">
<parameter type="color" name="Neutral Color" default="0xffffffff">
<name>Neutral Color</name>
</parameter>
<parameter type="simplekeyframe" name="Green Tint" default="1200" min="0" max="2500" factor="1000">
......@@ -15,7 +15,7 @@
<name>White Balance</name>
<description>Adjust the white balance / color temperature</description>
<author>Dan Dennedy</author>
<parameter type="color" name="Neutral Color" default="0xFFFFFF">
<parameter type="color" name="Neutral Color" default="0xffffffff">
<name>Neutral Color</name>
</parameter>
<parameter type="simplekeyframe" name="Green Tint" default="1333" min="0" max="10000" factor="10000">
......
......@@ -3,7 +3,7 @@
<name>Color Distance</name>
<description>Calculates the distance between the selected color and the current pixel and uses that value as new pixel value</description>
<author>Richard Spindler</author>
<parameter type="color" name="Color" default="0x000000">
<parameter type="color" name="Color" default="0x000000ff">
<name>Source Color</name>
</parameter>
</effect>
......@@ -4,11 +4,11 @@
<description>Reduces the visibility of key color spill in chroma keying</description>
<author>Marko Cebokli</author>
<parameter type="color" name="Key color" default="0x1010D0">
<parameter type="color" name="Key color" default="0x1010D0ff">
<name>Key color</name>
</parameter>
<parameter type="color" name="Target color" default="0xC87F65">
<parameter type="color" name="Target color" default="0xC87F65ff">
<name>Target color</name>
</parameter>
......
......@@ -5,7 +5,7 @@
<description>Color based alpha selection</description>
<author>Marko Cebokli</author>
<parameter type="color" name="Color to select" default="0x00FF00">
<parameter type="color" name="Color to select" default="0x00ff00ff">
<name>Color to select</name>
</parameter>
......@@ -52,7 +52,7 @@
<description>Color based alpha selection</description>
<author>Marko Cebokli</author>
<parameter type="color" name="Color to select" default="0x00FF00">
<parameter type="color" name="Color to select" default="0x00ff00ff">
<name>Color to select</name>
</parameter>
......
......@@ -3,13 +3,13 @@
<name>3 point balance</name>
<description>Balances colors along with 3 points</description>
<author>Maksim Golovkin</author>
<parameter type="color" name="Black color" default="0x000000">
<parameter type="color" name="Black color" default="0x000000ff">
<name>Black color</name>
</parameter>
<parameter type="color" name="Gray color" default="0x808080">
<parameter type="color" name="Gray color" default="0x808080ff">
<name>Gray color</name>
</parameter>
<parameter type="color" name="White color" default="0xFFFFFF">
<parameter type="color" name="White color" default="0xffffffff">
<name>White color</name>
</parameter>
<parameter type="bool" name="Split preview" default="0">
......
......@@ -3,7 +3,7 @@
<effect tag="frei0r.timeout" id="frei0r.timeout">
<name>Timeout indicator</name>
<author>Simon A. Eugster (Granjow)</author>
<parameter type="color" name="color" default="0x6893C8">
<parameter type="color" name="color" default="0x6893C8ff">
<name>Indicator color</name>
</parameter>
<parameter type="simplekeyframe" name="time" default="0" min="0" max="1000" factor="1000">
......
......@@ -3,10 +3,10 @@
<name>Tint</name>
<description>Maps source image luminance between two colors specified</description>
<author>Maksim Golovkin</author>
<parameter type="color" name="Map black to" default="0x000000">
<parameter type="color" name="Map black to" default="0x000000ff">
<name>Map black to</name>
</parameter>
<parameter type="color" name="Map white to" default="0x80FF80">
<parameter type="color" name="Map white to" default="0x80FF80ff">
<name>Map white to</name>
</parameter>
<parameter type="simplekeyframe" name="Tint amount" default="250" min="0" max="1000" factor="1000">
......
......@@ -9,7 +9,7 @@
<parameter type="bool" name="transition.distort" default="0">
<name>Distort</name>
</parameter>
<parameter type="color" name="background" default="colour:0x00000000" paramprefix="colour:">
<parameter type="color" name="background" default="colour:0x00000000" alpha="1" paramprefix="colour:">
<name>Background Color</name>
</parameter>
</effect>
......@@ -36,7 +36,7 @@
<parameter type="geometry" name="transition.geometry" default="0%,0%:100%x100%" fixed="1" opacity="false">
<name>Pan and Zoom</name>
</parameter>
<parameter type="color" name="background" default="colour:0x00000000" paramprefix="colour:">
<parameter type="color" name="background" default="colour:0x00000000" alpha="1" paramprefix="colour:">
<name>Background Color</name>
</parameter>
</effect>
......@@ -18,7 +18,7 @@
<parameter type="simplekeyframe" name="transition.oy" max="32000" min="-32000" default="0">
<name>Offset Y</name>
</parameter>
<parameter type="color" name="background" default="colour:0x00000000" paramprefix="colour:">
<parameter type="color" name="background" default="colour:0x00000000" alpha="1" paramprefix="colour:">
<name>Background Color</name>
</parameter>
<parameter type="fixed" name="transition.keyed" max="1" min="1" default="1" />
......
......@@ -27,6 +27,7 @@
#include <KColorButton>
#include <KLocalizedString>
#include <kdeversion.h>
#include <KDebug>
static QColor stringToColor(QString strColor)
{
......@@ -81,10 +82,14 @@ static QString colorToString(QColor color, bool alpha)
{
stream << color.alpha();
}
else {
// MLT always wants 0xRRGGBBAA format
stream << "ff";
}
return colorStr;
}
ChooseColorWidget::ChooseColorWidget(QString text, QString color, QWidget *parent) :
ChooseColorWidget::ChooseColorWidget(QString text, QString color, bool alphaEnabled, QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
......@@ -99,6 +104,9 @@ ChooseColorWidget::ChooseColorWidget(QString text, QString color, QWidget *paren
rightSideLayout->setSpacing(0);
m_button = new KColorButton(stringToColor(color), rightSide);
#if KDE_IS_VERSION(4,5,0)
if (alphaEnabled) m_button->setAlphaChannelEnabled(alphaEnabled);
#endif
// m_button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
ColorPickerWidget *picker = new ColorPickerWidget(rightSide);
......@@ -121,13 +129,6 @@ QString ChooseColorWidget::getColor()
return colorToString(m_button->color(), alphaChannel);
}
void ChooseColorWidget::setAlphaChannelEnabled(bool enabled)
{
#if KDE_IS_VERSION(4,5,0)
m_button->setAlphaChannelEnabled(enabled);
#endif
}
void ChooseColorWidget::setColor(QColor color)
{
m_button->setColor(color);
......
......@@ -38,14 +38,12 @@ class ChooseColorWidget : public QWidget
public:
/** @brief Sets up the widget.
* @param text (optional) What the color will be used for
* @param color (optional) initial color */
ChooseColorWidget(QString text = QString(), QString color = "0xffffffff", QWidget* parent = 0);
* @param color (optional) initial color
* @param alphaEnabled (optional) Should transparent colors be enabled */
ChooseColorWidget(QString text = QString(), QString color = "0xffffffff", bool alphaEnabled = false, QWidget* parent = 0);
/** @brief Gets the choosen color. */
QString getColor();
/** @brief Enable the use of alpha channel.
* @param enabled (required) whether alpha is enabled or disabled */
void setAlphaChannelEnabled(bool enabled);
private:
KColorButton *m_button;
......
......@@ -269,8 +269,7 @@ ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, Effect
if (pa.hasAttribute("paramprefix")) value.remove(0, pa.attribute("paramprefix").size());
if (value.startsWith('#'))
value = value.replace('#', "0x");
ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, value, parent);
choosecolor->setAlphaChannelEnabled(true);
ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, value, pa.hasAttribute("alpha"), parent);
m_vbox->addWidget(choosecolor);
m_valueItems[paramName] = choosecolor;
connect(choosecolor, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
......
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