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

#include <ossimPngReader.h>

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

Public Types

enum  ossimPngReadMode {
  ossimPngReadUnknown = 0, ossimPngRead8 = 1, ossimPngRead16 = 2, ossimPngRead8a = 3,
  ossimPngRead16a = 4
}
 
- 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

 ossimPngReader ()
 default constructor More...
 
virtual ~ossimPngReader ()
 virtual destructor More...
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab from the image. More...
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands in the image. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 reduced_res_level=0) const
 Returns the number of lines in the image. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 reduced_res_level=0) const
 Returns the number of samples in the image. More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 reduced_res_level=0) const
 Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. 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 void setProperty (ossimRefPtr< ossimProperty > property)
 Set propterty method. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 Get propterty method. More...
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 Get propterty names. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the width of the output tile. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the height of the output tile. 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...
 
bool isOpen () const
 Derived classes must implement this method to be concrete. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual bool open (std::shared_ptr< ossim::istream > &str, const std::string &connectionString)
 This open takes a stream and stores/captures the shared pointer on success. More...
 
virtual void close ()
 Close method. More...
 
bool checkSignature (std::istream &str)
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Gets the image geometry. 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 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 getNumberOfDecimationLevels () const
 This returns the total number of decimation 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 isImageTiled () const
 Indicates whether or not the image is tiled internally. 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 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 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 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 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
 
- Public Member Functions inherited from ossimStreamReaderInterface
 ossimStreamReaderInterface ()
 default constructor More...
 
virtual ~ossimStreamReaderInterface ()
 virtual destructor. More...
 

Protected Member Functions

bool open (std::shared_ptr< ossim::istream > &str)
 This open takes a stream and stores/captures the shared pointer on success. More...
 
bool readPngInit ()
 Performs signature check and initializes png_structp and png_infop. More...
 
bool initReader ()
 Initializes this reader from libpng m_pngPtr and infoPtr. More...
 
void readPngVersionInfo ()
 
ossimString getPngColorTypeString () const
 
void setMaxPixelValue ()
 the max pixel value. More...
 
virtual bool open ()
 open method. More...
 
void allocate ()
 Initializes tiles and buffers. More...
 
void destroy ()
 Free tile and buffer memory. More...
 
void restart ()
 Method to restart reading from the beginning (for backing up). More...
 
void fillTile (const ossimIrect &clip_rect, ossimImageData *tile)
 
template<class T >
void copyLines (T dummy, ossim_uint32 stopLine)
 
template<class T >
void copyLinesWithAlpha (T, ossim_uint32 stopLine)
 
- 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)
 

Static Protected Member Functions

static void pngReadData (png_structp png_ptr, png_bytep data, png_size_t length)
 Callback method for reading from a stream. More...
 

Protected Attributes

ossimRefPtr< ossimImageDatam_tile
 
ossimRefPtr< ossimImageDatam_cacheTile
 
ossim_uint8m_lineBuffer
 
ossim_uint32 m_lineBufferSizeInBytes
 
std::shared_ptr< ossim::istreamm_str
 
ossimIrect m_bufferRect
 
ossimIrect m_imageRect
 
ossim_uint32 m_numberOfInputBands
 
ossim_uint32 m_numberOfOutputBands
 
ossim_uint32 m_bytePerPixelPerBand
 
ossimIpt m_cacheSize
 
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
 
png_structp m_pngReadPtr
 
png_infop m_pngReadInfoPtr
 
ossim_int8 m_pngColorType
 
ossim_uint32 m_currentRow
 
ossimScalarType m_outputScalarType
 
ossim_int32 m_interlacePasses
 
ossim_int8 m_bitDepth
 
ossimPngReadMode m_readMode
 
std::vector< ossim_float64m_maxPixelValue
 
bool m_swapFlag
 
bool m_useAlphaChannelFlag
 
- 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 26 of file ossimPngReader.h.

Member Enumeration Documentation

◆ ossimPngReadMode

Enumerator
ossimPngReadUnknown 
ossimPngRead8 
ossimPngRead16 
ossimPngRead8a 
ossimPngRead16a 

Definition at line 30 of file ossimPngReader.h.

Constructor & Destructor Documentation

◆ ossimPngReader()

ossimPngReader::ossimPngReader ( )

default constructor

Definition at line 46 of file ossimPngReader.cpp.

47  :
49  m_tile(0),
50  m_cacheTile(0),
51  m_lineBuffer(0),
53  m_str(0),
54  m_bufferRect(0, 0, 0, 0),
55  m_imageRect(0, 0, 0, 0),
59  m_cacheSize(0),
60  m_cacheId(-1),
61  m_pngReadPtr(0),
63  m_pngColorType(PNG_COLOR_TYPE_GRAY),
64  m_currentRow(0),
67  m_bitDepth(8),
70  m_swapFlag(false),
72 {
73  if (traceDebug())
74  {
76  << "ossimPngReader::ossimPngReader entered..." << std::endl;
78 #ifdef OSSIM_ID_ENABLED
80  << "OSSIM_ID: " << OSSIM_ID << endl;
81 #endif
82  }
83 }
std::shared_ptr< ossim::istream > m_str
ossimIrect m_imageRect
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
ossim_uint8 * m_lineBuffer
png_structp m_pngReadPtr
std::vector< ossim_float64 > m_maxPixelValue
ossimRefPtr< ossimImageData > m_cacheTile
ossim_uint32 m_lineBufferSizeInBytes
ossimPngReadMode m_readMode
ossim_uint32 m_numberOfInputBands
bool m_useAlphaChannelFlag
ossimIrect m_bufferRect
ossim_int8 m_bitDepth
ossim_int8 m_pngColorType
ossim_uint32 m_bytePerPixelPerBand
ossim_uint32 m_numberOfOutputBands
ossimIpt m_cacheSize
ossimRefPtr< ossimImageData > m_tile
ossim_int32 m_interlacePasses
ossimImageHandler()
Constructor (default):
ossim_uint32 m_currentRow
8 bit unsigned integer
png_infop m_pngReadInfoPtr
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimScalarType m_outputScalarType

◆ ~ossimPngReader()

ossimPngReader::~ossimPngReader ( )
virtual

virtual destructor

Definition at line 85 of file ossimPngReader.cpp.

References close(), and isOpen().

86 {
87  if (isOpen())
88  {
89  close();
90  }
91 }
bool isOpen() const
Derived classes must implement this method to be concrete.
virtual void close()
Close method.

Member Function Documentation

◆ allocate()

void ossimPngReader::allocate ( )
protected

Initializes tiles and buffers.

Called once on first getTile request.

Definition at line 124 of file ossimPngReader.cpp.

References ossimImageDataFactory::create(), ossim::defaultTileSize(), ossimAppFixedTileCache::deleteCache(), ossimImageData::dup(), ossimImageData::initialize(), ossimImageDataFactory::instance(), ossimAppFixedTileCache::instance(), m_cacheId, m_cacheSize, m_cacheTile, m_imageRect, m_lineBuffer, m_lineBufferSizeInBytes, m_tile, ossimImageData::setImageRectangle(), ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

125 {
126  // Make the cache tile the height of one tile by the image width.
129 
132  newTileCache(m_imageRect, m_cacheSize);
133 
136  m_tile->initialize();
137 
138  ossimIrect cache_rect(m_imageRect.ul().x,
139  m_imageRect.ul().y,
140  m_imageRect.ul().x + (m_cacheSize.x-1),
141  m_imageRect.ul().y + (m_cacheSize.y-1));
142 
143  m_cacheTile->setImageRectangle(cache_rect);
145 
146  if(m_lineBuffer)
147  {
148  delete [] m_lineBuffer;
149  }
151 
152  if (traceDebug())
153  {
155  << "ossimPngReader::allocate DEBUG:"
156  << "\nm_cacheTile:\n" << *(m_cacheTile.get())
157  << "\nm_tile:\n" << *(m_tile.get())
158  << "\ncache tile size: " << m_cacheSize
159  << "\nimage width: " << m_imageRect.width()
160  << "\nimage height: " << m_imageRect.height()
161  << "\nnumber of bands: " << m_numberOfOutputBands
162  << "\nline buffer size: " << m_lineBufferSizeInBytes
163  << endl;
164  }
165 }
virtual void deleteCache(ossimAppFixedCacheId cacheId)
virtual void setImageRectangle(const ossimIrect &rect)
ossimIrect m_imageRect
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossim_uint8 * m_lineBuffer
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
const ossimIpt & ul() const
Definition: ossimIrect.h:274
ossimRefPtr< ossimImageData > m_cacheTile
ossim_uint32 m_lineBufferSizeInBytes
virtual void initialize()
Initialize the data buffer.
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
virtual ossimObject * dup() const
static ossimImageDataFactory * instance()
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_uint32 m_numberOfOutputBands
ossimIpt m_cacheSize
ossim_int32 y
Definition: ossimIpt.h:142
ossimRefPtr< ossimImageData > m_tile
ossim_int32 x
Definition: ossimIpt.h:141
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ checkSignature()

bool ossimPngReader::checkSignature ( std::istream &  str)
Returns
true if first 8 bytes matches png signature, false if not.

Definition at line 768 of file ossimPngReader.cpp.

Referenced by open().

769 {
770  bool result = false;
771 
772  //---
773  // Verify the file is a png by checking the first eight bytes:
774  // 0x 89 50 4e 47 0d 0a 1a 0a
775  //---
776  ossim_uint8 sig[8];
777  str.read( (char*)sig, 8);
778  if ( str.good() )
779  {
780  if ( png_sig_cmp(sig, 0, 8) == 0 )
781  {
782  result = true;
783  }
784  }
785 
786  return result;
787 }
unsigned char ossim_uint8

◆ close()

void ossimPngReader::close ( )
virtual

Close method.

Reimplemented from ossimImageHandler.

Definition at line 93 of file ossimPngReader.cpp.

References ossimImageHandler::close(), and destroy().

Referenced by open(), and ~ossimPngReader().

94 {
95  destroy();
97 }
void destroy()
Free tile and buffer memory.
virtual void close()
Deletes the overview and clears the valid image vertices.

◆ copyLines()

template<class T >
void ossimPngReader::copyLines ( dummy,
ossim_uint32  stopLine 
)
protected

Definition at line 1185 of file ossimPngReader.cpp.

References ossimImageData::getBuf(), m_cacheTile, m_currentRow, m_imageRect, m_lineBuffer, m_numberOfInputBands, m_numberOfOutputBands, m_pngReadPtr, m_swapFlag, ossimEndian::swap(), and ossimIrect::width().

1187 {
1188  const ossim_uint32 SAMPLES = m_imageRect.width();
1189 
1190  T* src = (T*)m_lineBuffer;
1191  std::vector<T*> dst(m_numberOfOutputBands);
1192 
1193  ossim_uint32 band = 0;
1194  for (band = 0; band < m_numberOfOutputBands; ++band)
1195  {
1196  dst[band] = (T*) m_cacheTile->getBuf(band);
1197  }
1198 
1199  ossim_int32 bufIdx = 0;
1200 
1201  while (m_currentRow <= stopLine)
1202  {
1203  // Read a line from the jpeg file.
1204  png_read_row(m_pngReadPtr, m_lineBuffer, NULL);
1205  ++m_currentRow;
1206 
1207  if(m_swapFlag)
1208  {
1209  ossimEndian endian;
1210  endian.swap(src, SAMPLES*m_numberOfInputBands);
1211  }
1212 
1213  //---
1214  // Copy the line which is band interleaved by pixel the the band
1215  // separate buffers.
1216  //---
1217  ossim_uint32 index = 0;
1218  for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)
1219  {
1220  for (band = 0; band < m_numberOfOutputBands; ++band)
1221  {
1222  dst[band][bufIdx] = src[index];
1223  ++index;
1224  }
1225  ++bufIdx;
1226  }
1227  }
1228 }
ossimIrect m_imageRect
ossim_uint8 * m_lineBuffer
png_structp m_pngReadPtr
ossimRefPtr< ossimImageData > m_cacheTile
ossim_uint32 m_numberOfInputBands
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_uint32 m_numberOfOutputBands
virtual const void * getBuf() const
ossim_uint32 m_currentRow
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
int ossim_int32

◆ copyLinesWithAlpha()

template<class T >
void ossimPngReader::copyLinesWithAlpha ( ,
ossim_uint32  stopLine 
)
protected

Definition at line 1230 of file ossimPngReader.cpp.

References ossimImageData::getBuf(), ossimImageData::getMaxPix(), ossimImageData::getMinPix(), ossimImageData::getNullPix(), m_cacheTile, m_currentRow, m_imageRect, m_lineBuffer, m_maxPixelValue, m_numberOfInputBands, m_numberOfOutputBands, m_outputScalarType, m_pngReadPtr, m_swapFlag, OSSIM_UINT8, ossimEndian::swap(), and ossimIrect::width().

1232 {
1233  ossim_float64 denominator;
1235  {
1236  denominator = m_maxPixelValue[m_numberOfInputBands-1];
1237  }
1238  else
1239  {
1240  denominator = m_maxPixelValue[m_numberOfInputBands-1];
1241  }
1242 
1243  const ossim_uint32 SAMPLES = m_imageRect.width();
1244 
1245  T* src = (T*) m_lineBuffer;
1246 
1247  std::vector<T*> dst(m_numberOfOutputBands);
1248  std::vector<T> p(m_numberOfOutputBands);
1249 
1250  ossim_float64 alpha;
1251 
1252  const ossim_float64 MIN_PIX = m_cacheTile->getMinPix(0);
1253  const ossim_float64 MAX_PIX = m_cacheTile->getMaxPix(0);
1254  const ossim_float64 NULL_PIX = m_cacheTile->getNullPix(0);
1255 
1256  ossim_uint32 band = 0;
1257  for (band = 0; band < m_numberOfOutputBands; ++band)
1258  {
1259  dst[band] = (T*)m_cacheTile->getBuf(band);
1260  }
1261 
1262  ossim_int32 dstIdx = 0;
1263 
1264  while (m_currentRow <= stopLine)
1265  {
1266  // Read a line from the jpeg file.
1267  png_read_row(m_pngReadPtr, m_lineBuffer, NULL);
1268  ++m_currentRow;
1269 
1270  if(m_swapFlag)
1271  {
1272  ossimEndian endian;
1273  endian.swap(src, SAMPLES*m_numberOfInputBands);
1274  }
1275 
1276  //---
1277  // Copy the line which is band interleaved by pixel the the band
1278  // separate buffers.
1279  //---
1280  ossim_uint32 srcIdx = 0;
1281  for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)
1282  {
1283  // Copy the pixels.
1284  for (band = 0; band < m_numberOfOutputBands; ++band)
1285  {
1286  p[band] = src[srcIdx++];
1287  }
1288 
1289  // Get the alpha channel.
1290  alpha = src[srcIdx++];
1291  alpha = alpha / denominator;
1292 
1293  if (alpha == 1.0)
1294  {
1295  for (band = 0; band < m_numberOfOutputBands; ++band)
1296  {
1297  dst[band][dstIdx] = p[band];
1298  }
1299  }
1300  else if (alpha == 0.0)
1301  {
1302  for (band = 0; band < m_numberOfOutputBands; ++band)
1303  {
1304  dst[band][dstIdx] = static_cast<T>(NULL_PIX);
1305  }
1306  }
1307  else
1308  {
1309  for (band = 0; band < m_numberOfOutputBands; ++band)
1310  {
1311  ossim_float64 f = p[band];
1312  f = f * alpha;
1313  if (f != NULL_PIX)
1314  {
1315  dst[band][dstIdx] =
1316  static_cast<T>( (f>=MIN_PIX) ?
1317  ( (f<=MAX_PIX) ? f : MAX_PIX ) :
1318  MIN_PIX );
1319  }
1320  else
1321  {
1322  dst[band][dstIdx] = static_cast<T>(NULL_PIX);
1323  }
1324  }
1325  }
1326  ++dstIdx; // next sample...
1327 
1328  } // End of sample loop.
1329 
1330  } // End of line loop.
1331 }
virtual const ossim_float64 * getMaxPix() const
ossimIrect m_imageRect
ossim_uint8 * m_lineBuffer
png_structp m_pngReadPtr
std::vector< ossim_float64 > m_maxPixelValue
ossimRefPtr< ossimImageData > m_cacheTile
double ossim_float64
ossim_uint32 m_numberOfInputBands
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual const ossim_float64 * getMinPix() const
ossim_uint32 m_numberOfOutputBands
virtual const void * getBuf() const
ossim_uint32 m_currentRow
8 bit unsigned integer
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
ossimScalarType m_outputScalarType
int ossim_int32

◆ destroy()

void ossimPngReader::destroy ( )
protected

Free tile and buffer memory.

Deletes stream if own it flag is set.

Definition at line 99 of file ossimPngReader.cpp.

References ossimAppFixedTileCache::deleteCache(), ossimAppFixedTileCache::instance(), m_cacheId, m_cacheTile, m_lineBuffer, m_pngReadInfoPtr, m_pngReadPtr, m_str, and m_tile.

Referenced by close(), and open().

100 {
102 
103  // ossimRefPtrs so assign to 0(unreferencing) will handle memory.
104  m_tile = 0;
105  m_cacheTile = 0;
106 
107  if (m_lineBuffer)
108  {
109  delete [] m_lineBuffer;
110  m_lineBuffer = 0;
111  }
112 
113  if (m_pngReadPtr)
114  {
115  png_destroy_read_struct(&m_pngReadPtr, &m_pngReadInfoPtr, NULL);
116  m_pngReadPtr = 0;
117  m_pngReadInfoPtr = 0;
118  }
119 
120  // Stream data member m_str is share pointer now:
121  m_str = 0;
122 }
virtual void deleteCache(ossimAppFixedCacheId cacheId)
std::shared_ptr< ossim::istream > m_str
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
ossim_uint8 * m_lineBuffer
png_structp m_pngReadPtr
ossimRefPtr< ossimImageData > m_cacheTile
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
ossimRefPtr< ossimImageData > m_tile
png_infop m_pngReadInfoPtr

◆ fillTile()

void ossimPngReader::fillTile ( const ossimIrect clip_rect,
ossimImageData tile 
)
protected
Note
this method assumes that setImageRectangle has been called on theTile.

Definition at line 257 of file ossimPngReader.cpp.

References getImageRectangle(), ossimIrect::height(), m_cacheSize, m_str, ossimIrect::set_lrx(), ossimIrect::set_ulx(), ossimIrect::stretchToTileBoundary(), x, and ossimIpt::y.

Referenced by getTile().

259 {
260  if (!tile || !m_str) return;
261 
262  ossimIrect buffer_rect = clip_rect;
263  buffer_rect.stretchToTileBoundary(m_cacheSize);
264  buffer_rect.set_ulx(0);
265  buffer_rect.set_lrx(getImageRectangle(0).lr().x);
266 
267  ossim_int32 number_of_cache_tiles = buffer_rect.height()/m_cacheSize.y;
268 
269 #if 0
270  if (traceDebug())
271  {
273  << "tiles high: " << number_of_cache_tiles
274  << endl;
275  }
276 #endif
277 
278  ossimIpt origin = buffer_rect.ul();
279 
280  for (int tileIdx = 0; tileIdx < number_of_cache_tiles; ++tileIdx)
281  {
282  // See if it's in the cache already.
284  tempTile = ossimAppFixedTileCache::instance()->
285  getTile(m_cacheId, origin);
286  if (tempTile.valid())
287  {
288  tile->loadTile(tempTile.get());
289  }
290  else
291  {
292  // Have to read from the png file.
293  ossim_uint32 startLine = static_cast<ossim_uint32>(origin.y);
294  ossim_uint32 stopLine =
295  static_cast<ossim_uint32>( min(origin.y+m_cacheSize.y-1,
296  getImageRectangle().lr().y) );
297  ossimIrect cache_rect(origin.x,
298  origin.y,
299  origin.x+m_cacheSize.x-1,
300  origin.y+m_cacheSize.y-1);
301 
302  m_cacheTile->setImageRectangle(cache_rect);
303 
306  {
308  }
309 
310  if (startLine < m_currentRow)
311  {
312  // Must restart the compression process again.
313  restart();
314  }
315 
316  // Gobble any not needed lines.
317  while(m_currentRow < startLine)
318  {
319  png_read_row(m_pngReadPtr, m_lineBuffer, NULL);
320  ++m_currentRow;
321  }
322 
323  switch (m_readMode)
324  {
325  case ossimPngRead8:
326  {
327  copyLines(ossim_uint8(0), stopLine);
328  break;
329  }
330  case ossimPngRead16:
331  {
332  copyLines(ossim_uint16(0), stopLine);
333  break;
334  }
335  case ossimPngRead8a:
336  {
338  {
339  copyLines(ossim_uint8(0), stopLine);
340  }
341  else
342  {
343  // Will burn alpha value into the other bands.
344  copyLinesWithAlpha(ossim_uint8(0), stopLine);
345  }
346  break;
347  }
348  case ossimPngRead16a:
349  {
351  {
352  copyLines(ossim_uint16(0), stopLine);
353  }
354  else
355  {
356  // Will burn alpha value into the other bands.
357  copyLinesWithAlpha(ossim_uint16(0), stopLine);
358  }
359  break;
360  }
361  case ossimPngReadUnknown:
362  default:
363  {
364  break; // should never happen.
365  }
366  }
367 
369 
370  tile->loadTile(m_cacheTile.get());
371 
372  // Add it to the cache for the next time.
374  m_cacheTile);
375 
376  } // End of reading for png file.
377 
378  origin.y += m_cacheSize.y;
379 
380  } // for (int tile = 0; tile < number_of_cache_tiles; ++tile)
381 
382  tile->validate();
383 }
ossim_uint32 x
virtual void setImageRectangle(const ossimIrect &rect)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
std::shared_ptr< ossim::istream > m_str
void copyLines(T dummy, ossim_uint32 stopLine)
ossim_uint32 y
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in...
bool valid() const
Definition: ossimRefPtr.h:75
ossimAppFixedTileCache::ossimAppFixedCacheId m_cacheId
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossim_uint8 * m_lineBuffer
png_structp m_pngReadPtr
const ossimIpt & ul() const
Definition: ossimIrect.h:274
ossimRefPtr< ossimImageData > m_cacheTile
unsigned short ossim_uint16
static ossimAppFixedTileCache * instance(ossim_uint32 maxSize=0)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
ossimPngReadMode m_readMode
virtual ossimDataObjectStatus validate() const
unsigned int ossim_uint32
virtual ossimIrect getImageRectangle() const
void copyLinesWithAlpha(T, ossim_uint32 stopLine)
bool m_useAlphaChannelFlag
void set_lrx(ossim_int32 x)
Definition: ossimIrect.h:693
virtual void makeBlank()
Initializes data to null pixel values.
ossimIpt m_cacheSize
ossim_int32 y
Definition: ossimIpt.h:142
void restart()
Method to restart reading from the beginning (for backing up).
void stretchToTileBoundary(const ossimIpt &tileWidthHeight)
Definition: ossimIrect.cpp:212
ossim_uint32 m_currentRow
ossim_int32 x
Definition: ossimIpt.h:141
int completely_within(extent_type extent1, extent_type extent2)
unsigned char ossim_uint8
ossimRefPtr< ossimImageData > addTile(ossimAppFixedCacheId cacheId, ossimRefPtr< ossimImageData > data, bool duplicateData=true)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
#define min(a, b)
Definition: auxiliary.h:75
int ossim_int32
void set_ulx(ossim_int32 x)
Definition: ossimIrect.h:657

◆ getClassName()

ossimString ossimPngReader::getClassName ( ) const
virtual
Returns
"ossimPngReader"

Reimplemented from ossimObject.

Definition at line 616 of file ossimPngReader.cpp.

617 {
618  return ossimString("ossimPngReader");
619 }

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimPngReader::getImageGeometry ( )
virtual

Gets the image geometry.

This method overrides ossimImageHandler::getImageGeometry to NOT call ossimImageGeometryRegistry::instance()->extendGeometry().

Returns
the image geometry object associated with this tile source. In many case the underlying ossimImageGeometry projection may be NULL with this reader so callers should check.

Reimplemented from ossimImageHandler.

Definition at line 789 of file ossimPngReader.cpp.

References ossimRefPtr< T >::get(), ossimImageHandler::getExternalImageGeometry(), ossimImageHandler::initImageParameters(), and ossimImageHandler::theGeometry.

790 {
791  if ( !theGeometry )
792  {
793  //---
794  // Check factory for external geom:
795  //---
797 
798  if ( !theGeometry )
799  {
800  // Fist time through:
802 
803  //---
804  // This code does not call ossimImageGeometryRegistry::extendGeometry
805  // by design to avoid wasted factory calls.
806  //---
807  }
808 
809  // Set image things the geometry object should know about.
811  }
812  return theGeometry;
813 }
ossimRefPtr< ossimImageGeometry > theGeometry
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...

◆ getImageRectangle()

ossimIrect ossimPngReader::getImageRectangle ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in.

Note that rrds 0 is the highest resolution rrds.

Reimplemented from ossimImageHandler.

Definition at line 386 of file ossimPngReader.cpp.

References getNumberOfLines(), and getNumberOfSamples().

Referenced by fillTile(), and getTile().

387 {
388  return ossimIrect(0,
389  0,
390  getNumberOfSamples(reduced_res_level) - 1,
391  getNumberOfLines(reduced_res_level) - 1);
392 }
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of lines in the image.
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of samples in the image.

◆ getImageTileHeight()

ossim_uint32 ossimPngReader::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 601 of file ossimPngReader.cpp.

602 {
603  return 0;
604 }

◆ getImageTileWidth()

ossim_uint32 ossimPngReader::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 596 of file ossimPngReader.cpp.

597 {
598  return 0;
599 }

◆ getLongName()

ossimString ossimPngReader::getLongName ( ) const
virtual
Returns
"ossim png"

Reimplemented from ossimObject.

Definition at line 611 of file ossimPngReader.cpp.

612 {
613  return ossimString("ossim png reader");
614 }

◆ getMaxPixelValue()

double ossimPngReader::getMaxPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the max pixel of the band.

Reimplemented from ossimImageHandler.

Definition at line 648 of file ossimPngReader.cpp.

References m_maxPixelValue, and m_numberOfOutputBands.

649 {
650  //---
651  // Note the size of m_maxPixelValue can be one greater than output bands
652  // if there is an alpa channel.
653  //---
654  if (band < m_numberOfOutputBands)
655  {
656  return m_maxPixelValue[band];
657  }
658  return 255.0;
659 }
std::vector< ossim_float64 > m_maxPixelValue
ossim_uint32 m_numberOfOutputBands

◆ getNumberOfInputBands()

ossim_uint32 ossimPngReader::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 621 of file ossimPngReader.cpp.

References m_numberOfOutputBands.

622 {
623  //---
624  // NOTE: If there is an alpha channel the input band will be one more than
625  // the output bands. For library purposes the output bands and input bands
626  // are the same.
627  //---
628  return m_numberOfOutputBands;
629 }
ossim_uint32 m_numberOfOutputBands

◆ getNumberOfLines()

ossim_uint32 ossimPngReader::getNumberOfLines ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the number of lines in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageHandler.

Definition at line 568 of file ossimPngReader.cpp.

References ossimImageHandler::getNumberOfLines(), ossimIrect::height(), m_imageRect, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getImageRectangle().

569 {
570  if (reduced_res_level == 0)
571  {
572  return m_imageRect.height();
573  }
574  else if ( theOverview.valid() )
575  {
576  return theOverview->getNumberOfLines(reduced_res_level);
577  }
578 
579  return 0;
580 }
ossimIrect m_imageRect
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimRefPtr< ossimImageHandler > theOverview

◆ getNumberOfOutputBands()

ossim_uint32 ossimPngReader::getNumberOfOutputBands ( ) const
virtual

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

Note: we are supporting sources that can have multiple data objects. If you want to know the scalar type of an object you can pass in the

Reimplemented from ossimImageSource.

Definition at line 631 of file ossimPngReader.cpp.

References m_numberOfOutputBands.

Referenced by getTile().

632 {
633  return m_numberOfOutputBands;
634 }
ossim_uint32 m_numberOfOutputBands

◆ getNumberOfSamples()

ossim_uint32 ossimPngReader::getNumberOfSamples ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the number of samples in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageHandler.

Definition at line 582 of file ossimPngReader.cpp.

References ossimImageHandler::getNumberOfSamples(), m_imageRect, ossimImageHandler::theOverview, ossimRefPtr< T >::valid(), and ossimIrect::width().

Referenced by getImageRectangle().

583 {
584  if (reduced_res_level == 0)
585  {
586  return m_imageRect.width();
587  }
588  else if ( theOverview.valid() )
589  {
590  return theOverview->getNumberOfSamples(reduced_res_level);
591  }
592 
593  return 0;
594 }
ossimIrect m_imageRect
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getOutputScalarType()

ossimScalarType ossimPngReader::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 636 of file ossimPngReader.cpp.

References m_outputScalarType.

637 {
638  return m_outputScalarType;
639 }
ossimScalarType m_outputScalarType

◆ getPngColorTypeString()

ossimString ossimPngReader::getPngColorTypeString ( ) const
protected

Definition at line 1087 of file ossimPngReader.cpp.

References m_pngColorType.

1088 {
1089  ossimString result = "unknown";
1090  if (m_pngColorType == PNG_COLOR_TYPE_GRAY)
1091  {
1092  return ossimString("PNG_COLOR_TYPE_GRAY");
1093  }
1094  else if (m_pngColorType == PNG_COLOR_TYPE_PALETTE)
1095  {
1096  return ossimString("PNG_COLOR_TYPE_PALETTE");
1097  }
1098  else if (m_pngColorType == PNG_COLOR_TYPE_RGB)
1099  {
1100  return ossimString("PNG_COLOR_TYPE_RGB");
1101  }
1102  else if (m_pngColorType == PNG_COLOR_TYPE_RGB_ALPHA)
1103  {
1104  return ossimString("PNG_COLOR_TYPE_RGB_ALPHA");
1105  }
1106  else if (m_pngColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
1107  {
1108  return ossimString("PNG_COLOR_TYPE_GRAY_ALPHA");
1109  }
1110 
1111  return ossimString("unknown");
1112 }
ossim_int8 m_pngColorType

◆ getProperty()

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

Get propterty method.

Overrides ossimImageHandler::getProperty.

Parameters
nameProperty name to get.

Reimplemented from ossimImageHandler.

Definition at line 441 of file ossimPngReader.cpp.

References ossimString::string().

442 {
444  if ( name.string() == USE_ALPHA_KW )
445  {
447  }
448  else
449  {
450  prop = ossimImageHandler::getProperty(name);
451  }
452  return prop;
453 }
bool m_useAlphaChannelFlag
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
const std::string & string() const
Definition: ossimString.h:414

◆ getPropertyNames()

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

Get propterty names.

Overrides ossimImageHandler::getPropertyNames.

Parameters
propertyNamesArray to initialize.

Reimplemented from ossimImageHandler.

Definition at line 455 of file ossimPngReader.cpp.

456 {
457  propertyNames.push_back( ossimString(USE_ALPHA_KW) );
459 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ getShortName()

ossimString ossimPngReader::getShortName ( ) const
virtual
Returns
"png"

Reimplemented from ossimObject.

Definition at line 606 of file ossimPngReader.cpp.

607 {
608  return ossimString("ossim_png_reader");
609 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimPngReader::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual

Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab from the image.

Satisfies pure virtual from TileSource class.

Reimplemented from ossimImageSource.

Definition at line 167 of file ossimPngReader.cpp.

References allocate(), ossimRefPtr< T >::get(), ossimDataObject::getDataObjectStatus(), m_tile, ossimImageData::makeBlank(), OSSIM_NULL, ossimImageData::setImageRectangle(), and ossimRefPtr< T >::valid().

169 {
170  if ( !m_tile )
171  {
172  // First time through. Allocate memory...
173  allocate();
174  }
175 
176  if (m_tile.valid())
177  {
178  // Image rectangle must be set prior to calling getTile.
179  m_tile->setImageRectangle(rect);
180 
181  if ( getTile( m_tile.get(), resLevel ) == false )
182  {
184  {
185  m_tile->makeBlank();
186  }
187  }
188  }
189 
190  return m_tile;
191 }
virtual void setImageRectangle(const ossimIrect &rect)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
void allocate()
Initializes tiles and buffers.
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageData > m_tile

◆ getTile() [2/2]

bool ossimPngReader::getTile ( ossimImageData result,
ossim_uint32  resLevel = 0 
)
virtual

Method to get a tile.

Parameters
resultThe tile to stuff. Note The requested rectangle in full image space and bands should be set in the result tile prior to passing. It will be an error if: result.getNumberOfBands() != this->getNumberOfOutputBands()
Returns
true on success false on error. If return is false, result is undefined so caller should handle appropriately with makeBlank or whatever.

Reimplemented from ossimImageSource.

Definition at line 193 of file ossimPngReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), fillTile(), getImageRectangle(), ossimImageData::getImageRectangle(), ossimImageData::getNumberOfBands(), getNumberOfOutputBands(), ossimImageHandler::getOverviewTile(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), m_outputScalarType, m_tile, ossimImageData::makeBlank(), OSSIM_UINT16, ossimReferenced::ref(), ossimRectilinearDataObject::setScalarType(), status, and ossimReferenced::unref().

195 {
196  bool status = false;
197 
198  //---
199  // Not open, this tile source bypassed, or invalid res level,
200  // return a blank tile.
201  //---
202  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
203  result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
204  {
205  result->ref(); // Increment ref count.
206 
207  //---
208  // Check for overview tile. Some overviews can contain r0 so always
209  // call even if resLevel is 0. Method returns true on success, false
210  // on error.
211  //---
212  status = getOverviewTile(resLevel, result);
213 
214  if (status)
215  {
217  {
218  //---
219  // Temp fix:
220  // The overview handler could return a tile of OSSIM_USHORT11 if
221  // the max sample value was not set to 2047.
222  //
223  // To prevent a scalar mismatch set
224  //---
226  }
227  }
228 
229  if (!status) // Did not get an overview tile.
230  {
231  status = true;
232 
233  ossimIrect tile_rect = result->getImageRectangle();
234 
235  if ( ! tile_rect.completely_within(getImageRectangle(0)) )
236  {
237  // We won't fill totally so make blank first.
238  m_tile->makeBlank();
239  }
240 
241  if (getImageRectangle(0).intersects(tile_rect))
242  {
243  // Make a clip rect.
244  ossimIrect clip_rect = tile_rect.clipToRect(getImageRectangle(0));
245 
246  // This will validate the tile at the end.
247  fillTile(clip_rect, result);
248  }
249  }
250 
251  result->unref(); // Decrement ref count.
252  }
253 
254  return status;
255 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
void fillTile(const ossimIrect &clip_rect, ossimImageData *tile)
bool isOpen() const
Derived classes must implement this method to be concrete.
virtual ossim_uint32 getNumberOfBands() const
16 bit unsigned integer
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in...
void ref() const
increment the reference count by one, indicating that this object has another pointer which is refere...
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
void unref() const
decrement the reference count by one, indicating that a pointer to this object is referencing it...
return status
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageData > m_tile
virtual void setScalarType(ossimScalarType type)
See ossimScalarType in ossimConstants for a full list.
ossimScalarType m_outputScalarType

◆ getTileHeight()

ossim_uint32 ossimPngReader::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 563 of file ossimPngReader.cpp.

References ossimImageData::getHeight(), m_tile, and ossimRefPtr< T >::valid().

564 {
565  return ( m_tile.valid() ? m_tile->getHeight() : 0 );
566 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getHeight() const
ossimRefPtr< ossimImageData > m_tile

◆ getTileWidth()

ossim_uint32 ossimPngReader::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 558 of file ossimPngReader.cpp.

References ossimImageData::getWidth(), m_tile, and ossimRefPtr< T >::valid().

559 {
560  return ( m_tile.valid() ? m_tile->getWidth() : 0 );
561 }
virtual ossim_uint32 getWidth() const
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageData > m_tile

◆ initReader()

bool ossimPngReader::initReader ( )
protected

Initializes this reader from libpng m_pngPtr and infoPtr.

Returns
true on success, false on error.

Definition at line 858 of file ossimPngReader.cpp.

References ossim::byteOrder(), m_bitDepth, m_bytePerPixelPerBand, m_currentRow, m_imageRect, m_interlacePasses, m_lineBufferSizeInBytes, m_maxPixelValue, m_numberOfInputBands, m_numberOfOutputBands, m_outputScalarType, m_pngColorType, m_pngReadInfoPtr, m_pngReadPtr, m_readMode, m_swapFlag, m_useAlphaChannelFlag, OSSIM_LITTLE_ENDIAN, OSSIM_UINT16, OSSIM_UINT8, OSSIM_USHORT11, ossimPngRead16, ossimPngRead16a, ossimPngRead8, ossimPngRead8a, and setMaxPixelValue().

Referenced by open().

859 {
860  bool result = true;
861 
862  ossim_uint32 height = png_get_image_height(m_pngReadPtr, m_pngReadInfoPtr);
863  ossim_uint32 width = png_get_image_width(m_pngReadPtr, m_pngReadInfoPtr);
864  m_bitDepth = png_get_bit_depth(m_pngReadPtr, m_pngReadInfoPtr);
865  m_pngColorType = png_get_color_type(m_pngReadPtr, m_pngReadInfoPtr);
866 
867  m_imageRect = ossimIrect(0, 0, width - 1, height - 1);
868 
869  if (m_bitDepth == 16)
870  {
871  // png_set_strip_16 (m_pngReadPtr);
874  }
875  else
876  {
878  }
879 
880  // Set the read mode from scalar and color type.
882  {
883  if ( (m_pngColorType == PNG_COLOR_TYPE_RGB_ALPHA) ||
884  (m_pngColorType == PNG_COLOR_TYPE_GRAY_ALPHA) )
885  {
887  }
888  else
889  {
891  }
892  }
893  else
894  {
895  if ( (m_pngColorType == PNG_COLOR_TYPE_RGB_ALPHA) ||
896  (m_pngColorType == PNG_COLOR_TYPE_GRAY_ALPHA) )
897  {
899  }
900  else
901  {
903  }
904 
905  // Set the swap flag. PNG stores data in network byte order(big endian).
907  {
908  m_swapFlag = true;
909  }
910  }
911 
912  //---
913  // If png_set_expand used:
914  // Expand data to 24-bit RGB, or 8-bit grayscale,
915  // with alpha if available.
916  //---
917  bool expandFlag = false;
918 
919  if ( m_pngColorType == PNG_COLOR_TYPE_PALETTE )
920  {
921  expandFlag = true;
922  }
923  if ( (m_pngColorType == PNG_COLOR_TYPE_GRAY) && (m_bitDepth < 8) )
924  {
925  expandFlag = true;
926  }
927  if ( png_get_valid(m_pngReadPtr, m_pngReadInfoPtr, PNG_INFO_tRNS) )
928  {
929  expandFlag = true;
930  }
931 
932  //---
933  // If png_set_packing used:
934  // Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
935  //---
936  bool packingFlag = false;
937 
938  if ( (m_bitDepth < 8) && (m_pngColorType == PNG_COLOR_TYPE_GRAY) )
939  {
940  packingFlag = true;
941  }
942 
943  if (expandFlag)
944  {
945  png_set_expand(m_pngReadPtr);
946  }
947  if (packingFlag)
948  {
949  png_set_packing(m_pngReadPtr);
950  }
951 
952  // Gamma correction.
953  // ossim_float64 gamma;
954  // if (png_get_gAMA(m_pngReadPtr, m_pngReadInfoPtr, &gamma))
955  // {
956  // png_set_gamma(png_ptr, display_exponent, gamma);
957  // }
958 
959  //---
960  // Turn on interlace handling... libpng returns just 1 (ie single pass)
961  // if the image is not interlaced
962  //---
963  m_interlacePasses = png_set_interlace_handling (m_pngReadPtr);
964 
965  //---
966  // Update the info structures after the transformations take effect
967  //---
968  png_read_update_info (m_pngReadPtr, m_pngReadInfoPtr);
969 
970  // TODO:
971  // Add check for image offsets.
972  // Add check for resolution.
973  // Add check for colormap.
974 
975  switch (m_pngColorType)
976  {
977  case PNG_COLOR_TYPE_RGB: /* RGB */
978  {
981  break;
982  }
983  case PNG_COLOR_TYPE_RGB_ALPHA: /* RGBA */
984  {
987  {
989  }
990  else
991  {
993  }
994  break;
995  }
996  case PNG_COLOR_TYPE_GRAY: /* Grayscale */
997  {
1000  break;
1001  }
1002  case PNG_COLOR_TYPE_GRAY_ALPHA: /* Grayscale + alpha */
1003  {
1006  {
1007  m_numberOfOutputBands = 2;
1008  }
1009  else
1010  {
1012  }
1013  break;
1014  }
1015  case PNG_COLOR_TYPE_PALETTE: /* Indexed */
1016  {
1019  break;
1020  }
1021  default: /* Unknown type */
1022  {
1023  result = false;
1024  }
1025  }
1026 
1027  if ( result )
1028  {
1030 
1031  // Set the max pixel value.
1032  setMaxPixelValue();
1033 
1034  // Set to OSSIM_USHORT11 for use of specialized tile.
1035  if (m_maxPixelValue[0] == 2047.0)
1036  {
1038  }
1039 
1040  // We're on row 0 or first line.
1041  m_currentRow = 0;
1042 
1043  if (traceDebug())
1044  {
1046  << "ossimPngReader::initReader DEBUG:"
1047  << "\nm_imageRect: " << m_imageRect
1048  << "\nm_bitDepth: " << int(m_bitDepth)
1049  << "\nm_pngColorType: "
1051  << "\nm_numberOfInputBands: " << m_numberOfInputBands
1052  << "\nm_numberOfOutputBands: " << m_numberOfOutputBands
1053  << "\nm_bytePerPixelPerBand: " << m_bytePerPixelPerBand
1054  << "\nm_lineBufferSizeInBytes: " << m_lineBufferSizeInBytes
1055  << "\nm_interlacePasses: " << m_interlacePasses
1056  << "\npalette expansion: "
1057  << (expandFlag?"on":"off")
1058  << "\npacking (1,2,4 bit to one byte): "
1059  << (packingFlag?"on":"off")
1060  << "\nm_readMode: " << m_readMode
1061  << "\nm_swapFlag: " << m_swapFlag
1062  << std::endl;
1063 
1064  for (ossim_uint32 band = 0; band < m_numberOfInputBands; ++band)
1065  {
1067  << "max[" << band << "]: " << m_maxPixelValue[band]
1068  << std::endl;
1069  }
1070  }
1071  }
1072 
1073  return result;
1074 
1075 } // End: ossimPngReader::initReader()
16 bit unsigned integer
ossimIrect m_imageRect
png_structp m_pngReadPtr
std::vector< ossim_float64 > m_maxPixelValue
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossim_uint32 m_lineBufferSizeInBytes
ossimString getPngColorTypeString() const
ossimPngReadMode m_readMode
ossim_uint32 m_numberOfInputBands
unsigned int ossim_uint32
bool m_useAlphaChannelFlag
ossim_int8 m_bitDepth
ossim_int8 m_pngColorType
void setMaxPixelValue()
the max pixel value.
16 bit unsigned integer (11 bits used)
ossim_uint32 m_bytePerPixelPerBand
ossim_uint32 m_numberOfOutputBands
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
ossim_int32 m_interlacePasses
ossim_uint32 m_currentRow
8 bit unsigned integer
png_infop m_pngReadInfoPtr
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimScalarType m_outputScalarType

◆ isOpen()

bool ossimPngReader::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 641 of file ossimPngReader.cpp.

References m_str.

Referenced by getTile(), open(), and ~ossimPngReader().

642 {
643  if ( m_str ) return m_str->good();
644 
645  return false;
646 }
std::shared_ptr< ossim::istream > m_str

◆ loadState()

bool ossimPngReader::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 403 of file ossimPngReader.cpp.

References ossimKeywordlist::findKey(), and ossimImageHandler::loadState().

405 {
406  bool result = false;
407  if (ossimImageHandler::loadState(kwl, prefix))
408  {
409  // this was causing core dumps. Mainly because if prefix is null then
410  // standard string core dumps. So wrapped with OSSIM string that checks
411  // for this and inits with empty string if null
412  //
413  ossimString value = kwl.findKey( ossimString(prefix).c_str(), USE_ALPHA_KW );
414  if ( value.size() )
415  {
416  ossimString s = value;
418  }
419  result = open();
420  }
421  return result;
422 }
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
std::string::size_type size() const
Definition: ossimString.h:405
bool toBool() const
String to numeric methods.
bool m_useAlphaChannelFlag
virtual bool open()
open method.

◆ open() [1/3]

bool ossimPngReader::open ( std::shared_ptr< ossim::istream > &  str,
const std::string &  connectionString 
)
virtual

This open takes a stream and stores/captures the shared pointer on success.

Satisfies pure virtual from ossimStreamReaderInterface.

Parameters
strOpen stream to image.
connectionStringStored on success as the file name.
Returns
true on success, false on error.

Implements ossimStreamReaderInterface.

Definition at line 501 of file ossimPngReader.cpp.

References open(), and ossimImageHandler::theImageFile.

Referenced by ossimPngReaderFactory::open().

503 {
504  bool result = open( str );
505  if ( result )
506  {
507  theImageFile = connectionString;
508  }
509  return result;
510 }
ossimFilename theImageFile
virtual bool open()
open method.

◆ open() [2/3]

bool ossimPngReader::open ( std::shared_ptr< ossim::istream > &  str)
protected

This open takes a stream and stores/captures the shared pointer on success.

Parameters
strOpen stream to image.
Returns
true on success, false on error.

Definition at line 512 of file ossimPngReader.cpp.

References checkSignature(), close(), ossimImageHandler::completeOpen(), destroy(), initReader(), isOpen(), m_str, and readPngInit().

513 {
514  bool result = false;
515 
516  if (isOpen())
517  {
518  close();
519  }
520 
521  if ( str )
522  {
523  str->seekg( 0, std::ios_base::beg );
524 
525  if ( checkSignature( *str ) )
526  {
527  // Store the pointer:
528  m_str = str;
529 
530  result = readPngInit();
531  if ( result )
532  {
533  result = initReader();
534  if ( result )
535  {
536  completeOpen();
537  }
538  }
539  else
540  {
541  destroy();
542  }
543  }
544  else
545  {
546  if (traceDebug())
547  {
549  << "ossimPngReader::open NOTICE:\n"
550  << "Could not open stream!\n";
551  }
552  }
553  }
554 
555  return result;
556 }
void destroy()
Free tile and buffer memory.
bool isOpen() const
Derived classes must implement this method to be concrete.
std::shared_ptr< ossim::istream > m_str
bool initReader()
Initializes this reader from libpng m_pngPtr and infoPtr.
bool checkSignature(std::istream &str)
virtual void completeOpen()
Will complete the opening process.
virtual void close()
Close method.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
bool readPngInit()
Performs signature check and initializes png_structp and png_infop.

◆ open() [3/3]

bool ossimPngReader::open ( )
protectedvirtual

open method.

This open assumes base class ossimImageHandler::theImageFile has been set.

Returns
true on success, false on error.

Implements ossimImageHandler.

Definition at line 461 of file ossimPngReader.cpp.

Referenced by open().

462 {
463  static const char MODULE[] = "ossimPngReader::open()";
464  if (traceDebug())
465  {
467  << MODULE << " entered...\n" << "File: " << theImageFile.c_str()
468  << "\n";
469  }
470 
471  bool result = false;
472 
473  // Start with a clean slate.
474  if (isOpen())
475  {
476  close();
477  }
478 
479  // Check for empty filename.
480  if ( theImageFile.size() )
481  {
482  // Open up a stream to the file.
483  std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
484  createIstream( theImageFile.string(), ios::in | ios::binary);
485  if ( str )
486  {
487  // Pass to our open that takes a stream:
488  result = open( str );
489  }
490  }
491 
492  if (traceDebug())
493  {
495  << "ossimPngReader::open() exit status: " << (result?"true":"false") << "\n";
496  }
497 
498  return result;
499 }
bool isOpen() const
Derived classes must implement this method to be concrete.
ossimFilename theImageFile
static StreamFactoryRegistry * instance()
std::string::size_type size() const
Definition: ossimString.h:405
virtual void close()
Close method.
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
virtual bool open()
open method.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const std::string & string() const
Definition: ossimString.h:414

◆ pngReadData()

void ossimPngReader::pngReadData ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)
staticprotected

Callback method for reading from a stream.

This allows us to choose the stream; hence, writing to a file or memory. This will be passed to libpng's png_set_read_fn.

Definition at line 1334 of file ossimPngReader.cpp.

Referenced by readPngInit(), and restart().

1335 {
1336  ossim::istream* str = (ossim::istream*)png_get_io_ptr(png_ptr);
1337  if ( str )
1338  {
1339  str->read( (char*)data, length );
1340  }
1341 }
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20

◆ readPngInit()

bool ossimPngReader::readPngInit ( )
protected

Performs signature check and initializes png_structp and png_infop.

Returns
true on success, false on error.

Definition at line 815 of file ossimPngReader.cpp.

References m_pngReadInfoPtr, m_pngReadPtr, m_str, and pngReadData().

Referenced by open().

816 {
817  bool result = false;
818  if ( m_str )
819  {
820  if ( m_str->good() )
821  {
822  m_pngReadPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
823  NULL,
824  NULL,
825  NULL);
826  if ( m_pngReadPtr )
827  {
828  m_pngReadInfoPtr = png_create_info_struct(m_pngReadPtr);
829  if ( m_pngReadInfoPtr )
830  {
831  if ( setjmp( png_jmpbuf(m_pngReadPtr) ) == 0 )
832  {
833  //---
834  // Pass the static read method to libpng to allow us to use our
835  // c++ stream instead of doing "png_init_io (pp, ...);" with
836  // c stream.
837  //---
838  png_set_read_fn( m_pngReadPtr,
839  (png_voidp)m_str.get(),
840  (png_rw_ptr)&ossimPngReader::pngReadData );
841  png_set_sig_bytes(m_pngReadPtr, 8);
842  png_read_info(m_pngReadPtr, m_pngReadInfoPtr);
843  result = true;
844  }
845  }
846  else
847  {
848  // Out of memory?
849  png_destroy_read_struct(&m_pngReadPtr, NULL, NULL);
850  }
851  }
852  }
853  }
854  return result;
855 
856 } // End: ossimPngReader::readPngInit()
std::shared_ptr< ossim::istream > m_str
png_structp m_pngReadPtr
static void pngReadData(png_structp png_ptr, png_bytep data, png_size_t length)
Callback method for reading from a stream.
png_infop m_pngReadInfoPtr

◆ readPngVersionInfo()

void ossimPngReader::readPngVersionInfo ( )
protected

Definition at line 1077 of file ossimPngReader.cpp.

References ossimNotify(), and ossimNotifyLevel_WARN.

1078 {
1080  << "ossimPngReader::readPngVersionInfo\nCompiled with:"
1081  << "\nlibpng " << PNG_LIBPNG_VER_STRING
1082  << " using libpng " << PNG_LIBPNG_VER
1083  << "\nzlib " << ZLIB_VERSION " using zlib "
1084  << zlib_version << std::endl;
1085 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ restart()

void ossimPngReader::restart ( )
protected

Method to restart reading from the beginning (for backing up).

This is needed as libpng requires sequential read from start of the image.

Definition at line 661 of file ossimPngReader.cpp.

References m_bitDepth, m_currentRow, m_pngColorType, m_pngReadInfoPtr, m_pngReadPtr, m_str, ossimNotify(), ossimNotifyLevel_WARN, pngReadData(), and ossimImageHandler::theImageFile.

662 {
663  if ( m_str )
664  {
665  // Destroy the existing memory associated with png structs.
667  {
668  png_destroy_read_struct(&m_pngReadPtr, &m_pngReadInfoPtr, NULL);
669  }
670 
671  m_pngReadPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING,
672  NULL,
673  NULL,
674  NULL);
675  m_pngReadInfoPtr = png_create_info_struct(m_pngReadPtr);
676 
677  if ( setjmp( png_jmpbuf(m_pngReadPtr) ) )
678  {
680  << "Error while reading. File corrupted? "
681  << theImageFile
682  << std::endl;
683 
684  return;
685  }
686 
687  // Reset the file pointer.
688  m_str->seekg( 0, std::ios_base::beg );
689 
690  //---
691  // Pass the static read method to libpng to allow us to use our
692  // c++ stream instead of doing "png_init_io (pp, ...);" with
693  // c stream.
694  //---
695  png_set_read_fn( m_pngReadPtr,
696  (png_voidp)m_str.get(),
697  (png_rw_ptr)&ossimPngReader::pngReadData );
698 
699  //---
700  // Note we won't do png_set_sig_bytes(png_ptr, 8) here because we are not
701  // rechecking for png signature.
702  //---
703  png_read_info(m_pngReadPtr, m_pngReadInfoPtr);
704 
705  //---
706  // If png_set_expand used:
707  // Expand data to 24-bit RGB, or 8-bit grayscale,
708  // with alpha if available.
709  //---
710  bool expandFlag = false;
711 
712  if ( m_pngColorType == PNG_COLOR_TYPE_PALETTE )
713  {
714  expandFlag = true;
715  }
716  if ( (m_pngColorType == PNG_COLOR_TYPE_GRAY) && (m_bitDepth < 8) )
717  {
718  expandFlag = true;
719  }
720  if ( png_get_valid(m_pngReadPtr, m_pngReadInfoPtr, PNG_INFO_tRNS) )
721  {
722  expandFlag = true;
723  }
724 
725  //---
726  // If png_set_packing used:
727  // Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
728  //---
729  bool packingFlag = false;
730 
731  if ( (m_bitDepth < 8) && (m_pngColorType == PNG_COLOR_TYPE_GRAY) )
732  {
733  packingFlag = true;
734  }
735 
736  if (expandFlag)
737  {
738  png_set_expand(m_pngReadPtr);
739  }
740  if (packingFlag)
741  {
742  png_set_packing(m_pngReadPtr);
743  }
744 
745  // Gamma correction.
746  // ossim_float64 gamma;
747  // if (png_get_gAMA(m_pngReadPtr, m_pngReadInfoPtr, &gamma))
748  // {
749  // png_set_gamma(m_pngReadPtr, display_exponent, gamma);
750  // }
751 
752  //---
753  // Turn on interlace handling... libpng returns just 1 (ie single pass)
754  // if the image is not interlaced
755  //---
756  png_set_interlace_handling (m_pngReadPtr);
757 
758  //---
759  // Update the info structures after the transformations take effect
760  //---
761  png_read_update_info (m_pngReadPtr, m_pngReadInfoPtr);
762 
763  // We're back on row 0 or first line.
764  m_currentRow = 0;
765  }
766 }
ossimFilename theImageFile
std::shared_ptr< ossim::istream > m_str
png_structp m_pngReadPtr
ossim_int8 m_bitDepth
ossim_int8 m_pngColorType
ossim_uint32 m_currentRow
static void pngReadData(png_structp png_ptr, png_bytep data, png_size_t length)
Callback method for reading from a stream.
png_infop m_pngReadInfoPtr
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

bool ossimPngReader::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 394 of file ossimPngReader.cpp.

References ossimKeywordlist::addPair(), m_useAlphaChannelFlag, ossimString::string(), and ossimString::toString().

396 {
397  std::string p = ( prefix ? prefix : "" );
399  kwl.addPair( p, USE_ALPHA_KW, v, true );
400  return ossimImageHandler::saveState(kwl, prefix);
401 }
static ossimString toString(bool aValue)
Numeric to string methods.
void addPair(const std::string &key, const std::string &value, bool overwrite=true)
bool m_useAlphaChannelFlag
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
const std::string & string() const
Definition: ossimString.h:414

◆ setMaxPixelValue()

void ossimPngReader::setMaxPixelValue ( )
protected

the max pixel value.

Attempts to get the sBIT chunk.

Definition at line 1114 of file ossimPngReader.cpp.

References m_maxPixelValue, m_numberOfInputBands, m_pngReadInfoPtr, and m_pngReadPtr.

Referenced by initReader().

1115 {
1116  ossim_uint32 band;
1118  for (band = 0; band < m_numberOfInputBands; ++band)
1119  {
1120  m_maxPixelValue[band] = 0.0;
1121  }
1122 
1123  if (png_get_valid(m_pngReadPtr, m_pngReadInfoPtr, PNG_INFO_sBIT ))
1124  {
1125  png_color_8p sig_bit;
1126  png_get_sBIT(m_pngReadPtr, m_pngReadInfoPtr, &sig_bit);
1127  if (traceDebug())
1128  {
1130  << "ossimPngReader::setMaxPixelValue DEBUG:"
1131  << "\nsig_bit->red: " << int(sig_bit->red)
1132  << "\nsig_bit->green: " << int(sig_bit->green)
1133  << "\nsig_bit->blue: " << int(sig_bit->blue)
1134  << "\nsig_bit->gray: " << int(sig_bit->gray)
1135  << "\nsig_bit->alpa: " << int(sig_bit->alpha)
1136  << endl;
1137  }
1138  switch (m_pngColorType)
1139  {
1140  case PNG_COLOR_TYPE_RGB: /* RGB */
1141  m_maxPixelValue[0] = pow(2.0, double(sig_bit->red))-1.0;
1142  m_maxPixelValue[1] = pow(2.0, double(sig_bit->green))-1.0;
1143  m_maxPixelValue[2] = pow(2.0, double(sig_bit->blue))-1.0;
1144  break;
1145  case PNG_COLOR_TYPE_RGB_ALPHA: /* RGBA */
1146  m_maxPixelValue[0] = pow(2.0, double(sig_bit->red))-1.0;
1147  m_maxPixelValue[1] = pow(2.0, double(sig_bit->green))-1.0;
1148  m_maxPixelValue[2] = pow(2.0, double(sig_bit->blue))-1.0;
1149  m_maxPixelValue[3] = pow(2.0, double(sig_bit->alpha))-1.0;
1150  break;
1151  case PNG_COLOR_TYPE_GRAY: /* Grayscale */
1152  m_maxPixelValue[0] = pow(2.0, double(sig_bit->gray))-1.0;
1153  break;
1154  case PNG_COLOR_TYPE_GRAY_ALPHA: /* Grayscale + alpha */
1155  m_maxPixelValue[0] = pow(2.0, double(sig_bit->gray))-1.0;
1156  m_maxPixelValue[1] = pow(2.0, double(sig_bit->alpha))-1.0;
1157  break;
1158  case PNG_COLOR_TYPE_PALETTE: /* Indexed */
1159  m_maxPixelValue[0] = 255.0;
1160  m_maxPixelValue[1] = 255.0;
1161  m_maxPixelValue[2] = 255.0;
1162  break;
1163  default: /* Aie! Unknown type */
1164  break;
1165  }
1166  }
1167 
1168  // Sanity check.
1169  for (ossim_uint32 band = 0; band < m_numberOfInputBands; ++band)
1170  {
1171  if (m_maxPixelValue[band] == 0.0)
1172  {
1173  if (m_bitDepth <= 8)
1174  {
1175  m_maxPixelValue[band] = 255.0;
1176  }
1177  else
1178  {
1179  m_maxPixelValue[band] = 65535.0;
1180  }
1181  }
1182  }
1183 }
png_structp m_pngReadPtr
std::vector< ossim_float64 > m_maxPixelValue
ossim_uint32 m_numberOfInputBands
unsigned int ossim_uint32
ossim_int8 m_bitDepth
ossim_int8 m_pngColorType
png_infop m_pngReadInfoPtr
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setProperty()

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

Set propterty method.

Overrides ossimImageHandler::setProperty.

Current property name handled: "scale" One double value representing the scale in meters per pixel. It is assumed the scale is same for x and y direction.

Parameters
propertyto set.

Reimplemented from ossimImageHandler.

Definition at line 424 of file ossimPngReader.cpp.

References ossimProperty::getName(), ossimString::string(), and ossimRefPtr< T >::valid().

425 {
426  if ( property.valid() )
427  {
428  if ( property->getName().string() == USE_ALPHA_KW )
429  {
430  ossimString s;
431  property->valueToString(s);
433  }
434  else
435  {
437  }
438  }
439 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setProperty(ossimRefPtr< ossimProperty > property)
bool toBool() const
String to numeric methods.
bool m_useAlphaChannelFlag
const ossimString & getName() const
const std::string & string() const
Definition: ossimString.h:414

Member Data Documentation

◆ m_bitDepth

ossim_int8 ossimPngReader::m_bitDepth
protected

Definition at line 311 of file ossimPngReader.h.

Referenced by initReader(), and restart().

◆ m_bufferRect

ossimIrect ossimPngReader::m_bufferRect
protected

Definition at line 295 of file ossimPngReader.h.

◆ m_bytePerPixelPerBand

ossim_uint32 ossimPngReader::m_bytePerPixelPerBand
protected

Definition at line 299 of file ossimPngReader.h.

Referenced by initReader().

◆ m_cacheId

ossimAppFixedTileCache::ossimAppFixedCacheId ossimPngReader::m_cacheId
protected

Definition at line 303 of file ossimPngReader.h.

Referenced by allocate(), and destroy().

◆ m_cacheSize

ossimIpt ossimPngReader::m_cacheSize
protected

Definition at line 300 of file ossimPngReader.h.

Referenced by allocate(), and fillTile().

◆ m_cacheTile

ossimRefPtr<ossimImageData> ossimPngReader::m_cacheTile
protected

Definition at line 288 of file ossimPngReader.h.

Referenced by allocate(), copyLines(), copyLinesWithAlpha(), and destroy().

◆ m_currentRow

ossim_uint32 ossimPngReader::m_currentRow
protected

Definition at line 308 of file ossimPngReader.h.

Referenced by copyLines(), copyLinesWithAlpha(), initReader(), and restart().

◆ m_imageRect

ossimIrect ossimPngReader::m_imageRect
protected

◆ m_interlacePasses

ossim_int32 ossimPngReader::m_interlacePasses
protected

Definition at line 310 of file ossimPngReader.h.

Referenced by initReader().

◆ m_lineBuffer

ossim_uint8* ossimPngReader::m_lineBuffer
protected

Definition at line 290 of file ossimPngReader.h.

Referenced by allocate(), copyLines(), copyLinesWithAlpha(), and destroy().

◆ m_lineBufferSizeInBytes

ossim_uint32 ossimPngReader::m_lineBufferSizeInBytes
protected

Definition at line 291 of file ossimPngReader.h.

Referenced by allocate(), and initReader().

◆ m_maxPixelValue

std::vector<ossim_float64> ossimPngReader::m_maxPixelValue
protected

◆ m_numberOfInputBands

ossim_uint32 ossimPngReader::m_numberOfInputBands
protected

Definition at line 297 of file ossimPngReader.h.

Referenced by copyLines(), copyLinesWithAlpha(), initReader(), and setMaxPixelValue().

◆ m_numberOfOutputBands

ossim_uint32 ossimPngReader::m_numberOfOutputBands
protected

◆ m_outputScalarType

ossimScalarType ossimPngReader::m_outputScalarType
protected

Definition at line 309 of file ossimPngReader.h.

Referenced by copyLinesWithAlpha(), getOutputScalarType(), getTile(), and initReader().

◆ m_pngColorType

ossim_int8 ossimPngReader::m_pngColorType
protected

Definition at line 307 of file ossimPngReader.h.

Referenced by getPngColorTypeString(), initReader(), and restart().

◆ m_pngReadInfoPtr

png_infop ossimPngReader::m_pngReadInfoPtr
protected

Definition at line 306 of file ossimPngReader.h.

Referenced by destroy(), initReader(), readPngInit(), restart(), and setMaxPixelValue().

◆ m_pngReadPtr

png_structp ossimPngReader::m_pngReadPtr
protected

◆ m_readMode

ossimPngReadMode ossimPngReader::m_readMode
protected

Definition at line 312 of file ossimPngReader.h.

Referenced by initReader().

◆ m_str

std::shared_ptr<ossim::istream> ossimPngReader::m_str
protected

Definition at line 293 of file ossimPngReader.h.

Referenced by destroy(), fillTile(), isOpen(), open(), readPngInit(), and restart().

◆ m_swapFlag

bool ossimPngReader::m_swapFlag
protected

Definition at line 316 of file ossimPngReader.h.

Referenced by copyLines(), copyLinesWithAlpha(), and initReader().

◆ m_tile

ossimRefPtr<ossimImageData> ossimPngReader::m_tile
protected

Definition at line 287 of file ossimPngReader.h.

Referenced by allocate(), destroy(), getTile(), getTileHeight(), and getTileWidth().

◆ m_useAlphaChannelFlag

bool ossimPngReader::m_useAlphaChannelFlag
protected

Definition at line 319 of file ossimPngReader.h.

Referenced by initReader(), and saveState().


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