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

Generated by: LCOV version 1.14