12 #include "TilingOptions.h"
31 #define BUF_SCANLINES 4
39 void Setup(GDALDataset *pDataset);
42 void ReadScanline(
int y,
int bufrow,
int overview);
43 RGBi *GetScanlineFromBuffer(
int y,
int overview);
44 void FindMaxBlockSize(GDALDataset *pDataset);
54 GDALRasterBand *m_pBand;
55 GDALRasterBand *m_pRed;
56 GDALRasterBand *m_pGreen;
57 GDALRasterBand *m_pBlue;
58 GDALColorTable *m_pTable;
76 BitmapInfo() { m_pBitmap = NULL; m_bOnDisk =
false; }
95 bool GetExtent(
DRECT &rect)
const;
96 void SetExtent(
const DRECT &rect);
99 int iSampleN,
bool progress_callback(
int) = NULL);
101 DPoint2 GetSpacing(
int bitmap = 0)
const;
102 vtBitmap *GetBitmap() {
return m_Bitmaps[0].m_pBitmap; }
109 void GetDimensions(
int &xsize,
int &ysize)
const
111 xsize = m_Bitmaps[0].m_Size.x;
112 ysize = m_Bitmaps[0].m_Size.y;
116 return m_Bitmaps[0].m_Size;
120 void GetRGB(
int x,
int y,
RGBi &rgb,
double dRes = 0.0);
121 void SetRGB(
int x,
int y, uchar r, uchar g, uchar b);
122 void SetRGB(
int x,
int y,
const RGBi &rgb);
123 void ReplaceColor(
const RGBi &rgb1,
const RGBi &rgb2);
124 void SetupBitmapInfo(
int iXSize,
int iYSize);
127 bool ReadPPM(
const char *fname,
bool progress_callback(
int) = NULL);
128 bool WritePPM(
const char *fname)
const;
129 bool SaveToFile(
const char *fname)
const;
130 bool ReadPNGFromMemory(uchar *buf,
int len);
131 bool LoadFromGDAL(
const char *fname);
132 bool CreateOverviews();
134 bool ReadFeaturesFromTerraserver(
const DRECT &area,
int iTheme,
135 int iMetersPerPixel,
int iUTMZone,
const char *filename);
138 DRECT &tile_area,
DPoint2 &tile_dim,
int col,
int row,
int lod);
141 static bool bTreatBlackAsTransparent;
144 GDALDataset *m_pDataset;
147 size_t NumBitmaps()
const {
return m_Bitmaps.size(); }
148 BitmapInfo &GetBitmapInfo(
size_t i) {
return m_Bitmaps[i]; }
149 int NumBitmapsInMemory();
150 int NumBitmapsOnDisk();
158 void CleanupGDALUsage();
164 std::vector<BitmapInfo> m_Bitmaps;
167 int m_iTotal, m_iCompleted;
168 ImageGLCanvas *m_pCanvas;
172 int GetBitDepthUsingGDAL(
const char *fname);
173 void MakeSampleOffsets(
const DPoint2 cellsize, uint N,
DLine2 &offsets);