31 #include "cpl_string.h"
32 #include "ogr_spatialref.h"
33 #include "rawdataset.h"
51 const char *pszFilename;
54 vsi_l_offset nFileSize;
58 vsi_l_offset nGeoPtrOffset;
60 vsi_l_offset nGeoOffset;
61 vsi_l_offset nGcpPtrOffset;
63 vsi_l_offset nGcpOffset;
66 int bGeoTransformValid;
73 double adfGeoTransform[6];
75 char *pszGCPProjection;
77 GDALDataType PCIDSKTypeToGDAL(
const char *);
78 void WriteGeoSegment();
80 void CollectPCIDSKMetadata(
int nSegment );
86 vsi_l_offset *panSegOffset;
87 vsi_l_offset *panSegSize;
90 VSILFILE **pafpBandFiles;
96 static int Identify( GDALOpenInfo * );
97 static GDALDataset *Open( GDALOpenInfo * );
98 static GDALDataset *Create(
const char * pszFilename,
99 int nXSize,
int nYSize,
int nBands,
100 GDALDataType eType,
char **papszParmList );
101 static GDALDataset *CreateCopy(
const char * pszFilename,
102 GDALDataset *poSrcDS,
103 int bStrict,
char ** papszOptions,
104 GDALProgressFunc pfnProgress,
105 void * pProgressData );
107 virtual void FlushCache(
void );
109 CPLErr GetGeoTransform(
double * padfTransform );
110 virtual CPLErr SetGeoTransform(
double * );
111 const char *GetProjectionRef();
112 virtual CPLErr SetProjection(
const char * );
113 virtual int GetGCPCount();
114 virtual const char *GetGCPProjection();
115 virtual const GDAL_GCP *GetGCPs();
118 int SegRead(
int nSegment,
119 vsi_l_offset nOffset,
137 vsi_l_offset *panBlockOffset;
140 vsi_l_offset *panTileOffset;
144 GDALRasterBand **papoOverviews;
146 char szCompression[9];
148 void AttachOverview( GDALRasterBand *poOvBand ) {
151 papoOverviews = (GDALRasterBand **)
152 CPLRealloc(papoOverviews,
sizeof(
void*) * nOverviewCount);
153 papoOverviews[nOverviewCount-1] = poOvBand;
163 virtual CPLErr IReadBlock(
int,
int,
void * );
165 int SysRead( vsi_l_offset nOffset,
int nSize,
void * );
167 virtual int GetOverviewCount() {
return nOverviewCount; }
168 virtual GDALRasterBand *GetOverview(
int iOverview)
169 {
return papoOverviews[iOverview]; }
181 GDALRasterBand **papoOverviews;
183 void AttachOverview( GDALRasterBand *poOvBand ) {
185 papoOverviews = (GDALRasterBand **)
186 CPLRealloc(papoOverviews,
sizeof(
void*) * nOverviewCount);
187 papoOverviews[nOverviewCount-1] = poOvBand;
192 vsi_l_offset nImgOffset,
int nPixelOffset,
194 GDALDataType eDataType,
int bNativeOrder )
195 : RawRasterBand( poDS, nBand, fpRaw, nImgOffset, nPixelOffset,
196 nLineOffset, eDataType, bNativeOrder, TRUE ) {
198 papoOverviews = NULL;
202 for(
int i = 0; i < nOverviewCount; i++ )
203 delete papoOverviews[i];
204 CPLFree( papoOverviews );
207 virtual int GetOverviewCount() {
208 if (nOverviewCount > 0)
209 return nOverviewCount;
211 return RawRasterBand::GetOverviewCount();
213 virtual GDALRasterBand *GetOverview(
int iOverview) {
214 if (iOverview < nOverviewCount)
215 return papoOverviews[iOverview];
217 return RawRasterBand::GetOverview(iOverview);