38 static ossimTrace traceDebug(
"ossimTiledImageHandler:debug");
48 m_startOvrResLevel(-1),
70 vector<ossimTileFile>::iterator iter =
m_tileFiles.begin();
73 (*iter).imageHandler->close();
105 if (!source_tile.
valid())
108 "determine file-tile image data for allocating image tile. Aborting."<<endl;
163 vector<ossimTileFile>::iterator tf_iter =
m_tileFiles.begin();
167 if (( (*tf_iter).subImageRects.size() > resLevel) &&
168 adjusted_tile_rect.
intersects((*tf_iter).subImageRects[resLevel]))
176 adjusted_tile_rect.
clipToRect( (*tf_iter).subImageRects[resLevel]);
179 ossimIrect relative_clip_rect( full_image_clip_rect -
180 (*tf_iter).subImageRects[resLevel].
ul());
182 source_tile = (*tf_iter).imageHandler->getTile(relative_clip_rect, resLevel);
183 if ( source_tile.valid() )
185 if ( (source_tile->getDataObjectStatus() !=
OSSIM_NULL) &&
186 (source_tile->getDataObjectStatus() !=
OSSIM_EMPTY) )
190 full_image_clip_rect,
214 ossimIrect relative_rect (tile_rect - (*tf_iter).subImageRects[resLevel].ul());
215 std::cout <<
"reletive_rect: " << relative_rect << std::endl;
216 source_tile = (*tf_iter).imageHandler->getTile(relative_rect, resLevel);
227 source_tile->getWidthHeight(ws, hs);
228 std::cout <<
"ws: " << ws <<
" hs: " << hs <<
" wd: " << wd <<
" hd: " << hd
244 if (s[is] != null_pixel)
337 return m_tileFiles[0].imageHandler->getNumberOfInputBands();
352 return m_tileFiles[0].imageHandler->getImageTileWidth();
354 return m_tileFiles[0].imageHandler->getNumberOfSamples();
369 return m_tileFiles[0].imageHandler->getImageTileHeight();
371 return m_tileFiles[0].imageHandler->getNumberOfLines();
382 return m_tileFiles[0].imageHandler->getOutputScalarType();
400 rect = rect*decimation;
440 vector<ossimTileFile>::iterator iter =
m_tileFiles.begin();
443 if (!(*iter).imageHandler->hasOverviews())
446 <<(*iter).imageHandler->getFilename()<<
">"<<std::endl;
448 all_ok = (*iter).imageHandler->buildOverview(ctype, qual, rtype, ifr_flag);
458 if (!stop_dim_str.
empty())
464 if ((nlines > stop_dim) || (nsamps > stop_dim))
500 vector<ossimDpt> factors;
505 vector<ossimTileFile>::iterator iter =
m_tileFiles.begin();
508 handler = (*iter).imageHandler;
509 if (!handler.
valid())
515 if ((*iter).subImageRects.size() == 0)
518 <<(*iter).imageHandler->getFilename()<<
">! Cannot proceed with overviews."<<std::endl;
526 (*iter).overviewIsOpen =
true;
529 if (factors.size() < min_num_rlevels)
533 ossimIrect subRectR0 ((*iter).subImageRects[0]);
536 ossimIrect r (factors[i].
x * subRectR0.ul().x, factors[i].y * subRectR0.ul().y,
537 factors[i].x * subRectR0.lr().x, factors[i].y * subRectR0.lr().y);
538 (*iter).subImageRects.push_back(r);
544 <<(*iter).imageHandler->getFilename()<<
">"<<std::endl;
565 m_lockSubOvrs =
true;
567 m_lockSubOvrs =
false;
570 vector<ossimDpt> extra_decimations;
572 if (extra_decimations.size())
580 decimation.
x = start_decimation.x*extra_decimations[i].x;
581 decimation.
y = start_decimation.y*extra_decimations[i].y;
599 if (m_lockSubOvrs ==
false)
601 vector<ossimTileFile>::iterator iter =
m_tileFiles.begin();
604 if ((*iter).imageHandler.valid())
605 (*iter).imageHandler->closeOverview();
617 bool all_have_ovrs =
true;
618 vector<ossimTileFile>::const_iterator iter =
m_tileFiles.begin();
619 while ((iter !=
m_tileFiles.end()) && all_have_ovrs)
621 if (((*iter).imageHandler.valid()) && !((*iter).imageHandler->hasOverviews()))
622 all_have_ovrs =
false;
625 return all_have_ovrs;
virtual void getDecimationFactors(vector< ossimDpt > &decimations) const
This returns all decimation for all levels.
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
virtual void setImageRectangle(const ossimIrect &rect)
virtual bool buildOverview(ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
Will build over file for theImageFile.
void allocate()
Initialize tile buffer to match image datatype.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
Represents serializable keyword/value map.
std::vector< ossimDpt > theDecimationFactors
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_uint32 height() const
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
virtual const ossimImageHandler * getOverview() const
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns overall bounding rect in image space.
const ossimIpt & ul() const
virtual ossimDataObjectStatus getDataObjectStatus() const
ossim_uint32 toUInt32() const
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
virtual void closeOverview()
If theOverview is initialized it will be deleted and set to NULL.
bool intersects(const ossimIrect &rect) const
unsigned short ossim_uint16
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const
virtual bool openOverview()
Searches for an overview.
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
virtual ossimObject * dup() const
This class defines an abstract Handler which all image handlers(loaders) should derive from...
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel)
Fills the requested tile by pulling pixels from multiple file tiles as needed.
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual ossim_uint32 getNumberOfInputBands() const
virtual ~ossimTiledImageHandler()
Destructor:
const char * findPreference(const char *key) const
*virtual void close()
Deletes the overview and clears the valid image vertices.
virtual ossimDataObjectStatus validate() const
virtual bool setInputSource(ossimImageHandler *imageSource)
Sets the input to the builder.
unsigned int ossim_uint32
virtual ossim_uint32 getImageTileHeight() const
Returns the tile height of the image or 0 if the image is not tiled.
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
virtual bool isImageTiled() const
Indicates whether or not the image is tiled internally.
ossimTiledImageHandler()
Constructor (default):
ossim_uint32 width() const
ossimIrect clipToRect(const ossimIrect &rect) const
virtual bool openValidVertices()
Creates vertices file name based on image, then tries to open.
static ossimPreferences * instance()
virtual ossimScalarType getOutputScalarType() const
Returns scalar type of first tile (should be the same for all tiles)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossim_uint32 m_startOvrResLevel
virtual void makeBlank()
Initializes data to null pixel values.
virtual void completeOpen()
Will complete the opening process.
ossimRefPtr< ossimImageHandler > theOverview
void set_lr(const ossimIpt &pt)
This class defines an abstract Handler which all image handlers(loaders) should derive from...
ossimFilename theOverviewFile
vector< ossimTileFile > m_tileFiles
virtual bool hasOverviews() const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
#define RTTI_DEF1(cls, name, b1)
bool buildOverview(const ossimFilename &overview_file, bool copy_all=false)
Builds overview file and sets "theOutputFile" to that of the overview_file.
static const char * OVERVIEW_STOP_DIMENSION_KW
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...
ossimRefPtr< ossimImageData > m_tile
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.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)