45 #include <gdal_priv.h> 46 #include <cpl_string.h> 53 static ossimTrace traceDebug(
"ossimGdalTileSource:debug");
55 static const char DRIVER_SHORT_NAME_KW[] =
"driver_short_name";
56 static const char PRESERVE_PALETTE_KW[] =
"preserve_palette";
59 using namespace ossim;
74 theEntryNumberToRender(0),
76 theIsComplexFlag(false),
77 theAlphaChannelFlag(false),
78 m_preservePaletteIndexesFlag(false),
136 <<
"ossimGdalTileSource::open() DEBUG: entered ..." 165 <<
"ossimGdalTileSource::open DEBUG:" 166 <<
"\nOpened image: " 173 GDALDriverH driverTmp = GDALGetDatasetDriver(
theDataset);
177 driverNameTmp =
ossimString(GDALGetDriverShortName(driverTmp));
178 driverNameTmp = driverNameTmp.
upcase();
179 if (driverNameTmp ==
"NITF")
186 char** papszMetadata = GDALGetMetadata(
theDataset,
"SUBDATASETS" );
187 if( CSLCount(papszMetadata) > 0 )
191 for(
int i = 0; papszMetadata[i] != 0; ++i )
205 if ( subDataset != 0 )
210 ossimString nitfIcatTag( GDALGetMetadataItem( subDataset,
"NITF_ICAT",
"" ) );
211 if ( nitfIcatTag.
contains(
"CLOUD") == false )
216 GDALClose(subDataset);
228 <<
"ossimGdalTileSource::open DEBUG:" << std::endl;
232 <<
"Sub_data_set[" << idx <<
"] " 256 <<
"ossimGdalTileSource::open DEBUG:" 257 <<
"\nOpened sub data set: " 278 <<
"ossimGdalTileSource::open DEBUG:" 279 <<
"\nOpened sub data set: " 293 <<
"ossimGdalTileSource::open Driver: " 295 <<
"/" << GDALGetDriverLongName(
theDriver ) << std::endl;
303 if(CSLCount(GDALGetMetadata(
theDataset,
"SUBDATASETS")))
306 <<
"ossimGdalTileSource::open WARNING:" 307 <<
"\nHas multiple sub datasets and need to set the data before" 308 <<
" we can get to the bands" << std::endl;
313 <<
"ossimGdalTileSource::open WARNING:" 314 <<
"\nNo band data present in ossimGdalTileSource::open" << std::endl;
319 GDALRasterBandH bBand = GDALGetRasterBand(
theDataset, 1 );
324 char** papszMetadata = GDALGetMetadata( bBand, NULL );
325 if (CSLCount(papszMetadata) > 0)
327 for(
int i = 0; papszMetadata[i] != NULL; i++ )
330 if (metaStr.
contains(
"AREA_OR_POINT"))
334 if (pixel_is_point_or_area.
contains(
"area"))
343 for(i = 0; i < GDALGetRasterCount(
theDataset); ++i)
349 <<
"ossimGdalTileSource::open WARNING" 350 <<
"\nWe currently do not support different scalar type bands." 437 <<
"ossimGdalTileSoruce::open\n" 453 int xSize=0, ySize=0;
454 GDALGetBlockSize(GDALGetRasterBand(
theDataset, 1 ),
505 throw ossimException( std::string(
"ossimGdalTileSource::getTile ERROR: Accessing reduced resolution level with the preservePaletteIndexesFlag set!") );
523 GDALRasterBandH band = GDALGetRasterBand(
theDataset, 1);
524 if(static_cast<int>(resLevel) > GDALGetOverviewCount(band))
559 for(
ossim_uint32 aBandIndex =1; aBandIndex <= rasterCount; ++aBandIndex)
568 aGdalBandIndex = aBandIndex;
576 bReadSuccess = (GDALRasterIO(aBand
587 , 0 ) == CE_None) ?
true :
false;
589 if ( bReadSuccess ==
true )
598 clipRect, anOssimBandIndex);
599 anOssimBandIndex += 1;
610 anOssimBandIndex += 1;
639 bReadSuccess = (GDALRasterIO(aBand
650 , 0 ) == CE_None) ?
true :
false;
651 if ( bReadSuccess ==
true )
659 for(idx = 0; idx < idxMax; ++idx)
661 memcpy(outBufPtr, complexBufPtr, byteSize);
662 complexBufPtr += byteSize2;
663 outBufPtr += byteSize;
671 for(idx = 0; idx < idxMax; ++idx)
673 memcpy(outBufPtr, complexBufPtr, byteSize);
674 complexBufPtr += byteSize2;
675 outBufPtr += byteSize;
684 anOssimBandIndex += 2;
711 int xSize=0, ySize=0;
733 for(;
x < maxx;
x+=xSize)
735 for(;
y < maxy;
y+=ySize)
741 if(!cacheTile.
valid())
743 ossimIrect rect(origin.
x,origin.
y,origin.
x+xSize-1, origin.
y+ySize-1);
749 for(
ossim_uint32 aBandIndex =1; aBandIndex <= rasterCount; ++aBandIndex)
758 aGdalBandIndex = aBandIndex;
938 if (
x > 0 && x0 > 0 )
940 result.
x = ((double)
x) / x0;
944 result.
x = 1.0 / (1<<resLevel);
960 const char* prefix)
const 980 <<
"\nossimGdalTileSource::saveState keywordlist:\n" 998 const char* lookup = kwl.
find(prefix,
"entry");
1007 lookup = kwl.
find(prefix, PRESERVE_PALETTE_KW);
1083 if ( fgdcXmlDoc->
open(xmlFile) )
1104 static const char MODULE[] =
"ossimGdalTileSource::getImageGeometry";
1115 const char* wkt = GDALGetProjectionRef(
theDataset );
1121 CLOG <<
"WKT PROJECTION STRING = " << wkt << std::endl;
1131 <<
"GDALGetGCPCount = " << gcpCount << std::endl;
1149 if (projGcp.
valid())
1152 if (mapProj.
valid())
1161 const GDAL_GCP* gcpList = GDALGetGCPs(
theDataset);
1165 for(idx = 0; idx < gcpCount; ++idx)
1173 if ((gcpCount < 40) || (idx%10 == 0))
1175 ossimDpt dpt(gcpList[idx].dfGCPPixel, gcpList[idx].dfGCPLine);
1179 ossimDpt dptEastingNorthing(gcpList[idx].dfGCPX, gcpList[idx].dfGCPY);
1180 gpt = projGcp->
inverse(dptEastingNorthing);
1181 gpt.
hgt = gcpList[idx].dfGCPZ;
1185 gpt =
ossimGpt(gcpList[idx].dfGCPY, gcpList[idx].dfGCPX, gcpList[idx].dfGCPZ);
1193 <<
"Added tie point for gcp[" << idx <<
"]: " 1194 << dpt <<
", " << gpt << std::endl;
1210 double geoTransform[6];
1211 bool transOk = GDALGetGeoTransform(
theDataset, geoTransform ) == CE_None;
1217 << MODULE <<
"DEBUG: GDALGetGeoTransform failed..." << std::endl;
1224 << geoTransform[0] <<
", " << geoTransform[1] <<
", " << geoTransform[2] <<
", " 1225 << geoTransform[3] <<
", " << geoTransform[2] <<
", " << geoTransform[5] <<
">" 1238 if(transOk&&(driverName==
"AAIGrid"))
1243 << geoTransform[0] <<
", " << geoTransform[1] <<
", " << geoTransform[2] <<
", " 1244 << geoTransform[3] <<
", " << geoTransform[2] <<
", " << geoTransform[5] <<
">" 1247 if((std::fabs(geoTransform[0]) < (180.0+
FLT_EPSILON))&&
1248 (std::fabs(geoTransform[3]) < (90.0 +
FLT_EPSILON)))
1257 geoTransform[0] + ul.
x*geoTransform[1] + ul.
y*geoTransform[2]),
1261 geoTransform[0] + ur.
x*geoTransform[1] + ur.
y*geoTransform[2]),
1265 geoTransform[0] + lr.
x*geoTransform[1] + lr.
y*geoTransform[2]),
1269 geoTransform[0] + ll.
x*geoTransform[1] + ll.
y*geoTransform[2]),
1289 << MODULE <<
"DEBUG: wktTranslator.toOssimKwl failed..." << std::endl;
1297 const char* prefix = 0;
1302 ossimDpt gsd(fabs(geoTransform[1]), fabs(geoTransform[5]));
1313 if(driverName ==
"AIG")
1316 ossimDpt tie(geoTransform[0], geoTransform[3]);
1324 geoTransform[0] = tie.
x;
1325 geoTransform[3] = tie.
y;
1327 if(proj_type ==
"ossimLlxyProjection" ||
1328 proj_type ==
"ossimEquDistCylProjection")
1346 <<
" " << 0 <<
" " << 0 <<
" " << 1 <<
" " << 0
1347 <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " << 1;
1355 if(driverName ==
"AIG" && datum_type.
contains(
"OGB"))
1371 "ossimBngProjection",
true);
1377 if(datum ==
"OGB_A")
1379 else if(datum ==
"OGB_B")
1381 else if(datum ==
"OGB_C")
1383 else if(datum ==
"OGB_D")
1385 else if(datum ==
"OGB_M")
1387 else if(datum ==
"OGB_7")
1401 <<
"\nUnable to accurately support ArcGrid due to missing" 1402 <<
" prj.adf file." << std::endl;
1411 << MODULE <<
" DEBUG:" 1412 <<
"\nwktTranslator keyword list:\n" 1458 <<
"ossimGdalTileSource::getOutputScalarType debug:" 1459 <<
"\nOutput scalar: " << result << std::endl;
1545 <<
"ossimGdalTileSource::getInputScalarType debug:" 1547 <<
"\nInput scalar: " << result << std::endl;
1642 for(i = 0; i < 3; ++i)
1669 GDALRasterBandH aBand=0;
1671 aBand = GDALGetRasterBand(
theDataset, band+1);
1692 if ( driverName.
contains(
"JP2KAK") ||
1746 GDALRasterBandH band = GDALGetRasterBand(
theDataset, 1);
1747 if(GDALGetOverviewCount(band))
1749 result += (GDALGetOverviewCount(band));
1828 << __FILE__ << __LINE__
1829 <<
" ossimGdalTileSource::loadIndexTo3BandTile WARNING!\n" 1830 <<
"Unsupported scalar types:\nInupt scalar: " << inScalar
1831 <<
"\nOutput scalar: " << outScalar
1836 template<
class InputType,
class OutputType>
1844 GDALRasterBandH aBand=0;
1845 aBand = GDALGetRasterBand(
theDataset, aGdalBandStart);
1846 GDALColorTableH table = GDALGetRasterColorTable(aBand);
1861 s += (clipRect.
ul().
y - src_rect.
ul().
y) * s_width +
1862 clipRect.
ul().
x - src_rect.
ul().
x;
1867 d[0]=
static_cast<OutputType*
>(
theTile->
getBuf(anOssimBandStart));
1868 d[1]=
static_cast<OutputType*
>(
theTile->
getBuf(anOssimBandStart + 1));
1869 d[2]=
static_cast<OutputType*
>(
theTile->
getBuf(anOssimBandStart + 2));
1884 clipRect.
ul().
x - img_rect.
ul().
x;
1891 GDALPaletteInterp interp = GDALGetPaletteInterpretation(table);
1895 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
1897 GDALColorEntry entry;
1898 if(GDALGetColorEntryAsRGB(table, s[sample], &entry))
1900 if(interp == GPI_RGB)
1911 d[0][sample] = entry.c1==np[0]?minp[0]:entry.c1;
1912 d[1][sample] = entry.c2==np[1]?minp[1]:entry.c2;
1913 d[2][sample] = entry.c3==np[2]?minp[2]:entry.c3;
1915 d[0][sample] = entry.c1;
1916 d[1][sample] = entry.c2;
1917 d[2][sample] = entry.c3;
1923 d[0][sample] = entry.c1;
1924 d[1][sample] = entry.c2;
1925 d[2][sample] = entry.c3;
1946 GDALRasterBandH band = GDALGetRasterBand(
theDataset, bandNumber);
1947 if(GDALGetRasterColorInterpretation(band)==GCI_PaletteIndex)
1949 GDALColorTableH table = GDALGetRasterColorTable(band);
1950 GDALPaletteInterp interp = GDALGetPaletteInterpretation(table);
1951 if( (interp == GPI_RGB) ||
1952 (interp == GPI_HLS)||
1953 (interp == GPI_CMYK))
1964 GDALRasterBandH band = GDALGetRasterBand(
theDataset, bandNumber);
1965 if(GDALGetRasterColorInterpretation(band)==GCI_PaletteIndex)
1967 GDALColorTableH table = GDALGetRasterColorTable(band);
1968 GDALPaletteInterp interp = GDALGetPaletteInterpretation(table);
1969 if(interp == GPI_Gray)
1982 GDALRasterBandH band = GDALGetRasterBand(
theDataset, bandNumber);
1983 if(GDALGetRasterColorInterpretation(band)==GCI_PaletteIndex)
1985 GDALColorTableH table = GDALGetRasterColorTable(band);
1986 GDALPaletteInterp interp = GDALGetPaletteInterpretation(table);
2008 if(aGdalBandNumber <= GDALGetRasterCount(
theDataset))
2010 GDALRasterBandH band = GDALGetRasterBand(
theDataset, aGdalBandNumber);
2011 if(!band)
return false;
2012 if(GDALGetRasterColorInterpretation(band)==GCI_PaletteIndex)
2036 int aGdalBandIndex = 0;
2045 maxX = rect.
width();
2051 for(aGdalBandIndex=1;
2052 (int)aGdalBandIndex <= (
int)GDALGetRasterCount(
theDataset);
2058 maxY = ossim::max<int>((int)GDALGetRasterBandYSize(aBand), maxY);
2059 maxX = ossim::max<int>((int)GDALGetRasterBandXSize(aBand), maxX);
2069 int aGdalBandIndex )
const 2071 GDALRasterBandH aBand = GDALGetRasterBand(
theDataset, aGdalBandIndex );
2075 int overviewIndex = resLevel-1;
2077 GDALRasterBandH overviewBand = GDALGetOverview( aBand, overviewIndex );
2080 aBand = overviewBand;
2092 const char* driver = GDALGetDriverShortName(
theDriver);
2144 entryList.push_back(i);
2149 entryList.push_back(0);
2171 bool atStart =
false;
2174 if ( *(subString.
begin()+pos) ==
'=')
2202 GDALColorTableH aTable = GDALGetRasterColorTable(GDALGetRasterBand(
theDataset, 1 ));
2203 GDALPaletteInterp interp = GDALGetPaletteInterpretation(aTable);
2204 if(aTable && ( (interp == GPI_Gray) || (interp == GPI_RGB)))
2206 GDALColorEntry colorEntry;
2207 ossim_uint32 numberOfElements = GDALGetColorEntryCount(aTable);
2209 if(numberOfElements)
2218 bool nullSet =
false;
2219 for(idx = 0; idx < numberOfElements; ++idx)
2225 if(GDALGetColorEntryAsRGB(aTable, idx, &colorEntry))
2227 (*theLut)[idx][0] = colorEntry.c1;
2228 (*theLut)[idx][1] = colorEntry.c2;
2229 (*theLut)[idx][2] = colorEntry.c3;
2230 (*theLut)[idx][3] = colorEntry.c4;
2237 if ( (*
theLut)[idx][3] == 0 )
2251 if ( ( (*
theLut)[idx][0] == 0 ) &&
2252 ( (*
theLut)[idx][1] == 0 ) &&
2253 ( (*
theLut)[idx][2] == 0 ) )
2263 (*theLut)[idx][0] = 0;
2264 (*theLut)[idx][1] = 0;
2265 (*theLut)[idx][2] = 0;
2266 (*theLut)[idx][3] = 0;
2271 if ( (*
theLut)[idx][0] == 0 )
2281 const GDALColorEntry* constEntry = GDALGetColorEntry(aTable, idx);
2284 (*theLut)[idx][0] = constEntry->c1;
2288 (*theLut)[idx][0] = 0;
2302 for(
ossim_uint32 aGdalBandIndex=1; aGdalBandIndex <= rasterCount; ++aGdalBandIndex)
2304 GDALRasterBandH aBand = GDALGetRasterBand(
theDataset, aGdalBandIndex );
2307 GDALRasterAttributeTableH hRAT = GDALGetDefaultRAT(aBand);
2308 int colCount = GDALRATGetColumnCount(hRAT);
2311 const char* colName = GDALRATGetNameOfCol(hRAT, col);
2314 if (strcmp(colName,
"Class_Names") == 0)
2316 std::vector<ossimString> entryLabels;
2320 const char* className = GDALRATGetValueAsString(hRAT, row, col);
2322 entryLabels.push_back(entryLabel);
2335 if ( property->
getName() == PRESERVE_PALETTE_KW )
2338 property->valueToString(s);
2353 if( (name == DRIVER_SHORT_NAME_KW) &&
isOpen() )
2358 else if ( (name ==
"imag") &&
isOpen() )
2363 if (!nitfImagTag.
empty())
2369 else if ( name == PRESERVE_PALETTE_KW )
2382 propertyNames.push_back(DRIVER_SHORT_NAME_KW);
2383 propertyNames.push_back(PRESERVE_PALETTE_KW);
2390 if (outputBandList.size())
2393 for (
ossim_uint32 i = 0; i < outputBandList.size(); i++)
2395 if (outputBandList[i] > bandCount)
2416 if (
isOpen() && stateChanged )
2435 if ( nullIndex > -1 )
2485 int xSize=0, ySize=0;
2487 for(idx =0; idx < nLevels; ++idx)
virtual void deleteCache(ossimAppFixedCacheId cacheId)
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
void setPreservePaletteIndexesFlag(bool flag)
Sets preserve palette indexes flag.
void clear()
Erases the entire container.
virtual ossim_uint32 getWidth() const
virtual bool isSourceEnabled() const
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in...
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
ossimFilename noExtension() const
static ossimString upcase(const ossimString &aString)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
Set propterty method.
std::basic_stringstream< char > stringstream
Class for char mixed input and output memory streams.
static const char * DATUM_KW
virtual void getEntryNames(std::vector< ossimString > &entryStringList) const
ossimRefPtr< ossimImageData > theSingleBandTile
ossimFilename theImageFile
virtual void setImageRectangle(const ossimIrect &rect)
ossimScalarType getInputScalarType() const
Gets the input scalar type of the tile source.
ossim_uint32 getIndexBandOutputNumber(int bandNumber) const
Represents serializable keyword/value map.
bool addFile(const char *file)
const char * find(const char *key) const
std::vector< ossimDpt > theDecimationFactors
void setEntryLables(ossim_uint32 band, std::vector< ossimString > entryLabels)
virtual void getEntryNames(std::vector< ossimString > &entryNames) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual bool setOutputBandList(const std::vector< ossim_uint32 > &band_list)
If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled...
void loadIndexTo3BandTileTemplate(InputType in, OutputType out, const ossimIrect &clipRect, ossim_uint32 aGdalBandStart=1, ossim_uint32 anOssimBandStart=0)
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
This code was derived from https://gist.github.com/mshockwave.
static const char * IMAGE_MODEL_TRANSFORM_MATRIX_KW
ossim_uint32 height() const
bool contains(char aChar) const
virtual ossimGpt inverse(const ossimDpt &pp) const
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool isGeographic() const
const ossimIpt & ul() const
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
virtual ossim_uint32 getHeight() const
ossim_float64 hgt
Height in meters above the ellipsiod.
std::vector< ossimString > theSubDatasets
bool isIndexTo1Band(int bandNumber=1) const
ossim_uint32 toUInt32() const
virtual ossim_uint32 getNumberOfDecimationLevels() const
Returns the number of reduced resolution data sets (rrds).
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of bands in the image.
bool intersects(const ossimIrect &rect) const
unsigned short ossim_uint16
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
const ossimIpt & ll() const
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
static const char * TYPE_KW
virtual void initialize()
Initialize the data buffer.
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
virtual double optimizeFit(const ossimTieGptSet &tieSet, double *targetVariance=0)
ossimPixelType thePixelType
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Get propterty names.
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
bool completely_within(const ossimIrect &rect) const
static const char * PIXEL_SCALE_XY_KW
void push_back(char c)
Equivalent to insert(end(), c).
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
vector< ossim_uint32 > m_outputBandList
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
ossimRefPtr< ossimImageData > getTileBlockRead(const ossimIrect &tileRect, ossim_uint32 resLevel)
bool getPreservePaletteIndexesFlag() const
static ossimImageDataFactory * instance()
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
ossimRefPtr< ossimImageData > getTile(ossimAppFixedCacheId cacheId, const ossimIpt &origin)
const char * findPreference(const char *key) const
virtual ossimDataObjectStatus validate() const
static const char * TIE_POINT_XY_KW
void loadIndexTo3BandTile(const ossimIrect &clipRect, ossim_uint32 aGdalBandStart=1, ossim_uint32 anOssimBandStart=0)
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of bands available from an image.
signed short ossim_sint16
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
std::string::size_type size() const
bool toBool() const
String to numeric methods.
std::string::iterator begin()
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual void nullTileAlpha(const ossim_uint8 *src, const ossimIrect &src_rect, bool mutliplyAlphaFlag=false)
ossim_uint32 getNumberOfEntries() const
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
bool isIndexTo3Band(int bandNumber=1) const
ossimRefPtr< ossimImageGeometry > getExternalImageGeometryFromXml() const
Class for FGDC XML doc parsing.
virtual ossimIrect getImageRectangle() const
GDALRasterBandH resolveRasterBand(ossim_uint32 resLevel, int gdalBandIndex) const
For the given resolution level and GDAL band index, return a corresponding GDAL raster band...
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
const ossimIpt & lr() const
static const char * IMAGE_MODEL_TRANSFORM_UNIT_KW
static ossimString downcase(const ossimString &aString)
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
bool isBlocked(int band) const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
virtual ossimString getShortName() const
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
ossimIrect clipToRect(const ossimIrect &rect) const
virtual bool hasMetaData() const
static ossimPreferences * instance()
void setIndexedFlag(bool flag)
Sets the indexed flag.
const ossimIpt & ur() const
std::vector< ossim_uint8 > theGdalBuffer
virtual ossim_uint32 getTileWidth() const
Returns the width of the output tile.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
storage class for tie point between ground and image based on ossimGpt
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual ossimString getLongName() const
static ossimProjectionFactoryRegistry * instance()
virtual const ossim_float64 * getMinPix() const
virtual bool isIndexedData() const
Indicated data is indexed.
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
static const char * UNITS_KW
ossimRefPtr< ossimProjection > getProjection()
Gets projection from document.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossim_uint32 getTileHeight() const
Returns the height of the output tile.
virtual void completeOpen()
Will complete the opening process.
void addTiePoint(ossimRefPtr< ossimTieGpt > aTiePt)
operations
ossim_uint32 theEntryNumberToRender
std::vector< ossimAppFixedTileCache::ossimAppFixedCacheId > m_rlevelBlockCache
ossimImageMetaData theMetaData
ossimString toString(ossim_uint32 precision=15) const
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
ossimRefPtr< ossimImageHandler > theOverview
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Get propterty method.
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
storage class for a set of geographic tie points, between master and slave images ...
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual const void * getBuf() const
void setNullPixelIndex(ossim_int32 idx)
Allows you to specify which entry is to be designated as an invalid entry.
virtual ossim_uint32 getCurrentEntry() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
class ossimNBandLutDataObject
void stretchToTileBoundary(const ossimIpt &tileWidthHeight)
ossimFilename theOverviewFile
GDALDataType theOutputGdtType
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.
bool open(const ossimFilename &xmlFileName)
Open method.
ossim_int32 getNullPixelIndex() const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
bool toOssimKwl(const ossimString &wktString, ossimKeywordlist &kwl, const char *prefix=NULL) const
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
ossimRefPtr< ossimNBandLutDataObject > theLut
virtual ossimString getClassName() const
#define RTTI_DEF1(cls, name, b1)
bool isIndexed(int aGdalBandNumber=1) const
ossimRefPtr< ossimImageData > theTile
virtual void setScalarType(ossimScalarType type)
See ossimScalarType in ossimConstants for a full list.
virtual ~ossimGdalTileSource()
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
ossimAppFixedCacheId newTileCache(const ossimIrect &tileBoundaryRect, const ossimIpt &tileSize=ossimIpt(0, 0))
void getDefaults()
Checks prefences for default settings.
double * theNullPixValues
ossim_int32 getFirstNullAlphaIndex() const
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
ossimFilename path() const
void getMaxSize(ossim_uint32 resLevel, int &maxX, int &maxY) const
unsigned char ossim_uint8
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
bool m_preservePaletteIndexesFlag
ossimRefPtr< ossimImageData > addTile(ossimAppFixedCacheId cacheId, ossimRefPtr< ossimImageData > data, bool duplicateData=true)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
static const char * PIXEL_SCALE_UNITS_KW
static const char * TIE_POINT_UNITS_KW
const ossimString & getName() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
ossimString filterSubDatasetsString(const ossimString &subString) const
Filters string from "GDALGetMetadata( theDataset, "SUBDATASETS" )