30 #ifndef GDALPANSHARPEN_H_INCLUDED 31 #define GDALPANSHARPEN_H_INCLUDED 122 int nXOff,
int nYOff,
123 int nXSize,
int nYSize,
136 #include <sys/time.h> 147 const void* pPanBuffer;
148 const void* pUpsampledSpectralBuffer;
183 } GDALPansharpenResampleJob;
193 std::vector<int> anInputBands{};
194 std::vector<GDALDataset*> aVDS{};
195 std::vector<GDALRasterBand*> aMSBands{};
196 int bPositiveWeights = TRUE;
198 int nKernelRadius = 0;
200 static void PansharpenJobThreadFunc(
void* pUserData);
201 static void PansharpenResampleJobThreadFunc(
void* pUserData);
203 template<
class WorkDataType,
class OutDataType>
void WeightedBroveyWithNoData(
204 const WorkDataType* pPanBuffer,
205 const WorkDataType* pUpsampledSpectralBuffer,
206 OutDataType* pDataBuf,
209 WorkDataType nMaxValue)
const;
210 template<
class WorkDataType,
class OutDataType,
int bHasBitDepth>
void WeightedBrovey3(
211 const WorkDataType* pPanBuffer,
212 const WorkDataType* pUpsampledSpectralBuffer,
213 OutDataType* pDataBuf,
216 WorkDataType nMaxValue)
const;
219 template<
class WorkDataType,
class OutDataType>
void WeightedBrovey(
220 const WorkDataType* pPanBuffer,
221 const WorkDataType* pUpsampledSpectralBuffer,
222 OutDataType* pDataBuf,
225 WorkDataType nMaxValue)
const;
226 template<
class WorkDataType>
CPLErr WeightedBrovey(
227 const WorkDataType* pPanBuffer,
228 const WorkDataType* pUpsampledSpectralBuffer,
233 WorkDataType nMaxValue)
const;
236 template<
class WorkDataType>
CPLErr WeightedBrovey(
237 const WorkDataType* pPanBuffer,
238 const WorkDataType* pUpsampledSpectralBuffer,
242 int nBandValues)
const;
243 template<
class T>
void WeightedBroveyPositiveWeights(
245 const T* pUpsampledSpectralBuffer,
251 template<
class T,
int NINPUT,
int NOUTPUT>
int WeightedBroveyPositiveWeightsInternal(
253 const T* pUpsampledSpectralBuffer,
260 template<
class T>
void WeightedBroveyGByteOrUInt16(
262 const T* pUpsampledSpectralBuffer,
269 const void* pPanBuffer,
270 const void* pUpsampledSpectralBuffer,
281 int nXSize,
int nYSize,
GDALDataType
Definition: gdal.h:60
Definition: gdalpansharpen.h:50
double dfMSShiftY
Shift in pixels of multispectral bands w.r.t panchromatic band, in Y direction.
Definition: gdalpansharpen.h:107
GDALPansharpenOptions * GDALCreatePansharpenOptions(void)
Create pansharpening options.
Definition: gdalpansharpen.cpp:68
GDALPansharpenAlg ePansharpenAlg
Definition: gdalpansharpen.h:58
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:337
unsigned int GUInt32
Unsigned int32 type.
Definition: cpl_port.h:207
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:128
double dfNoData
NoData value of the panchromatic and spectral bands (only taken into account if bHasNoData = TRUE)...
Definition: gdalpansharpen.h:97
int bHasNoData
Definition: gdalpansharpen.h:93
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:258
double dfMSShiftX
Shift in pixels of multispectral bands w.r.t panchromatic band, in X direction.
Definition: gdalpansharpen.h:104
Pansharpening operation class.
Definition: gdalpansharpen.h:188
GDALPansharpenAlg
Pansharpening algorithms.
Definition: gdalpansharpen.h:47
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:1802
int nWeightCount
Definition: gdalpansharpen.h:67
void * GDALPansharpenOperationH
Definition: gdalpansharpen.h:117
GDALPansharpenOptions * GDALClonePansharpenOptions(const GDALPansharpenOptions *psOptions)
Clone pansharpening options.
Definition: gdalpansharpen.cpp:113
int nThreads
Number of threads or -1 to mean ALL_CPUS.
Definition: gdalpansharpen.h:101
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:273
int nBitDepth
Definition: gdalpansharpen.h:64
CPLErr Initialize(const GDALPansharpenOptions *psOptions)
Initialize the pansharpening operation.
Definition: gdalpansharpen.cpp:193
Public (C callable) GDAL entry points.
int nInputSpectralBands
Definition: gdalpansharpen.h:76
void GDALDestroyPansharpenOperation(GDALPansharpenOperationH)
Destroy a pansharpening operation.
Definition: gdalpansharpen.cpp:1768
~GDALPansharpenOperation()
Pansharpening operation destructor.
Definition: gdalpansharpen.cpp:174
int * panOutPansharpenedBands
Definition: gdalpansharpen.h:90
double * padfWeights
Definition: gdalpansharpen.h:70
Pansharpening options.
Definition: gdalpansharpen.h:55
void GDALDestroyPansharpenOptions(GDALPansharpenOptions *)
Destroy pansharpening options.
Definition: gdalpansharpen.cpp:89
GDALRasterBandH * pahInputSpectralBands
Array of nInputSpectralBands input spectral bands.
Definition: gdalpansharpen.h:84
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:1044
GDALPansharpenOperation()
Pansharpening operation constructor.
Class to manage a pool of worker threads.
Pool of worker threads.
Definition: cpl_worker_thread_pool.h:75
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:335
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:339
GDALPansharpenOperationH GDALCreatePansharpenOperation(const GDALPansharpenOptions *)
Instantiate a pansharpening operation.
Definition: gdalpansharpen.cpp:1747
GDALRasterBandH hPanchroBand
Definition: gdalpansharpen.h:73
GDALRIOResampleAlg eResampleAlg
Definition: gdalpansharpen.h:61
CPLErr
Error category.
Definition: cpl_error.h:52
GDALPansharpenOptions * GetOptions()
Return options.
Definition: gdalpansharpen.cpp:1727
#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:989
int nOutPansharpenedBands
Definition: gdalpansharpen.h:87