28 int theSrcDatumTransform,
29 int theDestDatumTransform,
31 int theDestRows,
int theDestCols,
32 double theMaxSrcXRes,
double theMaxSrcYRes,
35 , mSrcCRS( theSrcCRS )
36 , mDestCRS( theDestCRS )
37 , mSrcDatumTransform( theSrcDatumTransform )
38 , mDestDatumTransform( theDestDatumTransform )
39 , mPrecision( Approximate )
42 Q_UNUSED( theDestExtent );
43 Q_UNUSED( theDestRows );
44 Q_UNUSED( theDestCols );
45 Q_UNUSED( theMaxSrcXRes );
46 Q_UNUSED( theMaxSrcYRes );
47 Q_UNUSED( theExtent );
54 int theDestRows,
int theDestCols,
55 double theMaxSrcXRes,
double theMaxSrcYRes,
58 , mSrcCRS( theSrcCRS )
59 , mDestCRS( theDestCRS )
60 , mSrcDatumTransform( -1 )
61 , mDestDatumTransform( -1 )
65 Q_UNUSED( theDestExtent );
66 Q_UNUSED( theDestRows );
67 Q_UNUSED( theDestCols );
68 Q_UNUSED( theMaxSrcXRes );
69 Q_UNUSED( theMaxSrcYRes );
70 Q_UNUSED( theExtent );
76 double theMaxSrcXRes,
double theMaxSrcYRes,
79 , mSrcCRS( theSrcCRS )
80 , mDestCRS( theDestCRS )
81 , mSrcDatumTransform( -1 )
82 , mDestDatumTransform( -1 )
86 Q_UNUSED( theMaxSrcXRes );
87 Q_UNUSED( theMaxSrcYRes );
88 Q_UNUSED( theExtent );
93 , mSrcDatumTransform( -1 )
94 , mDestDatumTransform( -1 )
102 , mSrcCRS( projector.mSrcCRS )
103 , mDestCRS( projector.mDestCRS )
104 , mSrcDatumTransform( projector.mSrcDatumTransform )
105 , mDestDatumTransform( projector.mDestDatumTransform )
106 , mPrecision( projector.mPrecision )
112 if ( &projector !=
this )
114 mSrcCRS = projector.mSrcCRS;
115 mDestCRS = projector.mDestCRS;
116 mSrcDatumTransform = projector.mSrcDatumTransform;
117 mDestDatumTransform = projector.mDestDatumTransform;
118 mPrecision = projector.mPrecision;
128 projector->mSrcCRS = mSrcCRS;
129 projector->mDestCRS = mDestCRS;
130 projector->mSrcDatumTransform = mSrcDatumTransform;
131 projector->mDestDatumTransform = mDestDatumTransform;
132 projector->mPrecision = mPrecision;
160 mDestCRS = theDestCRS;
161 mSrcDatumTransform = srcDatumTransform;
162 mDestDatumTransform = destDatumTransform;
167 : mApproximate(
false )
168 , mInverseCt( inverseCt->
clone() )
169 , mDestExtent( extent )
170 , mDestRows( height )
178 , mDestRowsPerMatrixRow( 0.0 )
179 , mDestColsPerMatrixCol( 0.0 )
180 , pHelperTop(
nullptr )
181 , pHelperBottom(
nullptr )
185 , mSqrTolerance( 0.0 )
203 if ( mExtent.isEmpty() )
205 mExtent = provider->
extent();
210 mDestXRes = mDestExtent.
width() / ( mDestCols );
211 mDestYRes = mDestExtent.height() / ( mDestRows );
217 double myDestRes = mDestXRes < mDestYRes ? mDestXRes : mDestYRes;
218 mSqrTolerance = myDestRes * myDestRes;
226 mApproximate =
false;
231 mCPCols = mCPRows = 3;
232 for (
int i = 0; i < mCPRows; i++ )
238 mCPMatrix.insert( i, myRow );
241 myLegalRow.
append(
bool(
false ) );
242 myLegalRow.
append(
bool(
false ) );
243 myLegalRow.
append(
bool(
false ) );
244 mCPLegalMatrix.insert( i, myLegalRow );
246 for (
int i = 0; i < mCPRows; i++ )
248 calcRow( i, inverseCt );
253 bool myColsOK = checkCols( inverseCt );
256 insertRows( inverseCt );
258 bool myRowsOK = checkRows( inverseCt );
261 insertCols( inverseCt );
263 if ( myColsOK && myRowsOK )
270 if ( mCPRows * mCPCols > 0.25 * mDestRows * mDestCols )
274 mApproximate =
false;
279 mDestRowsPerMatrixRow =
static_cast< float >( mDestRows ) / ( mCPRows - 1 );
280 mDestColsPerMatrixCol =
static_cast< float >( mDestCols ) / ( mCPCols - 1 );
286 pHelperTop =
new QgsPoint[mDestCols];
287 pHelperBottom =
new QgsPoint[mDestCols];
288 calcHelper( 0, pHelperTop );
289 calcHelper( 1, pHelperBottom );
295 mSrcYRes = mSrcExtent.height() / mSrcRows;
296 mSrcXRes = mSrcExtent.width() / mSrcCols;
299 ProjectorData::~ProjectorData()
302 delete[] pHelperBottom;
307 void ProjectorData::calcSrcExtent()
318 mSrcExtent =
QgsRectangle( myPoint.
x(), myPoint.
y(), myPoint.
x(), myPoint.
y() );
319 for (
int i = 0; i < mCPRows; i++ )
321 for (
int j = 0; j < mCPCols ; j++ )
323 myPoint = mCPMatrix[i][j];
324 if ( mCPLegalMatrix[i][j] )
326 mSrcExtent.combineExtentWith( myPoint.
x(), myPoint.
y() );
333 mSrcExtent = mSrcExtent.intersect( &mExtent );
344 if ( !mExtent.isEmpty() )
346 if ( mMaxSrcXRes > 0 )
349 double col = floor(( mSrcExtent.xMinimum() - mExtent.xMinimum() ) / mMaxSrcXRes );
350 double x = mExtent.xMinimum() + col * mMaxSrcXRes;
351 mSrcExtent.setXMinimum( x );
353 col = ceil(( mSrcExtent.xMaximum() - mExtent.xMinimum() ) / mMaxSrcXRes );
354 x = mExtent.xMinimum() + col * mMaxSrcXRes;
355 mSrcExtent.setXMaximum( x );
357 if ( mMaxSrcYRes > 0 )
359 double row = floor(( mExtent.yMaximum() - mSrcExtent.yMaximum() ) / mMaxSrcYRes );
360 double y = mExtent.yMaximum() - row * mMaxSrcYRes;
361 mSrcExtent.setYMaximum( y );
363 row = ceil(( mExtent.yMaximum() - mSrcExtent.yMinimum() ) / mMaxSrcYRes );
364 y = mExtent.yMaximum() - row * mMaxSrcYRes;
365 mSrcExtent.setYMinimum( y );
371 QString ProjectorData::cpToString()
374 for (
int i = 0; i < mCPRows; i++ )
378 for (
int j = 0; j < mCPCols; j++ )
383 if ( mCPLegalMatrix[i][j] )
396 void ProjectorData::calcSrcRowsCols()
409 double myDestColsPerMatrixCell =
static_cast< double >( mDestCols ) / mCPCols;
410 double myDestRowsPerMatrixCell =
static_cast< double >( mDestRows ) / mCPRows;
411 QgsDebugMsgLevel(
QString(
"myDestColsPerMatrixCell = %1 myDestRowsPerMatrixCell = %2" ).arg( myDestColsPerMatrixCell ).arg( myDestRowsPerMatrixCell ), 4 );
412 for (
int i = 0; i < mCPRows - 1; i++ )
414 for (
int j = 0; j < mCPCols - 1; j++ )
416 QgsPoint myPointA = mCPMatrix[i][j];
417 QgsPoint myPointB = mCPMatrix[i][j+1];
418 QgsPoint myPointC = mCPMatrix[i+1][j];
419 if ( mCPLegalMatrix[i][j] && mCPLegalMatrix[i][j+1] && mCPLegalMatrix[i+1][j] )
421 double mySize = sqrt( myPointA.
sqrDist( myPointB ) ) / myDestColsPerMatrixCell;
422 if ( mySize < myMinSize )
425 mySize = sqrt( myPointA.
sqrDist( myPointC ) ) / myDestRowsPerMatrixCell;
426 if ( mySize < myMinSize )
437 int srcXSize, srcYSize;
440 double srcXRes = srcExtent.
width() / srcXSize;
441 double srcYRes = srcExtent.
height() / srcYSize;
442 myMinSize =
std::min( srcXRes, srcYRes );
457 double myMinXSize = mMaxSrcXRes > myMinSize ? mMaxSrcXRes : myMinSize;
458 double myMinYSize = mMaxSrcYRes > myMinSize ? mMaxSrcYRes : myMinSize;
460 QgsDebugMsgLevel(
QString(
"mSrcExtent.width = %1 mSrcExtent.height = %2" ).arg( mSrcExtent.width() ).arg( mSrcExtent.height() ), 4 );
463 mSrcRows =
static_cast< int >( qRound( mSrcExtent.height() / myMinYSize ) );
464 mSrcCols =
static_cast< int >( qRound( mSrcExtent.width() / myMinXSize ) );
470 inline void ProjectorData::destPointOnCPMatrix(
int theRow,
int theCol,
double *theX,
double *theY )
472 *theX = mDestExtent.xMinimum() + theCol * mDestExtent.width() / ( mCPCols - 1 );
473 *theY = mDestExtent.yMaximum() - theRow * mDestExtent.height() / ( mCPRows - 1 );
476 inline int ProjectorData::matrixRow(
int theDestRow )
478 return static_cast< int >( floor(( theDestRow + 0.5 ) / mDestRowsPerMatrixRow ) );
480 inline int ProjectorData::matrixCol(
int theDestCol )
482 return static_cast< int >( floor(( theDestCol + 0.5 ) / mDestColsPerMatrixCol ) );
485 void ProjectorData::calcHelper(
int theMatrixRow,
QgsPoint *thePoints )
488 for (
int myDestCol = 0; myDestCol < mDestCols; myDestCol++ )
490 double myDestX = mDestExtent.xMinimum() + ( myDestCol + 0.5 ) * mDestXRes;
492 int myMatrixCol = matrixCol( myDestCol );
494 double myDestXMin, myDestYMin, myDestXMax, myDestYMax;
496 destPointOnCPMatrix( theMatrixRow, myMatrixCol, &myDestXMin, &myDestYMin );
497 destPointOnCPMatrix( theMatrixRow, myMatrixCol + 1, &myDestXMax, &myDestYMax );
499 double xfrac = ( myDestX - myDestXMin ) / ( myDestXMax - myDestXMin );
501 QgsPoint &mySrcPoint0 = mCPMatrix[theMatrixRow][myMatrixCol];
502 QgsPoint &mySrcPoint1 = mCPMatrix[theMatrixRow][myMatrixCol+1];
503 double s = mySrcPoint0.
x() + ( mySrcPoint1.
x() - mySrcPoint0.
x() ) * xfrac;
504 double t = mySrcPoint0.
y() + ( mySrcPoint1.
y() - mySrcPoint0.
y() ) * xfrac;
506 thePoints[myDestCol].
setX( s );
507 thePoints[myDestCol].
setY( t );
511 void ProjectorData::nextHelper()
516 pHelperTop = pHelperBottom;
518 calcHelper( mHelperTopRow + 2, pHelperBottom );
522 bool ProjectorData::srcRowCol(
int theDestRow,
int theDestCol,
int *theSrcRow,
int *theSrcCol )
526 return approximateSrcRowCol( theDestRow, theDestCol, theSrcRow, theSrcCol );
530 return preciseSrcRowCol( theDestRow, theDestCol, theSrcRow, theSrcCol );
534 bool ProjectorData::preciseSrcRowCol(
int theDestRow,
int theDestCol,
int *theSrcRow,
int *theSrcCol )
538 QgsDebugMsgLevel(
QString(
"theDestRow = %1 mDestExtent.yMaximum() = %2 mDestYRes = %3" ).arg( theDestRow ).arg( mDestExtent.yMaximum() ).arg( mDestYRes ), 5 );
542 double x = mDestExtent.xMinimum() + ( theDestCol + 0.5 ) * mDestXRes;
543 double y = mDestExtent.yMaximum() - ( theDestRow + 0.5 ) * mDestYRes;
552 mInverseCt->transformInPlace( x, y, z );
559 if ( !mExtent.contains(
QgsPoint( x, y ) ) )
564 *theSrcRow =
static_cast< int >( floor(( mSrcExtent.yMaximum() - y ) / mSrcYRes ) );
565 *theSrcCol =
static_cast< int >( floor(( x - mSrcExtent.xMinimum() ) / mSrcXRes ) );
567 QgsDebugMsgLevel(
QString(
"mSrcExtent.yMinimum() = %1 mSrcExtent.yMaximum() = %2 mSrcYRes = %3" ).arg( mSrcExtent.yMinimum() ).arg( mSrcExtent.yMaximum() ).arg( mSrcYRes ), 5 );
575 if ( *theSrcRow >= mSrcRows )
return false;
576 if ( *theSrcRow < 0 )
return false;
577 if ( *theSrcCol >= mSrcCols )
return false;
578 if ( *theSrcCol < 0 )
return false;
583 bool ProjectorData::approximateSrcRowCol(
int theDestRow,
int theDestCol,
int *theSrcRow,
int *theSrcCol )
585 int myMatrixRow = matrixRow( theDestRow );
586 int myMatrixCol = matrixCol( theDestCol );
588 if ( myMatrixRow > mHelperTopRow )
594 double myDestY = mDestExtent.yMaximum() - ( theDestRow + 0.5 ) * mDestYRes;
598 double myDestXMin, myDestYMin, myDestXMax, myDestYMax;
600 destPointOnCPMatrix( myMatrixRow + 1, myMatrixCol, &myDestXMin, &myDestYMin );
601 destPointOnCPMatrix( myMatrixRow, myMatrixCol + 1, &myDestXMax, &myDestYMax );
603 double yfrac = ( myDestY - myDestYMin ) / ( myDestYMax - myDestYMin );
605 QgsPoint &myTop = pHelperTop[theDestCol];
606 QgsPoint &myBot = pHelperBottom[theDestCol];
612 double tx = myTop.
x();
613 double ty = myTop.
y();
614 double bx = myBot.
x();
615 double by = myBot.
y();
616 double mySrcX = bx + ( tx - bx ) * yfrac;
617 double mySrcY = by + ( ty - by ) * yfrac;
619 if ( !mExtent.contains(
QgsPoint( mySrcX, mySrcY ) ) )
626 *theSrcRow =
static_cast< int >( floor(( mSrcExtent.yMaximum() - mySrcY ) / mSrcYRes ) );
627 *theSrcCol =
static_cast< int >( floor(( mySrcX - mSrcExtent.xMinimum() ) / mSrcXRes ) );
632 if ( *theSrcRow >= mSrcRows )
return false;
633 if ( *theSrcRow < 0 )
return false;
634 if ( *theSrcCol >= mSrcCols )
return false;
635 if ( *theSrcCol < 0 )
return false;
642 for (
int r = 0; r < mCPRows - 1; r++ )
648 for (
int c = 0; c < mCPCols; ++c )
651 myLegalRow.
append(
false );
654 mCPMatrix.insert( 1 + r*2, myRow );
655 mCPLegalMatrix.insert( 1 + r*2, myLegalRow );
657 mCPRows += mCPRows - 1;
658 for (
int r = 1; r < mCPRows - 1; r += 2 )
666 for (
int r = 0; r < mCPRows; r++ )
668 for (
int c = 0; c < mCPCols - 1; c++ )
670 mCPMatrix[r].insert( 1 + c*2,
QgsPoint() );
671 mCPLegalMatrix[r].insert( 1 + c*2,
false );
674 mCPCols += mCPCols - 1;
675 for (
int c = 1; c < mCPCols - 1; c += 2 )
684 double myDestX, myDestY;
685 destPointOnCPMatrix( theRow, theCol, &myDestX, &myDestY );
686 QgsPoint myDestPoint( myDestX, myDestY );
691 mCPMatrix[theRow][theCol] = ct->
transform( myDestPoint );
692 mCPLegalMatrix[theRow][theCol] =
true;
696 mCPLegalMatrix[theRow][theCol] =
false;
703 mCPLegalMatrix[theRow][theCol] =
false;
710 for (
int i = 0; i < mCPCols; i++ )
712 calcCP( theRow, i, ct );
721 for (
int i = 0; i < mCPRows; i++ )
723 calcCP( i, theCol, ct );
736 for (
int c = 0; c < mCPCols; c++ )
738 for (
int r = 1; r < mCPRows - 1; r += 2 )
740 double myDestX, myDestY;
741 destPointOnCPMatrix( r, c, &myDestX, &myDestY );
742 QgsPoint myDestPoint( myDestX, myDestY );
744 QgsPoint mySrcPoint1 = mCPMatrix[r-1][c];
745 QgsPoint mySrcPoint2 = mCPMatrix[r][c];
746 QgsPoint mySrcPoint3 = mCPMatrix[r+1][c];
748 QgsPoint mySrcApprox(( mySrcPoint1.
x() + mySrcPoint3.
x() ) / 2, ( mySrcPoint1.
y() + mySrcPoint3.
y() ) / 2 );
749 if ( !mCPLegalMatrix[r-1][c] || !mCPLegalMatrix[r][c] || !mCPLegalMatrix[r+1][c] )
757 double mySqrDist = myDestApprox.
sqrDist( myDestPoint );
758 if ( mySqrDist > mSqrTolerance )
781 for (
int r = 0; r < mCPRows; r++ )
783 for (
int c = 1; c < mCPCols - 1; c += 2 )
785 double myDestX, myDestY;
786 destPointOnCPMatrix( r, c, &myDestX, &myDestY );
788 QgsPoint myDestPoint( myDestX, myDestY );
789 QgsPoint mySrcPoint1 = mCPMatrix[r][c-1];
790 QgsPoint mySrcPoint2 = mCPMatrix[r][c];
791 QgsPoint mySrcPoint3 = mCPMatrix[r][c+1];
793 QgsPoint mySrcApprox(( mySrcPoint1.
x() + mySrcPoint3.
x() ) / 2, ( mySrcPoint1.
y() + mySrcPoint3.
y() ) / 2 );
794 if ( !mCPLegalMatrix[r][c-1] || !mCPLegalMatrix[r][c] || !mCPLegalMatrix[r][c+1] )
802 double mySqrDist = myDestApprox.
sqrDist( myDestPoint );
803 if ( mySqrDist > mSqrTolerance )
827 return tr(
"Approximate" );
829 return tr(
"Exact" );
836 return block2( bandNo, extent, width, height );
849 if ( ! mSrcCRS.
isValid() || ! mDestCRS.
isValid() || mSrcCRS == mDestCRS )
852 return mInput->
block2( bandNo, extent, width, height, feedback );
857 ProjectorData pd( extent, width, height,
mInput, inverseCt, mPrecision );
863 if ( pd.srcRows() <= 0 || pd.srcCols() <= 0 )
870 if ( !inputBlock || inputBlock->
isEmpty() )
888 if ( !outputBlock->isValid() )
910 outputBlock->setIsNoData();
913 for (
int i = 0; i < height; ++i )
915 for (
int j = 0; j < width; ++j )
917 bool inside = pd.srcRowCol( i, j, &srcRow, &srcCol );
918 if ( !inside )
continue;
920 qgssize srcIndex =
static_cast< qgssize >( srcRow ) * pd.srcCols() + srcCol;
923 if ( doNoData && inputBlock->
isNoData( srcRow, srcCol ) )
925 outputBlock->setIsNoData( i, j );
930 char *srcBits = inputBlock->
bits( srcIndex );
931 char *destBits = outputBlock->bits( destIndex );
934 QgsDebugMsg(
QString(
"Cannot get input block data: row = %1 col = %2" ).arg( i ).arg( j ) );
939 QgsDebugMsg(
QString(
"Cannot set output block data: srcRow = %1 srcCol = %2" ).arg( srcRow ).arg( srcCol ) );
942 memcpy( destBits, srcBits, pixelSize );
943 outputBlock->setIsData( i, j );
953 QgsRectangle& theDestExtent,
int& theDestXSize,
int& theDestYSize )
955 if ( theSrcExtent.
isEmpty() || theSrcXSize <= 0 || theSrcYSize <= 0 )
961 return extentSize( ct, theSrcExtent, theSrcXSize, theSrcYSize, theDestExtent, theDestXSize, theDestYSize );
965 const QgsRectangle& theSrcExtent,
int theSrcXSize,
int theSrcYSize,
966 QgsRectangle& theDestExtent,
int& theDestXSize,
int& theDestYSize )
968 if ( theSrcExtent.
isEmpty() || theSrcXSize <= 0 || theSrcYSize <= 0 )
977 double srcXStep = theSrcExtent.
width() / 3;
978 double srcYStep = theSrcExtent.
height() / 3;
979 double srcXRes = theSrcExtent.
width() / theSrcXSize;
980 double srcYRes = theSrcExtent.
height() / theSrcYSize;
984 for (
int i = 0; i < 3; i++ )
986 double x = theSrcExtent.
xMinimum() + i * srcXStep;
987 for (
int j = 0; j < 3; j++ )
989 double y = theSrcExtent.
yMinimum() + j * srcYStep;
990 QgsRectangle srcRectangle( x - srcXRes / 2, y - srcYRes / 2, x + srcXRes / 2, y + srcYRes / 2 );
992 if ( destRectangle.
width() > 0 )
996 if ( destRectangle.
height() > 0 )
1002 theDestXSize =
std::max( 1, static_cast< int >( theDestExtent.
width() / destYRes ) );
1003 theDestYSize =
std::max( 1, static_cast< int >( theDestExtent.
height() / destYRes ) );
virtual int bandCount() const =0
Get number of bands.
A rectangle specified with double values.
void setCRS(const QgsCoordinateReferenceSystem &theSrcCRS, const QgsCoordinateReferenceSystem &theDestCRS, int srcDatumTransform=-1, int destDatumTransform=-1)
set source and destination CRS
Unknown or unspecified type.
Precision precision() const
Approximate (default), fast but possibly inaccurate.
static bool typeIsNumeric(QGis::DataType type)
Returns true if data type is numeric.
virtual QgsRasterInterface * input() const
Current input.
virtual int ySize() const
bool isNoData(int row, int column)
Check if value at position is no data.
double y() const
Get the y value of the point.
virtual QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)
Read block of data using given extent and size.
bool setIsNoData(int row, int column)
Set no data on pixel.
double ANALYSIS_EXPORT max(double x, double y)
Returns the maximum of two doubles or the first argument if both are equal.
QString toString(bool automaticPrecision=false) const
returns string representation of form xmin,ymin xmax,ymax
void append(const T &value)
~QgsRasterProjector()
The destructor.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height) override
Read block of data using given extent and size.
#define QgsDebugMsgLevel(str, level)
bool isEmpty() const
test if rectangle is empty.
virtual int capabilities() const
Returns a bitmask containing the supported capabilities.
double width() const
Width of the rectangle.
static int typeSize(int dataType)
bool isEmpty() const
Returns true if block is empty, i.e.
virtual QGis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
Base class for processing filters like renderers, reprojector, resampler etc.
A class to represent a point.
QString toString() const
String representation of the point (x,y)
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...
void setX(double x)
Sets the x value of the point.
void setY(double y)
Sets the y value of the point.
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
QgsRasterProjector implements approximate projection support for it calculates grid of points in sour...
virtual QgsRectangle extent() override=0
Get the extent of the data source.
virtual QgsRectangle extent()
Get the extent of the interface.
QGis::DataType dataType() const
Returns data type.
char * bits(int row, int column)
Get pointer to data.
QgsRasterProjector * clone() const override
Clone itself, create deep copy.
Precision
Precision defines if each pixel is reprojected or approximate reprojection based on an approximation ...
QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override
Read block of data using given extent and size.
Class for storing a coordinate reference system (CRS)
DataType
Raster data types.
bool hasNoDataValue() const
True if the block has no data value.
static bool extentSize(const QgsCoordinateTransform *ct, const QgsRectangle &theSrcExtent, int theSrcXSize, int theSrcYSize, QgsRectangle &theDestExtent, int &theDestXSize, int &theDestYSize)
Calculate destination extent and size from source extent and size.
double xMinimum() const
Get the x minimum value (left side of rectangle)
virtual const QgsRasterInterface * srcInput() const
Get source / raw input, the first in pipe, usually provider.
double sqrDist(double x, double y) const
Returns the squared distance between this point a specified x, y coordinate.
Custom exception class for Coordinate Reference System related exceptions.
QGis::DataType dataType(int bandNo) const override
Returns data type for the band specified by number.
double ANALYSIS_EXPORT min(double x, double y)
Returns the minimum of two doubles or the first argument if both are equal.
bool destExtentSize(const QgsRectangle &theSrcExtent, int theSrcXSize, int theSrcYSize, QgsRectangle &theDestExtent, int &theDestXSize, int &theDestYSize)
Calculate destination extent and size from source extent and size.
bool hasNoData() const
Returns true if the block may contain no data.
QgsRasterInterface * mInput
QgsRasterProjector & operator=(const QgsRasterProjector &projector)
double noDataValue() const
Return no data value.
Feedback object tailored for raster block reading.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
virtual int xSize() const
Get raster size.
static QString precisionLabel(Precision precision)
QString authid() const
Returns the authority identifier for the CRS, which includes both the authority (eg EPSG) and the CRS...
double x() const
Get the x value of the point.
double height() const
Height of the rectangle.
int bandCount() const override
Get number of bands.
Base class for raster data providers.
bool isValid() const
Returns whether this CRS is correctly initialized and usable.