OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimPotraceTool.h>
Classes | |
class | Path |
Public Types | |
enum | OutputMode { POLYGON, LINESTRING } |
![]() | |
enum | ossimProcessStatus { PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3, PROCESS_STATUS_NOT_EXECUTING = 4 } |
Public Member Functions | |
ossimPotraceTool () | |
virtual | ~ossimPotraceTool () |
virtual void | setUsage (ossimArgumentParser &ap) |
Initializes the aurgument parser with expected parameters and options. More... | |
virtual bool | initialize (ossimArgumentParser &ap) |
Initial method to be ran prior to execute. More... | |
virtual void | initialize (const ossimKeywordlist &ap) |
This method is responsible for completely setting up the full processing chain according to the specifications given in the kwl passed in. More... | |
virtual bool | execute () |
Performs the actual product write. More... | |
virtual ossimString | getClassName () const |
virtual void | getKwlTemplate (ossimKeywordlist &kwl) |
Assigns a template keywordlist to string for initializing derived classes. More... | |
![]() | |
ossimChipProcTool () | |
default constructor More... | |
virtual | ~ossimChipProcTool () |
virtual destructor More... | |
virtual void | clear () |
Disconnects and clears the dem and image layers. More... | |
virtual void | abort () |
virtual bool | isChipProcessor () const |
Overrides base class implementation to indicate this class supports getChip() calls. More... | |
virtual ossimListenerManager * | getManager () |
virtual ossimObject * | getObject () |
virtual const ossimObject * | getObject () const |
virtual ossimRefPtr< ossimImageData > | getChip (const ossimIrect &img_rect) |
The meat and potatos of this class. More... | |
virtual ossimRefPtr< ossimImageData > | getChip (const ossimGrect &gnd_rect) |
ossimRefPtr< ossimImageData > | getChip (const ossimDrect &map_bounding_rect, const ossimDpt &gsd) |
ossimRefPtr< ossimImageData > | getChip () |
Get chip method that assumes pre-initialized state. More... | |
const ossimFilename & | getProductFilename () const |
![]() | |
ossimTool () | |
virtual | ~ossimTool () |
virtual void | loadJSON (const Json::Value &json_request) |
Reads processing params from JSON object provided. More... | |
virtual void | saveJSON (Json::Value &json) const |
Fetch product as JSON object when applicable Always returns true since using exception on error. More... | |
virtual const std::string & | getResponse () const |
Fetch product as string (typically JSON) when applicable, otherwise passes back empty string. More... | |
void | getAPI (std::string &out) const |
Outputs a JSON representation of the Utility's API. More... | |
std::string | getAPI () const |
void | getBuildDate (std::string &s) const |
Gets build date. More... | |
void | getRevision (std::string &s) const |
Gets revision. More... | |
void | getVersion (std::string &s) const |
Gets version. More... | |
void | setOutputStream (std::ostream *os) |
Redirects any console output to the supplied stream for logging or JNI application. More... | |
bool | helpRequested () const |
Returns true when the initialization detects a "--help" option, so caller can avoid subsequent execute() call. More... | |
![]() | |
ossimObject () | |
virtual | ~ossimObject () |
virtual ossimObject * | dup () const |
virtual ossimString | getShortName () const |
virtual ossimString | getLongName () const |
virtual ossimString | getDescription () const |
virtual RTTItypeid | getType () const |
virtual bool | canCastTo (ossimObject *obj) const |
virtual bool | canCastTo (const RTTItypeid &id) const |
virtual bool | canCastTo (const ossimString &parentClassName) const |
virtual bool | saveState (ossimKeywordlist &kwl, const char *prefix=0) const |
virtual bool | loadState (const ossimKeywordlist &kwl, const char *prefix=0) |
virtual std::ostream & | print (std::ostream &out) const |
Generic print method. More... | |
virtual bool | isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const |
virtual void | accept (ossimVisitor &visitor) |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
![]() | |
JsonInterface () | |
virtual | ~JsonInterface () |
![]() | |
ossimProcessInterface () | |
virtual | ~ossimProcessInterface () |
bool | needsAborting () const |
bool | isAbortRequested () const |
bool | isAborted () const |
bool | isExecuting () const |
ossimProcessStatus | getProcessStatus () const |
virtual void | setProcessStatus (ossimProcessStatus processStatus) |
virtual double | getPercentComplete () const |
virtual void | setPercentComplete (double percentComplete) |
void | enableEvents () |
void | disableEvents () |
void | setCurrentMessage (const ossimString &message) |
virtual std::ostream & | print (std::ostream &out) const |
![]() | |
ossimListenerManager () | |
virtual | ~ossimListenerManager () |
virtual void | fireEvent (ossimEvent &event) |
virtual bool | addListener (ossimListener *listener) |
virtual bool | removeListener (ossimListener *listener) |
virtual bool | findListener (ossimListener *listener) |
Static Public Attributes | |
static const char * | DESCRIPTION |
Private Member Functions | |
virtual void | initProcessingChain () |
Derived classes initialize their custom chains here. More... | |
virtual void | finalizeChain () |
Called after initProcessingChain() to append common items to the processing chain. More... | |
potrace_bitmap_t * | convertToBitmap (ossimImageSource *handler) |
bool | writeGeoJSON (potrace_path_t *vectorList) |
bool | pixelIsMasked (const ossimIpt &image_pt, potrace_bitmap_t *bitmap) const |
void | transformLineStrings (potrace_state_t *pathTree) |
void | transformPolygons (potrace_state_t *pathTree) |
Private Attributes | |
OutputMode | m_mode |
double | m_alphamax |
int | m_turdSize |
bool | m_outputToConsole |
potrace_bitmap_t * | m_maskBitmap |
potrace_bitmap_t * | m_productBitmap |
Additional Inherited Members | |
![]() | |
void | processRemainingArgs (ossimArgumentParser &ap) |
Intended to be called after derived class has picked off its own options from the parser, and arguments remain (such as input and output filenames). More... | |
virtual void | loadImageFiles () |
Creates chains for image entries associated with specified keyword. More... | |
virtual void | loadDemFiles () |
Loads all DEM files specified in master KWL into the elev manager's database. More... | |
ossimRefPtr< ossimSingleImageChain > | createInputChain (const ossimFilename &image_file, ossim_uint32 entry_index=0) |
Creates the ossimSingleImageChain from image filename and populates the chain with resampler and product output projection on view-side of resampler's IVT. More... | |
void | createOutputProjection () |
Creates the output or view projection. More... | |
ossimRefPtr< ossimMapProjection > | newIdentityProjection () |
Sets the single image chain for identity operations view to a ossimImageViewAffineTransform. More... | |
ossimRefPtr< ossimMapProjection > | newUtmProjection () |
Convenience method to get a utm projection. More... | |
virtual void | initializeProjectionGsd () |
Initializes the projection gsd. More... | |
virtual void | initializeAOI () |
Initializes m_aoiViewRect with the output area of interest as specified in master KWL. More... | |
bool | getProjectionOrigin (ossimGpt &gpt) |
Reads the KWL for origin latitude and central meridian. More... | |
ossimRefPtr< ossimImageFileWriter > | newWriter () |
Creates a new writer. More... | |
void | propagateGeometryToChains () |
Loops through all chains and sets the output projection. More... | |
ossimRefPtr< ossimImageSource > | combineLayers (std::vector< ossimRefPtr< ossimSingleImageChain > > &layers) const |
When multiple input sources are present, this method instantiates a combiner and adds inputs. More... | |
void | computeAdjustedViewFromGrect () |
Initializes m_aoiViewRect given m_aoiGroundRect. More... | |
void | setAoiToInputs () |
Assigns the AOI to be the bounding rect of the union of all inputs. More... | |
void | getBandList (ossim_uint32 image_idx, std::vector< ossim_uint32 > &bandList) const |
Gets the band list if BANDS keyword is set. More... | |
void | setReaderProps (ossimImageHandler *ih) const |
Passes reader properties to single image handler if any. More... | |
ossimChipProcTool (const ossimChipProcTool &obj) | |
Hidden from use copy constructor. More... | |
const ossimChipProcTool & | operator= (const ossimChipProcTool &) |
Hidden from use assignment operator. More... | |
ossimRefPtr< ossimGeoPolygon > | createClipPolygon () const |
void | findCenterGpt (ossimGpt &gpt) |
Tries to determine the AOI center point based on KWL entries, else returns NaNs in gpt. More... | |
ossimRefPtr< ossimImageSource > | mosaicDemSources () |
Some utilities need to work on DEMs as images. More... | |
![]() | |
virtual | ~ossimReferenced () |
![]() | |
ossimListenerManager (const ossimListenerManager &rhs) | |
![]() | |
ossimRefPtr< ossimImageGeometry > | m_geom |
ossimIrect | m_aoiViewRect |
ossimGrect | m_aoiGroundRect |
std::vector< ossimRefPtr< ossimSingleImageChain > > | m_imgLayers |
std::vector< ossimFilename > | m_demSources |
ossimRefPtr< ossimImageFileWriter > | m_writer |
ossimRefPtr< ossimImageChain > | m_procChain |
ossimRefPtr< ossimRectangleCutFilter > | m_cutRectFilter |
bool | m_projIsIdentity |
ossimDpt | m_gsd |
bool | m_geoScaled |
ossimFilename | m_productFilename |
ossimScalarType | m_productScalarType |
bool | m_needCutRect |
![]() | |
ossimKeywordlist | m_kwl |
std::ostream * | m_consoleStream |
bool | m_helpRequested |
std::string | m_response |
![]() | |
double | thePercentComplete |
ossimProcessStatus | theProcessStatus |
ossimString | theMessage |
bool | theEventFlag |
![]() | |
std::list< ossimListener * > | theListenerList |
bool | theEnabledFlag |
std::list< ossimListener * > | theDelayedAdd |
std::list< ossimListener * > | theDelayedRemove |
bool | theFireEventFlag |
Definition at line 19 of file ossimPotraceTool.h.
Enumerator | |
---|---|
POLYGON | |
LINESTRING |
Definition at line 23 of file ossimPotraceTool.h.
ossimPotraceTool::ossimPotraceTool | ( | ) |
Definition at line 27 of file ossimPotraceTool.cpp.
|
virtual |
Definition at line 37 of file ossimPotraceTool.cpp.
References m_maskBitmap, and m_productBitmap.
|
private |
Definition at line 412 of file ossimPotraceTool.cpp.
References potrace_bitmap_s::dy, ossimImageGeometry::getBoundingRect(), ossimImageData::getHeight(), ossimImageSource::getImageGeometry(), ossimImageSourceSequencer::getNextTile(), ossimImageData::getNullPix(), ossimImageData::getOrigin(), ossimImageData::getPix(), ossimImageData::getWidth(), potrace_bitmap_s::h, ossimIrect::height(), ossimIrect::lr(), potrace_bitmap_s::map, potrace_writepbm(), ossimRefPtr< T >::valid(), potrace_bitmap_s::w, ossimIrect::width(), ossimIpt::x, and ossimIpt::y.
Referenced by execute().
|
virtual |
Performs the actual product write.
Reimplemented from ossimChipProcTool.
Definition at line 148 of file ossimPotraceTool.cpp.
References potrace_param_s::alphamax, convertToBitmap(), LINESTRING, m_alphamax, ossimChipProcTool::m_geom, ossimChipProcTool::m_imgLayers, m_maskBitmap, m_mode, m_productBitmap, m_turdSize, potrace_state_s::plist, potrace_param_default(), potrace_trace(), transformLineStrings(), transformPolygons(), potrace_param_s::turdsize, ossimRefPtr< T >::valid(), and writeGeoJSON().
|
privatevirtual |
Called after initProcessingChain() to append common items to the processing chain.
Sets up the AOI box cutter filter and related stuff and initializes area of interest(aoi). The filter is appended to the current m_procChain. Derived class should override if not applicable to its processing chain.
Reimplemented from ossimChipProcTool.
Definition at line 143 of file ossimPotraceTool.cpp.
|
inlinevirtual |
Reimplemented from ossimTool.
Definition at line 37 of file ossimPotraceTool.h.
|
virtual |
Assigns a template keywordlist to string for initializing derived classes.
Reimplemented from ossimTool.
Definition at line 393 of file ossimPotraceTool.cpp.
References ossimKeywordlist::addPair().
|
virtual |
Initial method to be ran prior to execute.
Intended for command-line app usage.
ap | Arg parser to initialize from. |
Reimplemented from ossimChipProcTool.
Definition at line 73 of file ossimPotraceTool.cpp.
References ossimKeywordlist::addPair(), ossimTool::initialize(), ossimTool::m_kwl, and ossimArgumentParser::read().
|
virtual |
This method is responsible for completely setting up the full processing chain according to the specifications given in the kwl passed in.
If the utility is run from a command line, the initialize(ossimArgumentParser) will assign the member master KWL and pass it to this method. Web service calls will fill a KWL and pass it.
This base class implementation should be called by the derived class implementation (assuming the derived class needs to pull some parameters out of the KWL before the chains are set up.
This method will instantiate the output projection and define the output bounding rect and product size in pixels. The processing chain (stored in m_procChain) will be completely initialized and ready for calls to getTile(). Then either getChip() or execute() can be called depending on usage to fetch product.
Reimplemented from ossimChipProcTool.
Definition at line 102 of file ossimPotraceTool.cpp.
References ossimKeywordlist::addList(), ossimKeywordlist::clear(), ossimKeywordlist::findKey(), and ossimTool::m_kwl.
|
privatevirtual |
Derived classes initialize their custom chains here.
Implements ossimChipProcTool.
Definition at line 138 of file ossimPotraceTool.cpp.
|
private |
Definition at line 477 of file ossimPotraceTool.cpp.
References potrace_bitmap_s::dy, potrace_bitmap_s::map, ossimIpt::x, and ossimIpt::y.
Referenced by transformLineStrings().
|
virtual |
Initializes the aurgument parser with expected parameters and options.
It does not output anything. To see the usage, the caller will need to do something like:
ap.getApplicationUsage()->write(<ostream>);
This base class has some common arguments to add. The derived class should call this implementation in addition to setting its own arguments.
Reimplemented from ossimChipProcTool.
Definition at line 44 of file ossimPotraceTool.cpp.
References ossimApplicationUsage::addCommandLineOption(), ossimArgumentParser::getApplicationName(), ossimArgumentParser::getApplicationUsage(), ossimApplicationUsage::setCommandLineUsage(), and ossimTool::setUsage().
|
private |
Definition at line 197 of file ossimPotraceTool.cpp.
References ossimPotraceTool::Path::addPotraceCurve(), potrace_path_s::area, potrace_curve_s::c, potrace_path_s::childlist, ossimPotraceTool::Path::closed, potrace_path_s::curve, ossimIrect::expand(), ossimImageGeometry::getBoundingRect(), ossimGpt::lat, ossimImageGeometry::localToWorld(), ossimGpt::lon, ossimChipProcTool::m_geom, m_maskBitmap, potrace_curve_s::n, potrace_path_s::next, pixelIsMasked(), potrace_state_s::plist, ossimIrect::pointWithin(), POTRACE_CORNER, POTRACE_ENDPOINT, potrace_path_s::priv, potrace_path_s::sibling, potrace_path_s::sign, potrace_curve_s::tag, ossimPotraceTool::Path::vertices, potrace_dpoint_s::x, and potrace_dpoint_s::y.
Referenced by execute().
|
private |
Definition at line 359 of file ossimPotraceTool.cpp.
References potrace_curve_s::c, potrace_path_s::curve, ossimGpt::lat, ossimImageGeometry::localToWorld(), ossimGpt::lon, ossimChipProcTool::m_geom, potrace_curve_s::n, potrace_path_s::next, potrace_state_s::plist, POTRACE_CORNER, potrace_curve_s::tag, potrace_dpoint_s::x, ossimDpt::x, potrace_dpoint_s::y, and ossimDpt::y.
Referenced by execute().
|
private |
Definition at line 493 of file ossimPotraceTool.cpp.
References ossimString::chars(), ossimTool::m_consoleStream, m_mode, m_outputToConsole, ossimChipProcTool::m_productFilename, POLYGON, and potrace_geojson().
Referenced by execute().
|
static |
Definition at line 22 of file ossimPotraceTool.h.
Referenced by ossimPotraceToolFactory::getCapabilities().
|
private |
Definition at line 61 of file ossimPotraceTool.h.
Referenced by execute().
|
private |
Definition at line 64 of file ossimPotraceTool.h.
Referenced by execute(), transformLineStrings(), and ~ossimPotraceTool().
|
private |
Definition at line 60 of file ossimPotraceTool.h.
Referenced by execute(), and writeGeoJSON().
|
private |
Definition at line 63 of file ossimPotraceTool.h.
Referenced by writeGeoJSON().
|
private |
Definition at line 65 of file ossimPotraceTool.h.
Referenced by execute(), and ~ossimPotraceTool().
|
private |
Definition at line 62 of file ossimPotraceTool.h.
Referenced by execute().