Пример #1
0
KisFilterConfiguration* KisFilterColorToAlpha::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("colortoalpha", 1);
    config->setProperty("targetcolor", QColor(255, 255, 255));
    config->setProperty("threshold", 0);
    return config;
}
Пример #2
0
KisFilterConfiguration* KisCubismFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("tileSize", 10);
    config->setProperty("tileSaturation", 10);
    return config;
}
Пример #3
0
KisFilterConfiguration* KisOilPaintFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("oilpaint", 1);
    config->setProperty("brushSize", 1);
    config->setProperty("smooth", 30);
    return config;
}
KisFilterConfiguration* KisPixelizeFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("pixelize", 1);
    config->setProperty("pixelWidth", 10);
    config->setProperty("pixelHeight", 10);
    return config;
}
KisPropertiesConfiguration* KisWdgColorToAlpha::configuration() const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("colortoalpha", 1);
    config->setProperty("targetcolor", widget()->colorSelector->color());
    config->setProperty("threshold", widget()->intThreshold->value());
    return config;
}
KisFilterConfiguration* KisMotionBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("blurAngle", 0);
    config->setProperty("blurLength", 5);

    return config;
}
Пример #7
0
KisFilterConfiguration* KisRainDropsFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("raindrops", 1);
    config->setProperty("dropsize", 80);
    config->setProperty("number", 80);
    config->setProperty("fishEyes", 30);
    return config;
}
KisFilterConfiguration* KisUnsharpFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("halfSize", 5);
    config->setProperty("amount", 0.5);
    config->setProperty("threshold", 10);
    return config;
}
KisFilterConfiguration* KisGaussianBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("horizRadius", 5);
    config->setProperty("vertRadius", 5);
    config->setProperty("lockAspect", true);

    return config;
}
Пример #10
0
KisPropertiesConfiguration* KisWdgUnsharp::configuration() const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("unsharp", 1);
    config->setProperty("halfSize", widget()->doubleHalfSize->value());
    config->setProperty("amount", widget()->doubleAmount->value());
    config->setProperty("threshold", widget()->intThreshold->value());
    config->setProperty("lightnessOnly", widget()->chkLightnessOnly->isChecked());
    return config;
}
KisFilterConfiguration* KisLensBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("irisShape", "Pentagon (5)");
    config->setProperty("irisRadius", 5);
    config->setProperty("irisRotation", 0);

    return config;
}
KisPropertiesConfiguration * KisHSVConfigWidget::configuration() const
{
    KisFilterConfiguration* c = new KisFilterConfiguration(KisHSVAdjustmentFilter::id().id(), 0);
    c->setProperty("h", m_page->hue->value());
    c->setProperty("s", m_page->saturation->value());
    c->setProperty("v", m_page->value->value());
    c->setProperty("type", m_page->cmbType->currentIndex());
    c->setProperty("colorize", m_page->chkColorize->isChecked());
    return c;
}
KisFilterConfiguration* KisHSVAdjustmentFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("h", 0);
    config->setProperty("s", 0);
    config->setProperty("v", 0);
    config->setProperty("type", 1);
    config->setProperty("colorize", false);
    return config;
}
Пример #14
0
KisFilterConfiguration* KisBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("halfWidth", 5);
    config->setProperty("halfHeight", 5);
    config->setProperty("rotate", 0);
    config->setProperty("strength", 0);
    config->setProperty("shape", 0);
    return config;
}
Пример #15
0
KisFilterConfiguration* KisRainDropsFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("raindrops", 2);
    config->setProperty("dropsize", 80);
    config->setProperty("number", 80);
    config->setProperty("fishEyes", 30);
    config->setProperty("seed", QTime::currentTime().msec());


    return config;
}
Пример #16
0
KisPropertiesConfiguration* KisWdgLensBlur::configuration() const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("lens blur", 1);
    config->setProperty("irisShape", m_widget->irisShapeCombo->currentText());
    config->setProperty("irisRadius", m_widget->irisRadiusSlider->value());
    config->setProperty("irisRotation", m_widget->irisRotationSlider->value());

    QSize halfSize = KisLensBlurFilter::getKernelHalfSize(config);
    config->setProperty("halfWidth", halfSize.width());
    config->setProperty("halfHeight", halfSize.height());

    return config;
}
void KisFilterConfigurationTest::testSetGetProperty()
{
    KisFilterConfiguration * kfc = new KisFilterConfiguration("test", 1);
    kfc->setProperty("value1", 10);
    kfc->setProperty("value2", "foo");
    QCOMPARE(kfc->getInt("value1"), 10);
    QCOMPARE(kfc->getString("value2"), QString("foo"));
    QString s = kfc->toXML();
    delete kfc;
    kfc = new KisFilterConfiguration("test2", 2);
    kfc->fromXML(s);
    QCOMPARE(kfc->getInt("value1"), 10);
    QCOMPARE(kfc->getString("value2"), QString("foo"));
    delete kfc;
}
KisFilterConfiguration * KisSimpleNoiseReducer::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 0);
    config->setProperty("threshold", 15);
    config->setProperty("windowsize", 1);
    return config;
}
Пример #19
0
KisPropertiesConfiguration * KisDodgeBurnConfigWidget::configuration() const
{
    KisFilterConfiguration* c = new KisFilterConfiguration(m_id, 0);
    int type = 0;
    if(m_page->radioButtonHighlights->isChecked())
    {
        type = KisFilterDodgeBurn::HIGHLIGHTS;
    } else if(m_page->radioButtonShadows->isChecked())
    {
        type = KisFilterDodgeBurn::SHADOWS;
    } else {
        type = KisFilterDodgeBurn::MIDTONES;
    }
    c->setProperty("type", type);
    c->setProperty("exposure", m_page->sliderExposure->value() / 100.0);
    return c;
}
Пример #20
0
KisFilterConfiguration* KisFilterWave::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("wave", 1);
    config->setProperty("horizontalwavelength", 50);
    config->setProperty("horizontalshift", 50);
    config->setProperty("horizontalamplitude", 4);
    config->setProperty("horizontalshape", 0);
    config->setProperty("verticalwavelength", 50);
    config->setProperty("verticalshift", 50);
    config->setProperty("verticalamplitude", 4);
    config->setProperty("verticalshape", 0);
    return config;
}
Пример #21
0
KisPropertiesConfiguration* KisWdgWave::configuration() const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("wave", 1);
    config->setProperty("horizontalwavelength", this->widget()->intHWavelength->value());
    config->setProperty("horizontalshift", this->widget()->intHShift->value());
    config->setProperty("horizontalamplitude", this->widget()->intHAmplitude->value());
    config->setProperty("horizontalshape", this->widget()->cbHShape->currentIndex());
    config->setProperty("verticalwavelength", this->widget()->intVWavelength->value());
    config->setProperty("verticalshift", this->widget()->intVShift->value());
    config->setProperty("verticalamplitude", this->widget()->intVAmplitude->value());
    config->setProperty("verticalshape", this->widget()->cbVShape->currentIndex());
    return config;
}
Пример #22
0
KisPropertiesConfiguration* KisWdgIndexColors::configuration() const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("indexcolors", 1);

    PaletteGeneratorConfig palCfg;

    for(int y = 0; y < 4; ++y)
        for(int x = 0; x < 4; ++x)
        {
            palCfg.colors[y][x] = m_colorSelectors[y][x].button->color();
            palCfg.colorsEnabled[y][x] = m_colorSelectors[y][x].button->isEnabled();
        }

    for(int y = 0; y < 3; ++y)
        palCfg.gradientSteps[y] = m_stepSpinners[y]->value();

    palCfg.diagonalGradients = ui->diagCheck->isChecked();
    palCfg.inbetweenRampSteps = ui->inbetweenSpinBox->value();
    
    IndexColorPalette pal = palCfg.generate();
    ui->colorCount->setText(QString::number(pal.numColors()));

    config->setProperty("paletteGen", palCfg.toByteArray());

    config->setProperty("LFactor",   ui->luminanceSlider->value() / 100.f);
    config->setProperty("aFactor",   ui->aSlider->value() / 100.f);
    config->setProperty("bFactor",   ui->bSlider->value() / 100.f);
    
    config->setProperty("reduceColorsEnabled", ui->colorLimitCheck->isChecked());
    config->setProperty("colorLimit", ui->colorLimit->value());

    config->setProperty("alphaSteps", ui->alphaStepsSpinBox->value());
    return config;
}
Пример #23
0
KisFilterConfiguration* KoPatternGenerator::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("pattern", 1);

    QVariant v;
    v.setValue(QString("Grid01.pat"));
    config->setProperty("pattern", v);

//    v.setValue(KoColor());
//    config->setProperty("color", v);

    return config;
}
Пример #24
0
KisPropertiesConfiguration* KisWdgNoise::configuration() const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("noise", 1);
    config->setProperty("level", this->widget()->intLevel->value());
    config->setProperty("opacity", this->widget()->intOpacity->value());
    config->setProperty("seedThreshold", m_seedThreshold);
    config->setProperty("seedRed", m_seedRed);
    config->setProperty("seedGreen", m_seedGreen);
    config->setProperty("seedBlue", m_seedBlue);
    return config;
}
Пример #25
0
KisFilterConfiguration* KisFilterNoise::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("noise", 1);
    config->setProperty("level", 50);
    config->setProperty("opacity", 100);
    config->setProperty("seedThreshold", rand());
    config->setProperty("seedRed", rand());
    config->setProperty("seedGreen", rand());
    config->setProperty("seedBlue", rand());
    return config;
}
KisFilterConfiguration* KisSmallTilesFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("smalltiles", 1);
    config->setProperty("numberOfTiles", 2);
    return config;
}
KisFilterConfiguration* KisRoundCornersFilter::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration("roundcorners", 1);
    config->setProperty("radius", 30);
    return config;
}
KisFilterConfiguration* KisWaveletNoiseReduction::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 0);
    config->setProperty("threshold", BEST_WAVELET_THRESHOLD_VALUE);
    return config;
}
KisPropertiesConfiguration *KisPhongBumpmapConfigWidget::configuration() const
{
    KisFilterConfiguration *config = new KisFilterConfiguration("phongbumpmap", 2);
    config->setProperty(PHONG_HEIGHT_CHANNEL, m_page->heightChannelComboBox->currentText());
    config->setProperty(USE_NORMALMAP_IS_ENABLED, m_page->useNormalMap->isChecked());
    
    config->setProperty(PHONG_AMBIENT_REFLECTIVITY, m_page->ambientReflectivityKisDoubleSliderSpinBox->value());
    config->setProperty(PHONG_DIFFUSE_REFLECTIVITY, m_page->diffuseReflectivityKisDoubleSliderSpinBox->value());
    config->setProperty(PHONG_SPECULAR_REFLECTIVITY, m_page->specularReflectivityKisDoubleSliderSpinBox->value());
    config->setProperty(PHONG_SHINYNESS_EXPONENT, m_page->shinynessExponentKisSliderSpinBox->value());
    config->setProperty(PHONG_DIFFUSE_REFLECTIVITY_IS_ENABLED, m_page->diffuseReflectivityGroup->isChecked());
    config->setProperty(PHONG_SPECULAR_REFLECTIVITY_IS_ENABLED, m_page->specularReflectivityGroup->isChecked());
    //config->setProperty(PHONG_SHINYNESS_EXPONENT_IS_ENABLED, m_page->specularReflectivityCheckBox->isChecked());
    // Indexes are off by 1 simply because arrays start at 0 and the GUI naming scheme started at 1
    config->setProperty(PHONG_ILLUMINANT_IS_ENABLED[0], m_page->lightSourceGroupBox1->isChecked());
    config->setProperty(PHONG_ILLUMINANT_IS_ENABLED[1], m_page->lightSourceGroupBox2->isChecked());
    config->setProperty(PHONG_ILLUMINANT_IS_ENABLED[2], m_page->lightSourceGroupBox3->isChecked());
    config->setProperty(PHONG_ILLUMINANT_IS_ENABLED[3], m_page->lightSourceGroupBox4->isChecked());
    config->setProperty(PHONG_ILLUMINANT_COLOR[0], m_page->lightKColorCombo1->color());
    config->setProperty(PHONG_ILLUMINANT_COLOR[1], m_page->lightKColorCombo2->color());
    config->setProperty(PHONG_ILLUMINANT_COLOR[2], m_page->lightKColorCombo3->color());
    config->setProperty(PHONG_ILLUMINANT_COLOR[3], m_page->lightKColorCombo4->color());
    config->setProperty(PHONG_ILLUMINANT_AZIMUTH[0], m_page->azimuthSpinBox1->value());
    config->setProperty(PHONG_ILLUMINANT_AZIMUTH[1], m_page->azimuthSpinBox2->value());
    config->setProperty(PHONG_ILLUMINANT_AZIMUTH[2], m_page->azimuthSpinBox3->value());
    config->setProperty(PHONG_ILLUMINANT_AZIMUTH[3], m_page->azimuthSpinBox4->value());
    config->setProperty(PHONG_ILLUMINANT_INCLINATION[0], m_page->inclinationSpinBox1->value());
    config->setProperty(PHONG_ILLUMINANT_INCLINATION[1], m_page->inclinationSpinBox2->value());
    config->setProperty(PHONG_ILLUMINANT_INCLINATION[2], m_page->inclinationSpinBox3->value());
    config->setProperty(PHONG_ILLUMINANT_INCLINATION[3], m_page->inclinationSpinBox4->value());

    // Read configuration
    /*
    QMap<QString, QVariant> rofl = QMap<QString, QVariant>(config->getProperties());

    QMap<QString, QVariant>::const_iterator i;
    for (i = rofl.constBegin(); i != rofl.constEnd(); ++i)
        dbgKrita << i.key() << ":" << i.value();
    */
    return config;
}
Пример #30
0
KisFilterConfiguration* KisFilterFastColorTransfer::factoryConfiguration(const KisPaintDeviceSP) const
{
    KisFilterConfiguration* config = new KisFilterConfiguration(id().id(), 1);
    config->setProperty("filename", "");  // TODO: put an exemple image in share/krita, like a sunset that what's give the best results
    return config;
}