OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimKakaduJpipHandler Class Reference

#include <ossimKakaduJpipHandler.h>

Inheritance diagram for ossimKakaduJpipHandler:
ossimImageHandler ossimImageSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Classes

struct  Box
 

Public Types

typedef std::vector< kdu_core::kdu_byte > ByteBuffer
 
typedef std::vector< BoxBoxList
 
typedef std::vector< ossimIrectRectList
 
typedef std::vector< ossimStringStringList
 
typedef std::vector< ossimIptRLevelBlockSizeList
 
typedef std::vector< ossimAppFixedTileCache::ossimAppFixedCacheIdRLevelCacheList
 
- Public Types inherited from ossimImageHandler
enum  ossimImageHandlerOverviewCompressionType {
  OSSIM_OVERVIEW_COMPRESSION_NONE = 0, OSSIM_OVERVIEW_COMPRESSION_JPEG, OSSIM_OVERVIEW_COMPRESSION_LZW, OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
  OSSIM_OVERVIEW_COMPRESSION_PACKBITS
}
 
- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Public Member Functions

 ossimKakaduJpipHandler ()
 
virtual ~ossimKakaduJpipHandler ()
 
virtual void close ()
 Deletes the overview and clears the valid image vertices. More...
 
virtual bool open ()
 Pure virtual open. More...
 
virtual bool isOpen () const
 Derived classes must implement this method to be concrete. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const
 Pure virtual, derived classes must implement. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const
 Pure virtual, derived classes must implement. More...
 
virtual ossim_uint32 getImageTileWidth () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 This returns the total number of decimation levels. More...
 
virtual bool isImageTiled () const
 Indicates whether or not the image is tiled internally. More...
 
virtual ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual void extractBoxes (BoxList &boxList)
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
- Public Member Functions inherited from ossimImageHandler
 ossimImageHandler ()
 Constructor (default): More...
 
virtual ~ossimImageHandler ()
 Destructor: Derived classes should implement. More...
 
virtual void initialize ()
 initialize Does nothing in this class. More...
 
virtual bool openOverview ()
 Searches for an overview. More...
 
virtual bool openOverview (const ossimFilename &overview_file)
 Calls closeOverview(), then attempts to open the overview_file. More...
 
virtual void closeOverview ()
 If theOverview is initialized it will be deleted and set to NULL. More...
 
virtual const ossimImageHandlergetOverview () const
 
virtual bool hasOverviews () const
 
virtual ossimFilename createDefaultOverviewFilename () const
 
virtual ossimFilename createDefaultGeometryFilename () const
 
virtual ossimFilename createDefaultMetadataFilename () const
 
virtual ossimFilename createDefaultHistogramFilename () const
 
virtual ossimFilename createDefaultValidVerticesFilename () const
 
virtual bool writeValidImageVertices (const std::vector< ossimIpt > &vertices, const ossimFilename &file=ossimFilename(""))
 Outputs vertices to file and updates the internal vertex array variable "theValidImageVertices". More...
 
virtual bool openValidVertices (const ossimFilename &vertices_file)
 Opens the valid image vertices file and sets theValidImageVerticesFile variable. More...
 
virtual bool openValidVertices ()
 Creates vertices file name based on image, then tries to open. More...
 
virtual bool open (const ossimFilename &imageFile, ossim_uint32 entryIndex)
 Opens the image file. More...
 
virtual bool open (const ossimFilename &imageFile)
 
virtual bool open (std::shared_ptr< ossim::ImageHandlerState > state)
 
virtual bool buildHistogram (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histogram for image file. More...
 
virtual bool buildAllHistograms (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histograms for all image entries. More...
 
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. More...
 
virtual bool buildAllOverviews (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for all image entries. More...
 
virtual bool buildOverview (const ossimFilename &filename, ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build an over file for filename. More...
 
ossimRefPtr< ossimMultiResLevelHistogramgetImageHistogram () const
 Fetches the current entry image's histogram. More...
 
virtual void setImageGeometry (ossimImageGeometry *geom)
 Sets the image geometry object. More...
 
virtual void saveImageGeometry () const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 This returns all decimation for all levels. More...
 
virtual ossim_uint32 getNumberOfReducedResSets () const
 This method is obsolete. More...
 
virtual void setFilename (const ossimFilename &filename)
 Sets the filename. More...
 
virtual const ossimFilenamegetFilename () const
 Returns the filename. More...
 
virtual bool isValidRLevel (ossim_uint32 resLevel) const
 Determines if the passed in reslution level is valid. More...
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 Connection rule. More...
 
virtual void getValidImageVertices (vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual bool isBandSelector () const
 Indicates whether or not the image handler can control output band selection via the setOutputBandList method. More...
 
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. More...
 
virtual bool setOutputToInputBandList ()
 If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity. More...
 
virtual bool isIdentityBandList (const std::vector< ossim_uint32 > &bandList) const
 Convenience method to see if band list is identity. More...
 
virtual bool hasMetaData () const
 
virtual ossimRefPtr< ossimNBandLutDataObjectgetLut () const
 
virtual bool hasLut () const
 
virtual void loadMetaData ()
 There is an external file with an omd extension. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Retuns the min pixel value. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual void setMinPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set min pixel value. More...
 
virtual void setMaxPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set max pixel value. More...
 
virtual void setNullPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set null pixel value. More...
 
virtual ossim_uint32 getCurrentEntry () const
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual void getEntryNames (std::vector< ossimString > &entryNames) const
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
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. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () 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 isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (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
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

ossimRefPtr< ossimImageDatagetTileAtRes (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual void extractBoxes (BoxList &boxList, kdu_supp::jp2_input_box *pParentBox)
 
void showBoxes (kdu_supp::jp2_input_box *pParentBox=0)
 
bool makeConnectionIfNeeded (kdu_supp::kdu_client *client)
 
int convertClassIdToKdu (int id)
 
void allocateTile ()
 
void deleteRlevelCache ()
 
void performRlevelSetup (kdu_core::kdu_codestream &codestream)
 
bool loadClient (kdu_supp::kdu_client *client, kdu_supp::kdu_window &window)
 
bool openStream ()
 
void flushCache ()
 
void initializeRlevelCache ()
 
void allocateSession ()
 
- Protected Member Functions inherited from ossimImageHandler
virtual ossimRefPtr< ossimImageGeometrygetExternalImageGeometry () const
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 
virtual bool getOverviewTile (ossim_uint32 resLevel, ossimImageData *result)
 Method to get an overview tile. More...
 
bool initVertices (const char *file)
 Opens file and attempts to initialize the valid image vertices. More...
 
virtual void completeOpen ()
 Will complete the opening process. More...
 
void initImageParameters (ossimImageGeometry *geom) const
 Convenience method to set things needed in the image geometry from the image handler. More...
 
virtual void establishDecimationFactors ()
 Virtual method determines the decimation factors at each resolution level. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &inBandList, std::vector< ossim_uint32 > &outBandList)
 Convenience method to set output band list. More...
 
void getFilenameWithNoExtension (ossimFilename &f) const
 Get filename with no extension, using supplentary directory for dirname if set. More...
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

bool m_useOurGrab
 
ossimUrl m_baseUrl
 
RectList m_overviewDimensions
 
ossim_uint32 m_nInputBands
 
ossim_uint32 m_nOutputBands
 
bool m_signed
 
ossim_uint16 m_bitDepth
 
ossim_uint32 m_nQualityLayers
 
ossimIpt m_tileSize
 
ossimIrect m_imageBounds
 
ossim_uint32 m_resLevels
 
int m_bYCC
 
ossimRefPtr< ossimImageDatam_tile
 
ossim_float32 m_quality
 
kdu_supp::kdu_client * m_headerClient
 
kdu_supp::kdu_client * m_client
 
kdu_supp::jp2_family_src m_jp2Family
 
int m_requestQueueId
 
RLevelBlockSizeList m_rlevelTileSize
 
RLevelCacheList m_rlevelBlockCache
 
ossimString m_cid
 
ossimString m_path
 
ossimString m_transport
 
ossimRefPtr< ossimHttpRequestm_request
 
 TYPE_DATA
 
- Protected Attributes inherited from ossimImageHandler
ossimFilename theImageFile
 
ossimFilename theOverviewFile
 
ossimFilename theSupplementaryDirectory
 
ossimRefPtr< ossimImageHandlertheOverview
 
vector< ossimIpttheValidImageVertices
 
ossimImageMetaData theMetaData
 
ossimRefPtr< ossimImageGeometrytheGeometry
 
ossimRefPtr< ossimNBandLutDataObjecttheLut
 
std::vector< ossimDpttheDecimationFactors
 
ossimString theImageID
 
ossim_uint32 theStartingResLevel
 theStartingResLevel If set to something other than zero(default) this is indicative that the reader is an overview. More...
 
bool theOpenOverviewFlag
 If true opening of overviews will be attempted. More...
 
ossimPixelType thePixelType
 
std::shared_ptr< ossim::ImageHandlerState > m_state
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 25 of file ossimKakaduJpipHandler.h.

Member Typedef Documentation

◆ BoxList

typedef std::vector<Box> ossimKakaduJpipHandler::BoxList

Definition at line 34 of file ossimKakaduJpipHandler.h.

◆ ByteBuffer

typedef std::vector<kdu_core::kdu_byte> ossimKakaduJpipHandler::ByteBuffer

Definition at line 28 of file ossimKakaduJpipHandler.h.

◆ RectList

Definition at line 35 of file ossimKakaduJpipHandler.h.

◆ RLevelBlockSizeList

Definition at line 37 of file ossimKakaduJpipHandler.h.

◆ RLevelCacheList

Definition at line 38 of file ossimKakaduJpipHandler.h.

◆ StringList

Definition at line 36 of file ossimKakaduJpipHandler.h.

Constructor & Destructor Documentation

◆ ossimKakaduJpipHandler()

ossimKakaduJpipHandler::ossimKakaduJpipHandler ( )

Definition at line 24 of file ossimKakaduJpipHandler.cpp.

26 m_headerClient(0), // let's cache the header information
27 m_client(0)
28 {
29  if(traceDebug())
30  {
31  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimKakaduJpipHandler::ossimKakaduJpipHandler(): entered ..................\n";
32  }
34  m_quality = 100.0;
35 }
kdu_supp::kdu_client * m_client
void makeNan()
Definition: ossimIrect.h:329
ossimImageHandler()
Constructor (default):
kdu_supp::kdu_client * m_headerClient
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimKakaduJpipHandler()

ossimKakaduJpipHandler::~ossimKakaduJpipHandler ( )
virtual

Definition at line 37 of file ossimKakaduJpipHandler.cpp.

38 {
39  if(traceDebug())
40  {
41  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimKakaduJpipHandler::~ossimKakaduJpipHandler(): entered ..................\n";
42  }
43  close();
44 }
virtual void close()
Deletes the overview and clears the valid image vertices.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Function Documentation

◆ allocateSession()

void ossimKakaduJpipHandler::allocateSession ( )
protected

Definition at line 434 of file ossimKakaduJpipHandler.cpp.

References ossimHttpRequest::addHeaderOption(), ossimString::c_str(), ossimWebRequestFactoryRegistry::createHttp(), ossimString::empty(), ossimWebRequest::getResponse(), ossimHttpResponse::getStatusCode(), ossimHttpResponse::headerKwl(), ossimWebRequestFactoryRegistry::instance(), m_baseUrl, m_cid, m_path, m_request, m_transport, ossimHttpRequest::set(), ossimUrl::setParams(), ossimString::substitute(), ossimUrl::toString(), ossimString::trim(), and ossimRefPtr< T >::valid().

Referenced by loadClient().

435 {
437 #if 0
438  if(m_request.valid())
439  {
440  m_cid = "";
441  m_path = "";
442  m_transport ="";
443  ossimString params;
444  ossimUrl imageInfoUrl = m_baseUrl;
445  params = "type=jpp-stream&stream=0&cnew=http";
446  imageInfoUrl.setParams(params);
447  std::cout << "URL------------------------- " << imageInfoUrl.toString() << std::endl;
448  m_request->set(imageInfoUrl, ossimKeywordlist());
449  m_request->addHeaderOption("HEADERS=Accept", "jpp-stream");
451  if(response.valid()&&(response->getStatusCode()==200))
452  {
453  std::cout << "__________________________" << std::endl;
454  std::cout << response->headerKwl() << std::endl;
455  ossimString jpipCnew = response->headerKwl()["JPIP-cnew"];
456  jpipCnew = jpipCnew.trim();
457  if(!jpipCnew.empty())
458  {
459  m_cid = "";
460  m_path = "";
461  m_transport ="";
462  ossimString tempKwlString = jpipCnew.substitute(",", "\n", true);
463  std::istringstream in(tempKwlString.c_str());
464 
465  ossimKeywordlist kwl('=');
466  if(kwl.parseStream(in))
467  {
468  m_cid = kwl["cid"];
469  m_path = kwl["path"];
470  m_transport = kwl["transport"];
471  m_cid = m_cid.trim();
472  m_path = m_path.trim();
474 
475  std::cout << "PATH === " << m_path << std::endl;
476  }
477  }
478  }
479  }
480 #endif
481 }
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
ossim_uint32 getStatusCode() const
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimHttpRequest > m_request
ossimKeywordlist & headerKwl()
virtual ossimHttpRequest * createHttp(const ossimUrl &url)
virtual ossimRefPtr< ossimWebResponse > getResponse()
ossimString toString() const
Definition: ossimUrl.cpp:106
static ossimWebRequestFactoryRegistry * instance()
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
bool set(const ossimUrl &url, const ossimKeywordlist &headerOptions, HttpMethodType methodType=HTTP_METHOD_GET)
void addHeaderOption(const ossimString &name, const ossimString &value)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool empty() const
Definition: ossimString.h:411
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
void setParams(const ossimString &params)
Definition: ossimUrl.h:27

◆ allocateTile()

void ossimKakaduJpipHandler::allocateTile ( )
protected

Definition at line 766 of file ossimKakaduJpipHandler.cpp.

References ossimImageDataFactory::create(), ossimImageData::initialize(), ossimImageDataFactory::instance(), m_tile, and ossimRefPtr< T >::valid().

Referenced by getTileAtRes().

767 {
769 
770  if(m_tile.valid())
771  {
772  m_tile->initialize();
773  }
774 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
ossimRefPtr< ossimImageData > m_tile
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const

◆ close()

void ossimKakaduJpipHandler::close ( )
virtual

Deletes the overview and clears the valid image vertices.

Derived classes should implement.

Reimplemented from ossimImageHandler.

Definition at line 46 of file ossimKakaduJpipHandler.cpp.

References ossimImageHandler::close(), deleteRlevelCache(), m_client, m_headerClient, m_jp2Family, m_request, ossimNotify(), and ossimNotifyLevel_WARN.

Referenced by loadState(), open(), and openStream().

47 {
49 
50  // Kakadu kdu_thread_entity::terminate throws exceptions...
51  try
52  {
53  m_jp2Family.close();
54  if(m_client)
55  {
56  if(m_client->is_alive())
57  {
58  m_client->disconnect();
59  }
60  m_client->close();
61  delete m_client;
62  m_client = 0;
63  }
64  if(m_headerClient)
65  {
66  if(m_headerClient->is_alive())
67  {
68  m_headerClient->disconnect();
69  }
70  m_headerClient->close();
71  delete m_headerClient;
72  m_headerClient = 0;
73  }
74  m_request = 0;
75  }
76  catch ( kdu_core::kdu_exception exc )
77  {
78  ostringstream e;
79  e << "ossimKakaduNitfReader::~ossimKakaduNitfReader\n"
80  << "Caught exception from kdu_region_decompressor: " << exc << "\n";
81  ossimNotify(ossimNotifyLevel_WARN) << e.str() << std::endl;
82  }
83  catch ( std::bad_alloc& )
84  {
85  std::string e =
86  "Caught exception from kdu_region_decompressor: std::bad_alloc";
87  ossimNotify(ossimNotifyLevel_WARN) << e << std::endl;
88  }
89  catch( ... )
90  {
91  std::string e =
92  "Caught unhandled exception from kdu_region_decompressor";
93  ossimNotify(ossimNotifyLevel_WARN) << e << std::endl;
94  }
95 
97 }
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
kdu_supp::kdu_client * m_client
ossimRefPtr< ossimHttpRequest > m_request
kdu_supp::jp2_family_src m_jp2Family
virtual void close()
Deletes the overview and clears the valid image vertices.
kdu_supp::kdu_client * m_headerClient
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ convertClassIdToKdu()

int ossimKakaduJpipHandler::convertClassIdToKdu ( int  id)
protected

Definition at line 105 of file ossimKakaduJpipHandler.cpp.

106 {
107 
108  if(id >=0 &&id<=8)
109  {
110  return (id >> 1);
111  }
112 #if 0
113  switch(id)
114  {
115  case 0:
116  case 1:
117  {
118  return KDU_PRECINCT_DATABIN;
119  }
120  case 2:
121  {
122  return KDU_TILE_HEADER_DATABIN;
123  }
124  case 4:
125  case 5:
126  {
127  return KDU_TILE_DATABIN;
128  }
129  case 6:
130  {
131  return KDU_MAIN_HEADER_DATABIN;
132  }
133  case 8:
134  {
135  return KDU_META_DATABIN;
136  }
137  default:
138  {
139  break;
140  }
141  }
142 #endif
143  return -1;
144 }

◆ deleteRlevelCache()

void ossimKakaduJpipHandler::deleteRlevelCache ( )
protected

Definition at line 1066 of file ossimKakaduJpipHandler.cpp.

References ossimAppFixedTileCache::deleteCache(), ossimAppFixedTileCache::instance(), and m_rlevelBlockCache.

Referenced by close(), initializeRlevelCache(), and performRlevelSetup().

1067 {
1068  ossim_uint32 idx = 0;
1069  for(idx = 0; idx < m_rlevelBlockCache.size();++idx)
1070  {
1072  }
1073  m_rlevelBlockCache.clear();
1074 }
virtual void deleteCache(ossimAppFixedCacheId cacheId)
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
unsigned int ossim_uint32

◆ extractBoxes() [1/2]

void ossimKakaduJpipHandler::extractBoxes ( BoxList boxList)
virtual

Definition at line 196 of file ossimKakaduJpipHandler.cpp.

References loadClient(), m_client, m_headerClient, and m_jp2Family.

197 {
198  kdu_window window;
199  window.init();
200  m_headerClient->close();
201  if(loadClient(m_headerClient, window))
202  {
203  m_headerClient->set_read_scope(KDU_MAIN_HEADER_DATABIN, 0, 0);
204  kdu_codestream codestream;
205  kdu_region_decompressor decompressor;
206  codestream.create(m_headerClient);
207  codestream.set_persistent();
208 
209  kdu_channel_mapping oChannels;
210  oChannels.configure(codestream);
211 
212  kdu_coords ref_expansion(1, 1);
213  kdu_dims view_dims = decompressor.get_rendered_image_dims(codestream, &oChannels, -1, 0,
214  ref_expansion, ref_expansion,
215  KDU_WANT_OUTPUT_COMPONENTS);
216  siz_params* siz_in = codestream.access_siz();
217  kdu_params* cod_in = siz_in->access_cluster("COD");
218  m_jp2Family.close();
219  m_client->set_read_scope(KDU_META_DATABIN, 0, 0);
221 
222  extractBoxes(boxList, 0);
223  m_jp2Family.close();
224  }
225 }
virtual void extractBoxes(BoxList &boxList)
kdu_supp::kdu_client * m_client
kdu_supp::jp2_family_src m_jp2Family
bool loadClient(kdu_supp::kdu_client *client, kdu_supp::kdu_window &window)
kdu_supp::kdu_client * m_headerClient

◆ extractBoxes() [2/2]

virtual void ossimKakaduJpipHandler::extractBoxes ( BoxList boxList,
kdu_supp::jp2_input_box *  pParentBox 
)
protectedvirtual

◆ flushCache()

void ossimKakaduJpipHandler::flushCache ( )
protected

Definition at line 1230 of file ossimKakaduJpipHandler.cpp.

References ossimAppFixedTileCache::flush(), ossimAppFixedTileCache::instance(), and m_rlevelBlockCache.

Referenced by setProperty().

1231 {
1232  ossim_uint32 idx = 0;
1233  for(idx = 0; idx < m_rlevelBlockCache.size();++idx)
1234  {
1236  }
1237 }
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
unsigned int ossim_uint32

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimKakaduJpipHandler::getImageGeometry ( )
virtual

Returns the image geometry object associated with this tile source or NULL if non defined.

The geometry contains full-to-local image transform as well as projection (image-to-world).

Reimplemented from ossimImageHandler.

Definition at line 1160 of file ossimKakaduJpipHandler.cpp.

References ossimString::c_str(), ossimImageGeometryRegistry::createGeometry(), ossimRefPtr< T >::get(), ossimImageHandler::getCurrentEntry(), ossimImageHandler::getImageGeometry(), ossimInfoBase::getKeywordlist(), ossimImageGeometry::getProjection(), ossimImageHandler::initImageParameters(), ossimImageGeometryRegistry::instance(), ossimKakaduJpipInfo::setHandler(), ossimImageHandler::theGeometry, ossimString::toString(), and ossimRefPtr< T >::valid().

1161 {
1162  if(theGeometry.valid()) return theGeometry.get();
1163 
1164  // if base is able to create a goemetry then return it
1166 
1167  if(!theGeometry->getProjection())
1168  {
1169  ossimKeywordlist kwl;
1170 
1172  info->setHandler(this);
1173  info->getKeywordlist(kwl);
1174  info = 0;
1175  ossimString prefix = "jpip.image"+ossimString::toString(getCurrentEntry()) + ".";
1176  // dump the infromation into a kwl and then pass it to the geometry resgistry
1177 
1178  //std::cout << kwl << std::endl;
1179  //
1181  if(theGeometry.valid())
1182  {
1184  }
1185  }
1186 
1187  return theGeometry.get();
1188 }
virtual bool getKeywordlist(ossimKeywordlist &kwl) const
Method to dump info to a keyword list.
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setHandler(ossimKakaduJpipHandler *handler)
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossimImageGeometry * createGeometry(const ossimString &typeName) const
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual ossim_uint32 getCurrentEntry() const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ getImageTileHeight()

ossim_uint32 ossimKakaduJpipHandler::getImageTileHeight ( ) const
virtual

Returns the tile width of the image or 0 if the image is not tiled.

Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 707 of file ossimKakaduJpipHandler.cpp.

References ossimIpt::hasNans(), m_tileSize, and ossimIpt::y.

708 {
709  return m_tileSize.hasNans()?0:m_tileSize.y;
710 }
ossim_int32 y
Definition: ossimIpt.h:142
bool hasNans() const
Definition: ossimIpt.h:58

◆ getImageTileWidth()

ossim_uint32 ossimKakaduJpipHandler::getImageTileWidth ( ) const
virtual

Returns the tile width of the image or 0 if the image is not tiled.

Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 702 of file ossimKakaduJpipHandler.cpp.

References ossimIpt::hasNans(), m_tileSize, and ossimIpt::x.

703 {
704  return m_tileSize.hasNans()?0:m_tileSize.x;
705 }
ossim_int32 x
Definition: ossimIpt.h:141
bool hasNans() const
Definition: ossimIpt.h:58

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimKakaduJpipHandler::getNumberOfDecimationLevels ( ) const
virtual

This returns the total number of decimation levels.

It is important to note that res level 0 or full resolution is included in the list and has decimation values 1.0, 1.0

Reimplemented from ossimImageHandler.

Definition at line 756 of file ossimKakaduJpipHandler.cpp.

References ossimImageHandler::getNumberOfDecimationLevels(), m_overviewDimensions, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getTile(), and getTileAtRes().

757 {
758  ossim_uint32 result = m_overviewDimensions.size();
759  if (theOverview.valid())
760  {
762  }
763  return result;
764 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview

◆ getNumberOfInputBands()

ossim_uint32 ossimKakaduJpipHandler::getNumberOfInputBands ( ) const
virtual

Returns the number of bands available from the input.

Implements ossimImageSource.

Definition at line 692 of file ossimKakaduJpipHandler.cpp.

References m_nInputBands.

Referenced by getTileAtRes().

693 {
694  return m_nInputBands;
695 }

◆ getNumberOfLines()

ossim_uint32 ossimKakaduJpipHandler::getNumberOfLines ( ossim_uint32  resLevel = 0) const
virtual

Pure virtual, derived classes must implement.

Parameters
resLevelReduced resolution level to return lines of. Default = 0
Returns
The number of lines for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 664 of file ossimKakaduJpipHandler.cpp.

References ossimImageHandler::getNumberOfLines(), m_overviewDimensions, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

665 {
666  ossim_uint32 result = 0;
667  if (resLevel < m_overviewDimensions.size())
668  {
669  result = m_overviewDimensions[resLevel].height();
670  }
671  else if (theOverview.valid())
672  {
673  result = theOverview->getNumberOfLines(resLevel);
674  }
675  return result;
676 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview

◆ getNumberOfOutputBands()

ossim_uint32 ossimKakaduJpipHandler::getNumberOfOutputBands ( ) const
virtual

Returns the number of bands in a tile returned from this TileSource.

Reimplemented from ossimImageSource.

Definition at line 697 of file ossimKakaduJpipHandler.cpp.

References m_nOutputBands.

698 {
699  return m_nOutputBands;
700 }

◆ getNumberOfSamples()

ossim_uint32 ossimKakaduJpipHandler::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
virtual

Pure virtual, derived classes must implement.

Parameters
resLevelReduced resolution level to return samples of. Default = 0
Returns
The number of samples for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 678 of file ossimKakaduJpipHandler.cpp.

References ossimImageHandler::getNumberOfSamples(), m_overviewDimensions, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

679 {
680  ossim_uint32 result = 0;
681  if (resLevel < m_overviewDimensions.size())
682  {
683  result = m_overviewDimensions[resLevel].width();
684  }
685  else if (theOverview.valid())
686  {
687  result = theOverview->getNumberOfSamples(resLevel);
688  }
689  return result;
690 }
bool valid() const
Definition: ossimRefPtr.h:75
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getOutputScalarType()

ossimScalarType ossimKakaduJpipHandler::getOutputScalarType ( ) const
virtual

This will be used to query the output pixel type of the tile source.

Please ignore the argument. It will soon be removed.

Reimplemented from ossimImageSource.

Definition at line 712 of file ossimKakaduJpipHandler.cpp.

References m_bitDepth, m_signed, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT8, OSSIM_UINT11, OSSIM_UINT12, OSSIM_UINT13, OSSIM_UINT14, OSSIM_UINT15, OSSIM_UINT16, and OSSIM_UINT8.

Referenced by open().

713 {
715  switch(m_bitDepth)
716  {
717  case 8:
718  {
720  break;
721  }
722  case 11:
723  {
725  break;
726  }
727  case 12:
728  {
730  break;
731  }
732  case 13:
733  {
735  break;
736  }
737  case 14:
738  {
740  break;
741  }
742  case 15:
743  {
745  break;
746  }
747  case 16:
748  {
750  break;
751  }
752  };
753  return result;
754 }
8 bit signed integer
16 bit unsigned integer (12 bits used)
16 bit unsigned integer
16 bit unsigned integer (14 bits used)
16 bit signed integer
16 bit unsigned integer (13 bits used)
ossimScalarType
16 bit unsigned integer (15 bits used)
8 bit unsigned integer
16 bit unsigned integer (11 bits used)

◆ getProperty()

ossimRefPtr< ossimProperty > ossimKakaduJpipHandler::getProperty ( const ossimString name) const
virtual

Reimplemented from ossimImageHandler.

Definition at line 1140 of file ossimKakaduJpipHandler.cpp.

References ossimRefPtr< T >::get(), m_quality, ossimProperty::setCacheRefreshBit(), ossimProperty::setFullRefreshBit(), and ossimString::toString().

1141 {
1143  if(name == "quality")
1144  {
1146  0, 100);
1147  result->setCacheRefreshBit();
1148  result->setFullRefreshBit();
1149  }
1150 
1151  return result.get();
1152 }
static ossimString toString(bool aValue)
Numeric to string methods.
void setFullRefreshBit()
void setCacheRefreshBit()

◆ getPropertyNames()

void ossimKakaduJpipHandler::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Reimplemented from ossimImageHandler.

Definition at line 1154 of file ossimKakaduJpipHandler.cpp.

References ossimImageHandler::getPropertyNames(), and ossimKeywordNames::QUALITY_KW.

1155 {
1156  ossimImageHandler::getPropertyNames(propertyNames);
1157  propertyNames.push_back(ossimKeywordNames::QUALITY_KW);
1158 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
static const char * QUALITY_KW

◆ getTile()

ossimRefPtr< ossimImageData > ossimKakaduJpipHandler::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual
Returns
the requested region of interest

Reimplemented from ossimImageSource.

Definition at line 792 of file ossimKakaduJpipHandler.cpp.

References ossimConnectableObject::connectMyInputTo(), ossimConnectableObject::disconnect(), ossimRefPtr< T >::get(), getNumberOfDecimationLevels(), ossimImageRenderer::getResampler(), ossimImageRenderer::getTile(), getTileAtRes(), ossimIrect::lr(), m_quality, ossimNotify(), ossimNotifyLevel_WARN, ossimImageViewAffineTransform::scale(), ossimFilterResampler::setFilterType(), ossimMemoryImageSource::setImage(), ossimImageRenderer::setImageViewTransform(), ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

794 {
796 
797  try
798  {
800 
801  ossim_uint64 scalePower2 = 1<<nLevels;
802  ossim_int32 targetLevel = nLevels - ossim::round<ossim_uint32>(log(1.0+((scalePower2*m_quality)/100.0))/log(2.0));
803 
804  // now try log way
805  if(targetLevel > static_cast<ossim_int32>(resLevel))
806  {
807  double scale = 1.0/(1<<targetLevel);
808  ossimDrect scaledRect = rect*ossimDpt(scale, scale);
809  ossimIrect scaledRectRound = scaledRect;
810  scaledRectRound = ossimIrect(scaledRectRound.ul().x - 1,
811  scaledRectRound.ul().y - 1,
812  scaledRectRound.lr().x + 1,
813  scaledRectRound.lr().y + 1);
814  ossimRefPtr<ossimImageData> copy = getTileAtRes(scaledRectRound, targetLevel);
815  copy = (ossimImageData*)copy->dup();
816 
817  //result->setImageRectangle(rect);
818 
822  transform->scale(1<<targetLevel, 1<<targetLevel);
823  memSource->setImage(copy.get());
824  renderer->connectMyInputTo(memSource.get());
825  renderer->getResampler()->setFilterType("bilinear");
826  renderer->setImageViewTransform(transform.get());
827  result = renderer->getTile(rect);
828  renderer->disconnect();
829  memSource->disconnect();
830  renderer = 0;
831  memSource = 0;
832  }
833  else
834  {
835  // we need to apply a quality and then scale to the proper resolution.
836  // so if we want a 50% quality image and they are requesting a reslevel 0 product
837  // we need to query jpip at the next level down and not at 0 and scale the product up
838  // using a bilinear or some form of resampling
839  //
840  result = getTileAtRes(rect, resLevel);
841  }
842  }
843  catch ( kdu_exception exc )
844  {
845  ostringstream e;
846  e << "ossimKakaduNitfReader::~ossimKakaduNitfReader\n"
847  << "Caught exception from kdu_region_decompressor: " << exc << "\n";
848  ossimNotify(ossimNotifyLevel_WARN) << e.str() << std::endl;
849  }
850  catch ( std::bad_alloc& )
851  {
852  std::string e =
853  "Caught exception from kdu_region_decompressor: std::bad_alloc";
854  ossimNotify(ossimNotifyLevel_WARN) << e << std::endl;
855  }
856  catch( ... )
857  {
858  std::string e =
859  "Caught unhandled exception from kdu_region_decompressor";
860  ossimNotify(ossimNotifyLevel_WARN) << e << std::endl;
861  }
862 
863  return result.get();
864 }
ossimRefPtr< ossimImageData > getTileAtRes(const ossimIrect &rect, ossim_uint32 resLevel=0)
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual void disconnect(ossimConnectableObject *object=0)
Will disconnect the object passed in.
void setImage(ossimRefPtr< ossimImageData > image)
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &origin, ossim_uint32 resLevel=0)
the resampler will need the tile request to come from the view.
void setImageViewTransform(ossimImageViewTransform *transform)
void setFilterType(ossimFilterResamplerType filterType)
unsigned long long ossim_uint64
const ossimIpt & lr() const
Definition: ossimIrect.h:276
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
ossimFilterResampler * getResampler()
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
virtual void scale(double x, double y)
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ getTileAtRes()

ossimRefPtr< ossimImageData > ossimKakaduJpipHandler::getTileAtRes ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
protected

Definition at line 866 of file ossimKakaduJpipHandler.cpp.

References ossimAppFixedTileCache::addTile(), allocateTile(), ossim::clipRegionToImage(), ossimIrect::clipToRect(), ossim::copyRegionToTile(), ossimImageDataFactory::create(), ossimRefPtr< T >::get(), ossimImageHandler::getBoundingRect(), ossimImageData::getBuf(), ossimImageData::getImageRectangle(), getNumberOfDecimationLevels(), getNumberOfInputBands(), ossimImageHandler::getOverviewTile(), ossimImageSource::getTile(), ossimAppFixedTileCache::getTile(), ossimIrect::height(), ossimImageData::initialize(), ossimImageDataFactory::instance(), ossimAppFixedTileCache::instance(), ossimIrect::intersects(), isOpen(), ossimSource::isSourceEnabled(), loadClient(), ossimImageData::loadTile(), ossimIrect::lr(), m_client, m_nQualityLayers, m_overviewDimensions, m_rlevelBlockCache, m_rlevelTileSize, m_tile, m_useOurGrab, ossimImageData::makeBlank(), OSSIM_BSQ, ossimNotify(), ossimNotifyLevel_WARN, ossimImageData::setImageRectangle(), ossimIrect::stretchToTileBoundary(), ossimImageHandler::theOverview, ossimString::toString(), ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimImageData::validate(), ossimIrect::width(), ossimIpt::x, x, ossimIpt::y, and y.

Referenced by getTile().

868 {
871 
872  if((resLevel>=nLevels)||!isOpen()||!isSourceEnabled())
873  {
874  return result;
875  }
876 
877  if(resLevel > m_overviewDimensions.size()&&theOverview.valid())
878  {
879  return theOverview->getTile(rect, resLevel);
880  }
881  if(!m_tile.valid()) allocateTile();
882  m_tile->setImageRectangle(rect);
883 
884  if(getOverviewTile(resLevel, m_tile.get()))
885  {
886  return m_tile.get();
887  }
888 
889  ossimIrect bounds = getBoundingRect(resLevel);
890  ossimIrect clipRect = bounds.clipToRect(rect);
891 
892  kdu_dims dims;
893  if(!bounds.intersects(rect))
894  {
895  return result;
896  }
897 
898  kdu_coords ref_expansion;
899  kdu_coords exp_numerator;
900  kdu_coords exp_denominator;
901  kdu_dims rr_win;
902  ref_expansion.x = 1;
903  ref_expansion.y = 1;
904 
905  kdu_dims view_dims;
906 
907  ossimString comps;
909  ossim_uint32 idx = 0;
910  for(idx=0;idx<nBands;++idx)
911  {
912  comps+=ossimString::toString(idx);
913  if(idx+1!=nBands)
914  {
915  comps+=",";
916  }
917  }
918  ossimIpt tileSize;
919  tileSize = m_rlevelTileSize[resLevel];//m_tileSize;
920  // if(static_cast<ossim_int32>(bounds.width()) < tileSize.x) tileSize.x = bounds.width();
921  // if(static_cast<ossim_int32>(bounds.height()) < tileSize.y) tileSize.y = bounds.height();
922 
923  ossimIrect tileBoundaryRect = clipRect;
924  tileBoundaryRect.stretchToTileBoundary(tileSize);
925 
926 
927  tileBoundaryRect.clipToRect(bounds);
928  ossim_int64 ulx = tileBoundaryRect.ul().x;
929  ossim_int64 uly = tileBoundaryRect.ul().y;
930  ossim_int64 maxx = tileBoundaryRect.lr().x;
931  ossim_int64 maxy = tileBoundaryRect.lr().y;
932  m_tile->makeBlank();
933  kdu_window window;
934  kdu_dims region;
935  for(;ulx < maxx; ulx += tileSize.x)
936  {
937  for(;uly < maxy; uly += tileSize.y)
938  {
939  ossim_int64 x = ulx;
940  ossim_int64 y = uly;
941  ossim_int64 w = tileSize.x;
942  ossim_int64 h = tileSize.y;
943 
944  if(x+w-1 > maxx) w = maxx-x;
945  if(y+h-1 > maxy) h = maxy-y;
946 
948  if(!cacheTile.valid())
949  {
950  // double percent = (m_quality/100.0);
951  window.init();
952  region.pos.x = x;
953  region.pos.y = y;
954  region.size.x = w;
955  region.size.y = h;
956  //std::cout << "NLAYERS ================= " << m_nQualityLayers << std::endl;
957  //ossim_int32 nQualityLayers = ((m_quality/100.0)*m_nQualityLayers);
958  ossim_int32 nQualityLayers = (m_nQualityLayers);//*percent;
959  nQualityLayers = nQualityLayers<1?1:nQualityLayers;
960  // std::cout << "nquality === " << nQualityLayers << std::endl;
961  window.set_region(region);
962 
963  window.set_max_layers(nQualityLayers);
964  window.resolution.x = bounds.width();
965  window.resolution.y = bounds.height();
966 
967  try
968  {
969  if(loadClient(m_client, window))
970  {
971  //std::cout << "WE LOADED THE CLIENT!!!!" << std::endl;
972  bool gotRegion = true;
973  // if we do not need to use ssl we use kakadu for the window loads
974  if(!m_useOurGrab)
975  {
976  kdu_window reqWindow;
977  m_client->get_window_in_progress(&reqWindow);
978  gotRegion = ((reqWindow.region.size.x>0)&&
979  (reqWindow.region.size.y>0));
980  }
981  //kdu_window reqWindow = window;
982  //m_client->get_window_in_progress(&reqWindow);
983  // now get a codestream ready for decompressing the data
984  //
985 
986  if(gotRegion)
987  {
988  jp2_family_src jp2FamilySource;
989  jp2FamilySource.open(m_client);
990 
991  jpx_source jpxSource;
992  if(jpxSource.open(&jp2FamilySource, true)==1)
993  {
994  jpx_codestream_source jpx_codestream = jpxSource.access_codestream(0);
995  kdu_codestream codestream;
996  jpx_input_box* inputBox = jpx_codestream.open_stream();
997  if(inputBox)
998  {
999  codestream.create(inputBox);
1000  codestream.set_persistent();
1001  codestream.apply_input_restrictions(
1002  0, 0,
1003  resLevel, nQualityLayers, &region,
1004  KDU_WANT_CODESTREAM_COMPONENTS);
1005  if ( ossim::clipRegionToImage(codestream,
1006  region,
1007  resLevel,
1008  region) )
1009  {
1010  kdu_channel_mapping channels;
1011  channels.configure(codestream);
1012  cacheTile = ossimImageDataFactory::instance()->create(this, this);
1013  cacheTile->setImageRectangle(ossimIrect(region.pos.x,region.pos.y,
1014  region.pos.x + region.size.x - 1,
1015  region.pos.y+region.size.y - 1));
1016  cacheTile->initialize();
1017 
1018  ossim::copyRegionToTile(&channels, codestream, resLevel, 0, 0, cacheTile.get());
1019  ossimAppFixedTileCache::instance()->addTile(m_rlevelBlockCache[resLevel], cacheTile.get(), false);
1020  }
1021  }
1022  }
1023  jpxSource.close();
1024  jp2FamilySource.close();
1025  }
1026  else
1027  {
1028  ossimNotify(ossimNotifyLevel_WARN) << "Unable to get block from server, defaulting to blank\n";
1029  }
1030  }
1031  else
1032  {
1033  ossimNotify(ossimNotifyLevel_WARN) << "Unable to establish a connection to the server\n";
1034  }
1035  }
1036  catch(...)
1037  {
1038  cacheTile = 0;
1039  }
1040  }
1041  if(cacheTile.valid())
1042  {
1043  m_tile->loadTile(cacheTile->getBuf(), cacheTile->getImageRectangle(), OSSIM_BSQ);
1044  }
1045  }
1046  }
1047  m_tile->validate();
1048 
1049  return m_tile;
1050 }
ossim_uint32 x
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual void setImageRectangle(const ossimIrect &rect)
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
kdu_supp::kdu_client * m_client
ossim_uint32 height() const
Definition: ossimIrect.h:487
static ossimString toString(bool aValue)
Numeric to string methods.
RLevelBlockSizeList m_rlevelTileSize
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossim_uint32 getNumberOfInputBands() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual void initialize()
Initialize the data buffer.
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
static ossimImageDataFactory * instance()
ossimRefPtr< ossimImageData > getTile(ossimAppFixedCacheId cacheId, const ossimIpt &origin)
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
ossimRefPtr< ossimImageData > m_tile
const ossimIpt & lr() const
Definition: ossimIrect.h:276
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
bool clipRegionToImage(kdu_core::kdu_codestream &codestream, kdu_core::kdu_dims &region, int discard_levels, kdu_core::kdu_dims &clipRegion)
Sets clipRegion from region, and image dimensions for level.
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageHandler > theOverview
bool copyRegionToTile(kdu_supp::kdu_channel_mapping *channelMapping, kdu_core::kdu_codestream &codestream, int discard_levels, kdu_core::kdu_thread_env *threadEnv, kdu_core::kdu_thread_queue *threadQueue, ossimImageData *destTile)
Copies region from codestream to tile at a given rlevel.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
bool loadClient(kdu_supp::kdu_client *client, kdu_supp::kdu_window &window)
long long ossim_int64
void stretchToTileBoundary(const ossimIpt &tileWidthHeight)
Definition: ossimIrect.cpp:212
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
ossim_int32 x
Definition: ossimIpt.h:141
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
ossimRefPtr< ossimImageData > addTile(ossimAppFixedCacheId cacheId, ossimRefPtr< ossimImageData > data, bool duplicateData=true)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ initializeRlevelCache()

void ossimKakaduJpipHandler::initializeRlevelCache ( )
protected

Definition at line 1100 of file ossimKakaduJpipHandler.cpp.

References deleteRlevelCache(), ossimAppFixedTileCache::instance(), m_overviewDimensions, m_rlevelBlockCache, m_rlevelTileSize, and ossimIrect::stretchToTileBoundary().

1101 {
1103  m_rlevelTileSize.clear();
1104  ossim_uint32 idx = 0;
1105  if(m_rlevelTileSize.size() != m_overviewDimensions.size()) return;
1106  for(idx = 0; idx < m_rlevelTileSize.size(); ++idx)
1107  {
1108  ossimIrect rect = m_overviewDimensions[idx];
1109  ossimIpt tileSize(m_rlevelTileSize[idx]);
1110  rect.stretchToTileBoundary(tileSize);
1111  m_rlevelBlockCache.push_back(ossimAppFixedTileCache::instance()->newTileCache(rect, tileSize));
1112  }
1113 }
RLevelBlockSizeList m_rlevelTileSize
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
unsigned int ossim_uint32
void stretchToTileBoundary(const ossimIpt &tileWidthHeight)
Definition: ossimIrect.cpp:212

◆ isImageTiled()

virtual bool ossimKakaduJpipHandler::isImageTiled ( ) const
inlinevirtual

Indicates whether or not the image is tiled internally.

This implementation returns true if (getImageTileWidth() && getImageTileHeight()) are both non zero. Override in the image handler if something else is desired. Returns true if tiled, false if not.

Reimplemented from ossimImageHandler.

Definition at line 56 of file ossimKakaduJpipHandler.h.

References ossimIpt::hasNans(), and m_tileSize.

57  {
58  return !m_tileSize.hasNans();
59  }
bool hasNans() const
Definition: ossimIpt.h:58

◆ isOpen()

bool ossimKakaduJpipHandler::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 99 of file ossimKakaduJpipHandler.cpp.

References m_client.

Referenced by getTileAtRes(), and open().

100 {
101  return (m_client!=0);
102 }
kdu_supp::kdu_client * m_client

◆ loadClient()

bool ossimKakaduJpipHandler::loadClient ( kdu_supp::kdu_client *  client,
kdu_supp::kdu_window &  window 
)
protected

Definition at line 482 of file ossimKakaduJpipHandler.cpp.

References ossimHttpRequest::addHeaderOption(), allocateSession(), ossimString::c_str(), ossimHttpRequest::clearHeaderOptions(), ossimWebRequestFactoryRegistry::createHttp(), ossimString::empty(), ossimRefPtr< T >::get(), ossimWebRequest::getResponse(), ossimHttpResponse::getStatusCode(), ossimHttpResponse::headerKwl(), ossimWebRequestFactoryRegistry::instance(), m_baseUrl, m_cid, m_path, m_request, m_transport, m_useOurGrab, ossimHttpRequest::set(), ossimUrl::setParams(), ossimString::substitute(), ossimString::toString(), ossimString::trim(), and ossimRefPtr< T >::valid().

Referenced by extractBoxes(), getTileAtRes(), and openStream().

483 {
484  bool result =false;
485 
486  if(!client) return result;
487  // we will assume that the libcurl library support ssl connections and we will use our own
488  // urlquery instead of using kakadu's persistant code
489  // if m_ourGrab is true we currently only support stateless requests. Kakadu
490  // interface we use if m_useOurGrab communicates through the channel session
491  // id.
492  if(m_useOurGrab)
493  {
494  //if(!m_request.valid())
495  allocateSession();
496 
497  client->close();
498  bool needNewChannel = false;
499 #if 0
500  if(!m_request.valid())
501  {
503  needNewChannel = true;
504  }
505 #endif
506  if(m_request.valid())
507  {
509  ossimString params;
510  ossimUrl imageInfoUrl = m_baseUrl;
511  if(window.region.size.x == 0&&
512  window.region.size.y == 0)
513  {
514 
515  params = "type=jpp-stream&stream=0";
516  }
517  else
518  {
519  params = "type=jpp-stream&stream=0";
520 
521  params += ("&roff=" + ossimString::toString((ossim_int64)window.region.pos.x)+","+ossimString::toString((ossim_int64)window.region.pos.y));
522  params += ("&rsiz=" + ossimString::toString((ossim_int64)window.region.size.x)+","+ossimString::toString((ossim_int64)window.region.size.y));
523  params += ("&fsiz=" + ossimString::toString((ossim_int64)window.resolution.x)+","+ossimString::toString((ossim_int64)window.resolution.y));
524  params += ("&layers=" + ossimString::toString(window.get_max_layers()));
525 
526  }
527  if(!m_cid.empty())
528  {
529  params += ("&cid=" + m_cid);
530  // if(!m_path.empty()) imageInfoUrl.setPath(m_path);
531  }
532  if(needNewChannel)
533  {
534  params += "&cnew=http";
535  }
536  imageInfoUrl.setParams(params);
537 
538  m_request->set(imageInfoUrl, ossimKeywordlist());
539  m_request->addHeaderOption("HEADERS=Accept", "jpp-stream");
541  //std::cout << "URL======================== " << imageInfoUrl.toString() << std::endl;
542  ossimRefPtr<ossimHttpResponse> response = dynamic_cast<ossimHttpResponse*>(webResponse.get());
543  //std::cout << "__________________________" << std::endl;
544  if(response.valid()&&(response->getStatusCode()==200))
545  {
546 // std::cout << response->headerKwl() << std::endl;
547  //std::cout << "__________________________" << std::endl;
548  //std::cout << response->headerKwl() << std::endl;
549 #if 0
550  ossimString jpipCnew = response->headerKwl()["JPIP-cnew"];
551  jpipCnew = jpipCnew.trim();
552 
553  if(!jpipCnew.empty())
554  {
555  m_cid = "";
556  m_path = "";
557  m_transport ="";
558  ossimString tempKwlString = jpipCnew.substitute(",", "\n", true);
559  std::istringstream in(tempKwlString.c_str());
560 
561  ossimKeywordlist kwl('=');
562  if(kwl.parseStream(in))
563  {
564  m_cid = kwl["cid"];
565  m_path = kwl["path"];
566  m_transport = kwl["transport"];
567  m_cid = m_cid.trim();
568  m_path = m_path.trim();
570 
571  std::cout << "PATH === " << m_path << std::endl;
572  }
573  }
574 #endif
575  if(traceDebug())
576  {
577  ossimNotify(ossimNotifyLevel_DEBUG) << ossimString(response->headerBuffer().buffer(),response->headerBuffer().buffer()+response->headerBuffer().bufferSize()) << std::endl;
578  }
580  response->copyAllDataFromInputStream(buf);
581  if(buf.size())
582  {
583  try
584  {
586  decoder->inputStreamBuffer().setBuf(reinterpret_cast<char*>(&buf.front()),
587  buf.size(),
588  true);
589  ossimRefPtr<ossimJpipMessage> message = decoder->readMessage();
590  ossimRefPtr<ossimJpipMessage> mainHeaderMessage;
591  if(message.valid())
592  {
593  ossim_uint32 dataWritten = 0;
594  while(message.valid()&&!message->header()->m_isEOR)
595  {
596  int id = convertClassIdToKdu(message->header()->m_classIdentifier);
597  if((!message->header()->m_isEOR)&&
598  (id >=0))
599  {
600  client->add_to_databin( id,
601  message->header()->m_CSn,
602  message->header()->m_inClassIdentifier,
603  (const kdu_byte*)&message->messageBody().front(),
604  message->header()->m_msgOffset,
605  message->messageBody().size(),
606  message->header()->m_isLastByte);
607 
608  dataWritten+= message->messageBody().size();
609  }
610  message = decoder->readMessage();
611  }
612  }
613  result = true;
614  }
615  catch(...)
616  {
617  //std::cout << "EXCEPTION!!!!!!!!!!!!!!!!!!!\n";
618  //std::cout << "-----------------------------------------------\n";
619  result = false;
620  }
621  }
622  }
623  else if(response.valid())
624  {
625  if(traceDebug())
626  {
627  ossimNotify(ossimNotifyLevel_DEBUG) << ossimString(response->headerBuffer().buffer(),response->headerBuffer().buffer()+response->headerBuffer().bufferSize()) << std::endl;
628  }
629  //std::cout << imageInfoUrl.toString() << std::endl;
630  //std::cout << ossimString(response->headerBuffer().buffer(),response->headerBuffer().buffer()+response->headerBuffer().bufferSize()) << std::endl;
631  }
632  }
633  }
634  else
635  {
636  //std::cout << "TRYING TO MAKE A CONNECTION" << std::endl;
637  result = makeConnectionIfNeeded(client);
638  if(result)
639  {
640  result = false;
641  if(client->post_window(&window, m_requestQueueId))
642  {
643  try
644  {
645  //
646  while( !client->is_idle() &&client->is_alive())
647  {
649  }
650 
651  result = true;
652  }
653  catch(...)
654  {
655  result = false;
656  }
657  }
658  }
659  }
660  //std::cout << "RESULT? " << result << std::endl;
661  return result;
662 }
ossimString substitute(const ossimString &searchKey, const ossimString &replacementValue, bool replaceAll=false) const
Substitutes searchKey string with replacementValue and returns a string.
ossim_int64 m_msgOffset
Identifies the offset of the data in the message from the start of the data-bin.
ossim_uint32 getStatusCode() const
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimHttpRequest > m_request
static ossimString toString(bool aValue)
Numeric to string methods.
ossimKeywordlist & headerKwl()
ossimJpipMessageHeader * header()
ossim_uint64 bufferSize() const
MessageBodyType & messageBody()
virtual ossimHttpRequest * createHttp(const ossimUrl &url)
static void sleepInMicroSeconds(ossim_uint64 micros)
Utility method to allow one to sleep in microseconds.
Definition: Thread.cpp:83
char_type * buffer()
Returns a pointer to the buffer.
virtual ossimJpipMessage * readMessage()
virtual ossimRefPtr< ossimWebResponse > getResponse()
static ossimWebRequestFactoryRegistry * instance()
ossim_int32 m_CSn
If present, identifies the index (stating from 0) of the codestream to which the data-bin belongs...
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
bool set(const ossimUrl &url, const ossimKeywordlist &headerOptions, HttpMethodType methodType=HTTP_METHOD_GET)
ossimByteStreamBuffer & inputStreamBuffer()
void addHeaderOption(const ossimString &name, const ossimString &value)
bool m_isEOR
Indicates if this JPIP Message is an End of Response Message.
ossimByteStreamBuffer & headerBuffer()
std::streambuf * setBuf(char *buf, std::streamsize bufSize, bool shared)
void copyAllDataFromInputStream(ByteBuffer &buffer)
bool m_isLastByte
Bin-ID = [BinIdIndicator, completeDataBin, InClassIdentifier].
bool makeConnectionIfNeeded(kdu_supp::kdu_client *client)
long long ossim_int64
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool empty() const
Definition: ossimString.h:411
ossim_int32 m_classIdentifier
If present, provides a message class identifier.
std::vector< char > ByteBuffer
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
void setParams(const ossimString &params)
Definition: ossimUrl.h:27
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadState()

bool ossimKakaduJpipHandler::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 1190 of file ossimKakaduJpipHandler.cpp.

References close(), ossimKeywordlist::find(), ossimImageHandler::loadState(), m_baseUrl, m_quality, openStream(), and ossimKeywordNames::QUALITY_KW.

Referenced by open().

1191 {
1192  close();
1193  bool result = ossimImageHandler::loadState(kwl, prefix);
1194  if(result)
1195  {
1196  m_baseUrl = ossimUrl(kwl.find(prefix, "url"));
1197  ossimString qualityString = kwl.find(prefix,ossimKeywordNames::QUALITY_KW);
1198  if(!qualityString.empty())
1199  {
1200  m_quality = qualityString.toDouble();
1201  }
1202  result = openStream();
1203  }
1204 
1205 
1206  if(!result)
1207  {
1208  close();
1209  }
1210  return result;
1211 }
const char * find(const char *key) 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 void close()
Deletes the overview and clears the valid image vertices.
static const char * QUALITY_KW

◆ makeConnectionIfNeeded()

bool ossimKakaduJpipHandler::makeConnectionIfNeeded ( kdu_supp::kdu_client *  client)
protected

Definition at line 1053 of file ossimKakaduJpipHandler.cpp.

References ossimString::c_str(), ossimString::empty(), ossimUrl::getIp(), ossimUrl::getPath(), ossimUrl::getPort(), m_baseUrl, and m_requestQueueId.

1054 {
1055  if(!client->is_alive())
1056  {
1057  ossimString server = m_baseUrl.getIp()+(m_baseUrl.getPort().empty()?"":":"+m_baseUrl.getPort());
1058  ossimString path = m_baseUrl.getPath();
1059 
1060  m_requestQueueId = client->connect(server.c_str(), "",path.c_str(), "http", "", KDU_CLIENT_MODE_INTERACTIVE, "");
1061  }
1062  return client->is_alive();
1063 
1064 }
const ossimString & getPath() const
Definition: ossimUrl.h:20
const ossimString & getPort() const
Definition: ossimUrl.h:19
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool empty() const
Definition: ossimString.h:411
const ossimString & getIp() const
Definition: ossimUrl.h:18

◆ open()

bool ossimKakaduJpipHandler::open ( )
virtual

Pure virtual open.

Derived classes must implement.

Returns
Returns true on success, false on error.
Note
This method relies on the data member ossimImageData::theImageFile being set. Callers should do a "setFilename" prior to calling this method or use the ossimImageHandler::open that takes a file name and an entry index.

Implements ossimImageHandler.

Definition at line 402 of file ossimKakaduJpipHandler.cpp.

References ossimKeywordlist::addFile(), close(), ossimString::downcase(), ossimFilename::exists(), ossimFilename::ext(), ossimImageHandler::getFilename(), getOutputScalarType(), isOpen(), loadState(), m_baseUrl, openStream(), and OSSIM_SCALAR_UNKNOWN.

403 {
404  if(isOpen()) close();
405  bool result = false;
406  ossimFilename file = getFilename();
407  // local file and we will test for jpip extension and this
408  // will hold cached state information
409  //
410  if(file.exists())
411  {
412  if(file.ext().downcase()=="jpip")
413  {
414  ossimKeywordlist kwl;
415  if(kwl.addFile(file))
416  {
417  result = loadState(kwl);
418  }
419  }
420  }
421  else
422  {
423  m_baseUrl = ossimUrl(file);
424  result = openStream();
425  }
427  {
428  result = false;
429  close();
430  }
431  return result;
432 }
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.
bool addFile(const char *file)
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual void close()
Deletes the overview and clears the valid image vertices.
bool exists() const
virtual const ossimFilename & getFilename() const
Returns the filename.
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ openStream()

bool ossimKakaduJpipHandler::openStream ( )
protected

Definition at line 260 of file ossimKakaduJpipHandler.cpp.

References close(), ossimImageHandler::completeOpen(), ossimString::downcase(), ossimUrl::getProtocol(), loadClient(), m_baseUrl, m_bitDepth, m_bYCC, m_client, m_headerClient, m_imageBounds, m_jp2Family, m_nInputBands, m_nOutputBands, m_nQualityLayers, m_resLevels, m_signed, m_tileSize, m_useOurGrab, ossimIrect::makeNan(), performRlevelSetup(), ossimUrl::setProtocol(), showBoxes(), ossimIpt::x, and ossimIpt::y.

Referenced by loadState(), and open().

261 {
262  close();
263 
264  if(!m_client)
265  {
266  m_headerClient = new kdu_client();
267  m_client = new kdu_client();
268  }
269  bool result = false;
270  ossimString protocolString = m_baseUrl.getProtocol();
271  protocolString = protocolString.downcase();
272  m_useOurGrab = false;
273 
274  if(protocolString == "jpip")
275  {
276  m_baseUrl.setProtocol("http");
277  }
278  else
279  {
280  if(protocolString == "jpips")
281  {
282  m_useOurGrab = true;
283  m_baseUrl.setProtocol("https");
284  }
285  else
286  {
287  return false;
288  }
289  }
290  //std::cout << "OUR GRAB ==== " << m_useOurGrab << std::endl;
291  // m_useOurGrab = true;
293  kdu_window window;
294  window.init();
295  //std::cout << "calling loadClient " << std::endl;
296  if(loadClient(m_client, window))
297  {
298  try
299  {
300  m_client->set_read_scope(KDU_MAIN_HEADER_DATABIN, 0, 0);
301  kdu_codestream codestream;
302  kdu_region_decompressor decompressor;
303  codestream.create(m_client);
304  codestream.set_persistent();
305 
306  kdu_channel_mapping oChannels;
307  oChannels.configure(codestream);
308 
309 
310 
311  kdu_coords ref_expansion(1, 1);
312  kdu_dims view_dims = decompressor.get_rendered_image_dims(codestream, &oChannels, -1, 0,
313  ref_expansion, ref_expansion,
314  KDU_WANT_OUTPUT_COMPONENTS);
315  siz_params* siz_in = codestream.access_siz();
316  kdu_params* cod_in = siz_in->access_cluster("COD");
317  m_jp2Family.close();
318  m_client->set_read_scope(KDU_META_DATABIN, 0, 0);
319  m_jp2Family.open(m_client);
320  //std::cout <<"SHOWING BOXES!!!!!!!!!!!" << std::endl;
321  showBoxes();
322  if(cod_in&&siz_in)
323  {
324  //std::cout << "__________________________________====\n";
325  int nResLevels = 0;
326  int nQualityLayers = 0;
327  int nTileSizeX = 0;
328  int nTileSizeY = 0;
329 
330  cod_in->get("Clevels", 0, 0, nResLevels);
331  cod_in->get("Clayers", 0, 0, nQualityLayers);
332  siz_in->get("Stiles", 0, 0, nTileSizeY);
333  siz_in->get("Stiles", 0, 1, nTileSizeX);
334  m_nQualityLayers = nQualityLayers;
335  m_nInputBands = codestream.get_num_components(false);
336  m_nOutputBands = codestream.get_num_components(true);
337  ossim_uint64 width = view_dims.size.x;
338  ossim_uint64 height = view_dims.size.y;
339  // ossim_int32 m_nQualityLayers = nQualityLayers;
340  m_bitDepth = codestream.get_bit_depth(0);
341  m_signed = codestream.get_signed(0);
342  m_resLevels = nResLevels;
343  if(nTileSizeX&&nTileSizeY)
344  {
345  m_tileSize = ossimIpt( nTileSizeX, nTileSizeY);
346  }
347  else
348  {
349  m_tileSize = ossimIpt(2048, 128);
350  }
351  m_tileSize.x = m_tileSize.x>2048?2048:m_tileSize.x;
352  m_tileSize.y = m_tileSize.y>128?128:m_tileSize.y;
353  m_bYCC=1;
354  cod_in->get("Cycc", 0, 0, m_bYCC);
355  performRlevelSetup(codestream);
356 
357  m_jp2Family.close();
358  result = true;
359 #if 0
360  std::cout << std::dec << "width = " << width << std::endl;
361  std::cout << std::dec << "height = " << height << std::endl;
362  std::cout << "m_nOutputBands = " << m_nOutputBands << std::endl;
363  std::cout << "m_nInputBands = " << m_nInputBands << std::endl;
364  std::cout << "BitDepth = " << m_bitDepth << std::endl;
365  std::cout << "Overviews = " << nResLevels<< std::endl;
366  std::cout << "nQualityLayers = " << m_nQualityLayers<< std::endl;
367  std::cout << "nTileSize = " << m_tileSize << std::endl;
368 #endif
369  }
370 
371  // walk boxes for testing
372  //
373  // showBoxes(&box);
374  // std::cout << "BOX OPENED!!!" << std::endl;
375  //do {
376  // std::cout << "type: " <<std::ios::hex << box.get_box_type() << std::endl;
377  // std::cout << "SUPER? " << jp2_is_superbox(box.get_box_type()) << std::endl;
378  // box.close();
379  // box.open_next();
380  //} while (box.exists());
381  // }
382  }
383  catch(...)
384  {
385  result = false;
386  }
387  }
388 
389  if(result)
390  {
391  completeOpen();
392  }
393  else
394  {
395  close();
396  }
397  //std::cout << "RETURNING RESULT === " << result << std::endl;
398  return result;
399 
400 }
void performRlevelSetup(kdu_core::kdu_codestream &codestream)
void showBoxes(kdu_supp::jp2_input_box *pParentBox=0)
kdu_supp::kdu_client * m_client
void setProtocol(const ossimString &protocol)
Definition: ossimUrl.h:23
virtual void close()
Deletes the overview and clears the valid image vertices.
kdu_supp::jp2_family_src m_jp2Family
unsigned long long ossim_uint64
const ossimString & getProtocol() const
Definition: ossimUrl.h:17
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual void completeOpen()
Will complete the opening process.
ossim_int32 y
Definition: ossimIpt.h:142
void makeNan()
Definition: ossimIrect.h:329
bool loadClient(kdu_supp::kdu_client *client, kdu_supp::kdu_window &window)
ossim_int32 x
Definition: ossimIpt.h:141
kdu_supp::kdu_client * m_headerClient

◆ performRlevelSetup()

void ossimKakaduJpipHandler::performRlevelSetup ( kdu_core::kdu_codestream &  codestream)
protected

Definition at line 1076 of file ossimKakaduJpipHandler.cpp.

References deleteRlevelCache(), ossimIrect::height(), ossimAppFixedTileCache::instance(), m_overviewDimensions, m_resLevels, m_rlevelBlockCache, m_rlevelTileSize, m_tileSize, ossimIrect::stretchToTileBoundary(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by openStream().

1077 {
1079  m_rlevelTileSize.clear();
1080 
1081  //Get resolution level dimensions
1082  //
1083  ossim_uint32 nDiscard = 0;
1084  for(nDiscard = 0; nDiscard < m_resLevels; ++nDiscard)
1085  {
1086  kdu_dims dims;
1087  codestream.apply_input_restrictions( 0, 0, nDiscard, 0, NULL );
1088  codestream.get_dims( 0, dims );
1089  ossimIrect rect(0,0,dims.size.x-1, dims.size.y-1);
1090  m_overviewDimensions.push_back(rect);
1091  ossimIpt tileSize(m_tileSize);
1092  tileSize.x = ((tileSize.x > static_cast<ossim_int32>(rect.width()))?static_cast<ossim_int32>(rect.width()):tileSize.x);
1093  tileSize.y = ((tileSize.y > static_cast<ossim_int32>(rect.height()))?static_cast<ossim_int32>(rect.height()):tileSize.y);
1094  m_rlevelTileSize.push_back(tileSize);
1095  rect.stretchToTileBoundary(tileSize);
1096  m_rlevelBlockCache.push_back(ossimAppFixedTileCache::instance()->newTileCache(rect, tileSize));
1097  }
1098 }
RLevelBlockSizeList m_rlevelTileSize
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
unsigned int ossim_uint32
int ossim_int32

◆ saveState()

bool ossimKakaduJpipHandler::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 1213 of file ossimKakaduJpipHandler.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimUrl::getProtocol(), m_baseUrl, m_quality, ossimKeywordNames::QUALITY_KW, ossimImageHandler::saveState(), ossimUrl::setProtocol(), and ossimUrl::toString().

1214 {
1215  bool result = ossimImageHandler::saveState(kwl, prefix);
1216 
1217  ossimUrl url = m_baseUrl;
1218  ossimString protocol = m_baseUrl.getProtocol();
1219  if(protocol == "http") protocol = "jpip";
1220  else if(protocol == "https") protocol = "jpips";
1221  url.setProtocol(protocol);
1222 
1223  kwl.add(prefix, "url", url.toString().c_str(), true);
1224  kwl.add(prefix, ossimKeywordNames::QUALITY_KW, m_quality, true);
1225 
1226  return result;
1227 }
void setProtocol(const ossimString &protocol)
Definition: ossimUrl.h:23
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimString toString() const
Definition: ossimUrl.cpp:106
const ossimString & getProtocol() const
Definition: ossimUrl.h:17
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
static const char * QUALITY_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setProperty()

void ossimKakaduJpipHandler::setProperty ( ossimRefPtr< ossimProperty property)
virtual

Reimplemented from ossimImageHandler.

Definition at line 1115 of file ossimKakaduJpipHandler.cpp.

References ossim::almostEqual(), flushCache(), ossimRefPtr< T >::get(), m_client, m_quality, ossimImageHandler::setProperty(), ossimRefPtr< T >::valid(), and ossimProperty::valueToString().

1116 {
1117  bool refreshCache = false;
1118  if(property.valid())
1119  {
1120  ossimString name = property->getName();
1121  if(name == "quality")
1122  {
1123  refreshCache = !ossim::almostEqual((double)m_quality,
1124  property->valueToString().toDouble());
1125  m_quality = property->valueToString().toDouble();
1126  }
1127  else
1128  {
1129  ossimImageHandler::setProperty(property.get());
1130  }
1131  }
1132 
1133  if(refreshCache)
1134  {
1135  flushCache();
1136  if(m_client) m_client->close();
1137  }
1138 }
virtual void valueToString(ossimString &valueResult) const =0
bool valid() const
Definition: ossimRefPtr.h:75
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53
kdu_supp::kdu_client * m_client
virtual void setProperty(ossimRefPtr< ossimProperty > property)

◆ showBoxes()

void ossimKakaduJpipHandler::showBoxes ( kdu_supp::jp2_input_box *  pParentBox = 0)
protected

Definition at line 146 of file ossimKakaduJpipHandler.cpp.

References m_jp2Family.

Referenced by openStream().

147 {
148  kdu_supp::jp2_input_box box;
149 
150  if(!pParentBox)
151  {
152  //std::cout << "DEBUG: SHOWING HEADER BOXES FOR STREAM" << std::endl;
153  box.open(&m_jp2Family);
154  }
155  else
156  {
157  box.open(pParentBox);
158  }
159  while(box.exists())
160  {
161  kdu_uint32 boxType = box.get_box_type();
162  char ch[] = { (char) ( boxType >> 24 ), (char) ( boxType >> 16 ), (char) ( boxType >> 8 ) , (char) ( boxType >> 0 ), '\0' };
163 
164  //std::cout << ch << std::endl;
165  //std::cout << "Remaining bytes = " << box.get_remaining_bytes() << "\n";
166  if ( box.get_box_type() == jp2_xml_4cc )
167  {
168  //std::cout << "XML_________________________________________________\n";
169  std::vector<kdu_byte> bytes(box.get_remaining_bytes());
170  box.read(&bytes.front(), bytes.size());
171 
172  //std::cout << ossimString((char*)&bytes.front(), ((char*)&bytes.front())+bytes.size() ) << std::endl;
173  }
174  if(box.get_box_type() == jp2_uuid_4cc)
175  {
176  std::vector<kdu_byte> bytes(box.get_remaining_bytes());
177  box.read(&bytes.front(), bytes.size());
178  ossim_uint32 idx = 0;
179  //for(idx = 0; idx < 16; ++idx)
180  //{
181  //std::cout << (int)bytes[idx]<< " ";
182  //}
183  //std::cout << "\n";
184  }
185  if ( jp2_is_superbox( box.get_box_type() ) )
186  {
187  showBoxes( &box );
188  }
189  else
190  {
191  }
192  box.close();
193  box.open_next();
194  }
195 }
void showBoxes(kdu_supp::jp2_input_box *pParentBox=0)
kdu_supp::jp2_family_src m_jp2Family
unsigned int ossim_uint32

Member Data Documentation

◆ m_baseUrl

ossimUrl ossimKakaduJpipHandler::m_baseUrl
protected

◆ m_bitDepth

ossim_uint16 ossimKakaduJpipHandler::m_bitDepth
protected

Definition at line 94 of file ossimKakaduJpipHandler.h.

Referenced by getOutputScalarType(), and openStream().

◆ m_bYCC

int ossimKakaduJpipHandler::m_bYCC
protected

Definition at line 99 of file ossimKakaduJpipHandler.h.

Referenced by openStream().

◆ m_cid

ossimString ossimKakaduJpipHandler::m_cid
protected

Definition at line 110 of file ossimKakaduJpipHandler.h.

Referenced by allocateSession(), and loadClient().

◆ m_client

kdu_supp::kdu_client* ossimKakaduJpipHandler::m_client
protected

◆ m_headerClient

kdu_supp::kdu_client* ossimKakaduJpipHandler::m_headerClient
protected

Definition at line 103 of file ossimKakaduJpipHandler.h.

Referenced by close(), extractBoxes(), and openStream().

◆ m_imageBounds

ossimIrect ossimKakaduJpipHandler::m_imageBounds
protected

Definition at line 97 of file ossimKakaduJpipHandler.h.

Referenced by openStream().

◆ m_jp2Family

kdu_supp::jp2_family_src ossimKakaduJpipHandler::m_jp2Family
protected

Definition at line 105 of file ossimKakaduJpipHandler.h.

Referenced by close(), extractBoxes(), openStream(), and showBoxes().

◆ m_nInputBands

ossim_uint32 ossimKakaduJpipHandler::m_nInputBands
protected

Definition at line 91 of file ossimKakaduJpipHandler.h.

Referenced by getNumberOfInputBands(), and openStream().

◆ m_nOutputBands

ossim_uint32 ossimKakaduJpipHandler::m_nOutputBands
protected

Definition at line 92 of file ossimKakaduJpipHandler.h.

Referenced by getNumberOfOutputBands(), and openStream().

◆ m_nQualityLayers

ossim_uint32 ossimKakaduJpipHandler::m_nQualityLayers
protected

Definition at line 95 of file ossimKakaduJpipHandler.h.

Referenced by getTileAtRes(), and openStream().

◆ m_overviewDimensions

RectList ossimKakaduJpipHandler::m_overviewDimensions
protected

◆ m_path

ossimString ossimKakaduJpipHandler::m_path
protected

Definition at line 111 of file ossimKakaduJpipHandler.h.

Referenced by allocateSession(), and loadClient().

◆ m_quality

ossim_float32 ossimKakaduJpipHandler::m_quality
protected

Definition at line 102 of file ossimKakaduJpipHandler.h.

Referenced by getProperty(), getTile(), loadState(), saveState(), and setProperty().

◆ m_request

ossimRefPtr<ossimHttpRequest> ossimKakaduJpipHandler::m_request
protected

Definition at line 113 of file ossimKakaduJpipHandler.h.

Referenced by allocateSession(), close(), and loadClient().

◆ m_requestQueueId

int ossimKakaduJpipHandler::m_requestQueueId
protected

Definition at line 106 of file ossimKakaduJpipHandler.h.

Referenced by makeConnectionIfNeeded().

◆ m_resLevels

ossim_uint32 ossimKakaduJpipHandler::m_resLevels
protected

Definition at line 98 of file ossimKakaduJpipHandler.h.

Referenced by openStream(), and performRlevelSetup().

◆ m_rlevelBlockCache

RLevelCacheList ossimKakaduJpipHandler::m_rlevelBlockCache
protected

◆ m_rlevelTileSize

RLevelBlockSizeList ossimKakaduJpipHandler::m_rlevelTileSize
protected

◆ m_signed

bool ossimKakaduJpipHandler::m_signed
protected

Definition at line 93 of file ossimKakaduJpipHandler.h.

Referenced by getOutputScalarType(), and openStream().

◆ m_tile

ossimRefPtr<ossimImageData> ossimKakaduJpipHandler::m_tile
protected

Definition at line 100 of file ossimKakaduJpipHandler.h.

Referenced by allocateTile(), and getTileAtRes().

◆ m_tileSize

ossimIpt ossimKakaduJpipHandler::m_tileSize
protected

◆ m_transport

ossimString ossimKakaduJpipHandler::m_transport
protected

Definition at line 112 of file ossimKakaduJpipHandler.h.

Referenced by allocateSession(), and loadClient().

◆ m_useOurGrab

bool ossimKakaduJpipHandler::m_useOurGrab
protected

Definition at line 88 of file ossimKakaduJpipHandler.h.

Referenced by getTileAtRes(), loadClient(), and openStream().

◆ TYPE_DATA

ossimKakaduJpipHandler::TYPE_DATA
protected

Definition at line 114 of file ossimKakaduJpipHandler.h.


The documentation for this class was generated from the following files: