LCOV - code coverage report
Current view: top level - gcore - gdalproxydataset.cpp (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 95 151 62.9 %
Date: 2025-12-17 16:19:51 Functions: 40 82 48.8 %

          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        1045 : 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        1045 :     GDALDataset *poUnderlyingDataset = RefUnderlyingDataset();
      56        1045 :     if (poUnderlyingDataset)
      57             :     {
      58             :         /* --------------------------------------------------------------------
      59             :          */
      60             :         /*      Do some validation of parameters. */
      61             :         /* --------------------------------------------------------------------
      62             :          */
      63        2090 :         if (nXOff + nXSize > poUnderlyingDataset->GetRasterXSize() ||
      64        1045 :             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        1045 :         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        1045 :             ret = CE_None;
      85        3805 :             for (int i = 0; i < nBandCount && ret == CE_None; ++i)
      86             :             {
      87        2760 :                 int iBand = (panBandMap != nullptr) ? panBandMap[i] : i + 1;
      88        2760 :                 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        5520 :                 if (ret == CE_None &&
      98        2760 :                     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        1045 :             if (ret != CE_Failure)
     108             :             {
     109        1045 :                 ret = poUnderlyingDataset->IRasterIO(
     110             :                     eRWFlag, nXOff, nYOff, nXSize, nYSize, pData, nBufXSize,
     111             :                     nBufYSize, eBufType, nBandCount, panBandMap, nPixelSpace,
     112        1045 :                     nLineSpace, nBandSpace, psExtraArg);
     113             :             }
     114             :         }
     115        1045 :         UnrefUnderlyingDataset(poUnderlyingDataset);
     116             :     }
     117             :     else
     118             :     {
     119           0 :         ret = CE_Failure;
     120             :     }
     121        1045 :     return ret;
     122             : }
     123             : 
     124          58 : 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           0 : 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           0 : D_PROXY_METHOD_WITH_RET(char **, nullptr, GetMetadataDomainList, (), ())
     167          92 : D_PROXY_METHOD_WITH_RET(char **, nullptr, GetMetadata, (const char *pszDomain),
     168             :                         (pszDomain))
     169           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadata,
     170             :                         (char **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, char **papszOptions),
     205             :                         (nXOff, nYOff, nXSize, nYSize, nBufXSize, nBufYSize,
     206             :                          eDT, nBandCount, panBandList, papszOptions))
     207           0 : D_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, CreateMaskBand, (int nFlagsIn),
     208             :                         (nFlagsIn))
     209             : 
     210             : /************************************************************************/
     211             : /*                    UnrefUnderlyingDataset()                        */
     212             : /************************************************************************/
     213             : 
     214         114 : void GDALProxyDataset::UnrefUnderlyingDataset(
     215             :     GDALDataset * /* poUnderlyingDataset */) const
     216             : {
     217         114 : }
     218             : 
     219             : /* ******************************************************************** */
     220             : /*                        GDALProxyRasterBand                           */
     221             : /* ******************************************************************** */
     222             : 
     223             : #define RB_PROXY_METHOD_WITH_RET(retType, retErrValue, methodName, argList,    \
     224             :                                  argParams)                                    \
     225             :     retType GDALProxyRasterBand::methodName argList                            \
     226             :     {                                                                          \
     227             :         retType ret;                                                           \
     228             :         GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();                 \
     229             :         if (poSrcBand)                                                         \
     230             :         {                                                                      \
     231             :             ret = poSrcBand->methodName argParams;                             \
     232             :             UnrefUnderlyingRasterBand(poSrcBand);                              \
     233             :         }                                                                      \
     234             :         else                                                                   \
     235             :         {                                                                      \
     236             :             ret = retErrValue;                                                 \
     237             :         }                                                                      \
     238             :         return ret;                                                            \
     239             :     }
     240             : 
     241             : #define RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK(                              \
     242             :     retType, retErrValue, methodName, argList, argParams)                      \
     243             :     retType GDALProxyRasterBand::methodName argList                            \
     244             :     {                                                                          \
     245             :         retType ret;                                                           \
     246             :         GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();                 \
     247             :         if (poSrcBand)                                                         \
     248             :         {                                                                      \
     249             :             if (!poSrcBand->InitBlockInfo())                                   \
     250             :                 ret = CE_Failure;                                              \
     251             :             else                                                               \
     252             :             {                                                                  \
     253             :                 int nSrcBlockXSize, nSrcBlockYSize;                            \
     254             :                 poSrcBand->GetBlockSize(&nSrcBlockXSize, &nSrcBlockYSize);     \
     255             :                 if (poSrcBand->GetRasterDataType() != GetRasterDataType())     \
     256             :                 {                                                              \
     257             :                     CPLError(                                                  \
     258             :                         CE_Failure, CPLE_AppDefined,                           \
     259             :                         "Inconsistent datatype between proxy and source");     \
     260             :                     ret = CE_Failure;                                          \
     261             :                 }                                                              \
     262             :                 else if (nSrcBlockXSize != nBlockXSize ||                      \
     263             :                          nSrcBlockYSize != nBlockYSize)                        \
     264             :                 {                                                              \
     265             :                     CPLError(CE_Failure, CPLE_AppDefined,                      \
     266             :                              "Inconsistent block dimensions between proxy "    \
     267             :                              "and source");                                    \
     268             :                     ret = CE_Failure;                                          \
     269             :                 }                                                              \
     270             :                 else                                                           \
     271             :                 {                                                              \
     272             :                     ret = poSrcBand->methodName argParams;                     \
     273             :                 }                                                              \
     274             :             }                                                                  \
     275             :             UnrefUnderlyingRasterBand(poSrcBand);                              \
     276             :         }                                                                      \
     277             :         else                                                                   \
     278             :         {                                                                      \
     279             :             ret = retErrValue;                                                 \
     280             :         }                                                                      \
     281             :         return ret;                                                            \
     282             :     }
     283             : 
     284           0 : RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK(CPLErr, CE_Failure, IReadBlock,
     285             :                                          (int nXBlockOff, int nYBlockOff,
     286             :                                           void *pImage),
     287             :                                          (nXBlockOff, nYBlockOff, pImage))
     288           0 : RB_PROXY_METHOD_WITH_RET_WITH_INIT_BLOCK(CPLErr, CE_Failure, IWriteBlock,
     289             :                                          (int nXBlockOff, int nYBlockOff,
     290             :                                           void *pImage),
     291             :                                          (nXBlockOff, nYBlockOff, pImage))
     292             : 
     293      872276 : CPLErr GDALProxyRasterBand::IRasterIO(GDALRWFlag eRWFlag, int nXOff, int nYOff,
     294             :                                       int nXSize, int nYSize, void *pData,
     295             :                                       int nBufXSize, int nBufYSize,
     296             :                                       GDALDataType eBufType,
     297             :                                       GSpacing nPixelSpace, GSpacing nLineSpace,
     298             :                                       GDALRasterIOExtraArg *psExtraArg)
     299             : {
     300             :     CPLErr ret;
     301      872276 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     302      872276 :     if (poSrcBand)
     303             :     {
     304             :         /* --------------------------------------------------------------------
     305             :          */
     306             :         /*      Do some validation of parameters. */
     307             :         /* --------------------------------------------------------------------
     308             :          */
     309     1744540 :         if (nXOff + nXSize > poSrcBand->GetXSize() ||
     310      872269 :             nYOff + nYSize > poSrcBand->GetYSize())
     311             :         {
     312           0 :             ReportError(CE_Failure, CPLE_IllegalArg,
     313             :                         "Access window out of range in RasterIO().  Requested\n"
     314             :                         "(%d,%d) of size %dx%d on raster of %dx%d.",
     315             :                         nXOff, nYOff, nXSize, nYSize, poSrcBand->GetXSize(),
     316             :                         poSrcBand->GetYSize());
     317           0 :             ret = CE_Failure;
     318             :         }
     319             :         else
     320             :         {
     321      872269 :             ret = poSrcBand->IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize,
     322             :                                        pData, nBufXSize, nBufYSize, eBufType,
     323      872269 :                                        nPixelSpace, nLineSpace, psExtraArg);
     324             :         }
     325      872269 :         UnrefUnderlyingRasterBand(poSrcBand);
     326             :     }
     327             :     else
     328             :     {
     329           7 :         ret = CE_Failure;
     330             :     }
     331      872276 :     return ret;
     332             : }
     333             : 
     334          43 : int GDALProxyRasterBand::IGetDataCoverageStatus(int nXOff, int nYOff,
     335             :                                                 int nXSize, int nYSize,
     336             :                                                 int nMaskFlagStop,
     337             :                                                 double *pdfDataPct)
     338             : {
     339          43 :     if (pdfDataPct)
     340           4 :         *pdfDataPct = 0.0;
     341          43 :     int ret = GDAL_DATA_COVERAGE_STATUS_UNIMPLEMENTED |
     342             :               GDAL_DATA_COVERAGE_STATUS_EMPTY;
     343          43 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     344          43 :     if (poSrcBand)
     345             :     {
     346          43 :         ret = poSrcBand->GetDataCoverageStatus(nXOff, nYOff, nXSize, nYSize,
     347             :                                                nMaskFlagStop, pdfDataPct);
     348          43 :         UnrefUnderlyingRasterBand(poSrcBand);
     349             :     }
     350          43 :     return ret;
     351             : }
     352             : 
     353           0 : RB_PROXY_METHOD_WITH_RET(char **, nullptr, GetMetadataDomainList, (), ())
     354         103 : RB_PROXY_METHOD_WITH_RET(char **, nullptr, GetMetadata, (const char *pszDomain),
     355             :                          (pszDomain))
     356           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadata,
     357             :                          (char **papszMetadata, const char *pszDomain),
     358             :                          (papszMetadata, pszDomain))
     359             : 
     360         310 : const char *GDALProxyRasterBand::GetMetadataItem(const char *pszKey,
     361             :                                                  const char *pszDomain)
     362             : {
     363         310 :     const char *pszRet = nullptr;
     364         310 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     365         310 :     if (poSrcBand)
     366             :     {
     367         310 :         if (!m_bEnablePixelTypeSignedByteWarning)
     368           0 :             poSrcBand->EnablePixelTypeSignedByteWarning(false);
     369         310 :         pszRet = poSrcBand->GetMetadataItem(pszKey, pszDomain);
     370         310 :         poSrcBand->EnablePixelTypeSignedByteWarning(true);
     371         310 :         UnrefUnderlyingRasterBand(poSrcBand);
     372             :     }
     373         310 :     return pszRet;
     374             : }
     375             : 
     376           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetMetadataItem,
     377             :                          (const char *pszName, const char *pszValue,
     378             :                           const char *pszDomain),
     379             :                          (pszName, pszValue, pszDomain))
     380             : 
     381           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBlock *, nullptr, GetLockedBlockRef,
     382             :                          (int nXBlockOff, int nYBlockOff, int bJustInitialize),
     383             :                          (nXBlockOff, nYBlockOff, bJustInitialize))
     384             : 
     385           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBlock *, nullptr, TryGetLockedBlockRef,
     386             :                          (int nXBlockOff, int nYBlockOff),
     387             :                          (nXBlockOff, nYBlockOff))
     388             : 
     389           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, FlushBlock,
     390             :                          (int nXBlockOff, int nYBlockOff, int bWriteDirtyBlock),
     391             :                          (nXBlockOff, nYBlockOff, bWriteDirtyBlock))
     392             : 
     393         172 : CPLErr GDALProxyRasterBand::FlushCache(bool bAtClosing)
     394             : {
     395             :     // We need to make sure that all cached bocks at the proxy level are
     396             :     // first flushed
     397         172 :     CPLErr ret = GDALRasterBand::FlushCache(bAtClosing);
     398         172 :     if (ret == CE_None)
     399             :     {
     400         172 :         GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     401         172 :         if (poSrcBand)
     402             :         {
     403         172 :             ret = poSrcBand->FlushCache(bAtClosing);
     404         172 :             UnrefUnderlyingRasterBand(poSrcBand);
     405             :         }
     406             :         else
     407             :         {
     408           0 :             ret = CE_Failure;
     409             :         }
     410             :     }
     411         172 :     return ret;
     412             : }
     413             : 
     414          89 : RB_PROXY_METHOD_WITH_RET(char **, nullptr, GetCategoryNames, (), ())
     415        1108 : RB_PROXY_METHOD_WITH_RET(double, 0, GetNoDataValue, (int *pbSuccess),
     416             :                          (pbSuccess))
     417          18 : RB_PROXY_METHOD_WITH_RET(double, 0, GetMinimum, (int *pbSuccess), (pbSuccess))
     418          17 : RB_PROXY_METHOD_WITH_RET(double, 0, GetMaximum, (int *pbSuccess), (pbSuccess))
     419         109 : RB_PROXY_METHOD_WITH_RET(double, 0, GetOffset, (int *pbSuccess), (pbSuccess))
     420         109 : RB_PROXY_METHOD_WITH_RET(double, 0, GetScale, (int *pbSuccess), (pbSuccess))
     421          47 : RB_PROXY_METHOD_WITH_RET(const char *, nullptr, GetUnitType, (), ())
     422        1222 : RB_PROXY_METHOD_WITH_RET(GDALColorInterp, GCI_Undefined, GetColorInterpretation,
     423             :                          (), ())
     424         108 : RB_PROXY_METHOD_WITH_RET(GDALColorTable *, nullptr, GetColorTable, (), ())
     425           6 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, Fill,
     426             :                          (double dfRealValue, double dfImaginaryValue),
     427             :                          (dfRealValue, dfImaginaryValue))
     428             : 
     429           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetCategoryNames, (char **arg),
     430             :                          (arg))
     431           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetNoDataValue, (double arg),
     432             :                          (arg))
     433           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, DeleteNoDataValue, (), ())
     434           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetColorTable,
     435             :                          (GDALColorTable * arg), (arg))
     436           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetColorInterpretation,
     437             :                          (GDALColorInterp arg), (arg))
     438           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetOffset, (double arg), (arg))
     439           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetScale, (double arg), (arg))
     440           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetUnitType, (const char *arg),
     441             :                          (arg))
     442             : 
     443           3 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetStatistics,
     444             :                          (int bApproxOK, int bForce, double *pdfMin,
     445             :                           double *pdfMax, double *pdfMean, double *padfStdDev),
     446             :                          (bApproxOK, bForce, pdfMin, pdfMax, pdfMean,
     447             :                           padfStdDev))
     448           6 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, ComputeStatistics,
     449             :                          (int bApproxOK, double *pdfMin, double *pdfMax,
     450             :                           double *pdfMean, double *pdfStdDev,
     451             :                           GDALProgressFunc pfn, void *pProgressData),
     452             :                          (bApproxOK, pdfMin, pdfMax, pdfMean, pdfStdDev, pfn,
     453             :                           pProgressData))
     454           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetStatistics,
     455             :                          (double dfMin, double dfMax, double dfMean,
     456             :                           double dfStdDev),
     457             :                          (dfMin, dfMax, dfMean, dfStdDev))
     458          20 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, ComputeRasterMinMax,
     459             :                          (int arg1, double *arg2), (arg1, arg2))
     460             : 
     461           3 : RB_PROXY_METHOD_WITH_RET(int, 0, HasArbitraryOverviews, (), ())
     462        1059 : RB_PROXY_METHOD_WITH_RET(int, 0, GetOverviewCount, (), ())
     463           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBand *, nullptr, GetOverview, (int arg1),
     464             :                          (arg1))
     465           0 : RB_PROXY_METHOD_WITH_RET(GDALRasterBand *, nullptr, GetRasterSampleOverview,
     466             :                          (GUIntBig arg1), (arg1))
     467             : 
     468           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, BuildOverviews,
     469             :                          (const char *arg1, int arg2, const int *arg3,
     470             :                           GDALProgressFunc arg4, void *arg5,
     471             :                           CSLConstList papszOptions),
     472             :                          (arg1, arg2, arg3, arg4, arg5, papszOptions))
     473             : 
     474          45 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, AdviseRead,
     475             :                          (int nXOff, int nYOff, int nXSize, int nYSize,
     476             :                           int nBufXSize, int nBufYSize, GDALDataType eDT,
     477             :                           char **papszOptions),
     478             :                          (nXOff, nYOff, nXSize, nYSize, nBufXSize, nBufYSize,
     479             :                           eDT, papszOptions))
     480             : 
     481           2 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetHistogram,
     482             :                          (double dfMin, double dfMax, int nBuckets,
     483             :                           GUIntBig *panHistogram, int bIncludeOutOfRange,
     484             :                           int bApproxOK, GDALProgressFunc pfn,
     485             :                           void *pProgressData),
     486             :                          (dfMin, dfMax, nBuckets, panHistogram,
     487             :                           bIncludeOutOfRange, bApproxOK, pfn, pProgressData))
     488             : 
     489           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, GetDefaultHistogram,
     490             :                          (double *pdfMin, double *pdfMax, int *pnBuckets,
     491             :                           GUIntBig **ppanHistogram, int bForce,
     492             :                           GDALProgressFunc pfn, void *pProgressData),
     493             :                          (pdfMin, pdfMax, pnBuckets, ppanHistogram, bForce, pfn,
     494             :                           pProgressData))
     495             : 
     496           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetDefaultHistogram,
     497             :                          (double dfMin, double dfMax, int nBuckets,
     498             :                           GUIntBig *panHistogram),
     499             :                          (dfMin, dfMax, nBuckets, panHistogram))
     500             : 
     501         100 : RB_PROXY_METHOD_WITH_RET(GDALRasterAttributeTable *, nullptr, GetDefaultRAT, (),
     502             :                          ())
     503           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, SetDefaultRAT,
     504             :                          (const GDALRasterAttributeTable *arg1), (arg1))
     505             : 
     506           4 : RB_PROXY_METHOD_WITH_RET(GDALRasterBand *, nullptr, GetMaskBand, (), ())
     507        1633 : RB_PROXY_METHOD_WITH_RET(int, 0, GetMaskFlags, (), ())
     508           0 : RB_PROXY_METHOD_WITH_RET(CPLErr, CE_Failure, CreateMaskBand, (int nFlagsIn),
     509             :                          (nFlagsIn))
     510           0 : RB_PROXY_METHOD_WITH_RET(bool, false, IsMaskBand, () const, ())
     511           0 : RB_PROXY_METHOD_WITH_RET(GDALMaskValueRange, GMVR_UNKNOWN, GetMaskValueRange,
     512             :                          () const, ())
     513             : 
     514           0 : RB_PROXY_METHOD_WITH_RET(CPLVirtualMem *, nullptr, GetVirtualMemAuto,
     515             :                          (GDALRWFlag eRWFlag, int *pnPixelSpace,
     516             :                           GIntBig *pnLineSpace, char **papszOptions),
     517             :                          (eRWFlag, pnPixelSpace, pnLineSpace, papszOptions))
     518             : 
     519           0 : RB_PROXY_METHOD_WITH_RET(
     520             :     CPLErr, CE_Failure, InterpolateAtPoint,
     521             :     (double dfPixel, double dfLine, GDALRIOResampleAlg eInterpolation,
     522             :      double *pdfRealValue, double *pdfImagValue = nullptr) const,
     523             :     (dfPixel, dfLine, eInterpolation, pdfRealValue, pdfImagValue))
     524             : 
     525         170 : void GDALProxyRasterBand::EnablePixelTypeSignedByteWarning(bool b)
     526             : {
     527         170 :     GDALRasterBand *poSrcBand = RefUnderlyingRasterBand();
     528         170 :     if (poSrcBand)
     529             :     {
     530         170 :         poSrcBand->EnablePixelTypeSignedByteWarning(b);
     531         170 :         UnrefUnderlyingRasterBand(poSrcBand);
     532             :     }
     533         170 : }
     534             : 
     535             : /************************************************************************/
     536             : /*                 UnrefUnderlyingRasterBand()                        */
     537             : /************************************************************************/
     538             : 
     539        3621 : void GDALProxyRasterBand::UnrefUnderlyingRasterBand(
     540             :     GDALRasterBand * /* poUnderlyingRasterBand */) const
     541             : {
     542        3621 : }
     543             : 
     544             : /*! @endcond */

Generated by: LCOV version 1.14