28#include "moc_qgsrasterprojector.cpp"
30using namespace Qt::StringLiterals;
45 projector->mSrcCRS = mSrcCRS;
46 projector->mDestCRS = mDestCRS;
47 projector->mTransformContext = mTransformContext;
50 projector->mSrcDatumTransform = mSrcDatumTransform;
51 projector->mDestDatumTransform = mDestDatumTransform;
54 projector->mPrecision = mPrecision;
77 int srcDatumTransform,
78 int destDatumTransform )
83 mSrcDatumTransform = srcDatumTransform;
84 mDestDatumTransform = destDatumTransform;
92 mTransformContext = transformContext;
94 mSrcDatumTransform = -1;
95 mDestDatumTransform = -1;
101 : mInverseCt( inverseCt )
102 , mDestExtent( extent )
103 , mDestRows( height )
111 QgsRasterDataProvider *provider =
dynamic_cast<QgsRasterDataProvider *
>(
input->sourceInput() );
125 if ( mExtent.isEmpty() )
127 mExtent = provider->
extent();
132 mDestXRes = mDestExtent.width() / ( mDestCols );
133 mDestYRes = mDestExtent.height() / ( mDestRows );
139 const double myDestRes = mDestXRes < mDestYRes ? mDestXRes : mDestYRes;
140 mSqrTolerance = myDestRes * myDestRes;
148 mApproximate =
false;
153 mCPCols = mCPRows = 3;
161 if ( std::fabs( -mDestExtent.yMinimum() - mDestExtent.yMaximum() ) / height < 0.5 * mDestYRes )
164 for (
int i = 0; i < mCPRows; i++ )
166 QList<QgsPointXY> myRow;
167 myRow.append( QgsPointXY() );
168 myRow.append( QgsPointXY() );
169 myRow.append( QgsPointXY() );
170 mCPMatrix.insert( i, myRow );
172 QList<bool> myLegalRow;
173 myLegalRow.append(
bool(
false ) );
174 myLegalRow.append(
bool(
false ) );
175 myLegalRow.append(
bool(
false ) );
176 mCPLegalMatrix.insert( i, myLegalRow );
178 for (
int i = 0; i < mCPRows; i++ )
180 calcRow( i, inverseCt );
185 const bool myColsOK = checkCols( inverseCt );
188 insertRows( inverseCt );
190 const bool myRowsOK = checkRows( inverseCt );
193 insertCols( inverseCt );
195 if ( myColsOK && myRowsOK )
202 if ( mCPRows * mCPCols > 0.25 * mDestRows * mDestCols )
206 mApproximate =
false;
214 QgsDebugMsgLevel( u
"CPMatrix size: mCPRows = %1 mCPCols = %2"_s.arg( mCPRows ).arg( mCPCols ), 4 );
215 mDestRowsPerMatrixRow =
static_cast< double >( mDestRows ) / ( mCPRows - 1 );
216 mDestColsPerMatrixCol =
static_cast< double >( mDestCols ) / ( mCPCols - 1 );
224 pHelperTop =
new QgsPointXY[mDestCols];
225 pHelperBottom =
new QgsPointXY[mDestCols];
226 calcHelper( 0, pHelperTop );
227 calcHelper( 1, pHelperBottom );
233 mSrcYRes = mSrcExtent.height() / mSrcRows;
234 mSrcXRes = mSrcExtent.width() / mSrcCols;
237ProjectorData::~ProjectorData()
240 delete[] pHelperBottom;
244void ProjectorData::calcSrcExtent()
255 mSrcExtent =
QgsRectangle( myPoint.
x(), myPoint.
y(), myPoint.
x(), myPoint.
y() );
256 for (
int i = 0; i < mCPRows; i++ )
258 for (
int j = 0; j < mCPCols ; j++ )
260 myPoint = mCPMatrix[i][j];
261 if ( mCPLegalMatrix[i][j] )
263 mSrcExtent.combineExtentWith( myPoint.
x(), myPoint.
y() );
270 mSrcExtent = mSrcExtent.intersect( mExtent );
281 if ( !mExtent.isEmpty() )
283 if ( mMaxSrcXRes > 0 )
286 double col = std::floor( ( mSrcExtent.xMinimum() - mExtent.xMinimum() ) / mMaxSrcXRes );
287 double x = mExtent.xMinimum() + col * mMaxSrcXRes;
288 mSrcExtent.setXMinimum( x );
290 col = std::ceil( ( mSrcExtent.xMaximum() - mExtent.xMinimum() ) / mMaxSrcXRes );
291 x = mExtent.xMinimum() + col * mMaxSrcXRes;
292 mSrcExtent.setXMaximum( x );
294 if ( mMaxSrcYRes > 0 )
296 double row = std::floor( ( mExtent.yMaximum() - mSrcExtent.yMaximum() ) / mMaxSrcYRes );
297 double y = mExtent.yMaximum() - row * mMaxSrcYRes;
298 mSrcExtent.setYMaximum( y );
300 row = std::ceil( ( mExtent.yMaximum() - mSrcExtent.yMinimum() ) / mMaxSrcYRes );
301 y = mExtent.yMaximum() - row * mMaxSrcYRes;
302 mSrcExtent.setYMinimum( y );
308QString ProjectorData::cpToString()
const
311 for (
int i = 0; i < mCPRows; i++ )
315 for (
int j = 0; j < mCPCols; j++ )
320 if ( mCPLegalMatrix[i][j] )
326 myString +=
"(-,-)"_L1;
333void ProjectorData::calcSrcRowsCols()
341 double myMinSize = std::numeric_limits<double>::max();
345 double myMaxSize = 0;
348 const double myDestColsPerMatrixCell =
static_cast< double >( mDestCols ) / mCPCols;
349 const double myDestRowsPerMatrixCell =
static_cast< double >( mDestRows ) / mCPRows;
350 QgsDebugMsgLevel( u
"myDestColsPerMatrixCell = %1 myDestRowsPerMatrixCell = %2"_s.arg( myDestColsPerMatrixCell ).arg( myDestRowsPerMatrixCell ), 4 );
351 for (
int i = 0; i < mCPRows - 1; i++ )
353 for (
int j = 0; j < mCPCols - 1; j++ )
356 const QgsPointXY myPointB = mCPMatrix[i][j + 1];
357 const QgsPointXY myPointC = mCPMatrix[i + 1][j];
358 if ( mCPLegalMatrix[i][j] && mCPLegalMatrix[i][j + 1] && mCPLegalMatrix[i + 1][j] )
360 double mySize = std::sqrt( myPointA.
sqrDist( myPointB ) ) / myDestColsPerMatrixCell;
361 if ( mySize < myMinSize )
363 if ( mySize > myMaxSize )
366 mySize = std::sqrt( myPointA.
sqrDist( myPointC ) ) / myDestRowsPerMatrixCell;
367 if ( mySize < myMinSize )
369 if ( mySize > myMaxSize )
377 if ( myMinSize < 0.1 * myMaxSize )
378 myMinSize = 0.1 * myMaxSize;
385 int srcXSize, srcYSize;
388 const double srcXRes = srcExtent.
width() / srcXSize;
389 const double srcYRes = srcExtent.
height() / srcYSize;
390 myMinSize = std::min( srcXRes, srcYRes );
403 QgsDebugMsgLevel( u
"mMaxSrcXRes = %1 mMaxSrcYRes = %2"_s.arg( mMaxSrcXRes ).arg( mMaxSrcYRes ), 4 );
405 const double myMinXSize = mMaxSrcXRes > myMinSize ? mMaxSrcXRes : myMinSize;
406 const double myMinYSize = mMaxSrcYRes > myMinSize ? mMaxSrcYRes : myMinSize;
407 QgsDebugMsgLevel( u
"myMinXSize = %1 myMinYSize = %2"_s.arg( myMinXSize ).arg( myMinYSize ), 4 );
408 QgsDebugMsgLevel( u
"mSrcExtent.width = %1 mSrcExtent.height = %2"_s.arg( mSrcExtent.width() ).arg( mSrcExtent.height() ), 4 );
413 double dblSrcRows = mSrcExtent.height() / myMinYSize;
414 if ( dblSrcRows > mDestRows * 10 )
415 mSrcRows = mDestRows * 10;
417 mSrcRows =
static_cast< int >( std::round( dblSrcRows ) );
419 double dblSrcCols = mSrcExtent.width() / myMinXSize;
420 if ( dblSrcCols > mDestCols * 10 )
421 mSrcCols = mDestCols * 10;
423 mSrcCols =
static_cast< int >( std::round( dblSrcCols ) );
425 QgsDebugMsgLevel( u
"mSrcRows = %1 mSrcCols = %2"_s.arg( mSrcRows ).arg( mSrcCols ), 4 );
429inline void ProjectorData::destPointOnCPMatrix(
int row,
int col,
double *theX,
double *theY )
const
431 *theX = mDestExtent.xMinimum() + col * mDestExtent.width() / ( mCPCols - 1 );
432 *theY = mDestExtent.yMaximum() - row * mDestExtent.height() / ( mCPRows - 1 );
435inline int ProjectorData::matrixRow(
int destRow )
const
437 return static_cast< int >( std::floor( ( destRow + 0.5 ) / mDestRowsPerMatrixRow ) );
439inline int ProjectorData::matrixCol(
int destCol )
const
441 return static_cast< int >( std::floor( ( destCol + 0.5 ) / mDestColsPerMatrixCol ) );
444void ProjectorData::calcHelper(
int matrixRow,
QgsPointXY *points )
447 for (
int myDestCol = 0; myDestCol < mDestCols; myDestCol++ )
449 const double myDestX = mDestExtent.xMinimum() + ( myDestCol + 0.5 ) * mDestXRes;
451 const int myMatrixCol = matrixCol( myDestCol );
453 double myDestXMin, myDestYMin, myDestXMax, myDestYMax;
455 destPointOnCPMatrix( matrixRow, myMatrixCol, &myDestXMin, &myDestYMin );
456 destPointOnCPMatrix( matrixRow, myMatrixCol + 1, &myDestXMax, &myDestYMax );
458 const double xfrac = ( myDestX - myDestXMin ) / ( myDestXMax - myDestXMin );
460 const QgsPointXY &mySrcPoint0 = mCPMatrix[matrixRow][myMatrixCol];
461 const QgsPointXY &mySrcPoint1 = mCPMatrix[matrixRow][myMatrixCol + 1];
462 const double s = mySrcPoint0.
x() + ( mySrcPoint1.
x() - mySrcPoint0.
x() ) * xfrac;
463 const double t = mySrcPoint0.
y() + ( mySrcPoint1.
y() - mySrcPoint0.
y() ) * xfrac;
465 points[myDestCol].
setX( s );
466 points[myDestCol].
setY( t );
470void ProjectorData::nextHelper()
475 pHelperTop = pHelperBottom;
477 calcHelper( mHelperTopRow + 2, pHelperBottom );
481bool ProjectorData::srcRowCol(
int destRow,
int destCol,
int *srcRow,
int *srcCol )
485 return approximateSrcRowCol( destRow, destCol, srcRow, srcCol );
489 return preciseSrcRowCol( destRow, destCol, srcRow, srcCol );
493bool ProjectorData::preciseSrcRowCol(
int destRow,
int destCol,
int *srcRow,
int *srcCol )
497 QgsDebugMsgLevel( u
"theDestRow = %1 mDestExtent.yMaximum() = %2 mDestYRes = %3"_s.arg( destRow ).arg( mDestExtent.yMaximum() ).arg( mDestYRes ), 5 );
501 double x = mDestExtent.xMinimum() + ( destCol + 0.5 ) * mDestXRes;
502 double y = mDestExtent.yMaximum() - ( destRow + 0.5 ) * mDestYRes;
509 if ( mInverseCt.isValid() )
513 mInverseCt.transformInPlace( x, y, z );
525 if ( !mExtent.contains( x, y ) )
530 *srcRow =
static_cast< int >( std::floor( ( mSrcExtent.yMaximum() - y ) / mSrcYRes ) );
531 *srcCol =
static_cast< int >( std::floor( ( x - mSrcExtent.xMinimum() ) / mSrcXRes ) );
533 QgsDebugMsgLevel( u
"mSrcExtent.yMinimum() = %1 mSrcExtent.yMaximum() = %2 mSrcYRes = %3"_s.arg( mSrcExtent.yMinimum() ).arg( mSrcExtent.yMaximum() ).arg( mSrcYRes ), 5 );
534 QgsDebugMsgLevel( u
"theSrcRow = %1 srcCol = %2"_s.arg( *srcRow ).arg( *srcCol ), 5 );
541 if ( *srcRow >= mSrcRows )
return false;
542 if ( *srcRow < 0 )
return false;
543 if ( *srcCol >= mSrcCols )
return false;
544 if ( *srcCol < 0 )
return false;
549bool ProjectorData::approximateSrcRowCol(
int destRow,
int destCol,
int *srcRow,
int *srcCol )
551 const int myMatrixRow = matrixRow( destRow );
552 const int myMatrixCol = matrixCol( destCol );
554 if ( myMatrixRow > mHelperTopRow )
560 const double myDestY = mDestExtent.yMaximum() - ( destRow + 0.5 ) * mDestYRes;
564 double myDestXMin, myDestYMin, myDestXMax, myDestYMax;
566 destPointOnCPMatrix( myMatrixRow + 1, myMatrixCol, &myDestXMin, &myDestYMin );
567 destPointOnCPMatrix( myMatrixRow, myMatrixCol + 1, &myDestXMax, &myDestYMax );
569 const double yfrac = ( myDestY - myDestYMin ) / ( myDestYMax - myDestYMin );
571 const QgsPointXY &myTop = pHelperTop[destCol];
572 const QgsPointXY &myBot = pHelperBottom[destCol];
578 const double tx = myTop.
x();
579 const double ty = myTop.
y();
580 const double bx = myBot.
x();
581 const double by = myBot.
y();
582 const double mySrcX = bx + ( tx - bx ) * yfrac;
583 const double mySrcY = by + ( ty - by ) * yfrac;
585 if ( !mExtent.contains( mySrcX, mySrcY ) )
592 *srcRow =
static_cast< int >( std::floor( ( mSrcExtent.yMaximum() - mySrcY ) / mSrcYRes ) );
593 *srcCol =
static_cast< int >( std::floor( ( mySrcX - mSrcExtent.xMinimum() ) / mSrcXRes ) );
598 if ( *srcRow >= mSrcRows )
return false;
599 if ( *srcRow < 0 )
return false;
600 if ( *srcCol >= mSrcCols )
return false;
601 if ( *srcCol < 0 )
return false;
608 for (
int r = 0; r < mCPRows - 1; r++ )
610 QList<QgsPointXY> myRow;
611 QList<bool> myLegalRow;
612 myRow.reserve( mCPCols );
613 myLegalRow.reserve( mCPCols );
614 for (
int c = 0;
c < mCPCols; ++
c )
617 myLegalRow.append(
false );
620 mCPMatrix.insert( 1 + r * 2, myRow );
621 mCPLegalMatrix.insert( 1 + r * 2, myLegalRow );
623 mCPRows += mCPRows - 1;
624 for (
int r = 1; r < mCPRows - 1; r += 2 )
632 for (
int r = 0; r < mCPRows; r++ )
634 for (
int c = 0;
c < mCPCols - 1;
c++ )
637 mCPLegalMatrix[r].insert( 1 +
c * 2,
false );
640 mCPCols += mCPCols - 1;
641 for (
int c = 1;
c < mCPCols - 1;
c += 2 )
650 double myDestX, myDestY;
651 destPointOnCPMatrix( row, col, &myDestX, &myDestY );
652 const QgsPointXY myDestPoint( myDestX, myDestY );
657 mCPMatrix[row][col] = ct.
transform( myDestPoint );
658 mCPLegalMatrix[row][col] =
true;
662 mCPLegalMatrix[row][col] =
false;
669 mCPLegalMatrix[row][col] =
false;
676 for (
int i = 0; i < mCPCols; i++ )
678 calcCP( row, i, ct );
687 for (
int i = 0; i < mCPRows; i++ )
689 calcCP( i, col, ct );
702 for (
int c = 0;
c < mCPCols;
c++ )
704 for (
int r = 1; r < mCPRows - 1; r += 2 )
706 double myDestX, myDestY;
707 destPointOnCPMatrix( r,
c, &myDestX, &myDestY );
708 const QgsPointXY myDestPoint( myDestX, myDestY );
710 const QgsPointXY mySrcPoint1 = mCPMatrix[r - 1][
c];
712 const QgsPointXY mySrcPoint3 = mCPMatrix[r + 1][
c];
714 const QgsPointXY mySrcApprox( ( mySrcPoint1.
x() + mySrcPoint3.
x() ) / 2, ( mySrcPoint1.
y() + mySrcPoint3.
y() ) / 2 );
715 if ( !mCPLegalMatrix[r - 1][
c] || !mCPLegalMatrix[r][
c] || !mCPLegalMatrix[r + 1][
c] )
723 const double mySqrDist = myDestApprox.
sqrDist( myDestPoint );
724 if ( mySqrDist > mSqrTolerance )
747 for (
int r = 0; r < mCPRows; r++ )
749 for (
int c = 1;
c < mCPCols - 1;
c += 2 )
751 double myDestX, myDestY;
752 destPointOnCPMatrix( r,
c, &myDestX, &myDestY );
754 const QgsPointXY myDestPoint( myDestX, myDestY );
755 const QgsPointXY mySrcPoint1 = mCPMatrix[r][
c - 1];
757 const QgsPointXY mySrcPoint3 = mCPMatrix[r][
c + 1];
759 const QgsPointXY mySrcApprox( ( mySrcPoint1.
x() + mySrcPoint3.
x() ) / 2, ( mySrcPoint1.
y() + mySrcPoint3.
y() ) / 2 );
760 if ( !mCPLegalMatrix[r][
c - 1] || !mCPLegalMatrix[r][
c] || !mCPLegalMatrix[r][
c + 1] )
768 const double mySqrDist = myDestApprox.
sqrDist( myDestPoint );
769 if ( mySqrDist > mSqrTolerance )
793 return tr(
"Approximate" );
795 return tr(
"Exact" );
803 QgsDebugMsgLevel( u
"width = %1 height = %2"_s.arg( width ).arg( height ), 4 );
813 if ( ! mSrcCRS.isValid() || ! mDestCRS.isValid() || mSrcCRS == mDestCRS )
816 return mInput->block( bandNo,
extent, width, height, feedback );
824 ProjectorData pd(
extent, width, height,
mInput, inverseCt, mPrecision, feedback );
829 QgsDebugMsgLevel( u
"srcExtent:\n%1"_s.arg( pd.srcExtent().toString() ), 4 );
830 QgsDebugMsgLevel( u
"srcCols = %1 srcRows = %2"_s.arg( pd.srcCols() ).arg( pd.srcRows() ), 4 );
833 if ( pd.srcRows() <= 0 || pd.srcCols() <= 0 )
839 std::unique_ptr< QgsRasterBlock > inputBlock(
mInput->block( bandNo, pd.srcExtent(), pd.srcCols(), pd.srcRows(), feedback ) );
849 auto outputBlock = std::make_unique< QgsRasterBlock >(
input->dataType(), width, height );
852 if (
input->hasNoDataValue() )
859 return outputBlock.release();
878 for (
int i = 0; i < height; ++i )
882 for (
int j = 0; j < width; ++j )
884 const bool inside = pd.srcRowCol( i, j, &srcRow, &srcCol );
885 if ( !inside )
continue;
887 const qgssize srcIndex =
static_cast< qgssize >( srcRow ) * pd.srcCols() + srcCol;
890 if ( doNoData &&
input->isNoData( srcRow, srcCol ) )
895 const qgssize destIndex =
static_cast< qgssize >( i ) * width + j;
896 const char *srcBits =
input->constBits( srcIndex );
897 char *destBits = output->
bits( destIndex );
908 memcpy( destBits, srcBits, pixelSize );
913 return outputBlock.release();
917 QgsRectangle &destExtent,
int &destXSize,
int &destYSize )
919 if ( srcExtent.
isEmpty() || srcXSize <= 0 || srcYSize <= 0 )
929 return extentSize( ct, srcExtent, srcXSize, srcYSize, destExtent, destXSize, destYSize );
933 const QgsRectangle &srcExtent,
int srcXSize,
int srcYSize,
934 QgsRectangle &destExtent,
int &destXSize,
int &destYSize )
936 if ( srcExtent.
isEmpty() || srcXSize <= 0 || srcYSize <= 0 )
948 constexpr int steps = 3;
949 const double srcXStep = srcExtent.
width() / steps;
950 const double srcYStep = srcExtent.
height() / steps;
951 const double srcXRes = srcExtent.
width() / srcXSize;
952 const double srcYRes = srcExtent.
height() / srcYSize;
953 double destXRes = std::numeric_limits<double>::max();
954 double destYRes = std::numeric_limits<double>::max();
958 for (
int i = 0; i < steps; i++ )
960 const double x = srcExtent.
xMinimum() + i * srcXStep;
961 for (
int j = 0; j < steps; j++ )
963 const double y = srcExtent.
yMinimum() + j * srcYStep;
964 const QgsRectangle srcRectangle( x - srcXRes / 2, y - srcYRes / 2, x + srcXRes / 2, y + srcYRes / 2 );
968 if ( destRectangle.
width() > 0 )
970 destXRes = std::min( destXRes, destRectangle.
width() );
971 if ( destRectangle.
width() > maxXRes )
972 maxXRes = destRectangle.
width();
974 if ( destRectangle.
height() > 0 )
976 destYRes = std::min( destYRes, destRectangle.
height() );
977 if ( destRectangle.
height() > maxYRes )
978 maxYRes = destRectangle.
height();
991 if ( destXRes < 0.1 * maxXRes )
993 destXRes = 0.1 * maxXRes;
995 if ( destYRes < 0.1 * maxYRes )
997 destYRes = 0.1 * maxYRes;
999 if ( destXRes == 0 || destExtent.
width() / destXRes > std::numeric_limits<int>::max() )
1001 if ( destYRes == 0 || destExtent.
height() / destYRes > std::numeric_limits<int>::max() )
1004 destXSize = std::max( 1,
static_cast< int >( destExtent.
width() / destXRes ) );
1005 destYSize = std::max( 1,
static_cast< int >( destExtent.
height() / destYRes ) );
@ ProviderHintCanPerformProviderResampling
Provider can perform resampling (to be opposed to post rendering resampling).
@ Size
Original data source size (and thus resolution) is known, it is not always available,...
DataType
Raster data types.
@ UnknownDataType
Unknown or unspecified type.
@ Reverse
Reverse/inverse transform (from destination to source).
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Custom exception class for Coordinate Reference System related exceptions.
bool isCanceled() const
Tells whether the operation has been canceled already.
QString toString(int precision=-1) const
Returns a string representation of the point (x, y) with a preset precision.
double sqrDist(double x, double y) const
Returns the squared distance between this point a specified x, y coordinate.
void setY(double y)
Sets the y value of the point.
void setX(double x)
Sets the x value of the point.
Feedback object tailored for raster block reading.
bool isValid() const
Returns true if the block is valid (correctly filled with data).
static bool typeIsNumeric(Qgis::DataType type)
Returns true if a data type is numeric.
char * bits(int row, int column)
Returns a pointer to block data.
static int typeSize(Qgis::DataType dataType)
Returns the size in bytes for the specified dataType.
void setIsData(int row, int column)
Remove no data flag on pixel.
void setNoDataValue(double noDataValue)
Sets cell value that will be considered as "no data".
bool setIsNoData(int row, int column)
Set no data on pixel.
QgsRectangle extent() const override=0
Returns the extent of the layer.
virtual Qgis::RasterProviderCapabilities providerCapabilities() const
Returns flags containing the supported capabilities of the data provider.
Base class for processing filters like renderers, reprojector, resampler etc.
virtual Qgis::RasterInterfaceCapabilities capabilities() const
Returns the capabilities supported by the interface.
virtual int xSize() const
Gets raster size.
QgsRasterInterface(QgsRasterInterface *input=nullptr)
QgsRasterInterface * mInput
virtual int ySize() const
virtual QgsRectangle extent() const
Gets the extent of the interface.
virtual QgsRasterInterface * input() const
Current input.
QgsRasterProjector * clone() const override
Clone itself, create deep copy.
bool destExtentSize(const QgsRectangle &srcExtent, int srcXSize, int srcYSize, QgsRectangle &destExtent, int &destXSize, int &destYSize)
Calculate destination extent and size from source extent and size.
static QString precisionLabel(Precision precision)
Qgis::DataType dataType(int bandNo) const override
Returns data type for the band specified by number.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override
Read block of data using given extent and size.
static bool extentSize(const QgsCoordinateTransform &ct, const QgsRectangle &srcExtent, int srcXSize, int srcYSize, QgsRectangle &destExtent, int &destXSize, int &destYSize)
Calculate destination extent and size from source extent and size.
Precision
Precision defines if each pixel is reprojected or approximate reprojection based on an approximation ...
@ Exact
Exact, precise but slow.
@ Approximate
Approximate (default), fast but possibly inaccurate.
Precision precision() const
int bandCount() const override
Gets number of bands.
Q_DECL_DEPRECATED void setCrs(const QgsCoordinateReferenceSystem &srcCRS, const QgsCoordinateReferenceSystem &destCRS, int srcDatumTransform=-1, int destDatumTransform=-1)
Sets the source and destination CRS.
A rectangle specified with double values.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define Q_NOWARN_DEPRECATED_POP
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...
#define Q_NOWARN_DEPRECATED_PUSH
#define QgsDebugMsgLevel(str, level)
#define QgsDebugError(str)