25using namespace Qt::StringLiterals;
33QString QgsFuzzifyRasterAlgorithmBase::group()
const
35 return QObject::tr(
"Raster analysis" );
38QString QgsFuzzifyRasterAlgorithmBase::groupId()
const
40 return u
"rasteranalysis"_s;
43void QgsFuzzifyRasterAlgorithmBase::initAlgorithm(
const QVariantMap & )
59 auto createOptsParam = std::make_unique<QgsProcessingParameterString>( u
"CREATE_OPTIONS"_s, QObject::tr(
"Creation options" ), QVariant(),
false,
true );
60 createOptsParam->setMetadata( QVariantMap( { { u
"widget_wrapper"_s, QVariantMap( { { u
"widget_type"_s, u
"rasteroptions"_s } } ) } } ) );
62 addParameter( createOptsParam.release() );
64 auto creationOptsParam = std::make_unique<QgsProcessingParameterString>( u
"CREATION_OPTIONS"_s, QObject::tr(
"Creation options" ), QVariant(),
false,
true );
65 creationOptsParam->setMetadata( QVariantMap( { { u
"widget_wrapper"_s, QVariantMap( { { u
"widget_type"_s, u
"rasteroptions"_s } } ) } } ) );
67 addParameter( creationOptsParam.release() );
74 mInputRaster = parameterAsRasterLayer( parameters, u
"INPUT"_s, context );
79 mBand = parameterAsInt( parameters, u
"BAND"_s, context );
80 if ( mBand < 1 || mBand > mInputRaster->bandCount() )
81 throw QgsProcessingException( QObject::tr(
"Invalid band number for BAND (%1): Valid values for input raster are 1 to %2" ).arg( mBand ).arg( mInputRaster->bandCount() ) );
83 mInterface.reset( mInputRaster->dataProvider()->clone() );
84 mExtent = mInputRaster->extent();
85 mLayerWidth = mInputRaster->width();
86 mLayerHeight = mInputRaster->height();
87 mCrs = mInputRaster->crs();
88 mNbCellsXProvider = mInterface->xSize();
89 mNbCellsYProvider = mInterface->ySize();
92 prepareAlgorithmFuzzificationParameters( parameters, context, feedback );
99 QString creationOptions = parameterAsString( parameters, u
"CREATION_OPTIONS"_s, context ).trimmed();
101 const QString optionsString = parameterAsString( parameters, u
"CREATE_OPTIONS"_s, context );
102 if ( !optionsString.isEmpty() )
103 creationOptions = optionsString;
105 const QString outputFile = parameterAsOutputLayer( parameters, u
"OUTPUT"_s, context );
106 const QString outputFormat = parameterAsOutputRasterFormat( parameters, u
"OUTPUT"_s, context );
108 auto writer = std::make_unique<QgsRasterFileWriter>( outputFile );
109 writer->setOutputProviderKey( u
"gdal"_s );
110 if ( !creationOptions.isEmpty() )
112 writer->setCreationOptions( creationOptions.split(
'|' ) );
114 writer->setOutputFormat( outputFormat );
115 std::unique_ptr<QgsRasterDataProvider> provider( writer->createOneBandRaster( mDataType, mNbCellsXProvider, mNbCellsYProvider, mExtent, mCrs ) );
118 if ( !provider->isValid() )
121 provider->setNoDataValue( 1, mNoDataValue );
122 provider->setEditable(
true );
123 const qgssize layerSize =
static_cast<qgssize>( mLayerWidth ) *
static_cast<qgssize>( mLayerHeight );
125 const bool hasReportsDuringClose = provider->hasReportsDuringClose();
126 mMaxProgressDuringBlockWriting = hasReportsDuringClose ? 50.0 : 100.0;
128 fuzzify( provider.get(), feedback );
130 provider->setEditable(
false );
132 if ( feedback && hasReportsDuringClose )
135 if ( !provider->closeWithProgress( scaledFeedback.get() ) )
144 outputs.insert( u
"EXTENT"_s, mExtent.toString() );
145 outputs.insert( u
"CRS_AUTHID"_s, mCrs.authid() );
146 outputs.insert( u
"WIDTH_IN_PIXELS"_s, mLayerWidth );
147 outputs.insert( u
"HEIGHT_IN_PIXELS"_s, mLayerHeight );
148 outputs.insert( u
"TOTAL_PIXEL_COUNT"_s, layerSize );
149 outputs.insert( u
"OUTPUT"_s, outputFile );
158QString QgsFuzzifyRasterLinearMembershipAlgorithm::name()
const
160 return u
"fuzzifyrasterlinearmembership"_s;
163QString QgsFuzzifyRasterLinearMembershipAlgorithm::displayName()
const
165 return QObject::tr(
"Fuzzify raster (linear membership)" );
168QStringList QgsFuzzifyRasterLinearMembershipAlgorithm::tags()
const
170 return QObject::tr(
"fuzzy logic,fuzzify,fuzzy,logic,linear,membership" ).split(
',' );
173QString QgsFuzzifyRasterLinearMembershipAlgorithm::shortDescription()
const
175 return QObject::tr(
"Transforms an input raster to a fuzzified raster where values range from 0 to 1 following a "
176 "linear fuzzy membership function." );
179QString QgsFuzzifyRasterLinearMembershipAlgorithm::shortHelpString()
const
181 return QObject::tr(
"This algorithm transforms an input raster "
182 "to a fuzzified raster and thereby assigns values between 0 and 1 following a "
183 "linear fuzzy membership function. The value of 0 implies no membership with the "
184 "defined fuzzy set, a value of 1 depicts full membership. In between, the degree "
185 "of membership of raster values follows a linear membership function.\n\n"
186 "The linear function is constructed using two user-defined input raster values "
187 "which set the point of full membership (high bound, results to 1) and no membership "
188 "(low bound, results to 0) respectively. The fuzzy set in between those values is defined as a "
189 "linear function.\n\n"
190 "Both increasing and decreasing fuzzy sets can be modeled by "
191 "swapping the high and low bound parameters." );
194QgsFuzzifyRasterLinearMembershipAlgorithm *QgsFuzzifyRasterLinearMembershipAlgorithm::createInstance()
const
196 return new QgsFuzzifyRasterLinearMembershipAlgorithm();
199void QgsFuzzifyRasterLinearMembershipAlgorithm::addAlgorithmParams()
208 mFuzzifyHighBound = parameterAsDouble( parameters, u
"FUZZYHIGHBOUND"_s, context );
209 mFuzzifyLowBound = parameterAsDouble( parameters, u
"FUZZYLOWBOUND"_s, context );
216 iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent );
221 bool isNoData =
false;
222 std::unique_ptr<QgsRasterBlock> rasterBlock;
223 while ( iter.readNextRasterPart( mBand, iterCols, iterRows, rasterBlock, iterLeft, iterTop ) )
226 feedback->
setProgress( 100 * iter.progress( mBand ) );
227 auto fuzzifiedBlock = std::make_unique<QgsRasterBlock>( destinationProvider->
dataType( 1 ), iterCols, iterRows );
229 for (
int row = 0; row < iterRows; row++ )
233 for (
int column = 0; column < iterCols; column++ )
238 const double value = rasterBlock->valueAndNoData( row, column, isNoData );
239 double fuzzifiedValue;
243 fuzzifiedValue = mNoDataValue;
245 else if ( mFuzzifyLowBound < mFuzzifyHighBound )
247 if ( value <= mFuzzifyLowBound )
249 else if ( value >= mFuzzifyHighBound )
252 fuzzifiedValue = ( ( value - mFuzzifyLowBound ) / ( mFuzzifyHighBound - mFuzzifyLowBound ) );
254 else if ( mFuzzifyLowBound > mFuzzifyHighBound )
256 if ( value >= mFuzzifyLowBound )
258 else if ( value <= mFuzzifyHighBound )
261 fuzzifiedValue = ( ( value - mFuzzifyLowBound ) / ( mFuzzifyHighBound - mFuzzifyLowBound ) );
265 throw QgsProcessingException( QObject::tr(
"Please choose varying values for the high and low membership parameters" ) );
268 fuzzifiedBlock->setValue( row, column, fuzzifiedValue );
271 if ( !destinationProvider->
writeBlock( fuzzifiedBlock.get(), mBand, iterLeft, iterTop ) )
283QString QgsFuzzifyRasterPowerMembershipAlgorithm::name()
const
285 return u
"fuzzifyrasterpowermembership"_s;
288QString QgsFuzzifyRasterPowerMembershipAlgorithm::displayName()
const
290 return QObject::tr(
"Fuzzify raster (power membership)" );
293QStringList QgsFuzzifyRasterPowerMembershipAlgorithm::tags()
const
295 return QObject::tr(
"fuzzy logic,fuzzify,fuzzy,logic,power,non-linear,membership,exponent" ).split(
',' );
298QString QgsFuzzifyRasterPowerMembershipAlgorithm::shortDescription()
const
300 return QObject::tr(
"Transforms an input raster to a fuzzified raster where values range from 0 to 1 following a "
304QString QgsFuzzifyRasterPowerMembershipAlgorithm::shortHelpString()
const
306 return QObject::tr(
"This algorithm transforms an input raster "
307 "to a fuzzified raster and thereby assigns values between 0 and 1 following a "
308 "power function. The value of 0 implies no membership with the "
309 "defined fuzzy set, a value of 1 depicts full membership. In between, the degree "
310 "of membership of raster values follows a power function.\n\n"
311 "The power function is constructed using three user-defined input raster values "
312 "which set the point of full membership (high bound, results to 1), no membership "
313 "(low bound, results to 0) and function exponent (only positive) respectively. "
314 "The fuzzy set in between those the upper and lower bounds values is then defined as "
315 "a power function.\n\n"
316 "Both increasing and decreasing fuzzy sets can be modeled by "
317 "swapping the high and low bound parameters." );
320QgsFuzzifyRasterPowerMembershipAlgorithm *QgsFuzzifyRasterPowerMembershipAlgorithm::createInstance()
const
322 return new QgsFuzzifyRasterPowerMembershipAlgorithm();
325void QgsFuzzifyRasterPowerMembershipAlgorithm::addAlgorithmParams()
335 mFuzzifyHighBound = parameterAsDouble( parameters, u
"FUZZYHIGHBOUND"_s, context );
336 mFuzzifyLowBound = parameterAsDouble( parameters, u
"FUZZYLOWBOUND"_s, context );
337 mFuzzifyExponent = parameterAsDouble( parameters, u
"FUZZYEXPONENT"_s, context );
344 iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent );
349 bool isNoData =
false;
350 std::unique_ptr<QgsRasterBlock> rasterBlock;
351 while ( iter.readNextRasterPart( mBand, iterCols, iterRows, rasterBlock, iterLeft, iterTop ) )
354 feedback->
setProgress( 100 * iter.progress( mBand ) );
355 auto fuzzifiedBlock = std::make_unique<QgsRasterBlock>( destinationProvider->
dataType( 1 ), iterCols, iterRows );
357 for (
int row = 0; row < iterRows; row++ )
361 for (
int column = 0; column < iterCols; column++ )
366 const double value = rasterBlock->valueAndNoData( row, column, isNoData );
367 double fuzzifiedValue;
371 fuzzifiedValue = mNoDataValue;
373 else if ( mFuzzifyLowBound < mFuzzifyHighBound )
375 if ( value <= mFuzzifyLowBound )
377 else if ( value >= mFuzzifyHighBound )
380 fuzzifiedValue = std::pow( ( value - mFuzzifyLowBound ) / ( mFuzzifyHighBound - mFuzzifyLowBound ), mFuzzifyExponent );
382 else if ( mFuzzifyLowBound > mFuzzifyHighBound )
384 if ( value >= mFuzzifyLowBound )
386 else if ( value <= mFuzzifyHighBound )
389 fuzzifiedValue = std::pow( ( value - mFuzzifyLowBound ) / ( mFuzzifyHighBound - mFuzzifyLowBound ), mFuzzifyExponent );
393 throw QgsProcessingException( QObject::tr(
"Please choose varying values for the high and low membership parameters" ) );
396 fuzzifiedBlock->setValue( row, column, fuzzifiedValue );
399 if ( !destinationProvider->
writeBlock( fuzzifiedBlock.get(), mBand, iterLeft, iterTop ) )
410QString QgsFuzzifyRasterLargeMembershipAlgorithm::name()
const
412 return u
"fuzzifyrasterlargemembership"_s;
415QString QgsFuzzifyRasterLargeMembershipAlgorithm::displayName()
const
417 return QObject::tr(
"Fuzzify raster (large membership)" );
420QStringList QgsFuzzifyRasterLargeMembershipAlgorithm::tags()
const
422 return QObject::tr(
"fuzzy logic,fuzzify,fuzzy,logic,large,membership" ).split(
',' );
425QString QgsFuzzifyRasterLargeMembershipAlgorithm::shortDescription()
const
427 return QObject::tr(
"Transforms an input raster to a fuzzified raster where values range from 0 to 1 following the "
428 "'large' fuzzy membership function." );
431QString QgsFuzzifyRasterLargeMembershipAlgorithm::shortHelpString()
const
433 return QObject::tr(
"This algorithm transforms an input raster "
434 "to a fuzzified raster and thereby assigns values between 0 and 1 following the "
435 "'large' fuzzy membership function. The value of 0 implies no membership with the "
436 "defined fuzzy set, a value of 1 depicts full membership. In between, the degree "
437 "of membership of raster values follows the 'large' membership function.\n\n"
438 "The 'large' function is constructed using two user-defined input raster values "
439 "which set the point of half membership (midpoint, results to 0.5) and a predefined "
440 "function spread which controls the function uptake.\n\n"
441 "This function is typically used when larger input raster values should become members "
442 "of the fuzzy set more easily than smaller values." );
445QgsFuzzifyRasterLargeMembershipAlgorithm *QgsFuzzifyRasterLargeMembershipAlgorithm::createInstance()
const
447 return new QgsFuzzifyRasterLargeMembershipAlgorithm();
450void QgsFuzzifyRasterLargeMembershipAlgorithm::addAlgorithmParams()
459 mFuzzifyMidpoint = parameterAsDouble( parameters, u
"FUZZYMIDPOINT"_s, context );
460 mFuzzifySpread = parameterAsDouble( parameters, u
"FUZZYSPREAD"_s, context );
467 iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent );
472 bool isNoData =
false;
473 std::unique_ptr<QgsRasterBlock> rasterBlock;
474 while ( iter.readNextRasterPart( mBand, iterCols, iterRows, rasterBlock, iterLeft, iterTop ) )
477 feedback->
setProgress( 100 * iter.progress( mBand ) );
478 auto fuzzifiedBlock = std::make_unique<QgsRasterBlock>( destinationProvider->
dataType( 1 ), iterCols, iterRows );
480 for (
int row = 0; row < iterRows; row++ )
484 for (
int column = 0; column < iterCols; column++ )
489 const double value = rasterBlock->valueAndNoData( row, column, isNoData );
490 double fuzzifiedValue;
494 fuzzifiedValue = mNoDataValue;
498 fuzzifiedValue = 1 / ( 1 + std::pow( value / mFuzzifyMidpoint, -mFuzzifySpread ) );
501 fuzzifiedBlock->setValue( row, column, fuzzifiedValue );
504 if ( !destinationProvider->
writeBlock( fuzzifiedBlock.get(), mBand, iterLeft, iterTop ) )
516QString QgsFuzzifyRasterSmallMembershipAlgorithm::name()
const
518 return u
"fuzzifyrastersmallmembership"_s;
521QString QgsFuzzifyRasterSmallMembershipAlgorithm::displayName()
const
523 return QObject::tr(
"Fuzzify raster (small membership)" );
526QStringList QgsFuzzifyRasterSmallMembershipAlgorithm::tags()
const
528 return QObject::tr(
"fuzzy logic,fuzzify,fuzzy,logic,small,membership" ).split(
',' );
531QString QgsFuzzifyRasterSmallMembershipAlgorithm::shortDescription()
const
533 return QObject::tr(
"Transforms an input raster to a fuzzified raster where values range from 0 to 1 following the "
534 "'small' fuzzy membership function." );
537QString QgsFuzzifyRasterSmallMembershipAlgorithm::shortHelpString()
const
539 return QObject::tr(
"The Fuzzify raster (small membership) algorithm transforms an input raster "
540 "to a fuzzified raster and thereby assigns values between 0 and 1 following the "
541 "'small' fuzzy membership function. The value of 0 implies no membership with the "
542 "defined fuzzy set, a value of 1 depicts full membership. In between, the degree "
543 "of membership of raster values follows the 'small' membership function.\n\n"
544 "The 'small' function is constructed using two user-defined input raster values "
545 "which set the point of half membership (midpoint, results to 0.5) and a predefined "
546 "function spread which controls the function uptake.\n\n"
547 "This function is typically used when smaller input raster values should become members "
548 "of the fuzzy set more easily than higher values." );
551QgsFuzzifyRasterSmallMembershipAlgorithm *QgsFuzzifyRasterSmallMembershipAlgorithm::createInstance()
const
553 return new QgsFuzzifyRasterSmallMembershipAlgorithm();
556void QgsFuzzifyRasterSmallMembershipAlgorithm::addAlgorithmParams()
565 mFuzzifyMidpoint = parameterAsDouble( parameters, u
"FUZZYMIDPOINT"_s, context );
566 mFuzzifySpread = parameterAsDouble( parameters, u
"FUZZYSPREAD"_s, context );
573 iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent );
578 bool isNoData =
false;
579 std::unique_ptr<QgsRasterBlock> rasterBlock;
580 while ( iter.readNextRasterPart( mBand, iterCols, iterRows, rasterBlock, iterLeft, iterTop ) )
583 feedback->
setProgress( 100 * iter.progress( mBand ) );
584 auto fuzzifiedBlock = std::make_unique<QgsRasterBlock>( destinationProvider->
dataType( 1 ), iterCols, iterRows );
586 for (
int row = 0; row < iterRows; row++ )
590 for (
int column = 0; column < iterCols; column++ )
595 const double value = rasterBlock->valueAndNoData( row, column, isNoData );
596 double fuzzifiedValue;
600 fuzzifiedValue = mNoDataValue;
604 fuzzifiedValue = 1 / ( 1 + std::pow( value / mFuzzifyMidpoint, mFuzzifySpread ) );
607 fuzzifiedBlock->setValue( row, column, fuzzifiedValue );
610 if ( !destinationProvider->
writeBlock( fuzzifiedBlock.get(), mBand, iterLeft, iterTop ) )
622QString QgsFuzzifyRasterGaussianMembershipAlgorithm::name()
const
624 return u
"fuzzifyrastergaussianmembership"_s;
627QString QgsFuzzifyRasterGaussianMembershipAlgorithm::displayName()
const
629 return QObject::tr(
"Fuzzify raster (gaussian membership)" );
632QStringList QgsFuzzifyRasterGaussianMembershipAlgorithm::tags()
const
634 return QObject::tr(
"fuzzy logic,fuzzify,fuzzy,logic,gaussian,membership" ).split(
',' );
637QString QgsFuzzifyRasterGaussianMembershipAlgorithm::shortDescription()
const
639 return QObject::tr(
"Transforms an input raster to a fuzzified raster where values range from 0 to 1 following a "
640 "gaussian fuzzy membership function." );
643QString QgsFuzzifyRasterGaussianMembershipAlgorithm::shortHelpString()
const
645 return QObject::tr(
"This algorithm transforms an input raster "
646 "to a fuzzified raster and thereby assigns values between 0 and 1 following a "
647 "gaussian fuzzy membership function. The value of 0 implies no membership with the "
648 "defined fuzzy set, a value of 1 depicts full membership. In between, the degree "
649 "of membership of raster values follows a gaussian membership function.\n\n"
650 "The gaussian function is constructed using two user-defined input values "
651 "which set the midpoint of the gaussian function (midpoint, results to 1) and a "
652 "predefined function spread which controls the function spread.\n\n"
653 "This function is typically used when a certain range of raster values around a "
654 "predefined function midpoint should become members of the fuzzy set." );
657QgsFuzzifyRasterGaussianMembershipAlgorithm *QgsFuzzifyRasterGaussianMembershipAlgorithm::createInstance()
const
659 return new QgsFuzzifyRasterGaussianMembershipAlgorithm();
662void QgsFuzzifyRasterGaussianMembershipAlgorithm::addAlgorithmParams()
671 mFuzzifyMidpoint = parameterAsDouble( parameters, u
"FUZZYMIDPOINT"_s, context );
672 mFuzzifySpread = parameterAsDouble( parameters, u
"FUZZYSPREAD"_s, context );
679 iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent );
684 bool isNoData =
false;
685 std::unique_ptr<QgsRasterBlock> rasterBlock;
686 while ( iter.readNextRasterPart( mBand, iterCols, iterRows, rasterBlock, iterLeft, iterTop ) )
689 feedback->
setProgress( 100 * iter.progress( mBand ) );
690 auto fuzzifiedBlock = std::make_unique<QgsRasterBlock>( destinationProvider->
dataType( 1 ), iterCols, iterRows );
692 for (
int row = 0; row < iterRows; row++ )
696 for (
int column = 0; column < iterCols; column++ )
701 const double value = rasterBlock->valueAndNoData( row, column, isNoData );
702 double fuzzifiedValue;
706 fuzzifiedValue = mNoDataValue;
710 fuzzifiedValue = std::exp( -mFuzzifySpread * std::pow( value - mFuzzifyMidpoint, 2 ) );
713 fuzzifiedBlock->setValue( row, column, fuzzifiedValue );
716 if ( !destinationProvider->
writeBlock( fuzzifiedBlock.get(), mBand, iterLeft, iterTop ) )
728QString QgsFuzzifyRasterNearMembershipAlgorithm::name()
const
730 return u
"fuzzifyrasternearmembership"_s;
733QString QgsFuzzifyRasterNearMembershipAlgorithm::displayName()
const
735 return QObject::tr(
"Fuzzify raster (near membership)" );
738QStringList QgsFuzzifyRasterNearMembershipAlgorithm::tags()
const
740 return QObject::tr(
"fuzzy logic,fuzzify,fuzzy,logic,near,membership" ).split(
',' );
743QString QgsFuzzifyRasterNearMembershipAlgorithm::shortDescription()
const
745 return QObject::tr(
"Transforms an input raster to a fuzzified raster where values range from 0 to 1 following the "
746 "'near' fuzzy membership function." );
749QString QgsFuzzifyRasterNearMembershipAlgorithm::shortHelpString()
const
751 return QObject::tr(
"The Fuzzify raster (near membership) algorithm transforms an input raster "
752 "to a fuzzified raster and thereby assigns values between 0 and 1 following the "
753 "'near' fuzzy membership function. The value of 0 implies no membership with the "
754 "defined fuzzy set, a value of 1 depicts full membership. In between, the degree "
755 "of membership of raster values follows the 'near' membership function.\n\n"
756 "The 'near' function is constructed using two user-defined input values "
757 "which set the midpoint of the 'near' function (midpoint, results to 1) and a "
758 "predefined function spread which controls the function spread.\n\n"
759 "This function is typically used when a certain range of raster values near a "
760 "predefined function midpoint should become members of the fuzzy set. The function"
761 " generally shows a higher rate of decay than the gaussian membership function." );
764QgsFuzzifyRasterNearMembershipAlgorithm *QgsFuzzifyRasterNearMembershipAlgorithm::createInstance()
const
766 return new QgsFuzzifyRasterNearMembershipAlgorithm();
769void QgsFuzzifyRasterNearMembershipAlgorithm::addAlgorithmParams()
778 mFuzzifyMidpoint = parameterAsDouble( parameters, u
"FUZZYMIDPOINT"_s, context );
779 mFuzzifySpread = parameterAsDouble( parameters, u
"FUZZYSPREAD"_s, context );
786 iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent );
791 bool isNoData =
false;
792 std::unique_ptr<QgsRasterBlock> rasterBlock;
793 while ( iter.readNextRasterPart( mBand, iterCols, iterRows, rasterBlock, iterLeft, iterTop ) )
796 feedback->
setProgress( 100 * iter.progress( mBand ) );
797 auto fuzzifiedBlock = std::make_unique<QgsRasterBlock>( destinationProvider->
dataType( 1 ), iterCols, iterRows );
799 for (
int row = 0; row < iterRows; row++ )
803 for (
int column = 0; column < iterCols; column++ )
808 const double value = rasterBlock->valueAndNoData( row, column, isNoData );
809 double fuzzifiedValue;
813 fuzzifiedValue = mNoDataValue;
817 fuzzifiedValue = 1 / ( 1 + mFuzzifySpread * std::pow( value - mFuzzifyMidpoint, 2 ) );
820 fuzzifiedBlock->setValue( row, column, fuzzifiedValue );
823 if ( !destinationProvider->
writeBlock( fuzzifiedBlock.get(), mBand, iterLeft, iterTop ) )
@ Hidden
Parameter is hidden and should not be shown to users.
@ Advanced
Parameter is an advanced parameter which should be hidden from users by default.
@ Double
Double/float values.
virtual QgsError error() const
Gets current status error.
QString summary() const
Short error description, usually the first error in chain, the real error.
bool isCanceled() const
Tells whether the operation has been canceled already.
void setProgress(double progress)
Sets the current progress for the feedback object.
static std::unique_ptr< QgsFeedback > createScaledFeedback(QgsFeedback *parentFeedback, double startPercentage, double endPercentage)
Returns a feedback object whose [0, 100] progression range will be mapped to parentFeedback [startPer...
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A numeric output for processing algorithms.
A string output for processing algorithms.
A raster band parameter for Processing algorithms.
A numeric parameter for processing algorithms.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
A raster layer parameter for processing algorithms.
Base class for raster data providers.
bool writeBlock(QgsRasterBlock *block, int band, int xOffset=0, int yOffset=0)
Writes pixel data from a raster block into the provider data source.
Qgis::DataType dataType(int bandNo) const override=0
Returns data type for the band specified by number.
Iterator for sequentially processing raster cells.
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...