MCPcopy Create free account
hub / github.com/OSGeo/gdal / GWKSumPreservingThread

Function GWKSumPreservingThread

alg/gdalwarpkernel.cpp:8685–9330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8683}
8684
8685static void GWKSumPreservingThread(void *pData)
8686{
8687 GWKJobStruct *psJob = static_cast<GWKJobStruct *>(pData);
8688 GDALWarpKernel *poWK = psJob->poWK;
8689 const int iYMin = psJob->iYMin;
8690 const int iYMax = psJob->iYMax;
8691 const bool bIsAffineNoRotation =
8692 GDALTransformIsAffineNoRotation(poWK->pfnTransformer,
8693 poWK->pTransformerArg) &&
8694 // for debug/testing purposes
8695 CPLTestBool(
8696 CPLGetConfigOption("GDAL_WARP_USE_AFFINE_OPTIMIZATION", "YES"));
8697 const bool bAvoidNoDataSingleBand =
8698 poWK->nBands == 1 ||
8699 !CPLTestBool(CSLFetchNameValueDef(poWK->papszWarpOptions,
8700 "UNIFIED_SRC_NODATA", "FALSE"));
8701
8702 const int nDstXSize = poWK->nDstXSize;
8703 const int nSrcXSize = poWK->nSrcXSize;
8704 const int nSrcYSize = poWK->nSrcYSize;
8705
8706 std::vector<double> adfX0(nSrcXSize + 1);
8707 std::vector<double> adfY0(nSrcXSize + 1);
8708 std::vector<double> adfZ0(nSrcXSize + 1);
8709 std::vector<double> adfX1(nSrcXSize + 1);
8710 std::vector<double> adfY1(nSrcXSize + 1);
8711 std::vector<double> adfZ1(nSrcXSize + 1);
8712 std::vector<int> abSuccess0(nSrcXSize + 1);
8713 std::vector<int> abSuccess1(nSrcXSize + 1);
8714
8715 CPLRectObj sGlobalBounds;
8716 sGlobalBounds.minx = -2 * poWK->dfXScale;
8717 sGlobalBounds.miny = iYMin - 2 * poWK->dfYScale;
8718 sGlobalBounds.maxx = nDstXSize + 2 * poWK->dfXScale;
8719 sGlobalBounds.maxy = iYMax + 2 * poWK->dfYScale;
8720 CPLQuadTree *hQuadTree = CPLQuadTreeCreate(&sGlobalBounds, nullptr);
8721
8722 struct SourcePixel
8723 {
8724 int iSrcX;
8725 int iSrcY;
8726
8727 // Coordinates of source pixel in target pixel coordinates
8728 double dfDstX0;
8729 double dfDstY0;
8730 double dfDstX1;
8731 double dfDstY1;
8732 double dfDstX2;
8733 double dfDstY2;
8734 double dfDstX3;
8735 double dfDstY3;
8736
8737 // Source pixel total area (might be larger than the one described
8738 // by above coordinates, if the pixel was crossing the antimeridian
8739 // and split)
8740 double dfArea;
8741 };
8742

Callers

nothing calls this directly

Calls 15

CPLTestBoolFunction · 0.85
CSLFetchNameValueDefFunction · 0.85
CPLQuadTreeCreateFunction · 0.85
CPLMaskGetFunction · 0.85
fabsFunction · 0.85
CPLDebugFunction · 0.85
getAreaFunction · 0.85
getIntersectionFunction · 0.85
CPLQuadTreeSearchFunction · 0.85
isConvexFunction · 0.85

Tested by

no test coverage detected