GDAL
gdal_priv.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id$
3  *
4  * Name: gdal_priv.h
5  * Project: GDAL Core
6  * Purpose: GDAL Core C++/Private declarations.
7  * Author: Frank Warmerdam, warmerdam@pobox.com
8  *
9  ******************************************************************************
10  * Copyright (c) 1998, Frank Warmerdam
11  * Copyright (c) 2007-2014, Even Rouault <even dot rouault at mines-paris dot org>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  ****************************************************************************/
31 
32 #ifndef GDAL_PRIV_H_INCLUDED
33 #define GDAL_PRIV_H_INCLUDED
34 
41 /* -------------------------------------------------------------------- */
42 /* Predeclare various classes before pulling in gdal.h, the */
43 /* public declarations. */
44 /* -------------------------------------------------------------------- */
45 class GDALMajorObject;
46 class GDALDataset;
47 class GDALRasterBand;
48 class GDALDriver;
50 class GDALProxyDataset;
51 class GDALProxyRasterBand;
52 class GDALAsyncReader;
53 
54 /* -------------------------------------------------------------------- */
55 /* Pull in the public declarations. This gets the C apis, and */
56 /* also various constants. However, we will still get to */
57 /* provide the real class definitions for the GDAL classes. */
58 /* -------------------------------------------------------------------- */
59 
60 #include "gdal.h"
61 #include "gdal_frmts.h"
62 #include "cpl_vsi.h"
63 #include "cpl_conv.h"
64 #include "cpl_string.h"
65 #include "cpl_minixml.h"
66 #include "cpl_multiproc.h"
67 #include "cpl_atomic_ops.h"
68 
69 #include <cmath>
70 #include <iterator>
71 #include <limits>
72 #include <map>
73 #include <memory>
74 #include <vector>
75 
76 #include "ogr_core.h"
77 #include "ogr_feature.h"
78 
80 #define GMO_VALID 0x0001
81 #define GMO_IGNORE_UNIMPLEMENTED 0x0002
82 #define GMO_SUPPORT_MD 0x0004
83 #define GMO_SUPPORT_MDMD 0x0008
84 #define GMO_MD_DIRTY 0x0010
85 #define GMO_PAM_CLASS 0x0020
86 
88 /************************************************************************/
89 /* GDALMultiDomainMetadata */
90 /************************************************************************/
91 
93 class CPL_DLL GDALMultiDomainMetadata
94 {
95 private:
96  char **papszDomainList;
97  CPLStringList **papoMetadataLists;
98 
99 public:
100  GDALMultiDomainMetadata();
101  ~GDALMultiDomainMetadata();
102 
103  int XMLInit( CPLXMLNode *psMetadata, int bMerge );
104  CPLXMLNode *Serialize();
105 
106  char **GetDomainList() { return papszDomainList; }
107 
108  char **GetMetadata( const char * pszDomain = "" );
109  CPLErr SetMetadata( char ** papszMetadata,
110  const char * pszDomain = "" );
111  const char *GetMetadataItem( const char * pszName,
112  const char * pszDomain = "" );
113  CPLErr SetMetadataItem( const char * pszName,
114  const char * pszValue,
115  const char * pszDomain = "" );
116 
117  void Clear();
118 
119  private:
120  CPL_DISALLOW_COPY_ASSIGN(GDALMultiDomainMetadata)
121 };
123 
124 /* ******************************************************************** */
125 /* GDALMajorObject */
126 /* */
127 /* Base class providing metadata, description and other */
128 /* services shared by major objects. */
129 /* ******************************************************************** */
130 
132 class CPL_DLL GDALMajorObject
133 {
134  protected:
136  int nFlags; // GMO_* flags.
137  CPLString sDescription{};
138  GDALMultiDomainMetadata oMDMD{};
139 
141 
142  char **BuildMetadataDomainList( char** papszList,
143  int bCheckNonEmpty, ... ) CPL_NULL_TERMINATED;
144  public:
145  GDALMajorObject();
146  virtual ~GDALMajorObject();
147 
148  int GetMOFlags() const;
149  void SetMOFlags( int nFlagsIn );
150 
151  virtual const char *GetDescription() const;
152  virtual void SetDescription( const char * );
153 
154  virtual char **GetMetadataDomainList();
155 
156  virtual char **GetMetadata( const char * pszDomain = "" );
157  virtual CPLErr SetMetadata( char ** papszMetadata,
158  const char * pszDomain = "" );
159  virtual const char *GetMetadataItem( const char * pszName,
160  const char * pszDomain = "" );
161  virtual CPLErr SetMetadataItem( const char * pszName,
162  const char * pszValue,
163  const char * pszDomain = "" );
164 
168  static inline GDALMajorObjectH ToHandle(GDALMajorObject* poMajorObject)
169  { return static_cast<GDALMajorObjectH>(poMajorObject); }
170 
174  static inline GDALMajorObject* FromHandle(GDALMajorObjectH hMajorObject)
175  { return static_cast<GDALMajorObject*>(hMajorObject); }
176 };
177 
178 /* ******************************************************************** */
179 /* GDALDefaultOverviews */
180 /* ******************************************************************** */
181 
183 class CPL_DLL GDALDefaultOverviews
184 {
185  friend class GDALDataset;
186 
187  GDALDataset *poDS;
188  GDALDataset *poODS;
189 
190  CPLString osOvrFilename{};
191 
192  bool bOvrIsAux;
193 
194  bool bCheckedForMask;
195  bool bOwnMaskDS;
196  GDALDataset *poMaskDS;
197 
198  // For "overview datasets" we record base level info so we can
199  // find our way back to get overview masks.
200  GDALDataset *poBaseDS;
201 
202  // Stuff for deferred initialize/overviewscans.
203  bool bCheckedForOverviews;
204  void OverviewScan();
205  char *pszInitName;
206  bool bInitNameIsOVR;
207  char **papszInitSiblingFiles;
208 
209  public:
210  GDALDefaultOverviews();
211  ~GDALDefaultOverviews();
212 
213  void Initialize( GDALDataset *poDSIn, const char *pszName = nullptr,
214  char **papszSiblingFiles = nullptr,
215  int bNameIsOVR = FALSE );
216 
217  void TransferSiblingFiles( char** papszSiblingFiles );
218 
219  int IsInitialized();
220 
222 
223  // Overview Related
224 
225  int GetOverviewCount( int nBand );
226  GDALRasterBand *GetOverview( int nBand, int iOverview );
227 
228  CPLErr BuildOverviews( const char * pszBasename,
229  const char * pszResampling,
230  int nOverviews, int * panOverviewList,
231  int nBands, int * panBandList,
232  GDALProgressFunc pfnProgress,
233  void *pProgressData );
234 
235  CPLErr BuildOverviewsSubDataset( const char * pszPhysicalFile,
236  const char * pszResampling,
237  int nOverviews, int * panOverviewList,
238  int nBands, int * panBandList,
239  GDALProgressFunc pfnProgress,
240  void *pProgressData );
241 
242  CPLErr CleanOverviews();
243 
244  // Mask Related
245 
246  CPLErr CreateMaskBand( int nFlags, int nBand = -1 );
247  GDALRasterBand *GetMaskBand( int nBand );
248  int GetMaskFlags( int nBand );
249 
250  int HaveMaskFile( char **papszSiblings = nullptr,
251  const char *pszBasename = nullptr );
252 
253  char** GetSiblingFiles() { return papszInitSiblingFiles; }
254 
255  private:
256  CPL_DISALLOW_COPY_ASSIGN(GDALDefaultOverviews)
257 };
259 
260 /* ******************************************************************** */
261 /* GDALOpenInfo */
262 /* ******************************************************************** */
263 
265 class CPL_DLL GDALOpenInfo
266 {
267  bool bHasGotSiblingFiles;
268  char **papszSiblingFiles;
269  int nHeaderBytesTried;
270 
271  public:
272  GDALOpenInfo( const char * pszFile, int nOpenFlagsIn,
273  const char * const * papszSiblingFiles = nullptr );
274  ~GDALOpenInfo( void );
275 
277  char *pszFilename;
280 
285 
287  int bStatOK;
290 
293 
298 
300  const char* const* papszAllowedDrivers;
301 
302  int TryToIngest(int nBytes);
303  char **GetSiblingFiles();
304  char **StealSiblingFiles();
305  bool AreSiblingFilesLoaded() const;
306 
307  private:
309 };
310 
311 /* ******************************************************************** */
312 /* GDALDataset */
313 /* ******************************************************************** */
314 
315 class OGRLayer;
316 class OGRGeometry;
317 class OGRSpatialReference;
318 class OGRStyleTable;
319 class swq_select;
320 class swq_select_parse_options;
321 
323 typedef struct GDALSQLParseInfo GDALSQLParseInfo;
325 
327 #ifdef GDAL_COMPILATION
328 #define OPTIONAL_OUTSIDE_GDAL(val)
329 #else
330 #define OPTIONAL_OUTSIDE_GDAL(val) = val
331 #endif
332 
335 class CPL_DLL GDALDataset : public GDALMajorObject
336 {
337  friend GDALDatasetH CPL_STDCALL GDALOpenEx( const char* pszFilename,
338  unsigned int nOpenFlags,
339  const char* const* papszAllowedDrivers,
340  const char* const* papszOpenOptions,
341  const char* const* papszSiblingFiles );
342  friend void CPL_STDCALL GDALClose( GDALDatasetH hDS );
343 
344  friend class GDALDriver;
345  friend class GDALDefaultOverviews;
346  friend class GDALProxyDataset;
347  friend class GDALDriverManager;
348 
349  void AddToDatasetOpenList();
350 
351  protected:
353  GDALDriver *poDriver = nullptr;
354  GDALAccess eAccess = GA_ReadOnly;
355 
356  // Stored raster information.
357  int nRasterXSize = 512;
358  int nRasterYSize = 512;
359  int nBands = 0;
360  GDALRasterBand **papoBands = nullptr;
361 
362  int nOpenFlags = 0;
363 
364  int nRefCount = 1;
365  bool bForceCachedIO = false;
366  bool bShared = false;
367  bool bIsInternal = true;
368  bool bSuppressOnClose = false;
369 
370  GDALDataset(void);
371  explicit GDALDataset(int bForceCachedIO);
372 
373  void RasterInitialize( int, int );
374  void SetBand( int, GDALRasterBand * );
375 
376  GDALDefaultOverviews oOvManager{};
377 
378  virtual CPLErr IBuildOverviews( const char *, int, int *,
379  int, int *, GDALProgressFunc, void * );
380 
381  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
382  void *, int, int, GDALDataType,
383  int, int *, GSpacing, GSpacing, GSpacing,
385 
386  CPLErr BlockBasedRasterIO( GDALRWFlag, int, int, int, int,
387  void *, int, int, GDALDataType,
388  int, int *, GSpacing, GSpacing, GSpacing,
390  void BlockBasedFlushCache();
391 
392  CPLErr BandBasedRasterIO( GDALRWFlag eRWFlag,
393  int nXOff, int nYOff, int nXSize, int nYSize,
394  void * pData, int nBufXSize, int nBufYSize,
395  GDALDataType eBufType,
396  int nBandCount, int *panBandMap,
397  GSpacing nPixelSpace, GSpacing nLineSpace,
398  GSpacing nBandSpace,
400 
401  CPLErr RasterIOResampled( GDALRWFlag eRWFlag,
402  int nXOff, int nYOff, int nXSize, int nYSize,
403  void * pData, int nBufXSize, int nBufYSize,
404  GDALDataType eBufType,
405  int nBandCount, int *panBandMap,
406  GSpacing nPixelSpace, GSpacing nLineSpace,
407  GSpacing nBandSpace,
409 
410  CPLErr ValidateRasterIOOrAdviseReadParameters(
411  const char* pszCallingFunc,
412  int* pbStopProcessingOnCENone,
413  int nXOff, int nYOff, int nXSize, int nYSize,
414  int nBufXSize, int nBufYSize,
415  int nBandCount, int *panBandMap);
416 
417  CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
418  int nXOff, int nYOff, int nXSize, int nYSize,
419  void * pData, int nBufXSize, int nBufYSize,
420  GDALDataType eBufType,
421  int nBandCount, int *panBandMap,
422  GSpacing nPixelSpace, GSpacing nLineSpace,
423  GSpacing nBandSpace,
424  GDALRasterIOExtraArg* psExtraArg,
425  int* pbTried);
426 
428  virtual int CloseDependentDatasets();
430  int ValidateLayerCreationOptions( const char* const* papszLCO );
431 
432  char **papszOpenOptions = nullptr;
433 
434  friend class GDALRasterBand;
435 
436  // The below methods related to read write mutex are fragile logic, and
437  // should not be used by out-of-tree code if possible.
438  int EnterReadWrite(GDALRWFlag eRWFlag);
439  void LeaveReadWrite();
440  void InitRWLock();
441 
442  void TemporarilyDropReadWriteLock();
443  void ReacquireReadWriteLock();
444 
445  void DisableReadWriteMutex();
446 
447  int AcquireMutex();
448  void ReleaseMutex();
450 
451  public:
452  ~GDALDataset() override;
453 
454  int GetRasterXSize();
455  int GetRasterYSize();
456  int GetRasterCount();
457  GDALRasterBand *GetRasterBand( int );
458 
460  class CPL_DLL Bands
461  {
462  private:
463 
464  friend class GDALDataset;
465  GDALDataset* m_poSelf;
466  explicit Bands(GDALDataset* poSelf): m_poSelf(poSelf) {}
467 
468  class CPL_DLL Iterator
469  {
470  struct Private;
471  std::unique_ptr<Private> m_poPrivate;
472  public:
473  Iterator(GDALDataset* poDS, bool bStart);
474  Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
475  Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
476  ~Iterator();
477  GDALRasterBand* operator*();
478  Iterator& operator++();
479  bool operator!=(const Iterator& it) const;
480  };
481 
482  public:
483 
484  const Iterator begin() const;
485 
486  const Iterator end() const;
487 
488  size_t size() const;
489 
490  GDALRasterBand* operator[](int iBand);
491  GDALRasterBand* operator[](size_t iBand);
492  };
493 
494  Bands GetBands();
495 
496  virtual void FlushCache(void);
497 
498  virtual const char *GetProjectionRef(void);
499  virtual CPLErr SetProjection( const char * pszProjection );
500 
501  virtual CPLErr GetGeoTransform( double * padfTransform );
502  virtual CPLErr SetGeoTransform( double * padfTransform );
503 
504  virtual CPLErr AddBand( GDALDataType eType,
505  char **papszOptions=nullptr );
506 
507  virtual void *GetInternalHandle( const char * pszHandleName );
508  virtual GDALDriver *GetDriver(void);
509  virtual char **GetFileList(void);
510 
511  virtual const char* GetDriverName();
512 
513  virtual int GetGCPCount();
514  virtual const char *GetGCPProjection();
515  virtual const GDAL_GCP *GetGCPs();
516  virtual CPLErr SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList,
517  const char *pszGCPProjection );
518 
519  virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
520  int nBufXSize, int nBufYSize,
521  GDALDataType eDT,
522  int nBandCount, int *panBandList,
523  char **papszOptions );
524 
525  virtual CPLErr CreateMaskBand( int nFlagsIn );
526 
527  virtual GDALAsyncReader*
528  BeginAsyncReader(int nXOff, int nYOff, int nXSize, int nYSize,
529  void *pBuf, int nBufXSize, int nBufYSize,
530  GDALDataType eBufType,
531  int nBandCount, int* panBandMap,
532  int nPixelSpace, int nLineSpace, int nBandSpace,
533  char **papszOptions);
534  virtual void EndAsyncReader(GDALAsyncReader *);
535 
536  CPLErr RasterIO( GDALRWFlag, int, int, int, int,
537  void *, int, int, GDALDataType,
538  int, int *, GSpacing, GSpacing, GSpacing,
539  GDALRasterIOExtraArg* psExtraArg
540 #ifndef DOXYGEN_SKIP
541  OPTIONAL_OUTSIDE_GDAL(nullptr)
542 #endif
543  ) CPL_WARN_UNUSED_RESULT;
544 
545  int Reference();
546  int Dereference();
547  int ReleaseRef();
548 
552  GDALAccess GetAccess() const { return eAccess; }
553 
554  int GetShared() const;
555  void MarkAsShared();
556 
558  void MarkSuppressOnClose() { bSuppressOnClose = true; }
559 
563  char **GetOpenOptions() { return papszOpenOptions; }
564 
565  static GDALDataset **GetOpenDatasets( int *pnDatasetCount );
566 
567  CPLErr BuildOverviews( const char *, int, int *,
568  int, int *, GDALProgressFunc, void * );
569 
570  void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
571 
572  char ** GetMetadata(const char * pszDomain = "") override;
573 
574 // Only defined when Doxygen enabled
575 #ifdef DOXYGEN_SKIP
576  CPLErr SetMetadata( char ** papszMetadata,
577  const char * pszDomain ) override;
578  const char *GetMetadataItem( const char * pszName,
579  const char * pszDomain ) override;
580  CPLErr SetMetadataItem( const char * pszName,
581  const char * pszValue,
582  const char * pszDomain ) override;
583 #endif
584 
585  char **GetMetadataDomainList() override;
586 
590  static inline GDALDatasetH ToHandle(GDALDataset* poDS)
591  { return static_cast<GDALDatasetH>(poDS); }
592 
596  static inline GDALDataset* FromHandle(GDALDatasetH hDS)
597  { return static_cast<GDALDataset*>(hDS); }
598 
602  static GDALDataset* Open( const char* pszFilename,
603  unsigned int nOpenFlags = 0,
604  const char* const* papszAllowedDrivers = nullptr,
605  const char* const* papszOpenOptions = nullptr,
606  const char* const* papszSiblingFiles = nullptr )
607  {
608  return FromHandle(GDALOpenEx(pszFilename, nOpenFlags,
609  papszAllowedDrivers,
610  papszOpenOptions,
611  papszSiblingFiles));
612  }
613 
616  {
619 
621  OGRLayer* layer = nullptr;
622  };
623 
624 private:
625  class Private;
626  Private *m_poPrivate;
627 
628  OGRLayer* BuildLayerFromSelectInfo(swq_select* psSelectInfo,
629  OGRGeometry *poSpatialFilter,
630  const char *pszDialect,
631  swq_select_parse_options* poSelectParseOptions);
632  CPLStringList oDerivedMetadataList{};
633 
634  public:
635 
636  virtual int GetLayerCount();
637  virtual OGRLayer *GetLayer(int iLayer);
638 
642  class CPL_DLL Layers
643  {
644  private:
645 
646  friend class GDALDataset;
647  GDALDataset* m_poSelf;
648  explicit Layers(GDALDataset* poSelf): m_poSelf(poSelf) {}
649 
650  public:
651 
655  class CPL_DLL Iterator
656  {
657  struct Private;
658  std::unique_ptr<Private> m_poPrivate;
659  public:
660 
661  using value_type = OGRLayer*;
662  using reference = OGRLayer*;
663  using difference_type = void;
664  using pointer = void;
665  using iterator_category = std::input_iterator_tag;
667  Iterator();
668  Iterator(GDALDataset* poDS, bool bStart);
669  Iterator(const Iterator& oOther);
670  Iterator(Iterator&& oOther) noexcept;
671  ~Iterator();
673  Iterator& operator=(const Iterator& oOther);
674  Iterator& operator=(Iterator&& oOther) noexcept;
676  OGRLayer* operator*() const;
677  Iterator& operator++();
678  Iterator operator++(int);
679  bool operator!=(const Iterator& it) const;
680  };
681 
682  Iterator begin() const;
683  Iterator end() const;
684 
685  size_t size() const;
686 
687  OGRLayer* operator[](int iLayer);
688  OGRLayer* operator[](size_t iLayer);
689  OGRLayer* operator[](const char* pszLayername);
690  };
691 
692  Layers GetLayers();
693 
694  virtual OGRLayer *GetLayerByName(const char *);
695  virtual OGRErr DeleteLayer(int iLayer);
696 
697  virtual void ResetReading();
698  virtual OGRFeature* GetNextFeature( OGRLayer** ppoBelongingLayer,
699  double* pdfProgressPct,
700  GDALProgressFunc pfnProgress,
701  void* pProgressData );
702 
703 
705  class CPL_DLL Features
706  {
707  private:
708 
709  friend class GDALDataset;
710  GDALDataset* m_poSelf;
711  explicit Features(GDALDataset* poSelf): m_poSelf(poSelf) {}
712 
713  class CPL_DLL Iterator
714  {
715  struct Private;
716  std::unique_ptr<Private> m_poPrivate;
717  public:
718  Iterator(GDALDataset* poDS, bool bStart);
719  Iterator(const Iterator& oOther); // declared but not defined. Needed for gcc 5.4 at least
720  Iterator(Iterator&& oOther) noexcept; // declared but not defined. Needed for gcc 5.4 at least
721  ~Iterator();
722  const FeatureLayerPair& operator*() const;
723  Iterator& operator++();
724  bool operator!=(const Iterator& it) const;
725  };
726 
727  public:
728 
729  const Iterator begin() const;
730 
731  const Iterator end() const;
732  };
733 
734  Features GetFeatures();
735 
736  virtual int TestCapability( const char * );
737 
738  virtual OGRLayer *CreateLayer( const char *pszName,
739  OGRSpatialReference *poSpatialRef = nullptr,
741  char ** papszOptions = nullptr );
742  virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
743  const char *pszNewName,
744  char **papszOptions = nullptr );
745 
746  virtual OGRStyleTable *GetStyleTable();
747  virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
748 
749  virtual void SetStyleTable(OGRStyleTable *poStyleTable);
750 
751  virtual OGRLayer * ExecuteSQL( const char *pszStatement,
752  OGRGeometry *poSpatialFilter,
753  const char *pszDialect );
754  virtual void ReleaseResultSet( OGRLayer * poResultsSet );
755 
756  int GetRefCount() const;
757  int GetSummaryRefCount() const;
758  OGRErr Release();
759 
760  virtual OGRErr StartTransaction(int bForce=FALSE);
761  virtual OGRErr CommitTransaction();
762  virtual OGRErr RollbackTransaction();
763 
765  static int IsGenericSQLDialect(const char* pszDialect);
766 
767  // Semi-public methods. Only to be used by in-tree drivers.
768  GDALSQLParseInfo* BuildParseInfo(swq_select* psSelectInfo,
769  swq_select_parse_options* poSelectParseOptions);
770  static void DestroyParseInfo(GDALSQLParseInfo* psParseInfo );
771  OGRLayer * ExecuteSQL( const char *pszStatement,
772  OGRGeometry *poSpatialFilter,
773  const char *pszDialect,
774  swq_select_parse_options* poSelectParseOptions);
776 
777  protected:
778  virtual OGRLayer *ICreateLayer( const char *pszName,
779  OGRSpatialReference *poSpatialRef = nullptr,
781  char ** papszOptions = nullptr );
782 
784  OGRErr ProcessSQLCreateIndex( const char * );
785  OGRErr ProcessSQLDropIndex( const char * );
786  OGRErr ProcessSQLDropTable( const char * );
787  OGRErr ProcessSQLAlterTableAddColumn( const char * );
788  OGRErr ProcessSQLAlterTableDropColumn( const char * );
789  OGRErr ProcessSQLAlterTableAlterColumn( const char * );
790  OGRErr ProcessSQLAlterTableRenameColumn( const char * );
791 
792  OGRStyleTable *m_poStyleTable = nullptr;
794 
795  private:
797 };
798 
800 struct CPL_DLL GDALDatasetUniquePtrDeleter
801 {
802  void operator()(GDALDataset* poDataset) const
803  { GDALClose(poDataset); }
804 };
806 
812 typedef std::unique_ptr<GDALDataset, GDALDatasetUniquePtrDeleter> GDALDatasetUniquePtr;
813 
814 /* ******************************************************************** */
815 /* GDALRasterBlock */
816 /* ******************************************************************** */
817 
822 class CPL_DLL GDALRasterBlock
823 {
824  friend class GDALAbstractBandBlockCache;
825 
826  GDALDataType eType;
827 
828  bool bDirty;
829  volatile int nLockCount;
830 
831  int nXOff;
832  int nYOff;
833 
834  int nXSize;
835  int nYSize;
836 
837  void *pData;
838 
839  GDALRasterBand *poBand;
840 
841  GDALRasterBlock *poNext;
842  GDALRasterBlock *poPrevious;
843 
844  bool bMustDetach;
845 
846  void Detach_unlocked( void );
847  void Touch_unlocked( void );
848 
849  void RecycleFor( int nXOffIn, int nYOffIn );
850 
851  public:
852  GDALRasterBlock( GDALRasterBand *, int, int );
853  GDALRasterBlock( int nXOffIn, int nYOffIn ); /* only for lookup purpose */
854  virtual ~GDALRasterBlock();
855 
856  CPLErr Internalize( void );
857  void Touch( void );
858  void MarkDirty( void );
859  void MarkClean( void );
861  int AddLock( void ) { return CPLAtomicInc(&nLockCount); }
863  int DropLock( void ) { return CPLAtomicDec(&nLockCount); }
864  void Detach();
865 
866  CPLErr Write();
867 
871  GDALDataType GetDataType() const { return eType; }
875  int GetXOff() const { return nXOff; }
879  int GetYOff() const { return nYOff; }
883  int GetXSize() const { return nXSize; }
887  int GetYSize() const { return nYSize; }
891  int GetDirty() const { return bDirty; }
895  void *GetDataRef( void ) { return pData; }
899  int GetBlockSize() const {
900  return nXSize * nYSize * GDALGetDataTypeSizeBytes(eType); }
901 
902  int TakeLock();
903  int DropLockForRemovalFromStorage();
904 
907  GDALRasterBand *GetBand() { return poBand; }
908 
909  static void FlushDirtyBlocks();
910  static int FlushCacheBlock(int bDirtyBlocksOnly = FALSE);
911  static void Verify();
912 
913  static void EnterDisableDirtyBlockFlush();
914  static void LeaveDisableDirtyBlockFlush();
915 
916 #ifdef notdef
917  static void CheckNonOrphanedBlocks(GDALRasterBand* poBand);
918  void DumpBlock();
919  static void DumpAll();
920 #endif
921 
922  /* Should only be called by GDALDestroyDriverManager() */
924  static void DestroyRBMutex();
926 
927  private:
929 };
930 
931 /* ******************************************************************** */
932 /* GDALColorTable */
933 /* ******************************************************************** */
934 
937 class CPL_DLL GDALColorTable
938 {
939  GDALPaletteInterp eInterp;
940 
941  std::vector<GDALColorEntry> aoEntries{};
942 
943 public:
945  ~GDALColorTable();
946 
947  GDALColorTable *Clone() const;
948  int IsSame(const GDALColorTable* poOtherCT) const;
949 
950  GDALPaletteInterp GetPaletteInterpretation() const;
951 
952  int GetColorEntryCount() const;
953  const GDALColorEntry *GetColorEntry( int ) const;
954  int GetColorEntryAsRGB( int, GDALColorEntry * ) const;
955  void SetColorEntry( int, const GDALColorEntry * );
956  int CreateColorRamp( int, const GDALColorEntry * ,
957  int, const GDALColorEntry * );
958 
963  { return static_cast<GDALColorTableH>(poCT); }
964 
969  { return static_cast<GDALColorTable*>(hCT); }
970 
971 };
972 
973 /* ******************************************************************** */
974 /* GDALAbstractBandBlockCache */
975 /* ******************************************************************** */
976 
978 
980 // CPL_DLL is just technical here. This is really a private concept
981 // only used by GDALRasterBand implementation.
982 
983 class CPL_DLL GDALAbstractBandBlockCache
984 {
985  // List of blocks that can be freed or recycled, and its lock
986  CPLLock *hSpinLock = nullptr;
987  GDALRasterBlock *psListBlocksToFree = nullptr;
988 
989  // Band keep alive counter, and its lock & condition
990  CPLCond *hCond = nullptr;
991  CPLMutex *hCondMutex = nullptr;
992  volatile int nKeepAliveCounter = 0;
993 
994  CPL_DISALLOW_COPY_ASSIGN(GDALAbstractBandBlockCache)
995 
996  protected:
997  GDALRasterBand *poBand;
998 
999  void FreeDanglingBlocks();
1000  void UnreferenceBlockBase();
1001  void WaitKeepAliveCounter();
1002 
1003  public:
1004  explicit GDALAbstractBandBlockCache(GDALRasterBand* poBand);
1005  virtual ~GDALAbstractBandBlockCache();
1006 
1007  GDALRasterBlock* CreateBlock(int nXBlockOff, int nYBlockOff);
1008  void AddBlockToFreeList( GDALRasterBlock * );
1009 
1010  virtual bool Init() = 0;
1011  virtual bool IsInitOK() = 0;
1012  virtual CPLErr FlushCache() = 0;
1013  virtual CPLErr AdoptBlock( GDALRasterBlock* poBlock ) = 0;
1014  virtual GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff,
1015  int nYBlockYOff ) = 0;
1016  virtual CPLErr UnreferenceBlock( GDALRasterBlock* poBlock ) = 0;
1017  virtual CPLErr FlushBlock( int nXBlockOff, int nYBlockOff,
1018  int bWriteDirtyBlock ) = 0;
1019 };
1020 
1021 GDALAbstractBandBlockCache* GDALArrayBandBlockCacheCreate(GDALRasterBand* poBand);
1022 GDALAbstractBandBlockCache* GDALHashSetBandBlockCacheCreate(GDALRasterBand* poBand);
1023 
1025 
1026 /* ******************************************************************** */
1027 /* GDALRasterBand */
1028 /* ******************************************************************** */
1029 
1032 class CPL_DLL GDALRasterBand : public GDALMajorObject
1033 {
1034  private:
1035  friend class GDALArrayBandBlockCache;
1036  friend class GDALHashSetBandBlockCache;
1037  friend class GDALRasterBlock;
1038 
1039  CPLErr eFlushBlockErr = CE_None;
1040  GDALAbstractBandBlockCache* poBandBlockCache = nullptr;
1041 
1042  void SetFlushBlockErr( CPLErr eErr );
1043  CPLErr UnreferenceBlock( GDALRasterBlock* poBlock );
1044  void SetValidPercent( GUIntBig nSampleCount, GUIntBig nValidCount );
1045 
1046  protected:
1048  GDALDataset *poDS = nullptr;
1049  int nBand = 0; /* 1 based */
1050 
1051  int nRasterXSize = 0;
1052  int nRasterYSize = 0;
1053 
1054  GDALDataType eDataType = GDT_Byte;
1055  GDALAccess eAccess = GA_ReadOnly;
1056 
1057  /* stuff related to blocking, and raster cache */
1058  int nBlockXSize = -1;
1059  int nBlockYSize = -1;
1060  int nBlocksPerRow = 0;
1061  int nBlocksPerColumn = 0;
1062 
1063  int nBlockReads = 0;
1064  int bForceCachedIO = 0;
1065 
1066  GDALRasterBand *poMask = nullptr;
1067  bool bOwnMask = false;
1068  int nMaskFlags = 0;
1069 
1070  void InvalidateMaskBand();
1071 
1072  friend class GDALDataset;
1073  friend class GDALProxyRasterBand;
1074  friend class GDALDefaultOverviews;
1075 
1076  CPLErr RasterIOResampled( GDALRWFlag, int, int, int, int,
1077  void *, int, int, GDALDataType,
1079 
1080  int EnterReadWrite(GDALRWFlag eRWFlag);
1081  void LeaveReadWrite();
1082  void InitRWLock();
1084 
1085  protected:
1086  virtual CPLErr IReadBlock( int nBlockXOff, int nBlockYOff, void * pData ) = 0;
1087  virtual CPLErr IWriteBlock( int nBlockXOff, int nBlockYOff, void * pData );
1088 
1089  virtual CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1090  void *, int, int, GDALDataType,
1092 
1093  virtual int IGetDataCoverageStatus( int nXOff, int nYOff,
1094  int nXSize, int nYSize,
1095  int nMaskFlagStop,
1096  double* pdfDataPct);
1098  CPLErr OverviewRasterIO( GDALRWFlag, int, int, int, int,
1099  void *, int, int, GDALDataType,
1101 
1102  CPLErr TryOverviewRasterIO( GDALRWFlag eRWFlag,
1103  int nXOff, int nYOff, int nXSize, int nYSize,
1104  void * pData, int nBufXSize, int nBufYSize,
1105  GDALDataType eBufType,
1106  GSpacing nPixelSpace, GSpacing nLineSpace,
1107  GDALRasterIOExtraArg* psExtraArg,
1108  int* pbTried );
1109 
1110  int InitBlockInfo();
1111 
1112  void AddBlockToFreeList( GDALRasterBlock * );
1114 
1115  GDALRasterBlock *TryGetLockedBlockRef( int nXBlockOff, int nYBlockYOff );
1116 
1117  public:
1118  GDALRasterBand();
1119  explicit GDALRasterBand(int bForceCachedIO);
1120 
1121  ~GDALRasterBand() override;
1122 
1123  int GetXSize();
1124  int GetYSize();
1125  int GetBand();
1126  GDALDataset*GetDataset();
1127 
1128  GDALDataType GetRasterDataType( void );
1129  void GetBlockSize( int *, int * );
1130  CPLErr GetActualBlockSize ( int, int, int *, int * );
1131  GDALAccess GetAccess();
1132 
1133  CPLErr RasterIO( GDALRWFlag, int, int, int, int,
1134  void *, int, int, GDALDataType,
1135  GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg
1136 #ifndef DOXYGEN_SKIP
1137  OPTIONAL_OUTSIDE_GDAL(nullptr)
1138 #endif
1140  CPLErr ReadBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1141 
1142  CPLErr WriteBlock( int, int, void * ) CPL_WARN_UNUSED_RESULT;
1143 
1144  GDALRasterBlock *GetLockedBlockRef( int nXBlockOff, int nYBlockOff,
1145  int bJustInitialize = FALSE ) CPL_WARN_UNUSED_RESULT;
1146  CPLErr FlushBlock( int, int, int bWriteDirtyBlock = TRUE );
1147 
1148  unsigned char* GetIndexColorTranslationTo(/* const */ GDALRasterBand* poReferenceBand,
1149  unsigned char* pTranslationTable = nullptr,
1150  int* pApproximateMatching = nullptr);
1151 
1152  // New OpengIS CV_SampleDimension stuff.
1153 
1154  virtual CPLErr FlushCache();
1155  virtual char **GetCategoryNames();
1156  virtual double GetNoDataValue( int *pbSuccess = nullptr );
1157  virtual double GetMinimum( int *pbSuccess = nullptr );
1158  virtual double GetMaximum(int *pbSuccess = nullptr );
1159  virtual double GetOffset( int *pbSuccess = nullptr );
1160  virtual double GetScale( int *pbSuccess = nullptr );
1161  virtual const char *GetUnitType();
1162  virtual GDALColorInterp GetColorInterpretation();
1163  virtual GDALColorTable *GetColorTable();
1164  virtual CPLErr Fill(double dfRealValue, double dfImaginaryValue = 0);
1165 
1166  virtual CPLErr SetCategoryNames( char ** papszNames );
1167  virtual CPLErr SetNoDataValue( double dfNoData );
1168  virtual CPLErr DeleteNoDataValue();
1169  virtual CPLErr SetColorTable( GDALColorTable * poCT );
1170  virtual CPLErr SetColorInterpretation( GDALColorInterp eColorInterp );
1171  virtual CPLErr SetOffset( double dfNewOffset );
1172  virtual CPLErr SetScale( double dfNewScale );
1173  virtual CPLErr SetUnitType( const char * pszNewValue );
1174 
1175  virtual CPLErr GetStatistics( int bApproxOK, int bForce,
1176  double *pdfMin, double *pdfMax,
1177  double *pdfMean, double *padfStdDev );
1178  virtual CPLErr ComputeStatistics( int bApproxOK,
1179  double *pdfMin, double *pdfMax,
1180  double *pdfMean, double *pdfStdDev,
1181  GDALProgressFunc, void *pProgressData );
1182  virtual CPLErr SetStatistics( double dfMin, double dfMax,
1183  double dfMean, double dfStdDev );
1184  virtual CPLErr ComputeRasterMinMax( int, double* );
1185 
1186 // Only defined when Doxygen enabled
1187 #ifdef DOXYGEN_SKIP
1188  char **GetMetadata( const char * pszDomain = "" ) override;
1189  CPLErr SetMetadata( char ** papszMetadata,
1190  const char * pszDomain ) override;
1191  const char *GetMetadataItem( const char * pszName,
1192  const char * pszDomain ) override;
1193  CPLErr SetMetadataItem( const char * pszName,
1194  const char * pszValue,
1195  const char * pszDomain ) override;
1196 #endif
1197 
1198  virtual int HasArbitraryOverviews();
1199  virtual int GetOverviewCount();
1200  virtual GDALRasterBand *GetOverview(int);
1201  virtual GDALRasterBand *GetRasterSampleOverview( GUIntBig );
1202  virtual CPLErr BuildOverviews( const char * pszResampling,
1203  int nOverviews,
1204  int * panOverviewList,
1205  GDALProgressFunc pfnProgress,
1206  void * pProgressData );
1207 
1208  virtual CPLErr AdviseRead( int nXOff, int nYOff, int nXSize, int nYSize,
1209  int nBufXSize, int nBufYSize,
1210  GDALDataType eBufType, char **papszOptions );
1211 
1212  virtual CPLErr GetHistogram( double dfMin, double dfMax,
1213  int nBuckets, GUIntBig * panHistogram,
1214  int bIncludeOutOfRange, int bApproxOK,
1215  GDALProgressFunc, void *pProgressData );
1216 
1217  virtual CPLErr GetDefaultHistogram( double *pdfMin, double *pdfMax,
1218  int *pnBuckets, GUIntBig ** ppanHistogram,
1219  int bForce,
1220  GDALProgressFunc, void *pProgressData);
1221  virtual CPLErr SetDefaultHistogram( double dfMin, double dfMax,
1222  int nBuckets, GUIntBig *panHistogram );
1223 
1224  virtual GDALRasterAttributeTable *GetDefaultRAT();
1225  virtual CPLErr SetDefaultRAT( const GDALRasterAttributeTable * poRAT );
1226 
1227  virtual GDALRasterBand *GetMaskBand();
1228  virtual int GetMaskFlags();
1229  virtual CPLErr CreateMaskBand( int nFlagsIn );
1230 
1231  virtual CPLVirtualMem *GetVirtualMemAuto( GDALRWFlag eRWFlag,
1232  int *pnPixelSpace,
1233  GIntBig *pnLineSpace,
1234  char **papszOptions ) CPL_WARN_UNUSED_RESULT;
1235 
1236  int GetDataCoverageStatus( int nXOff, int nYOff,
1237  int nXSize, int nYSize,
1238  int nMaskFlagStop = 0,
1239  double* pdfDataPct = nullptr );
1240 
1241  void ReportError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt, ...) CPL_PRINT_FUNC_FORMAT (4, 5);
1242 
1246  static inline GDALRasterBandH ToHandle(GDALRasterBand* poBand)
1247  { return static_cast<GDALRasterBandH>(poBand); }
1248 
1253  { return static_cast<GDALRasterBand*>(hBand); }
1254 
1255 private:
1257 };
1258 
1260 /* ******************************************************************** */
1261 /* GDALAllValidMaskBand */
1262 /* ******************************************************************** */
1263 
1264 class CPL_DLL GDALAllValidMaskBand : public GDALRasterBand
1265 {
1266  protected:
1267  CPLErr IReadBlock( int, int, void * ) override;
1268 
1269  CPL_DISALLOW_COPY_ASSIGN(GDALAllValidMaskBand)
1270 
1271  public:
1272  explicit GDALAllValidMaskBand( GDALRasterBand * );
1273  ~GDALAllValidMaskBand() override;
1274 
1275  GDALRasterBand *GetMaskBand() override;
1276  int GetMaskFlags() override;
1277 };
1278 
1279 /* ******************************************************************** */
1280 /* GDALNoDataMaskBand */
1281 /* ******************************************************************** */
1282 
1283 class CPL_DLL GDALNoDataMaskBand : public GDALRasterBand
1284 {
1285  double dfNoDataValue;
1286  GDALRasterBand *poParent;
1287 
1288  CPL_DISALLOW_COPY_ASSIGN(GDALNoDataMaskBand)
1289 
1290  protected:
1291  CPLErr IReadBlock( int, int, void * ) override;
1292  CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1293  void *, int, int, GDALDataType,
1294  GSpacing, GSpacing, GDALRasterIOExtraArg* psExtraArg ) override;
1295 
1296  public:
1297  explicit GDALNoDataMaskBand( GDALRasterBand * );
1298  ~GDALNoDataMaskBand() override;
1299 };
1300 
1301 /* ******************************************************************** */
1302 /* GDALNoDataValuesMaskBand */
1303 /* ******************************************************************** */
1304 
1305 class CPL_DLL GDALNoDataValuesMaskBand : public GDALRasterBand
1306 {
1307  double *padfNodataValues;
1308 
1309  CPL_DISALLOW_COPY_ASSIGN(GDALNoDataValuesMaskBand)
1310 
1311  protected:
1312  CPLErr IReadBlock( int, int, void * ) override;
1313 
1314  public:
1315  explicit GDALNoDataValuesMaskBand( GDALDataset * );
1316  ~GDALNoDataValuesMaskBand() override;
1317 };
1318 
1319 /* ******************************************************************** */
1320 /* GDALRescaledAlphaBand */
1321 /* ******************************************************************** */
1322 
1323 class GDALRescaledAlphaBand : public GDALRasterBand
1324 {
1325  GDALRasterBand *poParent;
1326  void *pTemp;
1327 
1328  CPL_DISALLOW_COPY_ASSIGN(GDALRescaledAlphaBand)
1329 
1330  protected:
1331  CPLErr IReadBlock( int, int, void * ) override;
1332  CPLErr IRasterIO( GDALRWFlag, int, int, int, int,
1333  void *, int, int, GDALDataType,
1334  GSpacing, GSpacing,
1335  GDALRasterIOExtraArg* psExtraArg ) override;
1336 
1337  public:
1338  explicit GDALRescaledAlphaBand( GDALRasterBand * );
1339  ~GDALRescaledAlphaBand() override;
1340 };
1342 
1343 /* ******************************************************************** */
1344 /* GDALIdentifyEnum */
1345 /* ******************************************************************** */
1346 
1352 typedef enum
1353 {
1361 
1362 /* ******************************************************************** */
1363 /* GDALDriver */
1364 /* ******************************************************************** */
1365 
1377 class CPL_DLL GDALDriver : public GDALMajorObject
1378 {
1379  public:
1380  GDALDriver();
1381  ~GDALDriver() override;
1382 
1383  CPLErr SetMetadataItem( const char * pszName,
1384  const char * pszValue,
1385  const char * pszDomain = "" ) override;
1386 
1387 /* -------------------------------------------------------------------- */
1388 /* Public C++ methods. */
1389 /* -------------------------------------------------------------------- */
1390  GDALDataset *Create( const char * pszName,
1391  int nXSize, int nYSize, int nBands,
1392  GDALDataType eType, char ** papszOptions ) CPL_WARN_UNUSED_RESULT;
1393 
1394  CPLErr Delete( const char * pszName );
1395  CPLErr Rename( const char * pszNewName,
1396  const char * pszOldName );
1397  CPLErr CopyFiles( const char * pszNewName,
1398  const char * pszOldName );
1399 
1400  GDALDataset *CreateCopy( const char *, GDALDataset *,
1401  int, char **,
1402  GDALProgressFunc pfnProgress,
1403  void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1404 
1405 /* -------------------------------------------------------------------- */
1406 /* The following are semiprivate, not intended to be accessed */
1407 /* by anyone but the formats instantiating and populating the */
1408 /* drivers. */
1409 /* -------------------------------------------------------------------- */
1411  GDALDataset *(*pfnOpen)( GDALOpenInfo * );
1412 
1413  GDALDataset *(*pfnCreate)( const char * pszName,
1414  int nXSize, int nYSize, int nBands,
1415  GDALDataType eType,
1416  char ** papszOptions );
1417 
1418  CPLErr (*pfnDelete)( const char * pszName );
1419 
1420  GDALDataset *(*pfnCreateCopy)( const char *, GDALDataset *,
1421  int, char **,
1422  GDALProgressFunc pfnProgress,
1423  void * pProgressData );
1424 
1425  void *pDriverData;
1426 
1427  void (*pfnUnloadDriver)(GDALDriver *);
1428 
1436  int (*pfnIdentify)( GDALOpenInfo * );
1437 
1438  CPLErr (*pfnRename)( const char * pszNewName,
1439  const char * pszOldName );
1440  CPLErr (*pfnCopyFiles)( const char * pszNewName,
1441  const char * pszOldName );
1442 
1443  /* For legacy OGR drivers */
1444  GDALDataset *(*pfnOpenWithDriverArg)( GDALDriver*, GDALOpenInfo * );
1445  GDALDataset *(*pfnCreateVectorOnly)( GDALDriver*,
1446  const char * pszName,
1447  char ** papszOptions );
1448  CPLErr (*pfnDeleteDataSource)( GDALDriver*,
1449  const char * pszName );
1451 
1452 /* -------------------------------------------------------------------- */
1453 /* Helper methods. */
1454 /* -------------------------------------------------------------------- */
1456  GDALDataset *DefaultCreateCopy( const char *, GDALDataset *,
1457  int, char **,
1458  GDALProgressFunc pfnProgress,
1459  void * pProgressData ) CPL_WARN_UNUSED_RESULT;
1460  static CPLErr DefaultCopyMasks( GDALDataset *poSrcDS,
1461  GDALDataset *poDstDS,
1462  int bStrict );
1464  static CPLErr QuietDelete( const char * pszName );
1465 
1467  static CPLErr DefaultRename( const char * pszNewName,
1468  const char * pszOldName );
1469  static CPLErr DefaultCopyFiles( const char * pszNewName,
1470  const char * pszOldName );
1472 
1476  static inline GDALDriverH ToHandle(GDALDriver* poDriver)
1477  { return static_cast<GDALDriverH>(poDriver); }
1478 
1482  static inline GDALDriver* FromHandle(GDALDriverH hDriver)
1483  { return static_cast<GDALDriver*>(hDriver); }
1484 
1485 private:
1486  CPL_DISALLOW_COPY_ASSIGN(GDALDriver)
1487 };
1488 
1489 /* ******************************************************************** */
1490 /* GDALDriverManager */
1491 /* ******************************************************************** */
1492 
1500 class CPL_DLL GDALDriverManager : public GDALMajorObject
1501 {
1502  int nDrivers = 0;
1503  GDALDriver **papoDrivers = nullptr;
1504  std::map<CPLString, GDALDriver*> oMapNameToDrivers{};
1505 
1506  GDALDriver *GetDriver_unlocked( int iDriver )
1507  { return (iDriver >= 0 && iDriver < nDrivers) ?
1508  papoDrivers[iDriver] : nullptr; }
1509 
1510  GDALDriver *GetDriverByName_unlocked( const char * pszName )
1511  { return oMapNameToDrivers[CPLString(pszName).toupper()]; }
1512 
1514 
1515  public:
1517  ~GDALDriverManager();
1518 
1519  int GetDriverCount( void ) const;
1520  GDALDriver *GetDriver( int );
1521  GDALDriver *GetDriverByName( const char * );
1522 
1523  int RegisterDriver( GDALDriver * );
1524  void DeregisterDriver( GDALDriver * );
1525 
1526  // AutoLoadDrivers is a no-op if compiled with GDAL_NO_AUTOLOAD defined.
1527  static void AutoLoadDrivers();
1528  void AutoSkipDrivers();
1529 };
1530 
1532 GDALDriverManager CPL_DLL * GetGDALDriverManager( void );
1533 CPL_C_END
1534 
1535 /* ******************************************************************** */
1536 /* GDALAsyncReader */
1537 /* ******************************************************************** */
1538 
1544 class CPL_DLL GDALAsyncReader
1545 {
1546 
1548 
1549  protected:
1551  GDALDataset* poDS;
1552  int nXOff;
1553  int nYOff;
1554  int nXSize;
1555  int nYSize;
1556  void * pBuf;
1557  int nBufXSize;
1558  int nBufYSize;
1559  GDALDataType eBufType;
1560  int nBandCount;
1561  int* panBandMap;
1562  int nPixelSpace;
1563  int nLineSpace;
1564  int nBandSpace;
1566 
1567  public:
1568  GDALAsyncReader();
1569  virtual ~GDALAsyncReader();
1570 
1574  GDALDataset* GetGDALDataset() {return poDS;}
1578  int GetXOffset() const { return nXOff; }
1582  int GetYOffset() const { return nYOff; }
1586  int GetXSize() const { return nXSize; }
1590  int GetYSize() const { return nYSize; }
1594  void * GetBuffer() {return pBuf;}
1598  int GetBufferXSize() const { return nBufXSize; }
1602  int GetBufferYSize() const { return nBufYSize; }
1606  GDALDataType GetBufferType() const { return eBufType; }
1610  int GetBandCount() const { return nBandCount; }
1614  int* GetBandMap() { return panBandMap; }
1618  int GetPixelSpace() const { return nPixelSpace; }
1622  int GetLineSpace() const { return nLineSpace; }
1626  int GetBandSpace() const { return nBandSpace; }
1627 
1628  virtual GDALAsyncStatusType
1629  GetNextUpdatedRegion(double dfTimeout,
1630  int* pnBufXOff, int* pnBufYOff,
1631  int* pnBufXSize, int* pnBufYSize) = 0;
1632  virtual int LockBuffer( double dfTimeout = -1.0 );
1633  virtual void UnlockBuffer();
1634 };
1635 
1636 /* ==================================================================== */
1637 /* An assortment of overview related stuff. */
1638 /* ==================================================================== */
1639 
1641 /* Only exported for drivers as plugin. Signature may change */
1642 CPLErr CPL_DLL
1643 GDALRegenerateOverviewsMultiBand(int nBands, GDALRasterBand** papoSrcBands,
1644  int nOverviews,
1645  GDALRasterBand*** papapoOverviewBands,
1646  const char * pszResampling,
1647  GDALProgressFunc pfnProgress, void * pProgressData );
1648 
1649 typedef CPLErr (*GDALResampleFunction)
1650  ( double dfXRatioDstToSrc,
1651  double dfYRatioDstToSrc,
1652  double dfSrcXDelta,
1653  double dfSrcYDelta,
1654  GDALDataType eWrkDataType,
1655  void * pChunk,
1656  GByte * pabyChunkNodataMask,
1657  int nChunkXOff, int nChunkXSize,
1658  int nChunkYOff, int nChunkYSize,
1659  int nDstXOff, int nDstXOff2,
1660  int nDstYOff, int nDstYOff2,
1661  GDALRasterBand * poOverview,
1662  const char * pszResampling,
1663  int bHasNoData, float fNoDataValue,
1664  GDALColorTable* poColorTable,
1665  GDALDataType eSrcDataType,
1666  bool bPropagateNoData );
1667 
1668 GDALResampleFunction GDALGetResampleFunction(const char* pszResampling,
1669  int* pnRadius);
1670 
1671 #ifdef GDAL_ENABLE_RESAMPLING_MULTIBAND
1672 typedef CPLErr (*GDALResampleFunctionMultiBands)
1673  ( double dfXRatioDstToSrc,
1674  double dfYRatioDstToSrc,
1675  double dfSrcXDelta,
1676  double dfSrcYDelta,
1677  GDALDataType eWrkDataType,
1678  void * pChunk, int nBands,
1679  GByte * pabyChunkNodataMask,
1680  int nChunkXOff, int nChunkXSize,
1681  int nChunkYOff, int nChunkYSize,
1682  int nDstXOff, int nDstXOff2,
1683  int nDstYOff, int nDstYOff2,
1684  GDALRasterBand ** papoDstBands,
1685  const char * pszResampling,
1686  int bHasNoData, float fNoDataValue,
1687  GDALColorTable* poColorTable,
1688  GDALDataType eSrcDataType);
1689 
1690 GDALResampleFunctionMultiBands GDALGetResampleFunctionMultiBands(const char* pszResampling,
1691  int* pnRadius);
1692 #endif
1693 
1694 GDALDataType GDALGetOvrWorkDataType(const char* pszResampling,
1695  GDALDataType eSrcDataType);
1696 
1698 
1699 CPLErr CPL_DLL
1700 HFAAuxBuildOverviews( const char *pszOvrFilename, GDALDataset *poParentDS,
1701  GDALDataset **ppoDS,
1702  int nBands, int *panBandList,
1703  int nNewOverviews, int *panNewOverviewList,
1704  const char *pszResampling,
1705  GDALProgressFunc pfnProgress,
1706  void *pProgressData );
1707 
1708 CPLErr CPL_DLL
1709 GTIFFBuildOverviews( const char * pszFilename,
1710  int nBands, GDALRasterBand **papoBandList,
1711  int nOverviews, int * panOverviewList,
1712  const char * pszResampling,
1713  GDALProgressFunc pfnProgress, void * pProgressData );
1714 
1715 CPLErr CPL_DLL
1716 GDALDefaultBuildOverviews( GDALDataset *hSrcDS, const char * pszBasename,
1717  const char * pszResampling,
1718  int nOverviews, int * panOverviewList,
1719  int nBands, int * panBandList,
1720  GDALProgressFunc pfnProgress, void * pProgressData);
1721 
1722 int CPL_DLL GDALBandGetBestOverviewLevel(GDALRasterBand* poBand,
1723  int &nXOff, int &nYOff,
1724  int &nXSize, int &nYSize,
1725  int nBufXSize, int nBufYSize) CPL_WARN_DEPRECATED("Use GDALBandGetBestOverviewLevel2 instead");
1726 int CPL_DLL GDALBandGetBestOverviewLevel2(GDALRasterBand* poBand,
1727  int &nXOff, int &nYOff,
1728  int &nXSize, int &nYSize,
1729  int nBufXSize, int nBufYSize,
1730  GDALRasterIOExtraArg* psExtraArg);
1731 
1732 int CPL_DLL GDALOvLevelAdjust( int nOvLevel, int nXSize ) CPL_WARN_DEPRECATED("Use GDALOvLevelAdjust2 instead");
1733 int CPL_DLL GDALOvLevelAdjust2( int nOvLevel, int nXSize, int nYSize );
1734 int CPL_DLL GDALComputeOvFactor( int nOvrXSize, int nRasterXSize,
1735  int nOvrYSize, int nRasterYSize );
1736 
1737 GDALDataset CPL_DLL *
1738 GDALFindAssociatedAuxFile( const char *pszBasefile, GDALAccess eAccess,
1739  GDALDataset *poDependentDS );
1740 
1741 /* ==================================================================== */
1742 /* Infrastructure to check that dataset characteristics are valid */
1743 /* ==================================================================== */
1744 
1745 int CPL_DLL GDALCheckDatasetDimensions( int nXSize, int nYSize );
1746 int CPL_DLL GDALCheckBandCount( int nBands, int bIsZeroAllowed );
1747 
1748 /* Internal use only */
1749 
1750 /* CPL_DLL exported, but only for in-tree drivers that can be built as plugins */
1751 int CPL_DLL GDALReadWorldFile2( const char *pszBaseFilename, const char *pszExtension,
1752  double *padfGeoTransform, char** papszSiblingFiles,
1753  char** ppszWorldFileNameOut);
1754 int GDALReadTabFile2( const char * pszBaseFilename,
1755  double *padfGeoTransform, char **ppszWKT,
1756  int *pnGCPCount, GDAL_GCP **ppasGCPs,
1757  char** papszSiblingFiles, char** ppszTabFileNameOut );
1758 
1759 void CPL_DLL GDALCopyRasterIOExtraArg(GDALRasterIOExtraArg* psDestArg,
1760  GDALRasterIOExtraArg* psSrcArg);
1761 
1762 CPL_C_END
1763 
1764 void GDALNullifyOpenDatasetsList();
1765 CPLMutex** GDALGetphDMMutex();
1766 CPLMutex** GDALGetphDLMutex();
1767 void GDALNullifyProxyPoolSingleton();
1768 GDALDriver* GDALGetAPIPROXYDriver();
1769 void GDALSetResponsiblePIDForCurrentThread(GIntBig responsiblePID);
1770 GIntBig GDALGetResponsiblePIDForCurrentThread();
1771 
1772 CPLString GDALFindAssociatedFile( const char *pszBasename, const char *pszExt,
1773  CSLConstList papszSiblingFiles, int nFlags );
1774 
1775 CPLErr EXIFExtractMetadata(char**& papszMetadata,
1776  void *fpL, int nOffset,
1777  int bSwabflag, int nTIFFHEADER,
1778  int& nExifOffset, int& nInterOffset, int& nGPSOffset);
1779 
1780 int GDALValidateOpenOptions( GDALDriverH hDriver,
1781  const char* const* papszOptionOptions);
1782 int GDALValidateOptions( const char* pszOptionList,
1783  const char* const* papszOptionsToValidate,
1784  const char* pszErrorMessageOptionType,
1785  const char* pszErrorMessageContainerName);
1786 
1787 GDALRIOResampleAlg GDALRasterIOGetResampleAlg(const char* pszResampling);
1788 const char* GDALRasterIOGetResampleAlg(GDALRIOResampleAlg eResampleAlg);
1789 
1790 void GDALRasterIOExtraArgSetResampleAlg(GDALRasterIOExtraArg* psExtraArg,
1791  int nXSize, int nYSize,
1792  int nBufXSize, int nBufYSize);
1793 
1794 
1795 GDALDataset* GDALCreateOverviewDataset(GDALDataset* poDS, int nOvrLevel,
1796  int bThisLevelOnly);
1797 
1798 // Should cover particular cases of #3573, #4183, #4506, #6578
1799 // Behaviour is undefined if fVal1 or fVal2 are NaN (should be tested before
1800 // calling this function)
1801 template<class T> inline bool ARE_REAL_EQUAL(T fVal1, T fVal2, int ulp = 2)
1802 {
1803  return fVal1 == fVal2 || /* Should cover infinity */
1804  std::abs(fVal1 - fVal2) < std::numeric_limits<float>::epsilon() * std::abs(fVal1+fVal2) * ulp;
1805 }
1806 
1807 #define DIV_ROUND_UP(a, b) ( ((a) % (b)) == 0 ? ((a) / (b)) : (((a) / (b)) + 1) )
1808 
1809 // Number of data samples that will be used to compute approximate statistics
1810 // (minimum value, maximum value, etc.)
1811 #define GDALSTAT_APPROX_NUMSAMPLES 2500
1812 
1814 /* Caution: for technical reason this declaration is duplicated in gdal_crs.c */
1815 /* so any signature change should be reflected there too */
1816 void GDALSerializeGCPListToXML( CPLXMLNode* psParentNode,
1817  GDAL_GCP* pasGCPList,
1818  int nGCPCount,
1819  const char* pszGCPProjection );
1820 void GDALDeserializeGCPListFromXML( CPLXMLNode* psGCPList,
1821  GDAL_GCP** ppasGCPList,
1822  int* pnGCPCount,
1823  char** ppszGCPProjection );
1824 CPL_C_END
1825 
1826 void GDALSerializeOpenOptionsToXML( CPLXMLNode* psParentNode, char** papszOpenOptions);
1827 char** GDALDeserializeOpenOptionsFromXML( CPLXMLNode* psParentNode );
1828 
1829 int GDALCanFileAcceptSidecarFile(const char* pszFilename);
1831 
1832 #endif /* ndef GDAL_PRIV_H_INCLUDED */
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:47
Layer iterator.
Definition: gdal_priv.h:655
GDALDatasetH GDALOpenEx(const char *pszFilename, unsigned int nOpenFlags, const char *const *papszAllowedDrivers, const char *const *papszOpenOptions, const char *const *papszSiblingFiles) CPL_WARN_UNUSED_RESULT
Open a raster or vector file as a GDALDataset.
Definition: gdaldataset.cpp:2633
std::unique_ptr< OGRFeature, OGRFeatureUniquePtrDeleter > OGRFeatureUniquePtr
Unique pointer type for OGRFeature.
Definition: ogr_feature.h:779
GDALDataType
Definition: gdal.h:60
GDALDataType GetBufferType() const
Return buffer data type.
Definition: gdal_priv.h:1606
Identify could not determine if the file is recognized or not by the probed driver.
Definition: gdal_priv.h:1355
std::unique_ptr< GDALDataset, GDALDatasetUniquePtrDeleter > GDALDatasetUniquePtr
Unique pointer type for GDALDataset.
Definition: gdal_priv.h:812
Document node structure.
Definition: cpl_minixml.h:66
Standard C Covers.
Definitions for CPL mini XML Parser/Serializer.
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition: gdal_priv.h:879
void static GDALRasterBandH ToHandle(GDALRasterBand *poBand)
Convert a GDALRasterBand* to a GDALRasterBandH.
Definition: gdal_priv.h:1246
Definition: gdal.h:62
Definition: gdal.h:219
GDALDataset * GetGDALDataset()
Return dataset.
Definition: gdal_priv.h:1574
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:335
Object returned by GetFeatures() iterators.
Definition: gdal_priv.h:615
const char *const * papszAllowedDrivers
Allowed drivers (NULL for all)
Definition: gdal_priv.h:300
int * GetBandMap()
Return band map.
Definition: gdal_priv.h:1614
int DropLock(void)
Decrement the lock count.
Definition: gdal_priv.h:863
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:155
char ** GetOpenOptions()
Return open options.
Definition: gdal_priv.h:563
void pointer
pointer
Definition: gdal_priv.h:664
GByte * pabyHeader
Buffer with first bytes of the file.
Definition: gdal_priv.h:297
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition: gdal_priv.h:875
GDALAccess eAccess
Access flag.
Definition: gdal_priv.h:282
GDALRIOResampleAlg
RasterIO() resampling method.
Definition: gdal.h:128
VSILFILE * fpL
Pointer to the file.
Definition: gdal_priv.h:292
int GetXSize() const
Return width.
Definition: gdal_priv.h:1586
static GDALRasterBand * FromHandle(GDALRasterBandH hBand)
Convert a GDALRasterBandH to a GDALRasterBand*.
Definition: gdal_priv.h:1252
GDALRWFlag
Definition: gdal.h:119
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition: gdal.h:255
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:213
char * pszFilename
Filename.
Definition: gdal_priv.h:277
Color tuple.
Definition: gdal.h:1044
int nOpenFlags
Open flags.
Definition: gdal_priv.h:284
A single raster block in the block cache.
Definition: gdal_priv.h:822
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition: gdal.h:258
int AddLock(void)
Increment the lock count.
Definition: gdal_priv.h:861
Convenient string class based on std::string.
Definition: cpl_string.h:327
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Tag a function to have printf() formatting.
Definition: cpl_port.h:904
unknown type, non-standard
Definition: ogr_core.h:319
int GetLineSpace() const
Return line spacing.
Definition: gdal_priv.h:1622
struct CPLVirtualMem CPLVirtualMem
Opaque type that represents a virtual memory mapping.
Definition: cpl_virtualmem.h:62
virtual CPLErr IReadBlock(int nBlockXOff, int nBlockYOff, void *pData)=0
Read a block of data.
CPLErr BuildOverviews(const char *, int, int *, int, int *, GDALProgressFunc, void *)
Build raster overview(s)
Definition: gdaldataset.cpp:1456
Various convenience functions for working with strings and string lists.
GIntBig GSpacing
Type to express pixel, line or band spacing.
Definition: gdal.h:273
int bIsDirectory
Whether the file is a directory.
Definition: gdal_priv.h:289
static GDALColorTableH ToHandle(GDALColorTable *poCT)
Convert a GDALColorTable* to a GDALRasterBandH.
Definition: gdal_priv.h:962
int GetYSize() const
Return the height of the block.
Definition: gdal_priv.h:887
int GetXSize() const
Return the width of the block.
Definition: gdal_priv.h:883
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:317
static GDALDriverH ToHandle(GDALDriver *poDriver)
Convert a GDALDriver* to a GDALDriverH.
Definition: gdal_priv.h:1476
Public (C callable) GDAL entry points.
static GDALDataset * Open(const char *pszFilename, unsigned int nOpenFlags=0, const char *const *papszAllowedDrivers=nullptr, const char *const *papszOpenOptions=nullptr, const char *const *papszSiblingFiles=nullptr)
Definition: gdal_priv.h:602
GDALAsyncStatusType
status of the asynchronous stream
Definition: gdal.h:100
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:286
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1184
void * GetBuffer()
Return buffer.
Definition: gdal_priv.h:1594
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition: gdal_priv.h:907
Class for dataset open functions.
Definition: gdal_priv.h:265
int GetYOffset() const
Return y offset.
Definition: gdal_priv.h:1582
void MarkSuppressOnClose()
Set that the dataset must be deleted on close.
Definition: gdal_priv.h:558
String list class designed around our use of C "char**" string lists.
Definition: cpl_string.h:435
static GDALDriver * FromHandle(GDALDriverH hDriver)
Convert a GDALDriverH to a GDALDriver*.
Definition: gdal_priv.h:1482
Structure to pass extra arguments to RasterIO() method.
Definition: gdal.h:147
Identify determined the file is recognized by the probed driver.
Definition: gdal_priv.h:1359
static GDALMajorObjectH ToHandle(GDALMajorObject *poMajorObject)
Convert a GDALMajorObject* to a GDALMajorObjectH.
Definition: gdal_priv.h:168
GDALPaletteInterp
Definition: gdal.h:216
Core portability services for cross-platform OGR code.
int bStatOK
Whether stat()'ing the file was successful.
Definition: gdal_priv.h:287
int nHeaderBytes
Number of bytes in pabyHeader.
Definition: gdal_priv.h:295
Class returned by GetBands() that act as a container for raster bands.
Definition: gdal_priv.h:460
virtual int CloseDependentDatasets()
Drop references to any other datasets referenced by this dataset.
Definition: gdaldataset.cpp:3398
void * GetDataRef(void)
Return the data buffer.
Definition: gdal_priv.h:895
int GetYSize() const
Return height.
Definition: gdal_priv.h:1590
virtual CPLErr CreateMaskBand(int nFlagsIn)
Adds a mask band to the dataset.
Definition: gdaldataset.cpp:2444
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:249
int CPLErrorNum
Error number.
Definition: cpl_error.h:94
Various convenience functions for CPL.
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:147
int GetBufferXSize() const
Return buffer width.
Definition: gdal_priv.h:1598
void * GDALDriverH
Opaque type used for the C bindings of the C++ GDALDriver class.
Definition: gdal.h:261
void GDALClose(GDALDatasetH)
Close GDAL dataset.
Definition: gdaldataset.cpp:3027
static GDALDatasetH ToHandle(GDALDataset *poDS)
Convert a GDALDataset* to a GDALDatasetH.
Definition: gdal_priv.h:590
void * GDALMajorObjectH
Opaque type used for the C bindings of the C++ GDALMajorObject class.
Definition: gdal.h:252
char ** papszOpenOptions
Open options.
Definition: gdal_priv.h:279
Object with metadata.
Definition: gdal_priv.h:132
int GetBufferYSize() const
Return buffer height.
Definition: gdal_priv.h:1602
Class returned by GetLayers() that acts as a range of layers.
Definition: gdal_priv.h:642
static GDALDataset * FromHandle(GDALDatasetH hDS)
Convert a GDALDatasetH to a GDALDataset*.
Definition: gdal_priv.h:596
std::input_iterator_tag iterator_category
iterator_category
Definition: gdal_priv.h:665
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:70
int GetDirty() const
Return the dirty flag.
Definition: gdal_priv.h:891
A single raster band (or channel).
Definition: gdal_priv.h:1032
GDALAccess
Definition: gdal.h:113
Simple feature classes.
int GetPixelSpace() const
Return pixel spacing.
Definition: gdal_priv.h:1618
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:353
int GetBandSpace() const
Return band spacing.
Definition: gdal_priv.h:1626
This class represents a style table.
Definition: ogr_featurestyle.h:84
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:335
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:337
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:246
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition: gdal.h:264
int GetXOffset() const
Return x offset.
Definition: gdal_priv.h:1578
Class for managing the registration of file format drivers.
Definition: gdal_priv.h:1500
OGRLayer::FeatureIterator begin(OGRLayer *poLayer)
Return begin of feature iterator.
Definition: ogrsf_frmts.h:287
#define CPL_NULL_TERMINATED
Null terminated variadic.
Definition: cpl_port.h:894
CPLSTRING_METHOD_DLL CPLString & toupper(void)
Convert to upper case in place.
Definition: cplstring.cpp:316
GDALIdentifyEnum
Enumeration used by GDALDriver::pfnIdentify().
Definition: gdal_priv.h:1352
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
GDALColorInterp
Definition: gdal.h:190
int GDALGetDataTypeSizeBytes(GDALDataType)
Get data type size in bytes.
Definition: gdal_misc.cpp:305
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition: gdalmajorobject.cpp:388
Class returned by GetFeatures() that act as a container for vector features.
Definition: gdal_priv.h:705
static GDALMajorObject * FromHandle(GDALMajorObjectH hMajorObject)
Convert a GDALMajorObjectH to a GDALMajorObject*.
Definition: gdal_priv.h:174
GDALDataType GetDataType() const
Return the data type.
Definition: gdal_priv.h:871
Identify determined the file is not recognized by the probed driver.
Definition: gdal_priv.h:1357
OGRLayer::FeatureIterator end(OGRLayer *poLayer)
Return end of feature iterator.
Definition: ogrsf_frmts.h:292
int GetBandCount() const
Return band count.
Definition: gdal_priv.h:1610
void difference_type
difference_type
Definition: gdal_priv.h:663
Definition: gdal.h:114
Format specific driver.
Definition: gdal_priv.h:1377
int GetBlockSize() const
Return the block size in bytes.
Definition: gdal_priv.h:899
A color table / palette.
Definition: gdal_priv.h:937
Ground Control Point.
Definition: gdal.h:560
CPLErr
Error category.
Definition: cpl_error.h:52
GDALDriverManager * GetGDALDriverManager(void)
Fetch the global GDAL driver manager.
Definition: gdaldrivermanager.cpp:97
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:987
#define CPL_WARN_UNUSED_RESULT
Qualifier to warn when the return value of a function is not used.
Definition: cpl_port.h:929
Class used as a session object for asynchronous requests.
Definition: gdal_priv.h:1544
static GDALColorTable * FromHandle(GDALColorTableH hCT)
Convert a GDALColorTableH to a GDALColorTable*.
Definition: gdal_priv.h:968

Generated for GDAL by doxygen 1.8.8.