30#ifndef GDALPANSHARPEN_H_INCLUDED
31#define GDALPANSHARPEN_H_INCLUDED
130 int nXOff,
int nYOff,
int nXSize,
131 int nYSize,
void *pDataBuf,
154 const void *pPanBuffer;
155 const void *pUpsampledSpectralBuffer;
190} GDALPansharpenResampleJob;
200 std::vector<int> anInputBands{};
201 std::vector<GDALDataset *> aVDS{};
202 std::vector<GDALRasterBand *> aMSBands{};
204 int bPositiveWeights = TRUE;
206 int nKernelRadius = 0;
208 static void PansharpenJobThreadFunc(
void *pUserData);
209 static void PansharpenResampleJobThreadFunc(
void *pUserData);
211 template <
class WorkDataType,
class OutDataType>
212 void WeightedBroveyWithNoData(
const WorkDataType *pPanBuffer,
213 const WorkDataType *pUpsampledSpectralBuffer,
214 OutDataType *pDataBuf,
size_t nValues,
216 WorkDataType nMaxValue)
const;
217 template <
class WorkDataType,
class OutDataType,
int bHasBitDepth>
218 void WeightedBrovey3(
const WorkDataType *pPanBuffer,
219 const WorkDataType *pUpsampledSpectralBuffer,
220 OutDataType *pDataBuf,
size_t nValues,
221 size_t nBandValues, WorkDataType nMaxValue)
const;
224 template <
class WorkDataType,
class OutDataType>
225 void WeightedBrovey(
const WorkDataType *pPanBuffer,
226 const WorkDataType *pUpsampledSpectralBuffer,
227 OutDataType *pDataBuf,
size_t nValues,
228 size_t nBandValues, WorkDataType nMaxValue)
const;
229 template <
class WorkDataType>
230 CPLErr WeightedBrovey(
const WorkDataType *pPanBuffer,
231 const WorkDataType *pUpsampledSpectralBuffer,
233 size_t nValues,
size_t nBandValues,
234 WorkDataType nMaxValue)
const;
237 template <
class WorkDataType>
238 CPLErr WeightedBrovey(
const WorkDataType *pPanBuffer,
239 const WorkDataType *pUpsampledSpectralBuffer,
241 size_t nValues,
size_t nBandValues)
const;
243 void WeightedBroveyPositiveWeights(
const T *pPanBuffer,
244 const T *pUpsampledSpectralBuffer,
245 T *pDataBuf,
size_t nValues,
246 size_t nBandValues, T nMaxValue)
const;
248 template <
class T,
int NINPUT,
int NOUTPUT>
249 size_t WeightedBroveyPositiveWeightsInternal(
250 const T *pPanBuffer,
const T *pUpsampledSpectralBuffer, T *pDataBuf,
251 size_t nValues,
size_t nBandValues, T nMaxValue)
const;
255 void WeightedBroveyGByteOrUInt16(
const T *pPanBuffer,
256 const T *pUpsampledSpectralBuffer,
257 T *pDataBuf,
size_t nValues,
258 size_t nBandValues, T nMaxValue)
const;
263 const void *pUpsampledSpectralBuffer,
void *pDataBuf,
264 size_t nValues,
size_t nBandValues,
Pool of worker threads.
Definition cpl_worker_thread_pool.h:79
A set of associated raster bands, usually from one file.
Definition gdal_priv.h:348
Pansharpening operation class.
Definition gdalpansharpen.h:196
CPLErr ProcessRegion(int nXOff, int nYOff, int nXSize, int nYSize, void *pDataBuf, GDALDataType eBufDataType)
Executes a pansharpening operation on a rectangular region of the resulting dataset.
Definition gdalpansharpen.cpp:1040
GDALPansharpenOperation()
Pansharpening operation constructor.
~GDALPansharpenOperation()
Pansharpening operation destructor.
Definition gdalpansharpen.cpp:173
GDALPansharpenOptions * GetOptions()
Return options.
Definition gdalpansharpen.cpp:1671
CPLErr Initialize(const GDALPansharpenOptions *psOptions)
Initialize the pansharpening operation.
Definition gdalpansharpen.cpp:192
CPLErr
Error category.
Definition cpl_error.h:53
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:317
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:313
unsigned int GUInt32
Unsigned int32 type.
Definition cpl_port.h:197
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1049
Class to manage a pool of worker threads.
Public (C callable) GDAL entry points.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition gdal.h:314
GDALDataType
Definition gdal.h:64
GDALRIOResampleAlg
RasterIO() resampling method.
Definition gdal.h:142
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition gdal.h:293
CPLErr GDALPansharpenProcessRegion(GDALPansharpenOperationH hOperation, int nXOff, int nYOff, int nXSize, int nYSize, void *pDataBuf, GDALDataType eBufDataType)
Executes a pansharpening operation on a rectangular region of the resulting dataset.
Definition gdalpansharpen.cpp:1746
GDALPansharpenOperationH GDALCreatePansharpenOperation(const GDALPansharpenOptions *)
Instantiate a pansharpening operation.
Definition gdalpansharpen.cpp:1692
GDALPansharpenAlg
Pansharpening algorithms.
Definition gdalpansharpen.h:48
@ GDAL_PSH_WEIGHTED_BROVEY
Definition gdalpansharpen.h:50
void GDALDestroyPansharpenOptions(GDALPansharpenOptions *)
Destroy pansharpening options.
Definition gdalpansharpen.cpp:89
void * GDALPansharpenOperationH
Definition gdalpansharpen.h:124
GDALPansharpenOptions * GDALCreatePansharpenOptions(void)
Create pansharpening options.
Definition gdalpansharpen.cpp:68
GDALPansharpenOptions * GDALClonePansharpenOptions(const GDALPansharpenOptions *psOptions)
Clone pansharpening options.
Definition gdalpansharpen.cpp:114
void GDALDestroyPansharpenOperation(GDALPansharpenOperationH)
Destroy a pansharpening operation.
Definition gdalpansharpen.cpp:1712
Pansharpening options.
Definition gdalpansharpen.h:56
GDALPansharpenAlg ePansharpenAlg
Definition gdalpansharpen.h:58
int bHasNoData
Definition gdalpansharpen.h:96
int nBitDepth
Definition gdalpansharpen.h:66
double * padfWeights
Definition gdalpansharpen.h:72
int nThreads
Number of threads or -1 to mean ALL_CPUS.
Definition gdalpansharpen.h:106
int nWeightCount
Definition gdalpansharpen.h:69
double dfMSShiftY
Shift in pixels of multispectral bands w.r.t panchromatic band, in Y direction.
Definition gdalpansharpen.h:114
GDALRasterBandH * pahInputSpectralBands
Array of nInputSpectralBands input spectral bands.
Definition gdalpansharpen.h:86
int * panOutPansharpenedBands
Definition gdalpansharpen.h:93
double dfMSShiftX
Shift in pixels of multispectral bands w.r.t panchromatic band, in X direction.
Definition gdalpansharpen.h:110
GDALRIOResampleAlg eResampleAlg
Definition gdalpansharpen.h:62
GDALRasterBandH hPanchroBand
Definition gdalpansharpen.h:75
int nInputSpectralBands
Definition gdalpansharpen.h:78
int nOutPansharpenedBands
Definition gdalpansharpen.h:89
double dfNoData
NoData value of the panchromatic and spectral bands (only taken into account if bHasNoData = TRUE).
Definition gdalpansharpen.h:101