18 #ifndef QGSCUBICRASTERRESAMPLER_H 19 #define QGSCUBICRASTERRESAMPLER_H 25 #include "qgis_core.h" 40 void resample(
const QImage &srcImage, QImage &dstImage )
override;
41 QString
type()
const override {
return QStringLiteral(
"cubic" ); }
44 static void xDerivativeMatrix(
int nCols,
int nRows,
double *matrix,
const int *colorMatrix );
45 static void yDerivativeMatrix(
int nCols,
int nRows,
double *matrix,
const int *colorMatrix );
47 void calculateControlPoints(
int nCols,
int nRows,
int currentRow,
int currentCol,
int *redMatrix,
int *greenMatrix,
int *blueMatrix,
48 int *alphaMatrix,
double *xDerivativeMatrixRed,
double *xDerivativeMatrixGreen,
double *xDerivativeMatrixBlue,
49 double *xDerivativeMatrixAlpha,
double *yDerivativeMatrixRed,
double *yDerivativeMatrixGreen,
double *yDerivativeMatrixBlue,
50 double *yDerivativeMatrixAlpha );
53 QRgb curveInterpolation( QRgb pt1, QRgb pt2,
double t,
double d1red,
double d1green,
double d1blue,
double d1alpha,
double d2red,
double d2green,
54 double d2blue,
double d2alpha );
56 static inline double calcBernsteinPolyN3(
int i,
double t );
57 static inline int lowerN3(
int i );
60 static inline QRgb createPremultipliedColor(
int r,
int g,
int b,
int a );
82 double cGreen00 = 0.0;
83 double cGreen10 = 0.0;
84 double cGreen20 = 0.0;
85 double cGreen30 = 0.0;
86 double cGreen01 = 0.0;
87 double cGreen11 = 0.0;
88 double cGreen21 = 0.0;
89 double cGreen31 = 0.0;
90 double cGreen02 = 0.0;
91 double cGreen12 = 0.0;
92 double cGreen22 = 0.0;
93 double cGreen32 = 0.0;
94 double cGreen03 = 0.0;
95 double cGreen13 = 0.0;
96 double cGreen23 = 0.0;
97 double cGreen33 = 0.0;
100 double cBlue10 = 0.0;
101 double cBlue20 = 0.0;
102 double cBlue30 = 0.0;
103 double cBlue01 = 0.0;
104 double cBlue11 = 0.0;
105 double cBlue21 = 0.0;
106 double cBlue31 = 0.0;
107 double cBlue02 = 0.0;
108 double cBlue12 = 0.0;
109 double cBlue22 = 0.0;
110 double cBlue32 = 0.0;
111 double cBlue03 = 0.0;
112 double cBlue13 = 0.0;
113 double cBlue23 = 0.0;
114 double cBlue33 = 0.0;
116 double cAlpha00 = 0.0;
117 double cAlpha10 = 0.0;
118 double cAlpha20 = 0.0;
119 double cAlpha30 = 0.0;
120 double cAlpha01 = 0.0;
121 double cAlpha11 = 0.0;
122 double cAlpha21 = 0.0;
123 double cAlpha31 = 0.0;
124 double cAlpha02 = 0.0;
125 double cAlpha12 = 0.0;
126 double cAlpha22 = 0.0;
127 double cAlpha32 = 0.0;
128 double cAlpha03 = 0.0;
129 double cAlpha13 = 0.0;
130 double cAlpha23 = 0.0;
131 double cAlpha33 = 0.0;
136 #endif // QGSCUBICRASTERRESAMPLER_H
Interface for resampling rasters (e.g.
virtual void resample(const QImage &srcImage, QImage &dstImage)=0
virtual QgsRasterResampler * clone() const =0
Gets a deep copy of this object.
QString type() const override
Gets a descriptive type identifier for this raster resampler.