| 91 | } |
| 92 | |
| 93 | void DatapickerImage::init() { |
| 94 | Q_D(DatapickerImage); |
| 95 | KConfig config; |
| 96 | KConfigGroup group = config.group(QStringLiteral("DatapickerImage")); |
| 97 | |
| 98 | // general properties |
| 99 | d->fileName = group.readEntry(QStringLiteral("FileName"), QString()); |
| 100 | d->rotationAngle = group.readEntry(QStringLiteral("RotationAngle"), 0.0); |
| 101 | d->minSegmentLength = group.readEntry(QStringLiteral("MinSegmentLength"), 30); |
| 102 | d->pointSeparation = group.readEntry(QStringLiteral("PointSeparation"), 30); |
| 103 | d->axisPoints.type = static_cast<GraphType>(group.readEntry(QStringLiteral("GraphType"), static_cast<int>(GraphType::Linear))); |
| 104 | d->axisPoints.ternaryScale = group.readEntry(QStringLiteral("TernaryScale"), 1); |
| 105 | |
| 106 | // edit image settings |
| 107 | d->plotImageType = DatapickerImage::PlotImageType::OriginalImage; |
| 108 | d->settings.foregroundThresholdHigh = group.readEntry(QStringLiteral("ForegroundThresholdHigh"), d->settings.foregroundThresholdHigh); |
| 109 | d->settings.foregroundThresholdLow = group.readEntry(QStringLiteral("ForegroundThresholdLow"), d->settings.foregroundThresholdLow); |
| 110 | d->settings.hueThresholdHigh = group.readEntry(QStringLiteral("HueThresholdHigh"), d->settings.hueThresholdHigh); |
| 111 | d->settings.hueThresholdLow = group.readEntry(QStringLiteral("HueThresholdLow"), d->settings.hueThresholdLow); |
| 112 | d->settings.intensityThresholdHigh = group.readEntry(QStringLiteral("IntensityThresholdHigh"), d->settings.intensityThresholdHigh); |
| 113 | d->settings.intensityThresholdLow = group.readEntry(QStringLiteral("IntensityThresholdLow"), d->settings.intensityThresholdLow); |
| 114 | d->settings.saturationThresholdHigh = group.readEntry(QStringLiteral("SaturationThresholdHigh"), d->settings.saturationThresholdHigh); |
| 115 | d->settings.saturationThresholdLow = group.readEntry(QStringLiteral("SaturationThresholdLow"), d->settings.saturationThresholdLow); |
| 116 | d->settings.valueThresholdHigh = group.readEntry(QStringLiteral("ValueThresholdHigh"), d->settings.valueThresholdHigh); |
| 117 | d->settings.valueThresholdLow = group.readEntry(QStringLiteral("ValueThresholdLow"), d->settings.valueThresholdLow); |
| 118 | |
| 119 | // reference point symbol properties |
| 120 | d->symbol = new Symbol(QString()); |
| 121 | addChild(d->symbol); |
| 122 | d->symbol->setHidden(true); |
| 123 | connect(d->symbol, &Symbol::updateRequested, [=] { |
| 124 | d->retransform(); |
| 125 | }); |
| 126 | connect(d->symbol, &Symbol::updatePixmapRequested, [=] { |
| 127 | d->retransform(); |
| 128 | }); |
| 129 | d->symbol->init(group); |
| 130 | |
| 131 | d->pointVisibility = group.readEntry(QStringLiteral("PointVisibility"), true); |
| 132 | } |
| 133 | |
| 134 | /*! |
| 135 | Returns an icon to be used in the project explorer. |
nothing calls this directly
no test coverage detected