LCOV - code coverage report
Current view: top level - gcore - gdalproxydataset.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 97 151 64.2 %
Date: 2026-01-31 22:56:34 Functions: 42 82 51.2 %

          Line data    Source code
       1             : /******************************************************************************
       2             :  *
       3             :  * Project:  GDAL Core
       4             :  * Purpose:  A dataset and raster band classes that act as proxy for underlying
       5             :  *           GDALDataset* and GDALRasterBand*
       6             :  * Author:   Even Rouault <even dot rouault at spatialys.com>
       7             :  *
       8             :  ******************************************************************************
       9             :  * Copyright (c) 2008-2014, Even Rouault <even dot rouault at spatialys.com>
      10             :  *
      11             :  * SPDX-License-Identifier: MIT
      12             :  ****************************************************************************/
      13             : 
      14             : #include "cpl_port.h"
      15             : #include "gdal_proxy.h"
      16             : 
      17             : #include <cstddef>
      18             : 
      19             : #include "cpl_error.h"
      20             : #include "cpl_progress.h"
      21             : #include "cpl_virtualmem.h"
      22             : #include "gdal.h"
      23             : #include "gdal_priv.h"
      24             : 
      25             : /*! @cond Doxygen_Suppress */
      26             : /* ******************************************************************** */
      27             : /*                        GDALProxyDataset                              */
      28             : /* ******************************************************************** */
      29             : 
      30             : #define D_PROXY_METHOD_WITH_RET(retType, retErrValue, methodName, argList,     \
      31             :                                 argParams)                                     \
      32             :     retType GDALProxyDataset::methodName argList                               \
      33             :     {                                                                          \
      34             :         retType ret;                                                           \
      35             :         GDALDataset *poUnderlyingDataset = RefUnderlyingDataset();             \
      36             :         if (poUnderlyingDataset)                                               \
      37             :         {                                                                      \
      38             :             ret = poUnderlyingDataset->methodName argParams;                   \
      39             :             UnrefUnderlyingDataset(poUnderlyingDataset);                       \
      40             :         }                                                                      \
      41             :         else                                                                   \
      42             :         {                                                                      \
      43             :             ret = retErrValue;                                                 \
      44             :         }                                                                      \
      45             :         return ret;                                                            \
      46             :     }
      47             : 
      48        1046 : CPLErr GDALProxyDataset::IRasterIO(
      49             :     GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize,
      50             :     void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType,
      51             :     int nBandCount, BANDMAP_TYPE panBandMap, GSpacing nPixelSpace,
      52             :     GSpacing nLineSpace, GSpacing nBandSpace, GDALRasterIOExtraArg *psExtraArg)
      53             : {
      54             :     CPLErr ret;
      55        1046 :     GDALDataset *poUnderlyingDataset = RefUnderlyingDataset();
      56        1046 :     if (poUnderlyingDataset)
      57             :     {
      58             :         /* --------------------------------------------------------------------
      59             :          */
      60             :         /*      Do some validation of parameters. */
      61             :         /* --------------------------------------------------------------------
      62             :          */
      63        2092 :         if (nXOff + nXSize > poUnderlyingDataset->GetRasterXSize() ||
      64        1046 :             nYOff + nYSize > poUnderlyingDataset->GetRasterYSize())
      65             :         {
      66           0 :             ReportError(CE_Failure, CPLE_IllegalArg,
      67             :                         "Access window out of range in RasterIO().  Requested\n"
      68             :                         "(%d,%d) of size %dx%d on raster of %dx%d.",
      69             :                         nXOff, nYOff, nXSize, nYSize,
      70             :                         poUnderlyingDataset->GetRasterXSize(),
      71             :                         poUnderlyingDataset->GetRasterYSize());
      72           0 :             ret = CE_Failure;
      73             :         }
      74        1046 :         else if (panBandMap == nullptr &&
      75           0 :                  nBandCount > poUnderlyingDataset->GetRasterCount())
      76             :         {
      77           0 :             ReportError(CE_Failure, CPLE_IllegalArg,
      78             :                         "%s: nBandCount cannot be greater than %d", "IRasterIO",
      79             :                         poUnderlyingDataset->GetRasterCount());
      80           0 :             ret = CE_Failure;
      81             :         }
      82             :         else
      83             :         {
      84        1046 :             ret = CE_None;
      85        3809 :             for (int i = 0; i < nBandCount && ret == CE_None; ++i)
      86             :             {
      87        2763 :                 int iBand = (panBandMap != nullptr) ? panBandMap[i] : i + 1;
      88        2763 :                 if (iBand < 1 || iBand > poUnderlyingDataset->GetRasterCount())
      89             :                 {
      90           0 :                     ReportError(CE_Failure, CPLE_IllegalArg,
      91             :                                 "%s: panBandMap[%d] = %d, this band does not "
      92             :                                 "exist on dataset.",
      93             :                                 "IRasterIO", i, iBand);
      94           0 :                     ret = CE_Failure;
      95             :                 }
      96             : 
      97        5526 :                 if (ret == CE_None &&
      98        2763 :                     poUnderlyingDataset->GetRasterBand(iBand) == nullptr)
      99             :                 {
     100           0 :                     ReportError(CE_Failure, CPLE_IllegalArg,
     101             :                                 "%s: panBandMap[%d]=%d, this band should exist "
     102             :                                 "but is NULL!",
     103             :                                 "IRasterIO", i, iBand);
     104           0 :                     ret = CE_Failure;
     105             :                 }
     106             :             }
     107        1046 :             if (ret != CE_Failure)
     108             :             {
     109        1046 :                 ret = poUnderlyingDataset->IRasterIO(
     110             :                     eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize,
     111             :                     nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace,
     112        1046 :                     nLineSpace, nBandSpace, psExtraArg);
     113             :             }
     114             :         }
     115        1046 :         UnrefUnderlyingDataset(poUnderlyingDataset);
     116             :     }
     117             :     else
     118             :     {
     119           0 :         ret = CE_Failure;
     120             :     }
     121        1046 :     return ret;
     122             : }
     123             : 
     124        1059 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, Close,
     125             :                         (GDALProgressFunc pfnProgress, void *pProgressData),
     126             :                         (pfnProgress, pProgressData))
     127             : 
     128           0 : D_PROXY_METHOD_WITH_RET(bool, false, GetCloseReportsProgress, () const, ())
     129             : 
     130           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, BlockBasedRasterIO,
     131             :                         (GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
     132             :                          int nYSize, void *pData, int nBufXSize, int nBufYSize,
     133             :                          GDALDataType eBufType, int nBandCount,
     134             :                          const int *panBandMap, GSpacing nPixelSpace,
     135             :                          GSpacing nLineSpace, GSpacing nBandSpace,
     136             :                          GDALRasterIOExtraArg *psExtraArg),
     137             :                         (eRWFlag, nXOff, nYOff, nXSize, nYSize, pData,
     138             :                          nBufXSize, nBufYSize, eBufType, nBandCount, panBandMap,
     139             :                          nPixelSpace, nLineSpace, nBandSpace, psExtraArg))
     140             : 
     141           2 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, IBuildOverviews,
     142             :                         (const char *pszResampling, int nOverviews,
     143             :                          const int *panOverviewList, int nListBands,
     144             :                          const int *panBandList, GDALProgressFunc pfnProgress,
     145             :                          void *pProgressData, CSLConstList papszOptions),
     146             :                         (pszResampling, nOverviews, panOverviewList, nListBands,
     147             :                          panBandList, pfnProgress, pProgressData, papszOptions))
     148             : 
     149           0 : D_PROXY_METHOD_WITH_RET(CPLStringList, CPLStringList(), GetCompressionFormats,
     150             :                         (int nXOff, int nYOff, int nXSize, int nYSize,
     151             :                          int nBandCount, const int *panBandList),
     152             :                         (nXOff, nYOff, nXSize, nYSize, nBandCount, panBandList))
     153             : 
     154           1 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, ReadCompressedData,
     155             :                         (const char *pszFormat, int nXOff, int nYOff,
     156             :                          int nXSize, int nYSize, int nBandCount,
     157             :                          const int *panBandList, void **ppBuffer,
     158             :                          size_t *pnBufferSize, char **ppszDetailedFormat),
     159             :                         (pszFormat, nXOff, nYOff, nXSize, nYSize, nBandCount,
     160             :                          panBandList, ppBuffer, pnBufferSize,
     161             :                          ppszDetailedFormat))
     162             : 
     163           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_None, FlushCache, (bool bAtClosing),
     164             :                         (bAtClosing))
     165             : 
     166           1 : D_PROXY_METHOD_WITH_RET(char **, nullptr, GetMetadataDomainList, (), ())
     167          94 : D_PROXY_METHOD_WITH_RET(CSLConstList, nullptr, GetMetadata,
     168             :                         (const char *pszDomain), (pszDomain))
     169           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadata,
     170             :                         (CSLConstList papszMetadata, const char *pszDomain),
     171             :                         (papszMetadata, pszDomain))
     172          34 : D_PROXY_METHOD_WITH_RET(const char *, nullptr, GetMetadataItem,
     173             :                         (const char *pszName, const char *pszDomain),
     174             :                         (pszName, pszDomain))
     175           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadataItem,
     176             :                         (const char *pszName, const char *pszValue,
     177             :                          const char *pszDomain),
     178             :                         (pszName, pszValue, pszDomain))
     179             : 
     180         133 : D_PROXY_METHOD_WITH_RET(const OGRSpatialReference *, nullptr, GetSpatialRef,
     181             :                         () const, ())
     182          32 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetSpatialRef,
     183             :                         (const OGRSpatialReference *poSRS), (poSRS))
     184         113 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetGeoTransform,
     185             :                         (GDALGeoTransform & gt) const, (gt))
     186          33 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetGeoTransform,
     187             :                         (const GDALGeoTransform &gt), (gt))
     188             : 
     189           0 : D_PROXY_METHOD_WITH_RET(void *, nullptr, GetInternalHandle, (const char *arg1),
     190             :                         (arg1))
     191          50 : D_PROXY_METHOD_WITH_RET(GDALDriver *, nullptr, GetDriver, (), ())
     192           0 : D_PROXY_METHOD_WITH_RET(char **, nullptr, GetFileList, (), ())
     193         422 : D_PROXY_METHOD_WITH_RET(int, 0, GetGCPCount, (), ())
     194           0 : D_PROXY_METHOD_WITH_RET(const OGRSpatialReference *, nullptr, GetGCPSpatialRef,
     195             :                         () const, ())
     196           0 : D_PROXY_METHOD_WITH_RET(const GDAL_GCP *, nullptr, GetGCPs, (), ())
     197           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetGCPs,
     198             :                         (int nGCPCount, const GDAL_GCP *pasGCPList,
     199             :                          const OGRSpatialReference *poGCP_SRS),
     200             :                         (nGCPCount, pasGCPList, poGCP_SRS))
     201         109 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, AdviseRead,
     202             :                         (int nXOff, int nYOff, int nXSize, int nYSize,
     203             :                          int nBufXSize, int nBufYSize, GDALDataType eDT,
     204             :                          int nBandCount, int *panBandList,
     205             :                          CSLConstList papszOptions),
     206             :                         (nXOff, nYOff, nXSize, nYSize, nBufXSize, nBufYSize,
     207             :                          eDT, nBandCount, panBandList, papszOptions))
     208           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, CreateMaskBand, (int nFlagsIn),
     209             :                         (nFlagsIn))
     210             : 
     211             : /************************************************************************/
     212             : /*                       UnrefUnderlyingDataset()                       */
     213             : /************************************************************************/
     214             : 
     215        1120 : void GDALProxyDataset::UnrefUnderlyingDataset(
     216             :     GDALDataset * /* poUnderlyingDataset */) const
     217             : {
     218        1120 : }
     219             : 
     220             : /* ******************************************************************** */
     221             : /*                        GDALProxyRasterBand                           */
     222             : /* ******************************************************************** */
     223             : 
     224             : #define RB_PROXY_METHOD_WITH_RET(retType, retErrValue, methodName, argList,    \
     225             :                                  argParams)                                    \
     226             :     retType GDALProxyRasterBand::methodName argList                            \
     227             :     {                                                                          \
     228             :         retType ret;                                                           \
     229             :         GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();                 \
     230             :         if (poSrcBand)                                                         \
     231             :         {                                                                      \
     232             :             ret = poSrcBand->methodName argParams;                             \
     233             :             UnrefUnderlyingRasterBand(poSrcBand);                              \
     234             :         }                                                                      \
     235             :         else                                                                   \
     236             :         {                                                                      \
     237             :             ret = retErrValue;                                                 \
     238             :         }                                                                      \
     239             :         return ret;                                                            \
     240             :     }
     241             : 
     242             : #define RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK(                              \
     243             :     retType, retErrValue, methodName, argList, argParams)                      \
     244             :     retType GDALProxyRasterBand::methodName argList                            \
     245             :     {                                                                          \
     246             :         retType ret;                                                           \
     247             :         GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();                 \
     248             :         if (poSrcBand)                                                         \
     249             :         {                                                                      \
     250             :             if (!poSrcBand->InitBlockInfo())                                   \
     251             :                 ret = CE_Failure;                                              \
     252             :             else                                                               \
     253             :             {                                                                  \
     254             :                 int nSrcBlockXSize, nSrcBlockYSize;                            \
     255             :                 poSrcBand->GetBlockSize(&nSrcBlockXSize, &nSrcBlockYSize);     \
     256             :                 if (poSrcBand->GetRasterDataType() != GetRasterDataType())     \
     257             :                 {                                                              \
     258             :                     CPLError(                                                  \
     259             :                         CE_Failure, CPLE_AppDefined,                           \
     260             :                         "Inconsistent datatype between proxy and source");     \
     261             :                     ret = CE_Failure;                                          \
     262             :                 }                                                              \
     263             :                 else if (nSrcBlockXSize != nBlockXSize ||                      \
     264             :                          nSrcBlockYSize != nBlockYSize)                        \
     265             :                 {                                                              \
     266             :                     CPLError(CE_Failure, CPLE_AppDefined,                      \
     267             :                              "Inconsistent block dimensions between proxy "    \
     268             :                              "and source");                                    \
     269             :                     ret = CE_Failure;                                          \
     270             :                 }                                                              \
     271             :                 else                                                           \
     272             :                 {                                                              \
     273             :                     ret = poSrcBand->methodName argParams;                     \
     274             :                 }                                                              \
     275             :             }                                                                  \
     276             :             UnrefUnderlyingRasterBand(poSrcBand);                              \
     277             :         }                                                                      \
     278             :         else                                                                   \
     279             :         {                                                                      \
     280             :             ret = retErrValue;                                                 \
     281             :         }                                                                      \
     282             :         return ret;                                                            \
     283             :     }
     284             : 
     285           0 : RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK(CPLErr, CE_Failure, IReadBlock,
     286             :                                          (int nXBlockOff, int nYBlockOff,
     287             :                                           void *pImage),
     288             :                                          (nXBlockOff, nYBlockOff, pImage))
     289           0 : RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK(CPLErr, CE_Failure, IWriteBlock,
     290             :                                          (int nXBlockOff, int nYBlockOff,
     291             :                                           void *pImage),
     292             :                                          (nXBlockOff, nYBlockOff, pImage))
     293             : 
     294      872375 : CPLErr GDALProxyRasterBand::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff,
     295             :                                       int nXSize, int nYSize, void *pData,
     296             :                                       int nBufXSize, int nBufYSize,
     297             :                                       GDALDataType eBufType,
     298             :                                       GSpacing nPixelSpace, GSpacing nLineSpace,
     299             :                                       GDALRasterIOExtraArg *psExtraArg)
     300             : {
     301             :     CPLErr ret;
     302      872375 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     303      872375 :     if (poSrcBand)
     304             :     {
     305             :         /* --------------------------------------------------------------------
     306             :          */
     307             :         /*      Do some validation of parameters. */
     308             :         /* --------------------------------------------------------------------
     309             :          */
     310     1744740 :         if (nXOff + nXSize > poSrcBand->GetXSize() ||
     311      872368 :             nYOff + nYSize > poSrcBand->GetYSize())
     312             :         {
     313           0 :             ReportError(CE_Failure, CPLE_IllegalArg,
     314             :                         "Access window out of range in RasterIO().  Requested\n"
     315             :                         "(%d,%d) of size %dx%d on raster of %dx%d.",
     316             :                         nXOff, nYOff, nXSize, nYSize, poSrcBand->GetXSize(),
     317             :                         poSrcBand->GetYSize());
     318           0 :             ret = CE_Failure;
     319             :         }
     320             :         else
     321             :         {
     322      872368 :             ret = poSrcBand->IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize,
     323             :                                        pData, nBufXSize, nBufYSize, eBufType,
     324      872368 :                                        nPixelSpace, nLineSpace, psExtraArg);
     325             :         }
     326      872368 :         UnrefUnderlyingRasterBand(poSrcBand);
     327             :     }
     328             :     else
     329             :     {
     330           7 :         ret = CE_Failure;
     331             :     }
     332      872375 :     return ret;
     333             : }
     334             : 
     335          43 : int GDALProxyRasterBand::IGetDataCoverageStatus(int nXOff, int nYOff,
     336             :                                                 int nXSize, int nYSize,
     337             :                                                 int nMaskFlagStop,
     338             :                                                 double *pdfDataPct)
     339             : {
     340          43 :     if (pdfDataPct)
     341           4 :         *pdfDataPct = 0.0;
     342          43 :     int ret = GDAL_DATA_COVERAGE_STATUS_UNIMPLEMENTED |
     343             :               GDAL_DATA_COVERAGE_STATUS_EMPTY;
     344          43 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     345          43 :     if (poSrcBand)
     346             :     {
     347          43 :         ret = poSrcBand->GetDataCoverageStatus(nXOff, nYOff, nXSize, nYSize,
     348             :                                                nMaskFlagStop, pdfDataPct);
     349          43 :         UnrefUnderlyingRasterBand(poSrcBand);
     350             :     }
     351          43 :     return ret;
     352             : }
     353             : 
     354           0 : RB_PROXY_METHOD_WITH_RET(char **, nullptr, GetMetadataDomainList, (), ())
     355         103 : RB_PROXY_METHOD_WITH_RET(CSLConstList, nullptr, GetMetadata,
     356             :                          (const char *pszDomain), (pszDomain))
     357           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadata,
     358             :                          (CSLConstList papszMetadata, const char *pszDomain),
     359             :                          (papszMetadata, pszDomain))
     360             : 
     361         310 : const char *GDALProxyRasterBand::GetMetadataItem(const char *pszKey,
     362             :                                                  const char *pszDomain)
     363             : {
     364         310 :     const char *pszRet = nullptr;
     365         310 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     366         310 :     if (poSrcBand)
     367             :     {
     368         310 :         if (!m_bEnablePixelTypeSignedByteWarning)
     369           0 :             poSrcBand->EnablePixelTypeSignedByteWarning(false);
     370         310 :         pszRet = poSrcBand->GetMetadataItem(pszKey, pszDomain);
     371         310 :         poSrcBand->EnablePixelTypeSignedByteWarning(true);
     372         310 :         UnrefUnderlyingRasterBand(poSrcBand);
     373             :     }
     374         310 :     return pszRet;
     375             : }
     376             : 
     377           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadataItem,
     378             :                          (const char *pszName, const char *pszValue,
     379             :                           const char *pszDomain),
     380             :                          (pszName, pszValue, pszDomain))
     381             : 
     382           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBlock *, nullptr, GetLockedBlockRef,
     383             :                          (int nXBlockOff, int nYBlockOff, int bJustInitialize),
     384             :                          (nXBlockOff, nYBlockOff, bJustInitialize))
     385             : 
     386           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBlock *, nullptr, TryGetLockedBlockRef,
     387             :                          (int nXBlockOff, int nYBlockOff),
     388             :                          (nXBlockOff, nYBlockOff))
     389             : 
     390           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, FlushBlock,
     391             :                          (int nXBlockOff, int nYBlockOff, int bWriteDirtyBlock),
     392             :                          (nXBlockOff, nYBlockOff, bWriteDirtyBlock))
     393             : 
     394         172 : CPLErr GDALProxyRasterBand::FlushCache(bool bAtClosing)
     395             : {
     396             :     // We need to make sure that all cached bocks at the proxy level are
     397             :     // first flushed
     398         172 :     CPLErr ret = GDALRasterBand::FlushCache(bAtClosing);
     399         172 :     if (ret == CE_None)
     400             :     {
     401         172 :         GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     402         172 :         if (poSrcBand)
     403             :         {
     404         172 :             ret = poSrcBand->FlushCache(bAtClosing);
     405         172 :             UnrefUnderlyingRasterBand(poSrcBand);
     406             :         }
     407             :         else
     408             :         {
     409           0 :             ret = CE_Failure;
     410             :         }
     411             :     }
     412         172 :     return ret;
     413             : }
     414             : 
     415          89 : RB_PROXY_METHOD_WITH_RET(char **, nullptr, GetCategoryNames, (), ())
     416        1111 : RB_PROXY_METHOD_WITH_RET(double, 0, GetNoDataValue, (int *pbSuccess),
     417             :                          (pbSuccess))
     418          18 : RB_PROXY_METHOD_WITH_RET(double, 0, GetMinimum, (int *pbSuccess), (pbSuccess))
     419          17 : RB_PROXY_METHOD_WITH_RET(double, 0, GetMaximum, (int *pbSuccess), (pbSuccess))
     420         109 : RB_PROXY_METHOD_WITH_RET(double, 0, GetOffset, (int *pbSuccess), (pbSuccess))
     421         109 : RB_PROXY_METHOD_WITH_RET(double, 0, GetScale, (int *pbSuccess), (pbSuccess))
     422          47 : RB_PROXY_METHOD_WITH_RET(const char *, nullptr, GetUnitType, (), ())
     423        1225 : RB_PROXY_METHOD_WITH_RET(GDALColorInterp, GCI_Undefined, GetColorInterpretation,
     424             :                          (), ())
     425         108 : RB_PROXY_METHOD_WITH_RET(GDALColorTable *, nullptr, GetColorTable, (), ())
     426           6 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, Fill,
     427             :                          (double dfRealValue, double dfImaginaryValue),
     428             :                          (dfRealValue, dfImaginaryValue))
     429             : 
     430           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetCategoryNames, (char **arg),
     431             :                          (arg))
     432           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetNoDataValue, (double arg),
     433             :                          (arg))
     434           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, DeleteNoDataValue, (), ())
     435           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetColorTable,
     436             :                          (GDALColorTable * arg), (arg))
     437           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetColorInterpretation,
     438             :                          (GDALColorInterp arg), (arg))
     439           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetOffset, (double arg), (arg))
     440           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetScale, (double arg), (arg))
     441           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetUnitType, (const char *arg),
     442             :                          (arg))
     443             : 
     444           4 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetStatistics,
     445             :                          (int bApproxOK, int bForce, double *pdfMin,
     446             :                           double *pdfMax, double *pdfMean, double *padfStdDev),
     447             :                          (bApproxOK, bForce, pdfMin, pdfMax, pdfMean,
     448             :                           padfStdDev))
     449           7 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, ComputeStatistics,
     450             :                          (int bApproxOK, double *pdfMin, double *pdfMax,
     451             :                           double *pdfMean, double *pdfStdDev,
     452             :                           GDALProgressFunc pfn, void *pProgressData),
     453             :                          (bApproxOK, pdfMin, pdfMax, pdfMean, pdfStdDev, pfn,
     454             :                           pProgressData))
     455           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetStatistics,
     456             :                          (double dfMin, double dfMax, double dfMean,
     457             :                           double dfStdDev),
     458             :                          (dfMin, dfMax, dfMean, dfStdDev))
     459          20 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, ComputeRasterMinMax,
     460             :                          (int arg1, double *arg2), (arg1, arg2))
     461             : 
     462           3 : RB_PROXY_METHOD_WITH_RET(int, 0, HasArbitraryOverviews, (), ())
     463        1058 : RB_PROXY_METHOD_WITH_RET(int, 0, GetOverviewCount, (), ())
     464           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBand *, nullptr, GetOverview, (int arg1),
     465             :                          (arg1))
     466           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBand *, nullptr, GetRasterSampleOverview,
     467             :                          (GUIntBig arg1), (arg1))
     468             : 
     469           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, BuildOverviews,
     470             :                          (const char *arg1, int arg2, const int *arg3,
     471             :                           GDALProgressFunc arg4, void *arg5,
     472             :                           CSLConstList papszOptions),
     473             :                          (arg1, arg2, arg3, arg4, arg5, papszOptions))
     474             : 
     475          45 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, AdviseRead,
     476             :                          (int nXOff, int nYOff, int nXSize, int nYSize,
     477             :                           int nBufXSize, int nBufYSize, GDALDataType eDT,
     478             :                           CSLConstList papszOptions),
     479             :                          (nXOff, nYOff, nXSize, nYSize, nBufXSize, nBufYSize,
     480             :                           eDT, papszOptions))
     481             : 
     482           2 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetHistogram,
     483             :                          (double dfMin, double dfMax, int nBuckets,
     484             :                           GUIntBig *panHistogram, int bIncludeOutOfRange,
     485             :                           int bApproxOK, GDALProgressFunc pfn,
     486             :                           void *pProgressData),
     487             :                          (dfMin, dfMax, nBuckets, panHistogram,
     488             :                           bIncludeOutOfRange, bApproxOK, pfn, pProgressData))
     489             : 
     490           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetDefaultHistogram,
     491             :                          (double *pdfMin, double *pdfMax, int *pnBuckets,
     492             :                           GUIntBig **ppanHistogram, int bForce,
     493             :                           GDALProgressFunc pfn, void *pProgressData),
     494             :                          (pdfMin, pdfMax, pnBuckets, ppanHistogram, bForce, pfn,
     495             :                           pProgressData))
     496             : 
     497           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetDefaultHistogram,
     498             :                          (double dfMin, double dfMax, int nBuckets,
     499             :                           GUIntBig *panHistogram),
     500             :                          (dfMin, dfMax, nBuckets, panHistogram))
     501             : 
     502         100 : RB_PROXY_METHOD_WITH_RET(GDALRasterAttributeTable *, nullptr, GetDefaultRAT, (),
     503             :                          ())
     504           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetDefaultRAT,
     505             :                          (const GDALRasterAttributeTable *arg1), (arg1))
     506             : 
     507           5 : RB_PROXY_METHOD_WITH_RET(GDALRasterBand *, nullptr, GetMaskBand, (), ())
     508        1637 : RB_PROXY_METHOD_WITH_RET(int, 0, GetMaskFlags, (), ())
     509           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, CreateMaskBand, (int nFlagsIn),
     510             :                          (nFlagsIn))
     511           0 : RB_PROXY_METHOD_WITH_RET(bool, false, IsMaskBand, () const, ())
     512           0 : RB_PROXY_METHOD_WITH_RET(GDALMaskValueRange, GMVR_UNKNOWN, GetMaskValueRange,
     513             :                          () const, ())
     514             : 
     515           0 : RB_PROXY_METHOD_WITH_RET(CPLVirtualMem *, nullptr, GetVirtualMemAuto,
     516             :                          (GDALRWFlag eRWFlag, int *pnPixelSpace,
     517             :                           GIntBig *pnLineSpace, CSLConstList papszOptions),
     518             :                          (eRWFlag, pnPixelSpace, pnLineSpace, papszOptions))
     519             : 
     520           0 : RB_PROXY_METHOD_WITH_RET(
     521             :     CPLErr, CE_Failure, InterpolateAtPoint,
     522             :     (double dfPixel, double dfLine, GDALRIOResampleAlg eInterpolation,
     523             :      double *pdfRealValue, double *pdfImagValue = nullptr) const,
     524             :     (dfPixel, dfLine, eInterpolation, pdfRealValue, pdfImagValue))
     525             : 
     526         170 : void GDALProxyRasterBand::EnablePixelTypeSignedByteWarning(bool b)
     527             : {
     528         170 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     529         170 :     if (poSrcBand)
     530             :     {
     531         170 :         poSrcBand->EnablePixelTypeSignedByteWarning(b);
     532         170 :         UnrefUnderlyingRasterBand(poSrcBand);
     533             :     }
     534         170 : }
     535             : 
     536             : /************************************************************************/
     537             : /*                     UnrefUnderlyingRasterBand()                      */
     538             : /************************************************************************/
     539             : 
     540        3668 : void GDALProxyRasterBand::UnrefUnderlyingRasterBand(
     541             :     GDALRasterBand * /* poUnderlyingRasterBand */) const
     542             : {
     543        3668 : }
     544             : 
     545             : /*! @endcond */

Generated by: LCOV version 1.14